Class AbstractSnapshotEventEntry<T>
java.lang.Object
org.axonframework.eventhandling.AbstractEventEntry<T>
org.axonframework.eventsourcing.eventstore.AbstractSnapshotEventEntry<T>
- All Implemented Interfaces:
DomainEventData<T>,EventData<T>
- Direct Known Subclasses:
SnapshotEventEntry
@MappedSuperclass
@MappedSuperclass
public abstract class AbstractSnapshotEventEntry<T>
extends AbstractEventEntry<T>
implements DomainEventData<T>
Abstract base class of a serialized snapshot event storing the state of an aggregate. If JPA is used these entries
have a primary key that is a combination of the aggregate's identifier, sequence number and type.
- Author:
- Rene de Waele
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPrimary key definition of the AbstractEventEntry class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor required by JPAAbstractSnapshotEventEntry(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.AbstractSnapshotEventEntry(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
-
AbstractSnapshotEventEntry
public AbstractSnapshotEventEntry(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
-
AbstractSnapshotEventEntry
public AbstractSnapshotEventEntry(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
-
AbstractSnapshotEventEntry
protected AbstractSnapshotEventEntry()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
-