Interface SourcingHandler<I,E>
- Type Parameters:
I- the type of the entity identifierE- the type of the entity
- All Known Subinterfaces:
EntityLifecycleHandler<I,E>
- All Known Implementing Classes:
SimpleEntityLifecycleHandler,SnapshottingEntityLifecycleHandler
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, ProcessingContext processingContext) Sources the entity identified by the givenidentifier.
-
Method Details
-
source
Sources the entity identified by the givenidentifier.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 benullprocessingContext- theProcessingContextassociated with this sourcing operation, cannot benull- Returns:
- a
CompletableFuturethat completes with the sourced entity, nevernull
-