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
,java.io.Serializable
,java.lang.Cloneable
@Entity public final class RdeRevision extends UpdateAutoTimestampEntity
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RdeRevision.RdeRevisionId
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RdeRevision
create(java.lang.String tld, org.joda.time.LocalDate date, RdeMode mode, int revision)
static java.util.Optional<java.lang.Integer>
getCurrentRevision(java.lang.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(java.lang.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
getRevision()
static void
saveRevision(java.lang.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 Detail
-
create
public static RdeRevision create(java.lang.String tld, org.joda.time.LocalDate date, RdeMode mode, int revision)
-
getRevision
public int getRevision()
-
getNextRevision
public static int getNextRevision(java.lang.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.- Returns:
0
for first deposit generation and>0
for resends
-
getCurrentRevision
public static java.util.Optional<java.lang.Integer> getCurrentRevision(java.lang.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(java.lang.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:
java.lang.IllegalStateException
- if not in a transactioncom.google.common.base.VerifyException
- if the state doesn't meet the above criteria
-
-