Interface SubscriptionQueryMessage<Q,I,U>

Type Parameters:
Q - the type of payload
I - the type of initial response
U - the type of incremental responses
All Superinterfaces:
Message<Q>, QueryMessage<Q,I>, Serializable
All Known Implementing Classes:
GenericSubscriptionQueryMessage, GrpcBackedSubscriptionQueryMessage

public interface SubscriptionQueryMessage<Q,I,U> extends QueryMessage<Q,I>
Message type that carries a Subscription Query: a request for information. Besides a payload, Subscription Query Messages also carry the expected response type and update type. The response type is the type of result expected by the caller. The update type is type of incremental updates.

Handlers should only answer a query if they can respond with the appropriate response type and update type.

Since:
3.3
Author:
Allard Buijze
  • Method Details

    • getUpdateResponseType

      ResponseType<U> getUpdateResponseType()
      Returns the type of incremental responses.
      Returns:
      the type of incremental responses
    • withMetaData

      SubscriptionQueryMessage<Q,I,U> withMetaData(@Nonnull Map<String,?> metaData)
      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>
      Parameters:
      metaData - The new MetaData for the SubscriptionQueryMessage
      Returns:
      a copy of this message with the given MetaData
    • andMetaData

      SubscriptionQueryMessage<Q,I,U> andMetaData(@Nonnull Map<String,?> additionalMetaData)
      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>
      Parameters:
      additionalMetaData - The MetaData to merge into the SubscriptionQueryMessage
      Returns:
      a copy of this message with the given additional MetaData