Q
- a generic specifying the type of the SubscriptionQueryMessage
's payloadI
- 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
public class GrpcBackedSubscriptionQueryMessage<Q,I,U> extends Object implements SubscriptionQueryMessage<Q,I,U>
SubscriptionQuery
message as a SubscriptionQueryMessage
.Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
GrpcBackedSubscriptionQueryMessage<Q,I,U> |
andMetaData(Map<String,?> metaData)
Returns a copy of this SubscriptionQueryMessage with its MetaData merged with given
metaData . |
String |
getIdentifier()
Returns the identifier of this message.
|
MetaData |
getMetaData()
Returns the meta data for this message.
|
Q |
getPayload()
Returns the payload of this message.
|
Class<Q> |
getPayloadType()
Returns the type of the payload.
|
String |
getQueryName()
Returns the name identifying the query to be executed.
|
ResponseType<I> |
getResponseType()
The type of response expected by the sender of the query
|
ResponseType<U> |
getUpdateResponseType()
Returns the type of incremental responses.
|
GrpcBackedSubscriptionQueryMessage<Q,I,U> |
withMetaData(Map<String,?> metaData)
Returns a copy of this SubscriptionQueryMessage with the given
metaData . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
queryName
serializeMetaData, serializePayload
public GrpcBackedSubscriptionQueryMessage(io.axoniq.axonserver.grpc.query.SubscriptionQuery subscriptionQuery, Serializer messageSerializer, Serializer serializer)
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.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 typepublic ResponseType<U> getUpdateResponseType()
SubscriptionQueryMessage
getUpdateResponseType
in interface SubscriptionQueryMessage<Q,I,U>
@Nonnull public String getQueryName()
QueryMessage
getQueryName
in interface QueryMessage<Q,I>
@Nonnull public ResponseType<I> getResponseType()
QueryMessage
getResponseType
in interface QueryMessage<Q,I>
public String getIdentifier()
Message
getIdentifier
in interface Message<Q>
public MetaData getMetaData()
Message
getMetaData
in interface Message<Q>
public Q getPayload()
Message
getPayload
in interface Message<Q>
public Class<Q> getPayloadType()
Message
getPayload().getClass()
, but allows implementations to optimize by using lazy
loading or deserialization.getPayloadType
in interface Message<Q>
public GrpcBackedSubscriptionQueryMessage<Q,I,U> withMetaData(@Nonnull Map<String,?> metaData)
SubscriptionQueryMessage
metaData
. The payload remains unchanged.withMetaData
in interface Message<Q>
withMetaData
in interface QueryMessage<Q,I>
withMetaData
in interface SubscriptionQueryMessage<Q,I,U>
metaData
- The new MetaData for the SubscriptionQueryMessagepublic GrpcBackedSubscriptionQueryMessage<Q,I,U> andMetaData(@Nonnull Map<String,?> metaData)
SubscriptionQueryMessage
metaData
. The payload
remains unchanged.andMetaData
in interface Message<Q>
andMetaData
in interface QueryMessage<Q,I>
andMetaData
in interface SubscriptionQueryMessage<Q,I,U>
metaData
- The MetaData to merge into the SubscriptionQueryMessageCopyright © 2010–2024. All rights reserved.