Package com.opencqrs.framework.command
Interface StateRebuildingHandler<I,E>
- Type Parameters:
I- the instance typeE- the event type to be sourced
- All Known Subinterfaces:
StateRebuildingHandler.FromObject<I,,E> StateRebuildingHandler.FromObjectAndMetaData<I,,E> StateRebuildingHandler.FromObjectAndMetaDataAndSubject<I,,E> StateRebuildingHandler.FromObjectAndMetaDataAndSubjectAndRawEvent<I,,E> StateRebuildingHandler.FromObjectAndRawEvent<I,E>
public sealed interface StateRebuildingHandler<I,E>
permits StateRebuildingHandler.FromObject<I,E>, StateRebuildingHandler.FromObjectAndRawEvent<I,E>, StateRebuildingHandler.FromObjectAndMetaData<I,E>, StateRebuildingHandler.FromObjectAndMetaDataAndSubject<I,E>, StateRebuildingHandler.FromObjectAndMetaDataAndSubjectAndRawEvent<I,E>
Sealed base interface for inherited
FunctionalInterface variants encapsulating the event-sourcing logic
needed to reconstruct instance state from an event stream.
Implementations of this will be used during Command execution as follows:
- The instance state will be reconstructed based on the
Events sourced for theCommand.getSubject()before theCommandHandlerexecution, after they have been successfully upcasted and converted to their appropriate Java object type. This phase allows access to the rawEventread from the event store. - Any event published during command execution via
CommandEventPublisherwill be applied to update the instance state before the events will be written to the event store. Hence, this phase does not have access to the rawEvent.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFunctionalInterfaceto be implemented, if only the Java event is needed to reconstruct the instance state.static interfaceFunctionalInterfaceto be implemented, if the Java event and its meta-data is needed to reconstruct the instance state.static interfaceFunctionalInterfaceto be implemented, if the Java event, its meta-data, and subject is needed to reconstruct the instance state.static interfaceFunctionalInterfaceto be implemented, if the Java event, its meta-data, subject, and optional raw event is needed to reconstruct the instance state.static interfaceFunctionalInterfaceto be implemented, if the Java event and the rawEventis needed to reconstruct the instance state.