public class SimpleQueryUpdateEmitter extends Object implements QueryUpdateEmitter
QueryUpdateEmitter
that uses Project Reactor to implement Update Handlers.Modifier and Type | Class and Description |
---|---|
static class |
SimpleQueryUpdateEmitter.Builder
Builder class to instantiate a
SimpleQueryUpdateEmitter . |
Modifier | Constructor and Description |
---|---|
protected |
SimpleQueryUpdateEmitter(SimpleQueryUpdateEmitter.Builder builder)
Instantiate a
SimpleQueryUpdateEmitter based on the fields contained in the SimpleQueryUpdateEmitter.Builder . |
Modifier and Type | Method and Description |
---|---|
Set<SubscriptionQueryMessage<?,?,?>> |
activeSubscriptions()
Provides the set of running subscription queries.
|
static SimpleQueryUpdateEmitter.Builder |
builder()
Instantiate a Builder to be able to create a
SimpleQueryUpdateEmitter . |
void |
complete(Predicate<SubscriptionQueryMessage<?,?,?>> filter)
Completes subscription queries matching given filter.
|
void |
completeExceptionally(Predicate<SubscriptionQueryMessage<?,?,?>> filter,
Throwable cause)
Completes with an error subscription queries matching given 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.
|
boolean |
queryUpdateHandlerRegistered(SubscriptionQueryMessage<?,?,?> query)
Checks whether there is a query update handler for a given
query . |
Registration |
registerDispatchInterceptor(MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage<?>> interceptor)
Register the given DispatchInterceptor.
|
<U> UpdateHandlerRegistration<U> |
registerUpdateHandler(SubscriptionQueryMessage<?,?,?> query,
SubscriptionQueryBackpressure backpressure,
int updateBufferSize)
Registers an Update Handler for given
query with given backpressure and updateBufferSize . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, completeExceptionally, emit, emit, emit
protected SimpleQueryUpdateEmitter(SimpleQueryUpdateEmitter.Builder builder)
SimpleQueryUpdateEmitter
based on the fields contained in the SimpleQueryUpdateEmitter.Builder
.builder
- the SimpleQueryUpdateEmitter.Builder
used to instantiate a SimpleQueryUpdateEmitter
instancepublic static SimpleQueryUpdateEmitter.Builder builder()
SimpleQueryUpdateEmitter
.
The MessageMonitor
is defaulted to a NoOpMessageMonitor
.
SimpleQueryUpdateEmitter
public boolean queryUpdateHandlerRegistered(SubscriptionQueryMessage<?,?,?> query)
QueryUpdateEmitter
query
.queryUpdateHandlerRegistered
in interface QueryUpdateEmitter
query
- the subscription query for which we have registered the update handlertrue
if there is an update handler registered for given query
, false
otherwisepublic <U> UpdateHandlerRegistration<U> registerUpdateHandler(SubscriptionQueryMessage<?,?,?> query, SubscriptionQueryBackpressure backpressure, int updateBufferSize)
QueryUpdateEmitter
query
with given backpressure
and updateBufferSize
.registerUpdateHandler
in interface QueryUpdateEmitter
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
madepublic <U> void emit(Predicate<SubscriptionQueryMessage<?,?,U>> filter, SubscriptionQueryUpdateMessage<U> update)
QueryUpdateEmitter
emit
in interface QueryUpdateEmitter
U
- the type of the updatefilter
- predicate on subscription query message used to filter subscription queriesupdate
- incremental update messagepublic void complete(Predicate<SubscriptionQueryMessage<?,?,?>> filter)
QueryUpdateEmitter
complete
in interface QueryUpdateEmitter
filter
- predicate on subscription query message used to filter subscription queriespublic void completeExceptionally(Predicate<SubscriptionQueryMessage<?,?,?>> filter, Throwable cause)
QueryUpdateEmitter
completeExceptionally
in interface QueryUpdateEmitter
filter
- predicate on subscription query message used to filter subscription queriescause
- the cause of an errorpublic Registration registerDispatchInterceptor(MessageDispatchInterceptor<? super SubscriptionQueryUpdateMessage<?>> interceptor)
MessageDispatchInterceptorSupport
registerDispatchInterceptor
in interface MessageDispatchInterceptorSupport<SubscriptionQueryUpdateMessage<?>>
interceptor
- The interceptor to registerpublic Set<SubscriptionQueryMessage<?,?,?>> activeSubscriptions()
QueryUpdateEmitter
activeSubscriptions
in interface QueryUpdateEmitter
Copyright © 2010–2020. All rights reserved.