Class AggregateEventEntry
java.lang.Object
org.axonframework.eventsourcing.eventstore.jpa.AggregateEventEntry
A JPA entry dedicated for storing
EventMessages in the
AggregateBasedJpaEventStorageEngine.- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor required by JPA.AggregateEventEntry(long globalIndex, String identifier, String type, String version, byte[] payload, byte[] metadata, String timestamp, @Nullable String aggregateType, @Nullable String aggregateIdentifier, @Nullable Long aggregateSequenceNumber) Constructor for anAggregateEventEntrywhen reading events, since all parameters should be given.AggregateEventEntry(String identifier, String type, String version, byte[] payload, byte[] metadata, Object timestamp, @Nullable String aggregateType, @Nullable String aggregateIdentifier, @Nullable Long aggregateSequenceNumber) Constructor for aAggregateEventEntrywhen appending events, since theglobalIndex()will be defined by the storage layer. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the aggregateIdentifier of the storedEventMessage.@Nullable LongReturns the aggregate sequence number of the storedEventMessage.@Nullable StringReturns the aggregate type of the storedEventMessage.longReturns the global index of the storedEventMessage, reflecting its position in the event store.Returns theidentifierof the storedEventMessage.byte[]metadata()Returns themetadataof the storedEventMessage.byte[]payload()Returns thepayloadof the storedEventMessage.Returns thetimestampof the storedEventMessage.type()Returns thetypeof the storedEventMessage.version()Returns theversionof the storedEventMessage.
-
Constructor Details
-
AggregateEventEntry
public AggregateEventEntry(String identifier, String type, String version, byte[] payload, byte[] metadata, Object timestamp, @Nullable String aggregateType, @Nullable String aggregateIdentifier, @Nullable Long aggregateSequenceNumber) Constructor for aAggregateEventEntrywhen appending events, since theglobalIndex()will be defined by the storage layer.- Parameters:
identifier- The identifier of theEventMessage.type- TheMessageType.name()of anMessage.type().version- TheMessageType.version()of anMessage.type().payload- TheMessage.payload()as abyte[].metadata- TheMessage.metadata()as abyte[].timestamp- The time at which theEventMessagewas originally created.aggregateType- The type of the aggregate that published thisEventMessage. May benullif the event does not originate from an aggregate.aggregateIdentifier- The identifier of the aggregate that published thisEventMessage. May benullif the event does not originate from an aggregate.aggregateSequenceNumber- The sequence number of theEventMessagein the aggregate. May benullif the event does not originate from an aggregate.
-
AggregateEventEntry
public AggregateEventEntry(long globalIndex, String identifier, String type, String version, byte[] payload, byte[] metadata, String timestamp, @Nullable String aggregateType, @Nullable String aggregateIdentifier, @Nullable Long aggregateSequenceNumber) Constructor for anAggregateEventEntrywhen reading events, since all parameters should be given.- Parameters:
globalIndex- The position of theEventMessagein the event store.identifier- The identifier of theEventMessage.type- TheMessageType.name()of anMessage.type().version- TheMessageType.version()of anMessage.type().payload- TheMessage.payload()as abyte[].metadata- TheMessage.metadata()as abyte[].timestamp- The time at which theEventMessagewas originally created.aggregateType- The type of the aggregate that published thisEventMessage. May benullif the event does not originate from an aggregate.aggregateIdentifier- The identifier of the aggregate that published thisEventMessage. May benullif the event does not originate from an aggregate.aggregateSequenceNumber- The sequence number of theEventMessagein the aggregate. May benullif the event does not originate from an aggregate.
-
AggregateEventEntry
protected AggregateEventEntry()Default constructor required by JPA.
-
-
Method Details
-
globalIndex
public long globalIndex()Returns the global index of the storedEventMessage, reflecting its position in the event store.- Returns:
- The global index of the stored
EventMessage, reflecting its position in the event store.
-
identifier
Returns theidentifierof the storedEventMessage.- Returns:
- The
identifierof the storedEventMessage.
-
type
Returns thetypeof the storedEventMessage.- Returns:
- The
typeof the storedEventMessage.
-
version
Returns theversionof the storedEventMessage.- Returns:
- The
versionof the storedEventMessage.
-
payload
public byte[] payload()Returns thepayloadof the storedEventMessage.- Returns:
- The
payloadof the storedEventMessage.
-
metadata
public byte[] metadata()Returns themetadataof the storedEventMessage.- Returns:
- The
metadataof the storedEventMessage.
-
timestamp
Returns thetimestampof the storedEventMessage.- Returns:
- The
timestampof the storedEventMessage.
-
timestampAsString
- Returns:
- The
timestampof the storedEventMessageas aString.
-
aggregateType
Returns the aggregate type of the storedEventMessage.Will be
nullif the event did not originate from an aggregate.- Returns:
- The aggregate type of the stored
EventMessage.
-
aggregateIdentifier
Returns the aggregateIdentifier of the storedEventMessage.Will be
nullif the event did not originate from an aggregate.- Returns:
- The aggregateIdentifier of the stored
EventMessage.
-
aggregateSequenceNumber
Returns the aggregate sequence number of the storedEventMessage.Will be
nullif the event did not originate from an aggregate.- Returns:
- The aggregate sequence number of the stored
EventMessage.
-