Class HostBase

  • All Implemented Interfaces:
    Buildable, UnsafeSerializable,, java.lang.Cloneable
    Direct Known Subclasses:

    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:
    RFC 5732, Serialized Form
    • Constructor Detail

      • HostBase

        public HostBase()
    • Method Detail

      • getHostName

        public java.lang.String getHostName()
      • getSuperordinateDomain

        public VKey<Domain> getSuperordinateDomain()
      • isSubordinate

        public boolean isSubordinate()
      • getInetAddresses

        public<> getInetAddresses()
      • getLastTransferTime

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

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

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

        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
      • 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.