Class RdeRevision

All Implemented Interfaces:
UnsafeSerializable, Serializable, 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:
  • Method Details

    • create

      public static RdeRevision create(String tld, org.joda.time.LocalDate date, RdeMode mode, int revision)
    • getRevision

      public int getRevision()
    • getNextRevision

      public 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.
      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 if revision == 0.

      Throws:
      IllegalStateException - if not in a transaction
      com.google.common.base.VerifyException - if the state doesn't meet the above criteria