Class HistoryEntry

  • All Implemented Interfaces:
    Buildable, DatastoreEntity, java.lang.Cloneable
    Direct Known Subclasses:
    ContactHistory, DomainHistory, DomainHistoryLite, HostHistory

    @MappedSuperclass
    public class HistoryEntry
    extends ImmutableObject
    implements Buildable, DatastoreEntity
    A record of an EPP command that mutated a resource.

    Due to historical reasons this class is persisted only to Datastore. It has three subclasses that include the parent resource itself which are persisted to Cloud SQL. During migration this class cannot be made abstract in order for the class to be persisted and loaded to and from Datastore. However it should never be used directly in the Java code itself. When it is loaded from Datastore it should be converted to a subclass for handling and when a new history entry is built it should always be a subclass, which is automatically converted to HistoryEntry when persisting to Datastore.

    Some care has been taken to make it close to impossible to use this class directly, but the user should still exercise caution. After the migration is complete this class will be made abstract.

    • Field Detail

      • id

        public java.lang.Long id
        The autogenerated id of this event. Note that, this field is marked as Transient in the SQL schema, this is because the child class of HistoryEntry, e.g. DomainHistory, uses a composite primary key which the id is part of, and Hibernate requires that all the Id fields must be put in the exact same class.
      • parent

        protected com.googlecode.objectify.Key<? extends EppResource> parent
        The resource this event mutated.
      • domainTransactionRecords

        @EmptySetToNull
        protected java.util.Set<DomainTransactionRecord> domainTransactionRecords
        Logging field for transaction reporting.

        This will be empty for any HistoryEntry generated before this field was added. This will also be empty if the HistoryEntry refers to an EPP mutation that does not affect domain transaction counts (such as contact or host mutations).

    • Constructor Detail

      • HistoryEntry

        protected HistoryEntry()
    • Method Detail

      • getId

        public long getId()
      • getParent

        public com.googlecode.objectify.Key<? extends EppResource> getParent()
      • getPeriod

        public Period getPeriod()
      • getXmlBytes

        public byte[] getXmlBytes()
      • getModificationTime

        public org.joda.time.DateTime getModificationTime()
      • getRegistrarId

        public java.lang.String getRegistrarId()
      • getOtherRegistrarId

        public java.lang.String getOtherRegistrarId()
      • getTrid

        @Nullable
        public Trid getTrid()
        Returns the TRID, which may be null if the entry was not created by a normal flow.
      • getBySuperuser

        public boolean getBySuperuser()
      • getReason

        public java.lang.String getReason()
      • getRequestedByRegistrar

        public java.lang.Boolean getRequestedByRegistrar()
      • getResourceAtPointInTime

        public java.util.Optional<? extends EppResource> getResourceAtPointInTime()
        Throws an error when attempting to retrieve the EppResource at this point in time.

        Subclasses must override this to return the resource; it is non-abstract for legacy reasons and objects created prior to the Registry 3.0 migration.

      • asHistoryEntry

        public HistoryEntry asHistoryEntry()
        Clones and returns a HistoryEntry objec

        This is useful when converting a subclass to the base class to persist to Datastore.

      • toChildHistoryEntity

        public HistoryEntry toChildHistoryEntity()
      • createVKey

        public static VKey<? extends HistoryEntry> createVKey​(com.googlecode.objectify.Key<HistoryEntry> key)
        Creates a VKey instance from a Key instance.