Class RegistryLock

All Implemented Interfaces:
Buildable, UnsafeSerializable, Serializable, 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:
  • Constructor Details

    • RegistryLock

      public RegistryLock()
  • Method Details

    • getRepoId

      public String getRepoId()
    • getDomainName

      public String getDomainName()
    • getRegistrarId

      public String getRegistrarId()
    • getRegistrarPocId

      public String getRegistrarPocId()
    • getLockRequestTime

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

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

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

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

      public String getVerificationCode()
    • isSuperuser

      public boolean isSuperuser()
    • getLastUpdateTime

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

      public 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 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.
    • asBuilder

      public RegistryLock.Builder asBuilder()
      Specified by:
      asBuilder in interface Buildable