Package google.registry.model.rde
Class RdeRevision
java.lang.Object
google.registry.model.ImmutableObject
google.registry.model.UpdateAutoTimestampEntity
google.registry.model.rde.RdeRevision
- All Implemented Interfaces:
UnsafeSerializable
,Serializable
,Cloneable
Entity for tracking RDE revisions.
This class is used by the RDE staging, upload, and reporting systems to determine the revision
that should be used in the generated filename. It also determines whether or not a resend
flag is included in the generated XML.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class to represent the composite primary key ofRdeRevision
entity.Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
-
Field Summary
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
Method Summary
Modifier and TypeMethodDescriptionstatic RdeRevision
getCurrentRevision
(String tld, org.joda.time.DateTime date, RdeMode mode) Returns the latest revision of the report already generated for the given triplet.static int
getNextRevision
(String tld, org.joda.time.DateTime date, RdeMode mode) Returns next revision ID to use when staging a new deposit file for the given triplet.int
static void
saveRevision
(String tld, org.joda.time.DateTime date, RdeMode mode, int revision) Sets the revision ID for a given triplet.Methods inherited from class google.registry.model.UpdateAutoTimestampEntity
copyUpdateTimestamp, getUpdateTimestamp, resetUpdateTimestamp, setUpdateTimestamp
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
Method Details
-
create
public static RdeRevision create(String tld, org.joda.time.LocalDate date, RdeMode mode, int revision) -
getRevision
public int getRevision() -
getNextRevision
Returns next revision ID to use when staging a new deposit file for the given triplet.- Returns:
0
for first deposit generation and>0
for resends
-
getCurrentRevision
public static Optional<Integer> getCurrentRevision(String tld, org.joda.time.DateTime date, RdeMode mode) Returns the latest revision of the report already generated for the given triplet. -
saveRevision
public static void saveRevision(String tld, org.joda.time.DateTime date, RdeMode mode, int revision) Sets the revision ID for a given triplet.This method verifies that the current revision is
revision - 1
, or that the object does not exist in the database ifrevision == 0
.- Throws:
IllegalStateException
- if not in a transactioncom.google.common.base.VerifyException
- if the state doesn't meet the above criteria
-