Class DomainContent
- java.lang.Object
-
- google.registry.model.ImmutableObject
-
- google.registry.model.BackupGroupRoot
-
- google.registry.model.EppResource
-
- google.registry.model.domain.DomainContent
-
- All Implemented Interfaces:
Buildable
,EppResource.ResourceWithTransferData<DomainTransferData>
,UnsafeSerializable
,java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
DomainBase
,DomainBaseLite
@MappedSuperclass @Embeddable public class DomainContent extends EppResource implements EppResource.ResourceWithTransferData<DomainTransferData>
A persistable domain resource including mutable and non-mutable fields.This class deliberately does not include an
Id
so that any foreign-keyed fields can refer to the proper parent entity's ID, whether we're storing this in the DB itself or as part of another entity.For historical reasons, the name of this class is "DomainContent". Ideally it would be "DomainBase" for parallelism with the other
EppResource
entity classes, but because that name is already taken byDomainBase
(also for historical reasons), we can't use it. Once we are no longer on Datastore, we can rename the classes.- See Also:
- RFC 5731, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DomainContent.Builder<T extends DomainContent,B extends DomainContent.Builder<T,B>>
A builder for constructingDomainBase
, since it is immutable.-
Nested classes/interfaces inherited from class google.registry.model.EppResource
EppResource.BuilderWithTransferData<T extends TransferData,B extends EppResource.BuilderWithTransferData<T,B>>, EppResource.ForeignKeyedEppResource, EppResource.ResourceWithTransferData<T extends TransferData>
-
Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotCompare, ImmutableObject.DoNotHydrate, ImmutableObject.EmptySetToNull, 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 Modifier and Type Field Description static int
MAX_REGISTRATION_YEARS
The max number of years that a domain can be registered for, as set by ICANN policy.-
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
-
Constructor Summary
Constructors Constructor Description DomainContent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DomainContent.Builder<? extends DomainContent,?>
asBuilder()
An override ofEppResource.asBuilder()
with tighter typing.static void
beforeSqlDelete(VKey<DomainBase> key)
Callback to delete grace periods and DelegationSignerData records prior to domain delete.DomainContent
cloneProjectedAtTime(org.joda.time.DateTime now)
Return a clone of the resource with timed status values modified using the given time.VKey<DomainBase>
createVKey()
Create the VKey for the specified EPP resource.static org.joda.time.DateTime
extendRegistrationWithCap(org.joda.time.DateTime now, org.joda.time.DateTime currentExpirationTime, java.lang.Integer extendedRegistrationYears)
Return what the expiration time would be if the given number of years were added to it.VKey<ContactResource>
getAdminContact()
DomainAuthInfo
getAuthInfo()
VKey<BillingEvent.Recurring>
getAutorenewBillingEvent()
java.util.Optional<org.joda.time.DateTime>
getAutorenewEndTime()
Returns the autorenew end time if there is one, otherwise empty.VKey<PollMessage.Autorenew>
getAutorenewPollMessage()
VKey<ContactResource>
getBillingContact()
com.google.common.collect.ImmutableSet<DesignatedContact>
getContacts()
Associated contacts for the domain (other than registrant).java.lang.String
getCurrentSponsorRegistrarId()
VKey<PollMessage.OneTime>
getDeletePollMessage()
java.util.Optional<org.joda.time.DateTime>
getDnsRefreshRequestTime()
Returns the DNS refresh request time iff this domain's DNS needs refreshing, otherwise absent.java.lang.String
getDomainName()
com.google.common.collect.ImmutableSet<DelegationSignerData>
getDsData()
java.lang.String
getForeignKey()
Get the foreign key string for this resource.com.google.common.collect.ImmutableSet<GracePeriod>
getGracePeriods()
com.google.common.collect.ImmutableSet<GracePeriod>
getGracePeriodsOfType(GracePeriodStatus gracePeriodType)
Returns the subset of grace periods having the specified type.com.google.common.collect.ImmutableSet<GracePeriodStatus>
getGracePeriodStatuses()
Returns the Registry Grace Period Statuses for this domain.static java.lang.Long
getHistoryId(VKey<?> key)
Obtains a history id from the given key.java.lang.String
getIdnTableName()
org.joda.time.DateTime
getLastTransferTime()
The time that this resource was last transferred.LaunchNotice
getLaunchNotice()
com.google.common.collect.ImmutableSet<VKey<HostResource>>
getNameservers()
com.google.common.collect.ImmutableSet<VKey<ContactResource>>
getReferencedContacts()
Returns all referenced contacts from this domain.VKey<ContactResource>
getRegistrant()
A key to the registrant who registered this domain.org.joda.time.DateTime
getRegistrationExpirationTime()
java.lang.String
getSmdId()
com.google.common.collect.ImmutableSet<java.lang.String>
getSubordinateHosts()
VKey<ContactResource>
getTechContact()
java.lang.String
getTld()
DomainTransferData
getTransferData()
com.google.common.collect.ImmutableSortedSet<java.lang.String>
loadNameserverHostNames()
Loads and returns the fully qualified host names of all linked nameservers.protected void
postLoad()
static <T> VKey<T>
restoreOfyFrom(com.googlecode.objectify.Key<DomainBase> domainKey, VKey<T> key, java.lang.Long historyId)
boolean
shouldPublishToDns()
Returns true if DNS information should be published for the given domain.-
Methods inherited from class google.registry.model.EppResource
getCreationRegistrarId, getCreationTime, getDeletionTime, getLastEppUpdateRegistrarId, getLastEppUpdateTime, getPersistedCurrentSponsorRegistrarId, getRepoId, getRevisions, getStatusValues, loadCached, loadCached, saveIndexesToDatastore, setCacheForTest, setRepoId
-
Methods inherited from class google.registry.model.BackupGroupRoot
copyUpdateTimestamp, getUpdateTimestamp, resetUpdateTimestamp, setUpdateTimestamp
-
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
-
-
-
Field Detail
-
MAX_REGISTRATION_YEARS
public static final int MAX_REGISTRATION_YEARS
The max number of years that a domain can be registered for, as set by ICANN policy.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDnsRefreshRequestTime
public java.util.Optional<org.joda.time.DateTime> getDnsRefreshRequestTime()
Returns the DNS refresh request time iff this domain's DNS needs refreshing, otherwise absent.
-
postLoad
protected void postLoad()
-
beforeSqlDelete
public static void beforeSqlDelete(VKey<DomainBase> key)
Callback to delete grace periods and DelegationSignerData records prior to domain delete.See
ReplaySpecializer
.
-
restoreOfyFrom
public static <T> VKey<T> restoreOfyFrom(com.googlecode.objectify.Key<DomainBase> domainKey, VKey<T> key, java.lang.Long historyId)
-
getSubordinateHosts
public com.google.common.collect.ImmutableSet<java.lang.String> getSubordinateHosts()
-
getRegistrationExpirationTime
public org.joda.time.DateTime getRegistrationExpirationTime()
-
getDeletePollMessage
public VKey<PollMessage.OneTime> getDeletePollMessage()
-
getAutorenewBillingEvent
public VKey<BillingEvent.Recurring> getAutorenewBillingEvent()
-
getAutorenewPollMessage
public VKey<PollMessage.Autorenew> getAutorenewPollMessage()
-
getGracePeriods
public com.google.common.collect.ImmutableSet<GracePeriod> getGracePeriods()
-
getSmdId
public java.lang.String getSmdId()
-
getAutorenewEndTime
public java.util.Optional<org.joda.time.DateTime> getAutorenewEndTime()
Returns the autorenew end time if there is one, otherwise empty.Note that
DateTimeUtils.END_OF_TIME
is used as a sentinel value in the database representation to signify that autorenew doesn't end, and is mapped to empty here for the purposes of more legible business logic.
-
getTransferData
public DomainTransferData getTransferData()
- Specified by:
getTransferData
in interfaceEppResource.ResourceWithTransferData<DomainTransferData>
-
getLastTransferTime
public org.joda.time.DateTime getLastTransferTime()
Description copied from interface:EppResource.ResourceWithTransferData
The time that this resource was last transferred.Can be null if the resource has never been transferred.
- Specified by:
getLastTransferTime
in interfaceEppResource.ResourceWithTransferData<DomainTransferData>
-
getForeignKey
public java.lang.String getForeignKey()
Description copied from class:EppResource
Get the foreign key string for this resource.- Specified by:
getForeignKey
in classEppResource
-
getDomainName
public java.lang.String getDomainName()
-
getDsData
public com.google.common.collect.ImmutableSet<DelegationSignerData> getDsData()
-
getLaunchNotice
public LaunchNotice getLaunchNotice()
-
getIdnTableName
public java.lang.String getIdnTableName()
-
getNameservers
public com.google.common.collect.ImmutableSet<VKey<HostResource>> getNameservers()
-
getCurrentSponsorRegistrarId
public final java.lang.String getCurrentSponsorRegistrarId()
-
shouldPublishToDns
public boolean shouldPublishToDns()
Returns true if DNS information should be published for the given domain.
-
getGracePeriodStatuses
public com.google.common.collect.ImmutableSet<GracePeriodStatus> getGracePeriodStatuses()
Returns the Registry Grace Period Statuses for this domain.This collects all statuses from the domain's
GracePeriod
entries and also adds the PENDING_DELETE status if needed.
-
getGracePeriodsOfType
public com.google.common.collect.ImmutableSet<GracePeriod> getGracePeriodsOfType(GracePeriodStatus gracePeriodType)
Returns the subset of grace periods having the specified type.
-
cloneProjectedAtTime
public DomainContent cloneProjectedAtTime(org.joda.time.DateTime now)
Description copied from class:EppResource
Return a clone of the resource with timed status values modified using the given time.- Specified by:
cloneProjectedAtTime
in classEppResource
-
extendRegistrationWithCap
public static org.joda.time.DateTime extendRegistrationWithCap(org.joda.time.DateTime now, org.joda.time.DateTime currentExpirationTime, @Nullable java.lang.Integer extendedRegistrationYears)
Return what the expiration time would be if the given number of years were added to it.
-
loadNameserverHostNames
public com.google.common.collect.ImmutableSortedSet<java.lang.String> loadNameserverHostNames()
Loads and returns the fully qualified host names of all linked nameservers.
-
getRegistrant
public VKey<ContactResource> getRegistrant()
A key to the registrant who registered this domain.
-
getAdminContact
public VKey<ContactResource> getAdminContact()
-
getBillingContact
public VKey<ContactResource> getBillingContact()
-
getTechContact
public VKey<ContactResource> getTechContact()
-
getContacts
public com.google.common.collect.ImmutableSet<DesignatedContact> getContacts()
Associated contacts for the domain (other than registrant).
-
getAuthInfo
public DomainAuthInfo getAuthInfo()
-
getReferencedContacts
public com.google.common.collect.ImmutableSet<VKey<ContactResource>> getReferencedContacts()
Returns all referenced contacts from this domain.
-
getTld
public java.lang.String getTld()
-
createVKey
public VKey<DomainBase> createVKey()
Description copied from class:EppResource
Create the VKey for the specified EPP resource.- Specified by:
createVKey
in classEppResource
-
getHistoryId
public static java.lang.Long getHistoryId(VKey<?> key)
Obtains a history id from the given key.The key must be a composite key either of the form domain-key/history-key/long-event-key or EntityGroupRoot/long-event-key (for legacy keys). In the latter case or for a null key returns a history id of null.
-
asBuilder
public DomainContent.Builder<? extends DomainContent,?> asBuilder()
An override ofEppResource.asBuilder()
with tighter typing.- Specified by:
asBuilder
in interfaceBuildable
- Specified by:
asBuilder
in classEppResource
-
-