public interface QueryUpdateEmitter extends MessageDispatchInterceptorSupport<SubscriptionQueryUpdateMessage<?>>
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.
|
boolean |
queryUpdateHandlerRegistered(SubscriptionQueryMessage<?,?,?> query)
Checks whether there is a query update handler for a given
query . |
<U> UpdateHandlerRegistration<U> |
registerUpdateHandler(SubscriptionQueryMessage<?,?,?> query,
SubscriptionQueryBackpressure backpressure,
int updateBufferSize)
Registers an Update Handler for given
query with given backpressure and updateBufferSize . |
registerDispatchInterceptor
<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 errorboolean queryUpdateHandlerRegistered(SubscriptionQueryMessage<?,?,?> query)
query
.query
- the subscription query for which we have registered the update handlertrue
if there is an update handler registered for given query
, false
otherwise<U> UpdateHandlerRegistration<U> registerUpdateHandler(SubscriptionQueryMessage<?,?,?> query, SubscriptionQueryBackpressure backpressure, int updateBufferSize)
query
with given backpressure
and updateBufferSize
.U
- the incremental response types of the queryquery
- the subscription query for which we register an Update Handlerbackpressure
- the backpressure mechanism to be used for emitting updatesupdateBufferSize
- the size of buffer which accumulates updates before subscription to the flux
is
madeCopyright © 2010–2019. All rights reserved.