Package org.axonframework.eventhandling
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 Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor required by JPAAbstractDomainEventEntry(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.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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Identifier of the Aggregate to which the Event was applied.longReturns the sequence number of the event in the aggregate.getType()Returns the type identifier of the aggregate.Methods inherited from class org.axonframework.eventhandling.AbstractEventEntry
getEventIdentifier, getMetaData, getPayload, getTimestampMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.eventhandling.EventData
getEventIdentifier, getMetaData, getPayload, getTimestamp
-
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
serializerwill be used to serialize the payload and metadata in the giveneventMessage. The type of the serialized data will be the same as the givencontentType.- Parameters:
eventMessage- The event message to convert to a serialized event entryserializer- The serializer to convert the eventcontentType- 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 eventaggregateIdentifier- The identifier of the aggregate that published this eventsequenceNumber- The sequence number of the event in the aggregateeventIdentifier- The identifier of the eventtimestamp- The time at which the event was originally createdpayloadType- The fully qualified class name or alias of the event payloadpayloadRevision- The revision of the event payloadpayload- The serialized payloadmetaData- The serialized metadata
-
AbstractDomainEventEntry
protected AbstractDomainEventEntry()Default constructor required by JPA
-
-
Method Details
-
getType
Description copied from interface:DomainEventDataReturns the type identifier of the aggregate.- Specified by:
getTypein interfaceDomainEventData<T>- Returns:
- the type identifier of the aggregate.
-
getAggregateIdentifier
Description copied from interface:DomainEventDataReturns the Identifier of the Aggregate to which the Event was applied.- Specified by:
getAggregateIdentifierin interfaceDomainEventData<T>- Returns:
- the Identifier of the Aggregate to which the Event was applied
-
getSequenceNumber
public long getSequenceNumber()Description copied from interface:DomainEventDataReturns the sequence number of the event in the aggregate.- Specified by:
getSequenceNumberin interfaceDomainEventData<T>- Returns:
- the sequence number of the event in the aggregate
-