Q - a generic specifying the type of the QueryMessage's payloadR - a generic specifying the expected response type of the QueryMessagepublic class GrpcBackedQueryMessage<Q,R> extends Object implements QueryMessage<Q,R>
QueryRequest as a QueryMessage.| Constructor and Description |
|---|
GrpcBackedQueryMessage(io.axoniq.axonserver.grpc.query.QueryRequest queryRequest,
Serializer messageSerializer,
Serializer serializer)
Instantiate a
GrpcBackedResponseMessage with the given queryRequest, using the provided messageSerializer to be able to retrieve the payload and MetaData from it. |
| Modifier and Type | Method and Description |
|---|---|
GrpcBackedQueryMessage<Q,R> |
andMetaData(Map<String,?> metaData)
Returns a copy of this QueryMessage 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<R> |
getResponseType()
The type of response expected by the sender of the query
|
GrpcBackedQueryMessage<Q,R> |
withMetaData(Map<String,?> metaData)
Returns a copy of this QueryMessage with the given
metaData. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitqueryNameserializeMetaData, serializePayloadpublic GrpcBackedQueryMessage(io.axoniq.axonserver.grpc.query.QueryRequest queryRequest,
Serializer messageSerializer,
Serializer serializer)
GrpcBackedResponseMessage with the given queryRequest, 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.queryRequest - the QueryRequest which is being wrapped as a QueryMessagemessageSerializer - the Serializer used to deserialize the payload and MetaData from the
given queryRequestserializer - the Serializer used to deserialize the response typepublic String getQueryName()
QueryMessagegetQueryName in interface QueryMessage<Q,R>public ResponseType<R> getResponseType()
QueryMessagegetResponseType in interface QueryMessage<Q,R>public String getIdentifier()
MessagegetIdentifier in interface Message<Q>public MetaData getMetaData()
MessagegetMetaData in interface Message<Q>public Q getPayload()
MessagegetPayload in interface Message<Q>public Class<Q> getPayloadType()
MessagegetPayload().getClass(), but allows implementations to optimize by using lazy
loading or deserialization.getPayloadType in interface Message<Q>public GrpcBackedQueryMessage<Q,R> withMetaData(@Nonnull Map<String,?> metaData)
QueryMessagemetaData. The payload remains unchanged.withMetaData in interface Message<Q>withMetaData in interface QueryMessage<Q,R>metaData - The new MetaData for the QueryMessagepublic GrpcBackedQueryMessage<Q,R> andMetaData(@Nonnull Map<String,?> metaData)
QueryMessagemetaData. The payload remains
unchanged.andMetaData in interface Message<Q>andMetaData in interface QueryMessage<Q,R>metaData - The MetaData to merge into the QueryMessageCopyright © 2010–2023. All rights reserved.