Class RegistryLock

  • All Implemented Interfaces:
    Buildable, UnsafeSerializable, java.io.Serializable, java.lang.Cloneable

    @Entity
    public final class RegistryLock
    extends UpdateAutoTimestampEntity
    implements Buildable
    Represents a registry lock/unlock object, meaning that the domain is locked on the registry level.

    Registry locks must be requested through the registrar console by a lock-enabled contact, then confirmed through email within a certain length of time. Until that confirmation is processed, the completion time will remain null and the lock will have no effect. The same applies for unlock actions.

    Note that there will be at most one row per domain with a null completed time -- this means that there is at most one pending action per domain. This is enforced at the logic level.

    Note as well that in the case of a retry of a write after an unexpected success, the unique constraint on verificationCode means that the second write will fail.

    See Also:
    Serialized Form
    • Constructor Detail

      • RegistryLock

        public RegistryLock()
    • Method Detail

      • getRepoId

        public java.lang.String getRepoId()
      • getDomainName

        public java.lang.String getDomainName()
      • getRegistrarId

        public java.lang.String getRegistrarId()
      • getRegistrarPocId

        public java.lang.String getRegistrarPocId()
      • getLockRequestTime

        public org.joda.time.DateTime getLockRequestTime()
      • getUnlockRequestTime

        public java.util.Optional<org.joda.time.DateTime> getUnlockRequestTime()
        Returns the unlock request timestamp or null if an unlock has not been requested yet.
      • getLockCompletionTime

        public java.util.Optional<org.joda.time.DateTime> getLockCompletionTime()
        Returns the completion timestamp, or empty if this lock has not been completed yet.
      • getUnlockCompletionTime

        public java.util.Optional<org.joda.time.DateTime> getUnlockCompletionTime()
        Returns the unlock completion timestamp, or empty if this unlock has not been completed yet.
      • getVerificationCode

        public java.lang.String getVerificationCode()
      • isSuperuser

        public boolean isSuperuser()
      • getLastUpdateTime

        public org.joda.time.DateTime getLastUpdateTime()
      • getRevisionId

        public java.lang.Long getRevisionId()
      • getRelock

        public RegistryLock getRelock()
        The lock that undoes this lock, if this lock has been unlocked and the domain locked again.

        Note: this is lazily loaded, so it may not be initialized if referenced outside the transaction in which this lock is loaded.

      • getRelockDuration

        public java.util.Optional<org.joda.time.Duration> getRelockDuration()
        The duration after which we will re-lock this domain after it is unlocked.
      • isLocked

        public boolean isLocked()
      • isLockRequestExpired

        public boolean isLockRequestExpired​(org.joda.time.DateTime now)
        Returns true iff the lock was requested >= 1 hour ago and has not been verified.
      • isUnlockRequestExpired

        public boolean isUnlockRequestExpired​(org.joda.time.DateTime now)
        Returns true iff the unlock was requested >= 1 hour ago and has not been verified.