@MappedSuperclass @MappedSuperclass public abstract class AbstractSnapshotEventEntry<T> extends AbstractEventEntry<T> implements DomainEventData<T>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractSnapshotEventEntry.PK
Primary key definition of the AbstractEventEntry class.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractSnapshotEventEntry()
Default constructor required by JPA
|
|
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.
|
|
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.
|
Modifier and Type | Method and Description |
---|---|
String |
getAggregateIdentifier()
Returns the Identifier of the Aggregate to which the Event was applied.
|
long |
getSequenceNumber()
Returns the sequence number of the event in the aggregate.
|
String |
getType()
Returns the type identifier of the aggregate.
|
getEventIdentifier, getMetaData, getPayload, getTimestamp
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEventIdentifier, getMetaData, getPayload, getTimestamp
public AbstractSnapshotEventEntry(DomainEventMessage<?> eventMessage, Serializer serializer, Class<T> contentType)
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
.
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 serializationpublic AbstractSnapshotEventEntry(String type, String aggregateIdentifier, long sequenceNumber, String eventIdentifier, Object timestamp, String payloadType, String payloadRevision, T payload, T metaData)
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 metadataprotected AbstractSnapshotEventEntry()
public String getType()
DomainEventData
getType
in interface DomainEventData<T>
public String getAggregateIdentifier()
DomainEventData
getAggregateIdentifier
in interface DomainEventData<T>
public long getSequenceNumber()
DomainEventData
getSequenceNumber
in interface DomainEventData<T>
Copyright © 2010–2024. All rights reserved.