Class DomainBase

All Implemented Interfaces:
Buildable, EppResource.ResourceWithTransferData<DomainTransferData>, UnsafeSerializable, Serializable, Cloneable
Direct Known Subclasses:
Domain

@MappedSuperclass @Embeddable public class DomainBase 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.

See Also:
  • Field Details

    • 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:
  • Constructor Details

    • DomainBase

      public DomainBase()
  • Method Details

    • getLordnPhase

      public LordnTaskUtils.LordnPhase getLordnPhase()
    • getSubordinateHosts

      public com.google.common.collect.ImmutableSet<String> getSubordinateHosts()
    • getRegistrationExpirationTime

      public org.joda.time.DateTime getRegistrationExpirationTime()
    • getDeletePollMessage

      public VKey<PollMessage.OneTime> getDeletePollMessage()
    • getAutorenewBillingEvent

      public VKey<BillingRecurrence> getAutorenewBillingEvent()
    • getAutorenewPollMessage

      public VKey<PollMessage.Autorenew> getAutorenewPollMessage()
    • getGracePeriods

      public com.google.common.collect.ImmutableSet<GracePeriod> getGracePeriods()
    • getSmdId

      public String getSmdId()
    • getCurrentBulkToken

      public Optional<VKey<AllocationToken>> getCurrentBulkToken()
    • getAutorenewEndTime

      public 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 interface EppResource.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 interface EppResource.ResourceWithTransferData<DomainTransferData>
    • getForeignKey

      public String getForeignKey()
      Description copied from class: EppResource
      Get the foreign key string for this resource.
      Specified by:
      getForeignKey in class EppResource
    • getDomainName

      public String getDomainName()
    • getDsData

      public com.google.common.collect.ImmutableSet<DomainDsData> getDsData()
    • getLaunchNotice

      public LaunchNotice getLaunchNotice()
    • getIdnTableName

      public String getIdnTableName()
    • getNameservers

      public com.google.common.collect.ImmutableSet<VKey<Host>> getNameservers()
    • getCurrentSponsorRegistrarId

      public final 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 DomainBase 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 class EppResource
    • extendRegistrationWithCap

      public static org.joda.time.DateTime extendRegistrationWithCap(org.joda.time.DateTime now, org.joda.time.DateTime currentExpirationTime, @Nullable 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<String> loadNameserverHostNames()
      Loads and returns the fully qualified host names of all linked nameservers.
    • getRegistrant

      public Optional<VKey<Contact>> getRegistrant()
      A key to the registrant who registered this domain.
    • getAdminContact

      public Optional<VKey<Contact>> getAdminContact()
    • getBillingContact

      public Optional<VKey<Contact>> getBillingContact()
    • getTechContact

      public Optional<VKey<Contact>> getTechContact()
    • getContacts

      public com.google.common.collect.ImmutableSet<DesignatedContact> getContacts()
      Associated contacts for the domain (other than registrant).

      Note: This can be an empty set if no contacts are present for the domain.

    • getAllContacts

      public com.google.common.collect.ImmutableSet<DesignatedContact> getAllContacts()
      Gets all associated contacts for the domain, including the registrant.

      Note: This can be an empty set if no contacts are present for the domain.

    • getAuthInfo

      @Nullable public DomainAuthInfo getAuthInfo()
    • getReferencedContacts

      public com.google.common.collect.ImmutableSet<VKey<Contact>> getReferencedContacts()
      Returns all referenced contacts from this domain.

      Note: This can be an empty set if no contacts are present for the domain.

    • getTld

      public String getTld()
    • createVKey

      public VKey<Domain> createVKey()
      Description copied from class: EppResource
      Create the VKey for the specified EPP resource.
      Specified by:
      createVKey in class EppResource
    • asBuilder

      public DomainBase.Builder<? extends DomainBase,?> asBuilder()
      An override of EppResource.asBuilder() with tighter typing.
      Specified by:
      asBuilder in interface Buildable
      Specified by:
      asBuilder in class EppResource