Package org.axonframework.queryhandling
Class GenericSubscriptionQueryUpdateMessage<U>
java.lang.Object
org.axonframework.messaging.MessageDecorator<U>
org.axonframework.messaging.GenericResultMessage<U>
org.axonframework.queryhandling.GenericSubscriptionQueryUpdateMessage<U>
- Type Parameters:
U- type of incremental update
- All Implemented Interfaces:
Serializable,Message<U>,ResultMessage<U>,SubscriptionQueryUpdateMessage<U>
public class GenericSubscriptionQueryUpdateMessage<U>
extends GenericResultMessage<U>
implements SubscriptionQueryUpdateMessage<U>
Generic
SubscriptionQueryUpdateMessage which holds incremental update of an subscription query.- Since:
- 3.3
- Author:
- Milan Savic
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionGenericSubscriptionQueryUpdateMessage(Class<U> declaredType, Throwable exception, Map<String, ?> metaData) Initialize the subscription query update message with givendeclaredType,exceptionandmetaData.GenericSubscriptionQueryUpdateMessage(Class<U> declaredType, U payload) InitializesGenericSubscriptionQueryUpdateMessagewith incremental update of provideddeclaredType.InitializesGenericSubscriptionQueryUpdateMessagewith incremental update of provideddeclaredTypeandmetaData.protectedGenericSubscriptionQueryUpdateMessage(Message<U> delegate) Initializes a new decorator with givendelegatemessage.GenericSubscriptionQueryUpdateMessage(U payload) InitializesGenericSubscriptionQueryUpdateMessagewith incremental update. -
Method Summary
Modifier and TypeMethodDescriptionandMetaData(Map<String, ?> metaData) Returns a copy of this Message with it MetaData merged with the givenmetaData.static <T> SubscriptionQueryUpdateMessage<T> asUpdateMessage(Class<T> declaredType, Throwable exception) static <T> SubscriptionQueryUpdateMessage<T> asUpdateMessage(Object payload) CreatesGenericSubscriptionQueryUpdateMessagefrom providedpayloadwhich represents incremental update.protected StringDescribe the type of message, used inMessageDecorator.toString().withMetaData(Map<String, ?> metaData) Returns a copy of this Message with the givenmetaData.Methods inherited from class org.axonframework.messaging.GenericResultMessage
asResultMessage, asResultMessage, describeTo, getPayload, isExceptional, optionalExceptionResult, serializePayloadMethods inherited from class org.axonframework.messaging.MessageDecorator
getDelegate, getIdentifier, getMetaData, getPayloadType, serializeMetaData, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.axonframework.messaging.Message
getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaDataMethods inherited from interface org.axonframework.messaging.ResultMessage
exceptionDetails, exceptionResult, isExceptional, optionalExceptionResult, serializeExceptionResult, serializePayload
-
Constructor Details
-
GenericSubscriptionQueryUpdateMessage
InitializesGenericSubscriptionQueryUpdateMessagewith incremental update.- Parameters:
payload- payload of the message which represent incremental update
-
GenericSubscriptionQueryUpdateMessage
InitializesGenericSubscriptionQueryUpdateMessagewith incremental update of provideddeclaredType.- Parameters:
declaredType- the type of the updatepayload- the payload of the update
-
GenericSubscriptionQueryUpdateMessage
public GenericSubscriptionQueryUpdateMessage(Class<U> declaredType, U payload, Map<String, ?> metaData) InitializesGenericSubscriptionQueryUpdateMessagewith incremental update of provideddeclaredTypeandmetaData.- Parameters:
declaredType- the type of the updatepayload- the payload of the updatemetaData- the metadata of the update
-
GenericSubscriptionQueryUpdateMessage
public GenericSubscriptionQueryUpdateMessage(Class<U> declaredType, Throwable exception, Map<String, ?> metaData) Initialize the subscription query update message with givendeclaredType,exceptionandmetaData.- Parameters:
declaredType- The declared type of the Subscription Query Update Message to be createdexception- The exception describing the cause of an errormetaData- The meta data to contain in the message
-
GenericSubscriptionQueryUpdateMessage
Initializes a new decorator with givendelegatemessage. The decorator delegates to the delegate for the message's payload, metadata and identifier.- Parameters:
delegate- the message delegate
-
-
Method Details
-
asUpdateMessage
CreatesGenericSubscriptionQueryUpdateMessagefrom providedpayloadwhich represents incremental update. The providedpayloadmay not benull.- Type Parameters:
T- type of theGenericSubscriptionQueryUpdateMessage- Parameters:
payload- incremental update- Returns:
- created a
SubscriptionQueryUpdateMessagewith the givenpayload.
-
asUpdateMessage
public static <T> SubscriptionQueryUpdateMessage<T> asUpdateMessage(Class<T> declaredType, Throwable exception) - Type Parameters:
T- type of theGenericSubscriptionQueryUpdateMessage- Parameters:
declaredType- The declared type of the Subscription Query Update Message to be createdexception- The exception describing the cause of an error- Returns:
- a message containing exception result
-
withMetaData
Description copied from interface:MessageReturns a copy of this Message with the givenmetaData. The payload remains unchanged. While the implementation returned may be different than the implementation ofthis, implementations must take special care in returning the same type of Message (e.g. EventMessage, DomainEventMessage) to prevent errors further downstream.- Specified by:
withMetaDatain interfaceMessage<U>- Specified by:
withMetaDatain interfaceResultMessage<U>- Specified by:
withMetaDatain interfaceSubscriptionQueryUpdateMessage<U>- Overrides:
withMetaDatain classGenericResultMessage<U>- Parameters:
metaData- The new MetaData for the Message- Returns:
- a copy of this message with the given MetaData
-
andMetaData
Description copied from interface:MessageReturns a copy of this Message with it MetaData merged with the givenmetaData. The payload remains unchanged.- Specified by:
andMetaDatain interfaceMessage<U>- Specified by:
andMetaDatain interfaceResultMessage<U>- Specified by:
andMetaDatain interfaceSubscriptionQueryUpdateMessage<U>- Overrides:
andMetaDatain classGenericResultMessage<U>- Parameters:
metaData- The MetaData to merge with- Returns:
- a copy of this message with the given MetaData
-
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<U>- Returns:
- the type of message
-