Class AbstractEventEntry<T>

java.lang.Object
org.axonframework.eventhandling.AbstractEventEntry<T>
All Implemented Interfaces:
EventData<T>
Direct Known Subclasses:
AbstractDomainEventEntry, AbstractSnapshotEventEntry

@MappedSuperclass @MappedSuperclass public abstract class AbstractEventEntry<T> extends Object implements EventData<T>
Abstract base class of a serialized event. Fields in this class contain JPA annotations that direct JPA event storage engines how to store event entries.
Author:
Rene de Waele
  • Constructor Details

    • AbstractEventEntry

      public AbstractEventEntry(EventMessage<?> eventMessage, Serializer serializer, Class<T> contentType)
      Construct a new event entry from a published event message to enable storing the event or sending it to a remote location.

      The given serializer will be used to serialize the payload and metadata in the given eventMessage. The type of the serialized data will be the same as the given contentType.

      Parameters:
      eventMessage - The event message to convert to a serialized event entry
      serializer - The serializer to convert the event
      contentType - The data type of the payload and metadata after serialization
    • AbstractEventEntry

      public AbstractEventEntry(String eventIdentifier, Object timestamp, String payloadType, String payloadRevision, T payload, T metaData)
      Reconstruct an event entry from a stored object.
      Parameters:
      eventIdentifier - The identifier of the event
      timestamp - The time at which the event was originally created
      payloadType - The fully qualified class name or alias of the event payload
      payloadRevision - The revision of the event payload
      payload - The serialized payload
      metaData - The serialized metadata
    • AbstractEventEntry

      protected AbstractEventEntry()
      Default constructor required by JPA
  • Method Details

    • getEventIdentifier

      public String getEventIdentifier()
      Description copied from interface: EventData
      Returns the identifier of the serialized event.
      Specified by:
      getEventIdentifier in interface EventData<T>
      Returns:
      the identifier of the serialized event
    • getTimestamp

      public Instant getTimestamp()
      Description copied from interface: EventData
      Returns the timestamp at which the event was first created.
      Specified by:
      getTimestamp in interface EventData<T>
      Returns:
      the timestamp at which the event was first created
    • getMetaData

      public SerializedObject<T> getMetaData()
      Description copied from interface: EventData
      Returns the serialized data of the MetaData of the serialized Event.
      Specified by:
      getMetaData in interface EventData<T>
      Returns:
      the serialized data of the MetaData of the serialized Event
    • getPayload

      public SerializedObject<T> getPayload()
      Description copied from interface: EventData
      Returns the serialized data of the Event Message's payload.
      Specified by:
      getPayload in interface EventData<T>
      Returns:
      the serialized data of the Event Message's payload