Class GrpcBackedDomainEventData

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

public class GrpcBackedDomainEventData extends Object implements org.axonframework.eventhandling.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()
      Specified by:
      getType in interface org.axonframework.eventhandling.DomainEventData<byte[]>
    • getAggregateIdentifier

      public String getAggregateIdentifier()
      Specified by:
      getAggregateIdentifier in interface org.axonframework.eventhandling.DomainEventData<byte[]>
    • getSequenceNumber

      public long getSequenceNumber()
      Specified by:
      getSequenceNumber in interface org.axonframework.eventhandling.DomainEventData<byte[]>
    • getEventIdentifier

      public String getEventIdentifier()
      Specified by:
      getEventIdentifier in interface org.axonframework.eventhandling.EventData<byte[]>
    • getTimestamp

      public Instant getTimestamp()
      Specified by:
      getTimestamp in interface org.axonframework.eventhandling.EventData<byte[]>
    • getMetaData

      public org.axonframework.serialization.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

      Specified by:
      getMetaData in interface org.axonframework.eventhandling.EventData<byte[]>
    • getPayload

      public org.axonframework.serialization.SerializedObject<byte[]> getPayload()
      Specified by:
      getPayload in interface org.axonframework.eventhandling.EventData<byte[]>
    • isSnapshot

      public boolean isSnapshot()