Class GrpcBackedDomainEventData

java.lang.Object
org.axonframework.axonserver.connector.event.axon.GrpcBackedDomainEventData
All Implemented Interfaces:
DomainEventData<byte[]>, EventData<byte[]>

public class GrpcBackedDomainEventData extends Object implements DomainEventData<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 Details

    • GrpcBackedDomainEventData

      public GrpcBackedDomainEventData(io.axoniq.axonserver.grpc.event.Event event)
      Initialize using the given event as the source of raw data.
      Parameters:
      event - The protobuf Event message containing the raw data
  • Method Details

    • getType

      public String getType()
      Description copied from interface: DomainEventData
      Returns the type identifier of the aggregate.
      Specified by:
      getType in interface DomainEventData<byte[]>
      Returns:
      the type identifier of the aggregate.
    • getAggregateIdentifier

      public String getAggregateIdentifier()
      Description copied from interface: DomainEventData
      Returns the Identifier of the Aggregate to which the Event was applied.
      Specified by:
      getAggregateIdentifier in interface DomainEventData<byte[]>
      Returns:
      the Identifier of the Aggregate to which the Event was applied
    • getSequenceNumber

      public long getSequenceNumber()
      Description copied from interface: DomainEventData
      Returns the sequence number of the event in the aggregate.
      Specified by:
      getSequenceNumber in interface DomainEventData<byte[]>
      Returns:
      the sequence number of the event in the aggregate
    • getEventIdentifier

      public String getEventIdentifier()
      Description copied from interface: EventData
      Returns the identifier of the serialized event.
      Specified by:
      getEventIdentifier in interface EventData<byte[]>
      Returns:
      the identifier of the serialized event
    • getTimestamp

      public Instant getTimestamp()
      Description copied from interface: EventData
      Returns the timestamp at which the event was first created.
      Specified by:
      getTimestamp in interface EventData<byte[]>
      Returns:
      the timestamp at which the event was first created
    • getMetaData

      public SerializedObject 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 a MetaDataMap

      Specified by:
      getMetaData in interface EventData<byte[]>
      Returns:
      the serialized data of the MetaData of the serialized Event
    • getPayload

      public SerializedObject<byte[]> getPayload()
      Description copied from interface: EventData
      Returns the serialized data of the Event Message's payload.
      Specified by:
      getPayload in interface EventData<byte[]>
      Returns:
      the serialized data of the Event Message's payload
    • isSnapshot

      public boolean isSnapshot()