Package org.axonframework.queryhandling
Class DefaultSubscriptionQueryResult<I,U>
java.lang.Object
org.axonframework.queryhandling.DefaultSubscriptionQueryResult<I,U>
- Type Parameters:
I- The type of initial resultU- The type of incremental updates
- All Implemented Interfaces:
AutoCloseable,Registration,SubscriptionQueryResult<I,U>
public class DefaultSubscriptionQueryResult<I,U>
extends Object
implements SubscriptionQueryResult<I,U>
Default implementation of
SubscriptionQueryResult.- Since:
- 3.3
- Author:
- Milan Savic
-
Field Summary
Fields inherited from interface org.axonframework.queryhandling.SubscriptionQueryResult
logger -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSubscriptionQueryResult(reactor.core.publisher.Mono<I> initialResult, reactor.core.publisher.Flux<U> updates, Registration registrationDelegate) Initializes the result with mono and flux used for result retrieval. -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel()Cancels this Registration.reactor.core.publisher.Mono<I> Subscribing to this mono will trigger invocation of query handler.reactor.core.publisher.Flux<U> updates()When there is an update to the subscription query, it will be emitted to this flux.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.common.Registration
closeMethods inherited from interface org.axonframework.queryhandling.SubscriptionQueryResult
handle, handle
-
Constructor Details
-
DefaultSubscriptionQueryResult
public DefaultSubscriptionQueryResult(reactor.core.publisher.Mono<I> initialResult, reactor.core.publisher.Flux<U> updates, Registration registrationDelegate) Initializes the result with mono and flux used for result retrieval.- Parameters:
initialResult- mono representing initial resultupdates- flux representing incremental updatesregistrationDelegate- delegate which cancels the registration of this result
-
-
Method Details
-
initialResult
Description copied from interface:SubscriptionQueryResultSubscribing to this mono will trigger invocation of query handler. The return value of that query handler will be passed to the mono, once it's ready.- Specified by:
initialResultin interfaceSubscriptionQueryResult<I,U> - Returns:
- the mono representing the initial result
-
updates
Description copied from interface:SubscriptionQueryResultWhen there is an update to the subscription query, it will be emitted to this flux.- Specified by:
updatesin interfaceSubscriptionQueryResult<I,U> - Returns:
- the flux representing the incremental updates
-
cancel
public boolean cancel()Description copied from interface:RegistrationCancels this Registration. If the Registration was already cancelled, no action is taken.- Specified by:
cancelin interfaceRegistration- Returns:
trueif this handler is successfully deregistered,falseif this handler was not currently registered.
-