R - a generic specifying the type of the QueryResponseMessagepublic class GrpcBackedResponseMessage<R> extends Object implements QueryResponseMessage<R>
QueryResponse as a QueryResponseMessage.| Constructor and Description |
|---|
GrpcBackedResponseMessage(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse,
Serializer serializer)
Instantiate a
GrpcBackedResponseMessage with the given queryResponse, using the provided Serializer to be able to retrieve the payload and MetaData from it. |
| Modifier and Type | Method and Description |
|---|---|
GrpcBackedResponseMessage<R> |
andMetaData(Map<String,?> metaData)
Returns a copy of this QueryResponseMessage with its MetaData merged with given
metaData. |
String |
getIdentifier()
Returns the identifier of this message.
|
MetaData |
getMetaData()
Returns the meta data for this message.
|
R |
getPayload()
Returns the payload of this message.
|
Class<R> |
getPayloadType()
Returns the type of the payload.
|
boolean |
isExceptional()
Indicates whether the ResultMessage represents unsuccessful execution.
|
Optional<Throwable> |
optionalExceptionResult()
Returns the Exception in case of exceptional result message or an empty
Optional in case of successful
execution. |
GrpcBackedResponseMessage<R> |
withMetaData(Map<String,?> metaData)
Returns a copy of this QueryResponseMessage with the given
metaData. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionDetails, exceptionResult, serializeExceptionResult, serializePayloadserializeMetaDatapublic GrpcBackedResponseMessage(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse,
Serializer serializer)
GrpcBackedResponseMessage with the given queryResponse, using the provided Serializer to be able to retrieve the payload and MetaData from it.queryResponse - the QueryResponse which is being wrapped as a QueryResponseMessageserializer - the Serializer used to deserialize the payload and MetaData from the given
queryResponsepublic String getIdentifier()
MessagegetIdentifier in interface Message<R>public MetaData getMetaData()
MessagegetMetaData in interface Message<R>public R getPayload()
MessagegetPayload in interface Message<R>public Class<R> getPayloadType()
MessagegetPayload().getClass(), but allows implementations to optimize by using lazy
loading or deserialization.getPayloadType in interface Message<R>public boolean isExceptional()
ResultMessageisExceptional in interface ResultMessage<R>true if execution was unsuccessful, false otherwisepublic Optional<Throwable> optionalExceptionResult()
ResultMessageOptional in case of successful
execution.optionalExceptionResult in interface ResultMessage<R>Optional containing exception result or an empty Optional in case of a successful executionpublic GrpcBackedResponseMessage<R> withMetaData(@Nonnull Map<String,?> metaData)
QueryResponseMessagemetaData. The payload remains unchanged.withMetaData in interface Message<R>withMetaData in interface ResultMessage<R>withMetaData in interface QueryResponseMessage<R>metaData - The new MetaData for the QueryResponseMessagepublic GrpcBackedResponseMessage<R> andMetaData(@Nonnull Map<String,?> metaData)
QueryResponseMessagemetaData. The payload
remains unchanged.andMetaData in interface Message<R>andMetaData in interface ResultMessage<R>andMetaData in interface QueryResponseMessage<R>metaData - The MetaData to merge into the QueryResponseMessageCopyright © 2010–2025. All rights reserved.