Class GracePeriod
- java.lang.Object
-
- google.registry.model.ImmutableObject
-
- google.registry.model.domain.GracePeriodBase
-
- google.registry.model.domain.GracePeriod
-
- All Implemented Interfaces:
UnsafeSerializable
,java.io.Serializable
,java.lang.Cloneable
@Entity public class GracePeriod extends GracePeriodBase
A domain grace period with an expiration time.When a grace period expires, it is lazily removed from the
Domain
the next time the resource is loaded from the database.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GracePeriod.GracePeriodHistory
Entity class to represent a historicGracePeriod
.-
Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
-
-
Field Summary
-
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
-
Constructor Summary
Constructors Constructor Description GracePeriod()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GracePeriod
create(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, VKey<BillingEvent> billingEventOneTime)
Creates a GracePeriod for an (optional) OneTime billing event.static GracePeriod
create(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, VKey<BillingEvent> billingEventOneTime, java.lang.Long gracePeriodId)
Creates a GracePeriod for an (optional) OneTime billing event and a givenGracePeriodBase.gracePeriodId
.static GracePeriod
createForRecurrence(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, VKey<BillingRecurrence> billingEventRecurrence)
Creates a GracePeriod for a Recurrence billing event.static GracePeriod
createForRecurrence(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, VKey<BillingRecurrence> billingEventRecurrence, java.lang.Long gracePeriodId)
Creates a GracePeriod for a Recurrence billing event and a givenGracePeriodBase.gracePeriodId
.static GracePeriod
createFromHistory(GracePeriod.GracePeriodHistory history)
static GracePeriod
createWithoutBillingEvent(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId)
Creates a GracePeriod with no billing event.static GracePeriod
forBillingEvent(GracePeriodStatus type, java.lang.String domainRepoId, BillingEvent billingEvent)
Constructs a GracePeriod of the given type from the provided one-time BillingEvent.long
getGracePeriodId()
-
Methods inherited from class google.registry.model.domain.GracePeriodBase
getBillingEvent, getBillingRecurrence, getDomainRepoId, getExpirationTime, getRegistrarId, getType, hasBillingEvent
-
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
-
-
-
Method Detail
-
getGracePeriodId
public long getGracePeriodId()
- Overrides:
getGracePeriodId
in classGracePeriodBase
-
create
public static GracePeriod create(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, @Nullable VKey<BillingEvent> billingEventOneTime)
Creates a GracePeriod for an (optional) OneTime billing event.Normal callers should always use
forBillingEvent(google.registry.model.domain.rgp.GracePeriodStatus, java.lang.String, google.registry.model.billing.BillingEvent)
instead, assuming they do not need to avoid loading the BillingEvent from the database. This method should typically be called only from test code to explicitly construct GracePeriods.
-
create
public static GracePeriod create(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, @Nullable VKey<BillingEvent> billingEventOneTime, @Nullable java.lang.Long gracePeriodId)
Creates a GracePeriod for an (optional) OneTime billing event and a givenGracePeriodBase.gracePeriodId
.Normal callers should always use
forBillingEvent(google.registry.model.domain.rgp.GracePeriodStatus, java.lang.String, google.registry.model.billing.BillingEvent)
instead, assuming they do not need to avoid loading the BillingEvent from the database. This method should typically be called only from test code to explicitly construct GracePeriods.
-
createFromHistory
public static GracePeriod createFromHistory(GracePeriod.GracePeriodHistory history)
-
createForRecurrence
public static GracePeriod createForRecurrence(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, VKey<BillingRecurrence> billingEventRecurrence)
Creates a GracePeriod for a Recurrence billing event.
-
createForRecurrence
public static GracePeriod createForRecurrence(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId, VKey<BillingRecurrence> billingEventRecurrence, @Nullable java.lang.Long gracePeriodId)
Creates a GracePeriod for a Recurrence billing event and a givenGracePeriodBase.gracePeriodId
.
-
createWithoutBillingEvent
public static GracePeriod createWithoutBillingEvent(GracePeriodStatus type, java.lang.String domainRepoId, org.joda.time.DateTime expirationTime, java.lang.String registrarId)
Creates a GracePeriod with no billing event.
-
forBillingEvent
public static GracePeriod forBillingEvent(GracePeriodStatus type, java.lang.String domainRepoId, BillingEvent billingEvent)
Constructs a GracePeriod of the given type from the provided one-time BillingEvent.
-
-