Class HostBase
- java.lang.Object
-
- google.registry.model.ImmutableObject
-
- google.registry.model.UpdateAutoTimestampEntity
-
- google.registry.model.EppResource
-
- google.registry.model.host.HostBase
-
- All Implemented Interfaces:
Buildable
,UnsafeSerializable
,java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
Host
@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:
- RFC 5732, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
HostBase.Builder<T extends HostBase,B extends HostBase.Builder<T,B>>
A builder for constructingHostBase
, 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.DoNotHydrate, 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 inherited from class google.registry.model.ImmutableObject
hashCode
-
-
Constructor Summary
Constructors Constructor Description HostBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HostBase.Builder<? extends HostBase,?>
asBuilder()
Override ofBuildable.asBuilder()
so that the extra methods are visible.HostBase
cloneProjectedAtTime(org.joda.time.DateTime now)
Deprecated.org.joda.time.DateTime
computeLastTransferTime(Domain superordinateDomain)
Compute the correct last transfer time for this host given its loaded superordinate domain.VKey<? extends HostBase>
createVKey()
Create the VKey for the specified EPP resource.java.lang.String
getForeignKey()
Get the foreign key string for this resource.java.lang.String
getHostName()
com.google.common.collect.ImmutableSet<java.net.InetAddress>
getInetAddresses()
org.joda.time.DateTime
getLastSuperordinateChange()
org.joda.time.DateTime
getLastTransferTime()
VKey<Domain>
getSuperordinateDomain()
boolean
isSubordinate()
-
Methods inherited from class google.registry.model.EppResource
getCreationRegistrarId, getCreationTime, getDeletionTime, getLastEppUpdateRegistrarId, getLastEppUpdateTime, getPersistedCurrentSponsorRegistrarId, getRepoId, getStatusValues, loadCached, loadCached, setCacheForTest, setRepoId
-
Methods inherited from class google.registry.model.UpdateAutoTimestampEntity
copyUpdateTimestamp, getUpdateTimestamp, resetUpdateTimestamp, setUpdateTimestamp
-
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
-
-
-
Method Detail
-
getHostName
public java.lang.String getHostName()
-
isSubordinate
public boolean isSubordinate()
-
getInetAddresses
public com.google.common.collect.ImmutableSet<java.net.InetAddress> 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 classEppResource
-
createVKey
public VKey<? extends HostBase> createVKey()
Description copied from class:EppResource
Create the VKey for the specified EPP resource.- Specified by:
createVKey
in classEppResource
-
cloneProjectedAtTime
@Deprecated public HostBase cloneProjectedAtTime(org.joda.time.DateTime now)
Deprecated.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
-
asBuilder
public HostBase.Builder<? extends HostBase,?> asBuilder()
Description copied from class:EppResource
Override ofBuildable.asBuilder()
so that the extra methods are visible.- Specified by:
asBuilder
in interfaceBuildable
- Specified by:
asBuilder
in classEppResource
-
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.
- Parameters:
superordinateDomain
- the loaded superordinate domain, which must match the key in thesuperordinateDomain
field. Passing it as a parameter allows the caller to control the degree of consistency used to load it.
-
-