Class AbstractDomainEventEntry<T>

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

@MappedSuperclass @MappedSuperclass public abstract class AbstractDomainEventEntry<T> extends AbstractEventEntry<T> implements DomainEventData<T>
Abstract base class of a serialized domain 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

    • AbstractDomainEventEntry

      public AbstractDomainEventEntry(DomainEventMessage<?> eventMessage, Serializer serializer, Class<T> contentType)
      Construct a new event entry from a published domain 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
    • AbstractDomainEventEntry

      public AbstractDomainEventEntry(String type, String aggregateIdentifier, long sequenceNumber, String eventIdentifier, Object timestamp, String payloadType, String payloadRevision, T payload, T metaData)
      Reconstruct an event entry from a stored object.
      Parameters:
      type - The type of aggregate that published this event
      aggregateIdentifier - The identifier of the aggregate that published this event
      sequenceNumber - The sequence number of the event in the aggregate
      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
    • AbstractDomainEventEntry

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

    • getType

      public String getType()
      Description copied from interface: DomainEventData
      Returns the type identifier of the aggregate.
      Specified by:
      getType in interface DomainEventData<T>
      Returns:
      the type identifier of the aggregate.
    • getAggregateIdentifier

      public String getAggregateIdentifier()
      Description copied from interface: DomainEventData
      Returns the Identifier of the Aggregate to which the Event was applied.
      Specified by:
      getAggregateIdentifier in interface DomainEventData<T>
      Returns:
      the Identifier of the Aggregate to which the Event was applied
    • getSequenceNumber

      public long getSequenceNumber()
      Description copied from interface: DomainEventData
      Returns the sequence number of the event in the aggregate.
      Specified by:
      getSequenceNumber in interface DomainEventData<T>
      Returns:
      the sequence number of the event in the aggregate