Class GenericSubscriptionQueryUpdateMessage
java.lang.Object
org.axonframework.messaging.core.MessageDecorator
org.axonframework.messaging.core.GenericResultMessage
org.axonframework.messaging.queryhandling.GenericSubscriptionQueryUpdateMessage
- All Implemented Interfaces:
Message,ResultMessage,QueryResponseMessage,SubscriptionQueryUpdateMessage
public class GenericSubscriptionQueryUpdateMessage
extends GenericResultMessage
implements SubscriptionQueryUpdateMessage
Generic implementation of the
SubscriptionQueryUpdateMessage interface holding incremental update of a
subscription query.- Since:
- 3.3.0
- Author:
- Milan Savic, Steven van Beelen
-
Field Summary
Fields inherited from interface org.axonframework.messaging.core.Message
RESOURCE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionGenericSubscriptionQueryUpdateMessage(Message delegate) Initializes a new decorator with givendelegatemessage.GenericSubscriptionQueryUpdateMessage(MessageType type, Object payload) Constructs aGenericSubscriptionQueryUpdateMessagefor the giventypeandpayload.GenericSubscriptionQueryUpdateMessage(MessageType type, P payload, Class<P> declaredUpdateType) Constructs aGenericSubscriptionQueryUpdateMessagefor the giventypeandpayload.GenericSubscriptionQueryUpdateMessage(MessageType type, P payload, Class<P> declaredUpdateType, Map<String, String> metadata) Constructs aGenericSubscriptionQueryUpdateMessagefor the giventype,payload, andmetadata. -
Method Summary
Modifier and TypeMethodDescriptionandMetadata(Map<String, String> metadata) protected StringDescribe the type of message, used inMessageDecorator.toString().withConvertedPayload(Type type, Converter converter) Returns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.withMetadata(Map<String, String> metadata) Returns a copy of thisMessage(implementation) with the givenmetadata.Methods inherited from class org.axonframework.messaging.core.GenericResultMessage
asResultMessageMethods inherited from class org.axonframework.messaging.core.MessageDecorator
delegate, describeTo, identifier, metadata, payload, payloadAs, payloadType, toString, typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.axonframework.messaging.core.Message
identifier, metadata, payload, payloadAs, payloadAs, payloadAs, payloadAs, payloadAs, payloadType, typeMethods inherited from interface org.axonframework.messaging.queryhandling.SubscriptionQueryUpdateMessage
withConvertedPayload, withConvertedPayload
-
Constructor Details
-
GenericSubscriptionQueryUpdateMessage
Constructs aGenericSubscriptionQueryUpdateMessagefor the giventypeandpayload.The
Metadatadefaults to an empty instance.- Parameters:
type- Thetypefor thisSubscriptionQueryUpdateMessage.payload- The payload of typeUfor thisSubscriptionQueryUpdateMessagerepresenting an incremental update.
-
GenericSubscriptionQueryUpdateMessage
public GenericSubscriptionQueryUpdateMessage(@Nonnull MessageType type, @Nullable P payload, @Nonnull Class<P> declaredUpdateType) Constructs aGenericSubscriptionQueryUpdateMessagefor the giventypeandpayload.The
Metadatadefaults to an empty instance.- Type Parameters:
P- The generic type of the expected payload of the resulting object.- Parameters:
type- Thetypefor thisSubscriptionQueryUpdateMessage.payload- The payload of typeUfor thisSubscriptionQueryUpdateMessagerepresenting an incremental update.declaredUpdateType- The declared update type of thisSubscriptionQueryUpdateMessage.
-
GenericSubscriptionQueryUpdateMessage
public GenericSubscriptionQueryUpdateMessage(@Nonnull MessageType type, @Nullable P payload, @Nonnull Class<P> declaredUpdateType, @Nonnull Map<String, String> metadata) Constructs aGenericSubscriptionQueryUpdateMessagefor the giventype,payload, andmetadata.- Type Parameters:
P- The generic type of the expected payload of the resulting object.- Parameters:
type- Thetypefor thisSubscriptionQueryUpdateMessage.payload- The payload of typeUfor thisSubscriptionQueryUpdateMessagerepresenting an incremental update.declaredUpdateType- The declared update type of thisSubscriptionQueryUpdateMessage.metadata- The metadata for thisSubscriptionQueryUpdateMessage.
-
GenericSubscriptionQueryUpdateMessage
Initializes a new decorator with givendelegatemessage. The decorator delegates to the delegate for the message's payload, metadata and identifier.Unlike the other constructors, this constructor will not attempt to retrieve any correlation data from the Unit of Work.
- Parameters:
delegate- TheMessagecontainingpayload,type,identifierandmetadatafor theQueryResponseMessageto reconstruct.
-
-
Method Details
-
withMetadata
Description copied from interface:MessageReturns a copy of thisMessage(implementation) with the givenmetadata.All other fields, like for example the
Message.payload(), remain unchanged.While the implementation returned may be different from the implementation of
this, implementations must take special care in returning the same type ofMessageto prevent errors further downstream.- Specified by:
withMetadatain interfaceMessage- Specified by:
withMetadatain interfaceQueryResponseMessage- Specified by:
withMetadatain interfaceResultMessage- Specified by:
withMetadatain interfaceSubscriptionQueryUpdateMessage- Overrides:
withMetadatain classGenericResultMessage- Parameters:
metadata- The new metadata for theMessage.- Returns:
- A copy of
this Message (implementation)with the givenmetadata.
-
andMetadata
Description copied from interface:MessageReturns a copy of thisMessage(implementation) with itsmetadatamerged with the givenmetadata.All other fields, like for example the
Message.payload(), remain unchanged.- Specified by:
andMetadatain interfaceMessage- Specified by:
andMetadatain interfaceQueryResponseMessage- Specified by:
andMetadatain interfaceResultMessage- Specified by:
andMetadatain interfaceSubscriptionQueryUpdateMessage- Overrides:
andMetadatain classGenericResultMessage- Parameters:
metadata- The metadata to merge with.- Returns:
- A copy of
this Message (implementation)with the givenmetadata.
-
withConvertedPayload
@Nonnull public SubscriptionQueryUpdateMessage withConvertedPayload(@Nonnull Type type, @Nonnull Converter converter) Description copied from interface:MessageReturns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter. This newMessageis effectively a copy ofthis Messagewith a renewed payload andMessage.payloadType().Will return the
thisinstance if thepayload typeisassignable fromthe converted result.- Specified by:
withConvertedPayloadin interfaceMessage- Specified by:
withConvertedPayloadin interfaceQueryResponseMessage- Specified by:
withConvertedPayloadin interfaceResultMessage- Specified by:
withConvertedPayloadin interfaceSubscriptionQueryUpdateMessage- Overrides:
withConvertedPayloadin classGenericResultMessage- Parameters:
type- The type to convert theMessage.payload()to.converter- The converter to convert theMessage.payload()with.- Returns:
- A new
Messageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.
-
describeType
Description copied from class:MessageDecoratorDescribe the type of message, used inMessageDecorator.toString().Defaults to the simple class name of the actual instance.
- Overrides:
describeTypein classGenericResultMessage- Returns:
- The type of the message.
-