Interface SourcingHandler<I,E>
- Type Parameters:
I- the type of the entity identifierE- the type of the entity
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
SimpleSourcingHandler,SnapshottingSourcingHandler
Handles the sourcing of an entity from its historical event stream.
Implementations of this interface are responsible for retrieving all relevant events for a given identifier and applying them to construct or evolve the entity to its current state.
- Since:
- 5.1.0
- Author:
- John Hendrikx
-
Method Summary
Modifier and TypeMethodDescriptionsource(I identifier, InitializingEntityEvolver<I, E> evolver, ProcessingContext processingContext) Sources the entity identified by the givenidentifier.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
source
CompletableFuture<E> source(I identifier, InitializingEntityEvolver<I, E> evolver, ProcessingContext processingContext) Sources the entity identified by the givenidentifier.The
InitializingEntityEvolveris used to either create the entity (if it does not exist) or evolve it through the events retrieved from the underlying event stream.This method returns a
CompletableFuturethat completes when the entity has been fully reconstructed or evolved to its latest state.- Parameters:
identifier- the identifier of the entity to source, cannot benullevolver- theInitializingEntityEvolverused to initialize and evolve the entity, cannot benullprocessingContext- theProcessingContextassociated with this sourcing operation, cannot benull- Returns:
- a
CompletableFuturethat completes with the sourced entity, nevernull
-