Package org.axonframework.eventhandling
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 Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor required by JPAAbstractEventEntry(String eventIdentifier, Object timestamp, String payloadType, String payloadRevision, T payload, T metaData) Reconstruct an event entry from a stored object.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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the identifier of the serialized event.Returns the serialized data of the MetaData of the serialized Event.Returns the serialized data of the Event Message's payload.Returns the timestamp at which the event was first created.
-
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
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
-
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 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
-
AbstractEventEntry
protected AbstractEventEntry()Default constructor required by JPA
-
-
Method Details
-
getEventIdentifier
Description copied from interface:EventDataReturns the identifier of the serialized event.- Specified by:
getEventIdentifierin interfaceEventData<T>- Returns:
- the identifier of the serialized event
-
getTimestamp
Description copied from interface:EventDataReturns the timestamp at which the event was first created.- Specified by:
getTimestampin interfaceEventData<T>- Returns:
- the timestamp at which the event was first created
-
getMetaData
Description copied from interface:EventDataReturns the serialized data of the MetaData of the serialized Event.- Specified by:
getMetaDatain interfaceEventData<T>- Returns:
- the serialized data of the MetaData of the serialized Event
-
getPayload
Description copied from interface:EventDataReturns the serialized data of the Event Message's payload.- Specified by:
getPayloadin interfaceEventData<T>- Returns:
- the serialized data of the Event Message's payload
-