Interface QueryUpdateEmitter
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
SimpleQueryUpdateEmitter
Query-specific component that interacts with
subscription queries about
update, errors,
and when there are no more update.
Implementations of the QueryUpdateEmitter are expected to be context-aware, to
ensure operations occur within the correct order of (for example) the lifecycle of an
event handling function.
- Since:
- 3.3.0
- Author:
- Milan Savic, Steven van Beelen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<Q> voidCompletes subscription queries matching the givenqueryTypeandfilter.voidcomplete(QualifiedName queryName, Predicate<Object> filter) Completes subscription queries matching the givenqueryNameandfilter.<Q> voidcompleteExceptionally(Class<Q> queryType, Predicate<? super Q> filter, Throwable cause) Completes subscription queries with the givencausematching givenqueryTypeandfilter.voidcompleteExceptionally(QualifiedName queryName, Predicate<Object> filter, Throwable cause) Completes subscription queries with the givencausematching givenqueryNameandfilter.default <Q> voidEmits givenupdateto subscription queries matching the givenqueryTypeand givenfilter.<Q> voidEmits the outcome of theupdateSupplierto subscription queries matching the givenqueryTypeand givenfilter.default voidemit(QualifiedName queryName, Predicate<Object> filter, @Nullable Object update) Emits givenupdateto subscription queries matching the givenqueryNameand givenfilter.voidEmits the outcome of theupdateSupplierto subscription queries matching the givenqueryNameand givenfilter.static QueryUpdateEmitterforContext(ProcessingContext context) Creates a query update emitter for the givenProcessingContext.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Field Details
-
RESOURCE_KEY
-
-
Method Details
-
forContext
Creates a query update emitter for the givenProcessingContext.You can use this emitter only for the context it was created for. There is no harm in using this method more than once with the same
context, as the same emitter will be returned.- Parameters:
context- TheProcessingContextto create the emitter for.- Returns:
- The emitter specific for the given
context.
-
emit
Emits givenupdateto subscription queries matching the givenqueryTypeand givenfilter.- Type Parameters:
Q- The type of theQueryMessageto filter on.- Parameters:
queryType- The type of theQueryMessageto filter on.filter- A predicate to filter matching subscription queries based on theMessage.payload()converted to the givenqueryType.update- The incremental update to emit forsubscription queriesmatching the givenfilter.- Throws:
MessageTypeNotResolvedException- If the givenqueryTypehas no knownMessageTypeequivalent required to filter theMessage.payload().ConversionException- If theMessage.payload()could not be converted to the givenqueryTypeto perform the givenfilter. Will only occur if aMessageTypecould be found for the givenqueryType.
-
emit
Emits the outcome of theupdateSupplierto subscription queries matching the givenqueryTypeand givenfilter.The
updateSupplieris only invoked whenever there are matching queries.- Type Parameters:
Q- The type of theQueryMessageto filter on.- Parameters:
queryType- The type of theQueryMessageto filter on.filter- A predicate to filter matching subscription queries based on theMessage.payload()converted to the givenqueryTypeupdateSupplier- The update supplier to emit forsubscription queriesmatching the givenqueryTypeandfilter.- Throws:
MessageTypeNotResolvedException- If the givenqueryTypehas no knownMessageTypeequivalent required to filter theMessage.payload().ConversionException- If theMessage.payload()could not be converted to the givenqueryTypeto perform the givenfilter. Will only occur if aMessageTypecould be found for the givenqueryType.
-
emit
Emits givenupdateto subscription queries matching the givenqueryNameand givenfilter.- Parameters:
queryName- The qualified name of theMessage.type()to filter on.filter- A predicate to filter matching subscription queries based on the rawMessage.payload().update- The incremental update to emit forsubscription queriesmatching the givenfilter.
-
emit
Emits the outcome of theupdateSupplierto subscription queries matching the givenqueryNameand givenfilter.The
updateSupplieris only invoked whenever there are matching queries.- Parameters:
queryName- The qualified name of theMessage.type()to filter on.filter- A predicate to filter matching subscription queries based on the rawMessage.payload().updateSupplier- The update supplier to emit forsubscription queriesmatching the givenqueryNameandfilter.
-
complete
Completes subscription queries matching the givenqueryTypeandfilter.- Type Parameters:
Q- The type of theQueryMessageto filter on.- Parameters:
queryType- The type of theQueryMessageto filter on.filter- A predicate to filter matching subscription queries based on theMessage.payload()converted to the givenqueryType- Throws:
MessageTypeNotResolvedException- If the givenqueryTypehas no knownMessageTypeequivalent required to filter theMessage.payload().ConversionException- If theMessage.payload()could not be converted to the givenqueryTypeto perform the givenfilter. Will only occur if aMessageTypecould be found for the givenqueryType.
-
complete
Completes subscription queries matching the givenqueryNameandfilter.- Parameters:
queryName- The qualified name of theMessage.type()to filter on.filter- A predicate testing the rawMessage.payload()as is.
-
completeExceptionally
Completes subscription queries with the givencausematching givenqueryTypeandfilter.- Type Parameters:
Q- The type of theQueryMessageto filter on.- Parameters:
queryType- The type of theQueryMessageto filter on.filter- A predicate to filter matching subscription queries based on theMessage.payload()converted to the givenqueryTypecause- The cause of an error leading to exceptionally complete subscription queries.- Throws:
MessageTypeNotResolvedException- If the givenqueryTypehas no knownMessageTypeequivalent required to filter theMessage.payload().ConversionException- If theMessage.payload()could not be converted to the givenqueryTypeto perform the givenfilter. Will only occur if aMessageTypecould be found for the givenqueryType.
-
completeExceptionally
Completes subscription queries with the givencausematching givenqueryNameandfilter.- Parameters:
queryName- The qualified name of theMessage.type()to filter on.filter- A predicate to filter matching subscription queries based on the rawMessage.payload().cause- The cause of an error leading to exceptionally complete subscription queries.
-