Class GrpcBackedSubscriptionQueryMessage<Q,I,U>

java.lang.Object
org.axonframework.axonserver.connector.query.subscription.GrpcBackedSubscriptionQueryMessage<Q,I,U>
Type Parameters:
Q - a generic specifying the type of the SubscriptionQueryMessage's payload
I - a generic specifying the type of the initial result of the SubscriptionQueryResult
U - a generic specifying the type of the subsequent updates of the SubscriptionQueryResult
All Implemented Interfaces:
Serializable, Message<Q>, QueryMessage<Q,I>, SubscriptionQueryMessage<Q,I,U>

public class GrpcBackedSubscriptionQueryMessage<Q,I,U> extends Object implements SubscriptionQueryMessage<Q,I,U>
Wrapper that allows clients to access a gRPC SubscriptionQuery message as a SubscriptionQueryMessage.
Since:
4.0
Author:
Sara Pellegrini
See Also:
  • Constructor Details

    • GrpcBackedSubscriptionQueryMessage

      public GrpcBackedSubscriptionQueryMessage(io.axoniq.axonserver.grpc.query.SubscriptionQuery subscriptionQuery, Serializer messageSerializer, Serializer serializer)
      Instantiate a GrpcBackedSubscriptionQueryMessage with the given subscriptionQuery, using the provided messageSerializer to be able to retrieve the payload and MetaData from it. The serializer is solely used to deserialize the response type of the update message.
      Parameters:
      subscriptionQuery - the SubscriptionQuery which is being wrapped as a SubscriptionQueryMessage
      messageSerializer - the Serializer used to deserialize the payload and MetaData from the given queryRequest
      serializer - the Serializer used to deserialize the response type
  • Method Details

    • getUpdateResponseType

      public ResponseType<U> getUpdateResponseType()
      Description copied from interface: SubscriptionQueryMessage
      Returns the type of incremental responses.
      Specified by:
      getUpdateResponseType in interface SubscriptionQueryMessage<Q,I,U>
      Returns:
      the type of incremental responses
    • getQueryName

      @Nonnull public String getQueryName()
      Description copied from interface: QueryMessage
      Returns the name identifying the query to be executed.
      Specified by:
      getQueryName in interface QueryMessage<Q,I>
      Returns:
      the name identifying the query to be executed.
    • getResponseType

      @Nonnull public ResponseType<I> getResponseType()
      Description copied from interface: QueryMessage
      The type of response expected by the sender of the query
      Specified by:
      getResponseType in interface QueryMessage<Q,I>
      Returns:
      the type of response expected by the sender of the query
    • getIdentifier

      public String getIdentifier()
      Description copied from interface: Message
      Returns the identifier of this message. Two messages with the same identifiers should be interpreted as different representations of the same conceptual message. In such case, the meta-data may be different for both representations. The payload may be identical.
      Specified by:
      getIdentifier in interface Message<Q>
      Returns:
      the unique identifier of this message
    • getMetaData

      public MetaData getMetaData()
      Description copied from interface: Message
      Returns the meta data for this message. This meta data is a collection of key-value pairs, where the key is a String, and the value is a serializable object.
      Specified by:
      getMetaData in interface Message<Q>
      Returns:
      the meta data for this message
    • getPayload

      public Q getPayload()
      Description copied from interface: Message
      Returns the payload of this message. The payload is the application-specific information.
      Specified by:
      getPayload in interface Message<Q>
      Returns:
      the payload of this message
    • getPayloadType

      public Class<Q> getPayloadType()
      Description copied from interface: Message
      Returns the type of the payload.

      Is semantically equal to getPayload().getClass(), but allows implementations to optimize by using lazy loading or deserialization.

      Specified by:
      getPayloadType in interface Message<Q>
      Returns:
      the type of payload.
    • withMetaData

      public GrpcBackedSubscriptionQueryMessage<Q,I,U> withMetaData(@Nonnull Map<String,?> metaData)
      Description copied from interface: SubscriptionQueryMessage
      Returns a copy of this SubscriptionQueryMessage with the given metaData. The payload remains unchanged.
      Specified by:
      withMetaData in interface Message<Q>
      Specified by:
      withMetaData in interface QueryMessage<Q,I>
      Specified by:
      withMetaData in interface SubscriptionQueryMessage<Q,I,U>
      Parameters:
      metaData - The new MetaData for the SubscriptionQueryMessage
      Returns:
      a copy of this message with the given MetaData
    • andMetaData

      public GrpcBackedSubscriptionQueryMessage<Q,I,U> andMetaData(@Nonnull Map<String,?> metaData)
      Description copied from interface: SubscriptionQueryMessage
      Returns a copy of this SubscriptionQueryMessage with its MetaData merged with given metaData. The payload remains unchanged.
      Specified by:
      andMetaData in interface Message<Q>
      Specified by:
      andMetaData in interface QueryMessage<Q,I>
      Specified by:
      andMetaData in interface SubscriptionQueryMessage<Q,I,U>
      Parameters:
      metaData - The MetaData to merge into the SubscriptionQueryMessage
      Returns:
      a copy of this message with the given additional MetaData