public interface QueryUpdateEmitter
If any of the emitter functions in this interface are called from a message handling function (e.g. an EventHandler
annotated function), then that call will automatically be tied into the
lifecycle of the current UnitOfWork
to ensure correct order of
execution.
Added, implementations of this class should thus respect any current UnitOfWork in the
UnitOfWork.Phase.STARTED
phase for any of the emitting functions. If
this is the case then the emitter call action should be performed during the
UnitOfWork.Phase.AFTER_COMMIT
. Otherwise the operation can be executed
immediately.
Modifier and Type | Method and Description |
---|---|
default <Q> void |
complete(Class<Q> queryType,
Predicate<? super Q> filter)
Completes subscription queries matching given query type and filter.
|
void |
complete(Predicate<SubscriptionQueryMessage<?,?,?>> filter)
Completes subscription queries matching given filter.
|
default <Q> void |
completeExceptionally(Class<Q> queryType,
Predicate<? super Q> filter,
Throwable cause)
Completes with an error subscription queries matching given query type and filter
|
void |
completeExceptionally(Predicate<SubscriptionQueryMessage<?,?,?>> filter,
Throwable cause)
Completes with an error subscription queries matching given filter.
|
default <Q,U> void |
emit(Class<Q> queryType,
Predicate<? super Q> filter,
SubscriptionQueryUpdateMessage<U> update)
Emits given incremental update to subscription queries matching given query type and filter.
|
default <Q,U> void |
emit(Class<Q> queryType,
Predicate<? super Q> filter,
U update)
Emits given incremental update to subscription queries matching given query type and filter.
|
<U> void |
emit(Predicate<SubscriptionQueryMessage<?,?,U>> filter,
SubscriptionQueryUpdateMessage<U> update)
Emits incremental update (as return value of provided update function) to subscription queries matching given
filter.
|
default <U> void |
emit(Predicate<SubscriptionQueryMessage<?,?,U>> filter,
U update)
Emits given incremental update to subscription queries matching given filter.
|
<U> void emit(Predicate<SubscriptionQueryMessage<?,?,U>> filter, SubscriptionQueryUpdateMessage<U> update)
U
- the type of the updatefilter
- predicate on subscription query message used to filter subscription queriesupdate
- incremental update messagedefault <U> void emit(Predicate<SubscriptionQueryMessage<?,?,U>> filter, U update)
update
is null
, emit will be skipped. In order to send nullable updates, use emit(Class, Predicate,
SubscriptionQueryUpdateMessage)
or emit(Predicate, SubscriptionQueryUpdateMessage)
methods.U
- the type of the updatefilter
- predicate on subscription query message used to filter subscription queriesupdate
- incremental updatedefault <Q,U> void emit(Class<Q> queryType, Predicate<? super Q> filter, SubscriptionQueryUpdateMessage<U> update)
Q
- the type of the queryU
- the type of the updatequeryType
- the type of the queryfilter
- predicate on query payload used to filter subscription queriesupdate
- incremental update messagedefault <Q,U> void emit(Class<Q> queryType, Predicate<? super Q> filter, U update)
update
is null
, emit will be skipped. In order to send nullable updates, use emit(Class, Predicate,
SubscriptionQueryUpdateMessage)
or emit(Predicate, SubscriptionQueryUpdateMessage)
methods.Q
- the type of the queryU
- the type of the updatequeryType
- the type of the queryfilter
- predicate on query payload used to filter subscription queriesupdate
- incremental updatevoid complete(Predicate<SubscriptionQueryMessage<?,?,?>> filter)
filter
- predicate on subscription query message used to filter subscription queriesdefault <Q> void complete(Class<Q> queryType, Predicate<? super Q> filter)
Q
- the type of the queryqueryType
- the type of the queryfilter
- predicate on query payload used to filter subscription queriesvoid completeExceptionally(Predicate<SubscriptionQueryMessage<?,?,?>> filter, Throwable cause)
filter
- predicate on subscription query message used to filter subscription queriescause
- the cause of an errordefault <Q> void completeExceptionally(Class<Q> queryType, Predicate<? super Q> filter, Throwable cause)
Q
- the type of the queryqueryType
- the type of the queryfilter
- predicate on query payload used to filter subscription queriescause
- the cause of an errorCopyright © 2010–2018. All rights reserved.