Class HostBase

All Implemented Interfaces:
Buildable, UnsafeSerializable, Serializable, Cloneable
Direct Known Subclasses:

@MappedSuperclass @Embeddable public class HostBase extends EppResource
A persistable Host resource including mutable and non-mutable fields.

A host's TransferData is stored on the superordinate domain. Non-subordinate hosts don't carry a full set of TransferData; all they have is lastTransferTime.

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

    • HostBase

      public HostBase()
  • Method Details

    • getHostName

      public String getHostName()
    • getSuperordinateDomain

      public VKey<Domain> getSuperordinateDomain()
    • isSubordinate

      public boolean isSubordinate()
    • getInetAddresses

      public<InetAddress> getInetAddresses()
    • getLastTransferTime

      public org.joda.time.DateTime getLastTransferTime()
    • getLastSuperordinateChange

      public org.joda.time.DateTime getLastSuperordinateChange()
    • getForeignKey

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

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

      @Deprecated public HostBase 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
    • asBuilder

      public HostBase.Builder<? extends HostBase,?> asBuilder()
      Description copied from class: EppResource
      Override of Buildable.asBuilder() so that the extra methods are visible.
      Specified by:
      asBuilder in interface Buildable
      Specified by:
      asBuilder in class EppResource
    • computeLastTransferTime

      public org.joda.time.DateTime computeLastTransferTime(@Nullable Domain superordinateDomain)
      Compute the correct last transfer time for this host given its loaded superordinate domain.

      Hosts can move between superordinate domains, so to know which lastTransferTime is correct we need to know if the host was attached to this superordinate the last time that the superordinate was transferred. If the last superordinate change was before this time, then the host was attached to this superordinate domain during that transfer.

      If the host is not subordinate the domain can be null, and we just return last transfer time.

      superordinateDomain - the loaded superordinate domain, which must match the key in the superordinateDomain field. Passing it as a parameter allows the caller to control the degree of consistency used to load it.