Class RegistryLock
- java.lang.Object
-
- google.registry.model.ImmutableObject
-
- google.registry.model.UpdateAutoTimestampEntity
-
- google.registry.model.domain.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RegistryLock.Builder
Builder forRegistryLock
.-
Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
-
Nested classes/interfaces inherited from interface google.registry.model.Buildable
Buildable.GenericBuilder<S,B extends Buildable.GenericBuilder<?,?>>, Buildable.Overlayable<T>
-
-
Field Summary
-
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
-
Constructor Summary
Constructors Constructor Description RegistryLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistryLock.Builder
asBuilder()
java.lang.String
getDomainName()
org.joda.time.DateTime
getLastUpdateTime()
java.util.Optional<org.joda.time.DateTime>
getLockCompletionTime()
Returns the completion timestamp, or empty if this lock has not been completed yet.org.joda.time.DateTime
getLockRequestTime()
java.lang.String
getRegistrarId()
java.lang.String
getRegistrarPocId()
RegistryLock
getRelock()
The lock that undoes this lock, if this lock has been unlocked and the domain locked again.java.util.Optional<org.joda.time.Duration>
getRelockDuration()
The duration after which we will re-lock this domain after it is unlocked.java.lang.String
getRepoId()
java.lang.Long
getRevisionId()
java.util.Optional<org.joda.time.DateTime>
getUnlockCompletionTime()
Returns the unlock completion timestamp, or empty if this unlock has not been completed yet.java.util.Optional<org.joda.time.DateTime>
getUnlockRequestTime()
Returns the unlock request timestamp or null if an unlock has not been requested yet.java.lang.String
getVerificationCode()
boolean
isLocked()
boolean
isLockRequestExpired(org.joda.time.DateTime now)
Returns true iff the lock was requested >= 1 hour ago and has not been verified.boolean
isSuperuser()
boolean
isUnlockRequestExpired(org.joda.time.DateTime now)
Returns true iff the unlock was requested >= 1 hour ago and has not been verified.-
Methods inherited from class google.registry.model.UpdateAutoTimestampEntity
copyUpdateTimestamp, getUpdateTimestamp, resetUpdateTimestamp, setUpdateTimestamp
-
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
-
-
-
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.
-
asBuilder
public RegistryLock.Builder asBuilder()
-
-