Class EppResource
- java.lang.Object
-
- google.registry.model.ImmutableObject
-
- google.registry.model.UpdateAutoTimestampEntity
-
- google.registry.model.EppResource
-
- All Implemented Interfaces:
Buildable
,UnsafeSerializable
,java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
ContactBase
,DomainBase
,HostBase
@MappedSuperclass public abstract class EppResource extends UpdateAutoTimestampEntity implements Buildable
An EPP entity object (i.e. a domain, contact, or host).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EppResource.Builder<T extends EppResource,B extends EppResource.Builder<T,B>>
Abstract builder forEppResource
types.static interface
EppResource.BuilderWithTransferData<T extends TransferData,B extends EppResource.BuilderWithTransferData<T,B>>
An interface for builders of resources that have transfer data.static interface
EppResource.ForeignKeyedEppResource
EppResources that are loaded via foreign keys should implement this marker interface.static interface
EppResource.ResourceWithTransferData<T extends TransferData>
An interface for resources that have transfer data.-
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 EppResource()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract EppResource.Builder<?,?>
asBuilder()
Override ofBuildable.asBuilder()
so that the extra methods are visible.abstract EppResource
cloneProjectedAtTime(org.joda.time.DateTime now)
Return a clone of the resource with timed status values modified using the given time.abstract VKey<? extends EppResource>
createVKey()
Create the VKey for the specified EPP resource.java.lang.String
getCreationRegistrarId()
org.joda.time.DateTime
getCreationTime()
org.joda.time.DateTime
getDeletionTime()
abstract java.lang.String
getForeignKey()
Get the foreign key string for this resource.java.lang.String
getLastEppUpdateRegistrarId()
org.joda.time.DateTime
getLastEppUpdateTime()
java.lang.String
getPersistedCurrentSponsorRegistrarId()
Get the stored value ofcurrentSponsorRegistrarId
.java.lang.String
getRepoId()
com.google.common.collect.ImmutableSet<StatusValue>
getStatusValues()
static <T extends EppResource>
TloadCached(VKey<T> key)
Loads a given EppResource by its key using the cache (if enabled).static com.google.common.collect.ImmutableMap<VKey<? extends EppResource>,EppResource>
loadCached(java.lang.Iterable<VKey<? extends EppResource>> keys)
Loads the given EppResources by their keys using the cache (if enabled).static void
setCacheForTest(java.util.Optional<java.time.Duration> expiry)
void
setRepoId(java.lang.String repoId)
Sets the repository ID.-
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
-
getRepoId
public java.lang.String getRepoId()
-
setRepoId
public void setRepoId(java.lang.String repoId)
Sets the repository ID.This should only be used for restoring the repo id of an object being loaded in a PostLoad method (effectively, when it is still under construction by Hibernate). In all other cases, the object should be regarded as immutable and changes should go through a Builder.
In addition to this special case use, this method must exist to satisfy Hibernate.
-
getCreationTime
public final org.joda.time.DateTime getCreationTime()
-
getCreationRegistrarId
public java.lang.String getCreationRegistrarId()
-
getLastEppUpdateTime
public org.joda.time.DateTime getLastEppUpdateTime()
-
getLastEppUpdateRegistrarId
public java.lang.String getLastEppUpdateRegistrarId()
-
getPersistedCurrentSponsorRegistrarId
public final java.lang.String getPersistedCurrentSponsorRegistrarId()
Get the stored value ofcurrentSponsorRegistrarId
.For subordinate hosts, this value may not represent the actual current client id, which is the client id of the superordinate host. For all other resources this is the true client id.
-
getStatusValues
public final com.google.common.collect.ImmutableSet<StatusValue> getStatusValues()
-
getDeletionTime
public org.joda.time.DateTime getDeletionTime()
-
cloneProjectedAtTime
public abstract EppResource cloneProjectedAtTime(org.joda.time.DateTime now)
Return a clone of the resource with timed status values modified using the given time.
-
getForeignKey
public abstract java.lang.String getForeignKey()
Get the foreign key string for this resource.
-
createVKey
public abstract VKey<? extends EppResource> createVKey()
Create the VKey for the specified EPP resource.- Overrides:
createVKey
in classImmutableObject
-
asBuilder
public abstract EppResource.Builder<?,?> asBuilder()
Override ofBuildable.asBuilder()
so that the extra methods are visible.
-
setCacheForTest
public static void setCacheForTest(java.util.Optional<java.time.Duration> expiry)
-
loadCached
public static com.google.common.collect.ImmutableMap<VKey<? extends EppResource>,EppResource> loadCached(java.lang.Iterable<VKey<? extends EppResource>> keys)
Loads the given EppResources by their keys using the cache (if enabled).Don't use this unless you really need it for performance reasons, and be sure that you are OK with the trade-offs in loss of transactional consistency.
-
loadCached
public static <T extends EppResource> T loadCached(VKey<T> key)
Loads a given EppResource by its key using the cache (if enabled).Don't use this unless you really need it for performance reasons, and be sure that you are OK with the trade-offs in loss of transactional consistency.
-
-