Class GrpcBackedDomainEventData
java.lang.Object
org.axonframework.axonserver.connector.event.axon.GrpcBackedDomainEventData
- All Implemented Interfaces:
DomainEventData<byte[]>,EventData<byte[]>
DomainEventData implementation that retrieves its raw data from a protobuf
Event message.
This implementation strictly breaks the contract of DomainEventData, in that the returned SerializedObject for
MetaData does not contain the byte array representation of the metadata, but the MetaDataMap defined in the protobuf message.
- Since:
- 4.0
- Author:
- Marc Gathier
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcBackedDomainEventData(io.axoniq.axonserver.grpc.event.Event event) Initialize using the giveneventas the source of raw data. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Identifier of the Aggregate to which the Event was applied.Returns the identifier of the serialized event.Returns the serialized data of the MetaData of the serialized Event.SerializedObject<byte[]> Returns the serialized data of the Event Message's payload.longReturns the sequence number of the event in the aggregate.Returns the timestamp at which the event was first created.getType()Returns the type identifier of the aggregate.boolean
-
Constructor Details
-
GrpcBackedDomainEventData
public GrpcBackedDomainEventData(io.axoniq.axonserver.grpc.event.Event event) Initialize using the giveneventas the source of raw data.- Parameters:
event- The protobuf Event message containing the raw data
-
-
Method Details
-
getType
Description copied from interface:DomainEventDataReturns the type identifier of the aggregate.- Specified by:
getTypein interfaceDomainEventData<byte[]>- 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<byte[]>- 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<byte[]>- Returns:
- the sequence number of the event in the aggregate
-
getEventIdentifier
Description copied from interface:EventDataReturns the identifier of the serialized event.- Specified by:
getEventIdentifierin interfaceEventData<byte[]>- 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<byte[]>- Returns:
- the timestamp at which the event was first created
-
getMetaData
Returns the serialized data of the MetaData of the serialized Event.Note that this implementation breaks the contract of
EventData.getMetaData(), in that it doesn't return the serialized data as a byte array, but as aMetaDataMap- Specified by:
getMetaDatain interfaceEventData<byte[]>- 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<byte[]>- Returns:
- the serialized data of the Event Message's payload
-
isSnapshot
public boolean isSnapshot()
-