Package org.axonframework.queryhandling
Class GenericSubscriptionQueryMessage<Q,I,U>
java.lang.Object
org.axonframework.messaging.MessageDecorator<Q>
org.axonframework.queryhandling.GenericQueryMessage<Q,I>
org.axonframework.queryhandling.GenericSubscriptionQueryMessage<Q,I,U>
- Type Parameters:
Q- The type of payload expressing the query in this messageI- The type of initial response expected from this queryU- The type of incremental updates expected from this query
- All Implemented Interfaces:
Serializable,Message<Q>,QueryMessage<Q,,I> SubscriptionQueryMessage<Q,I, U>
public class GenericSubscriptionQueryMessage<Q,I,U>
extends GenericQueryMessage<Q,I>
implements SubscriptionQueryMessage<Q,I,U>
Generic implementation of the
SubscriptionQueryMessage. Unless explicitly provided, it assumes the
queryName of the message is the fully qualified class name of the message's payload.- Since:
- 3.3
- Author:
- Allard Buijze
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGenericSubscriptionQueryMessage(Message<Q> delegate, String queryName, ResponseType<I> responseType, ResponseType<U> updateResponseType) Initializes the message, using givendelegateas the carrier of payload and metadata and givenqueryName, expectedresponseTypeand expectedupdateResponseType.GenericSubscriptionQueryMessage(Q payload, String queryName, ResponseType<I> responseType, ResponseType<U> updateResponseType) Initializes the message with the givenpayload,queryName, expectedresponseTypeand expectedupdateResponseType.GenericSubscriptionQueryMessage(Q payload, ResponseType<I> responseType, ResponseType<U> updateResponseType) Initializes the message with the givenpayload, expectedresponseTypeand expectedupdateResponseType. -
Method Summary
Modifier and TypeMethodDescriptionandMetaData(Map<String, ?> metaData) Returns a copy of this QueryMessage with its MetaData merged with givenmetaData.Returns the type of incremental responses.withMetaData(Map<String, ?> metaData) Returns a copy of this QueryMessage with the givenmetaData.Methods inherited from class org.axonframework.queryhandling.GenericQueryMessage
describeTo, describeType, getQueryName, getResponseTypeMethods inherited from class org.axonframework.messaging.MessageDecorator
getDelegate, getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload, 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, serializeMetaData, serializePayloadMethods inherited from interface org.axonframework.queryhandling.QueryMessage
getQueryName, getResponseType
-
Constructor Details
-
GenericSubscriptionQueryMessage
public GenericSubscriptionQueryMessage(Q payload, ResponseType<I> responseType, ResponseType<U> updateResponseType) Initializes the message with the givenpayload, expectedresponseTypeand expectedupdateResponseType. The query name is set to the fully qualified class name of thepayload.- Parameters:
payload- The payload expressing the queryresponseType- The expected response typeupdateResponseType- The expected type of incremental updates
-
GenericSubscriptionQueryMessage
public GenericSubscriptionQueryMessage(Q payload, String queryName, ResponseType<I> responseType, ResponseType<U> updateResponseType) Initializes the message with the givenpayload,queryName, expectedresponseTypeand expectedupdateResponseType.- Parameters:
payload- The payload expressing the queryqueryName- The name identifying the query to executeresponseType- The expected response typeupdateResponseType- The expected type of incremental updates
-
GenericSubscriptionQueryMessage
public GenericSubscriptionQueryMessage(Message<Q> delegate, String queryName, ResponseType<I> responseType, ResponseType<U> updateResponseType) Initializes the message, using givendelegateas the carrier of payload and metadata and givenqueryName, expectedresponseTypeand expectedupdateResponseType.- Parameters:
delegate- The message containing the payload and meta data for this messagequeryName- The name identifying the query to executeresponseType- The expected response typeupdateResponseType- The expected type of incremental updates
-
-
Method Details
-
getUpdateResponseType
Description copied from interface:SubscriptionQueryMessageReturns the type of incremental responses.- Specified by:
getUpdateResponseTypein interfaceSubscriptionQueryMessage<Q,I, U> - Returns:
- the type of incremental responses
-
withMetaData
Description copied from interface:QueryMessageReturns a copy of this QueryMessage with the givenmetaData. The payload remains unchanged.- Specified by:
withMetaDatain interfaceMessage<Q>- Specified by:
withMetaDatain interfaceQueryMessage<Q,I> - Specified by:
withMetaDatain interfaceSubscriptionQueryMessage<Q,I, U> - Overrides:
withMetaDatain classGenericQueryMessage<Q,I> - Parameters:
metaData- The new MetaData for the QueryMessage- Returns:
- a copy of this message with the given MetaData
-
andMetaData
Description copied from interface:QueryMessageReturns a copy of this QueryMessage with its MetaData merged with givenmetaData. The payload remains unchanged.- Specified by:
andMetaDatain interfaceMessage<Q>- Specified by:
andMetaDatain interfaceQueryMessage<Q,I> - Specified by:
andMetaDatain interfaceSubscriptionQueryMessage<Q,I, U> - Overrides:
andMetaDatain classGenericQueryMessage<Q,I> - Parameters:
metaData- The MetaData to merge into the QueryMessage- Returns:
- a copy of this message with the given additional MetaData
-