Class GrpcBackedResponseMessage<R>
java.lang.Object
org.axonframework.axonserver.connector.query.GrpcBackedResponseMessage<R>
- Type Parameters:
R- a generic specifying the type of theQueryResponseMessage
- All Implemented Interfaces:
Serializable,Message<R>,ResultMessage<R>,QueryResponseMessage<R>
Wrapper that allows clients to access a gRPC
QueryResponse as a QueryResponseMessage.- Since:
- 4.0
- Author:
- Marc Gathier
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcBackedResponseMessage(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse, Serializer serializer) Instantiate aGrpcBackedResponseMessagewith the givenqueryResponse, using the providedSerializerto be able to retrieve the payload andMetaDatafrom it. -
Method Summary
Modifier and TypeMethodDescriptionandMetaData(Map<String, ?> metaData) Returns a copy of this QueryResponseMessage with its MetaData merged with givenmetaData.Returns the identifier of this message.Returns the meta data for this message.Returns the payload of this message.Returns the type of the payload.booleanIndicates whether the ResultMessage represents unsuccessful execution.Returns the Exception in case of exceptional result message or an emptyOptionalin case of successful execution.withMetaData(Map<String, ?> metaData) Returns a copy of this QueryResponseMessage with the givenmetaData.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.Message
serializeMetaDataMethods inherited from interface org.axonframework.messaging.ResultMessage
exceptionDetails, exceptionResult, serializeExceptionResult, serializePayload
-
Constructor Details
-
GrpcBackedResponseMessage
public GrpcBackedResponseMessage(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse, Serializer serializer) Instantiate aGrpcBackedResponseMessagewith the givenqueryResponse, using the providedSerializerto be able to retrieve the payload andMetaDatafrom it.- Parameters:
queryResponse- theQueryResponsewhich is being wrapped as aQueryResponseMessageserializer- theSerializerused to deserialize the payload andMetaDatafrom the givenqueryResponse
-
-
Method Details
-
getIdentifier
Description copied from interface:MessageReturns 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:
getIdentifierin interfaceMessage<R>- Returns:
- the unique identifier of this message
-
getMetaData
Description copied from interface:MessageReturns 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:
getMetaDatain interfaceMessage<R>- Returns:
- the meta data for this message
-
getPayload
Description copied from interface:MessageReturns the payload of this message. The payload is the application-specific information.- Specified by:
getPayloadin interfaceMessage<R>- Returns:
- the payload of this message
-
getPayloadType
Description copied from interface:MessageReturns the type of the payload. Is semantically equal togetPayload().getClass(), but allows implementations to optimize by using lazy loading or deserialization.- Specified by:
getPayloadTypein interfaceMessage<R>- Returns:
- the type of payload.
-
isExceptional
public boolean isExceptional()Description copied from interface:ResultMessageIndicates whether the ResultMessage represents unsuccessful execution.- Specified by:
isExceptionalin interfaceResultMessage<R>- Returns:
trueif execution was unsuccessful,falseotherwise
-
optionalExceptionResult
Description copied from interface:ResultMessageReturns the Exception in case of exceptional result message or an emptyOptionalin case of successful execution.- Specified by:
optionalExceptionResultin interfaceResultMessage<R>- Returns:
- an
Optionalcontaining exception result or an empty Optional in case of a successful execution
-
withMetaData
Description copied from interface:QueryResponseMessageReturns a copy of this QueryResponseMessage with the givenmetaData. The payload remains unchanged.- Specified by:
withMetaDatain interfaceMessage<R>- Specified by:
withMetaDatain interfaceQueryResponseMessage<R>- Specified by:
withMetaDatain interfaceResultMessage<R>- Parameters:
metaData- The new MetaData for the QueryResponseMessage- Returns:
- a copy of this message with the given MetaData
-
andMetaData
Description copied from interface:QueryResponseMessageReturns a copy of this QueryResponseMessage with its MetaData merged with givenmetaData. The payload remains unchanged.- Specified by:
andMetaDatain interfaceMessage<R>- Specified by:
andMetaDatain interfaceQueryResponseMessage<R>- Specified by:
andMetaDatain interfaceResultMessage<R>- Parameters:
metaData- The MetaData to merge into the QueryResponseMessage- Returns:
- a copy of this message with the given additional MetaData
-