public class GrpcBackedDomainEventData extends Object implements DomainEventData<byte[]>
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.
Constructor and Description |
---|
GrpcBackedDomainEventData(io.axoniq.axonserver.grpc.event.Event event)
Initialize using the given
event as the source of raw data. |
Modifier and Type | Method and Description |
---|---|
String |
getAggregateIdentifier()
Returns the Identifier of the Aggregate to which the Event was applied.
|
String |
getEventIdentifier()
Returns the identifier of the serialized event.
|
SerializedObject |
getMetaData()
Returns the serialized data of the MetaData of the serialized Event.
|
SerializedObject<byte[]> |
getPayload()
Returns the serialized data of the Event Message's payload.
|
long |
getSequenceNumber()
Returns the sequence number of the event in the aggregate.
|
Instant |
getTimestamp()
Returns the timestamp at which the event was first created.
|
String |
getType()
Returns the type identifier of the aggregate.
|
boolean |
isSnapshot() |
public GrpcBackedDomainEventData(io.axoniq.axonserver.grpc.event.Event event)
event
as the source of raw data.event
- The protobuf Event message containing the raw datapublic String getType()
DomainEventData
getType
in interface DomainEventData<byte[]>
public String getAggregateIdentifier()
DomainEventData
getAggregateIdentifier
in interface DomainEventData<byte[]>
public long getSequenceNumber()
DomainEventData
getSequenceNumber
in interface DomainEventData<byte[]>
public String getEventIdentifier()
EventData
getEventIdentifier
in interface EventData<byte[]>
public Instant getTimestamp()
EventData
getTimestamp
in interface EventData<byte[]>
public SerializedObject getMetaData()
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 a MetaDataMap
getMetaData
in interface EventData<byte[]>
public SerializedObject<byte[]> getPayload()
EventData
getPayload
in interface EventData<byte[]>
public boolean isSnapshot()
Copyright © 2010–2023. All rights reserved.