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 Set<SubscriptionQueryMessage<?,?,?>> |
activeSubscriptions()
Provides the set of running subscription queries.
|
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,
int updateBufferSize)
Registers an Update Handler for given
query with given updateBufferSize . |
<U> UpdateHandlerRegistration<U> |
registerUpdateHandler(SubscriptionQueryMessage<?,?,?> query,
SubscriptionQueryBackpressure backpressure,
int updateBufferSize)
Deprecated.
in favour of using {
registerUpdateHandler(SubscriptionQueryMessage, int) } |
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@Deprecated <U> UpdateHandlerRegistration<U> registerUpdateHandler(SubscriptionQueryMessage<?,?,?> query, SubscriptionQueryBackpressure backpressure, int updateBufferSize)
registerUpdateHandler(SubscriptionQueryMessage, int)
}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
made<U> UpdateHandlerRegistration<U> registerUpdateHandler(SubscriptionQueryMessage<?,?,?> query, int updateBufferSize)
query
with given updateBufferSize
.U
- the incremental response types of the queryquery
- the subscription query for which we register an Update HandlerupdateBufferSize
- the size of buffer which accumulates updates before subscription to the flux
is
madedefault Set<SubscriptionQueryMessage<?,?,?>> activeSubscriptions()
Copyright © 2010–2022. All rights reserved.