Class DefaultEventStore
java.lang.Object
io.fluxcapacitor.javaclient.persisting.eventsourcing.DefaultEventStore
- All Implemented Interfaces:
EventStore
,HasLocalHandlers
Default implementation of the
EventStore
interface, providing mechanisms to store and retrieve events
associated with aggregate instances.
This implementation includes support for intercepting and modifying event messages during dispatch. The
HandlerRegistry
is used to locally invoke event handlers after events are published.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the event stream for an aggregate with full control over behavior.storeEvents
(Object aggregateId, List<?> events, EventPublicationStrategy strategy) Stores a list of events for the given aggregate using a specified publication strategy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.javaclient.persisting.eventsourcing.EventStore
getEvents, getEvents, getEvents, storeEvents, storeEvents
Methods inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HasLocalHandlers
hasLocalHandlers, registerHandler, registerHandler, setSelfHandlerFilter
-
Constructor Details
-
DefaultEventStore
public DefaultEventStore()
-
-
Method Details
-
storeEvents
public CompletableFuture<Void> storeEvents(Object aggregateId, List<?> events, EventPublicationStrategy strategy) Description copied from interface:EventStore
Stores a list of events for the given aggregate using a specified publication strategy.- Specified by:
storeEvents
in interfaceEventStore
- Parameters:
aggregateId
- The ID of the aggregate.events
- The events to store.strategy
- Whether to publish the events in addition to storing them.- Returns:
- A future that completes once the operation is acknowledged.
-
getEvents
public AggregateEventStream<DeserializingMessage> getEvents(Object aggregateId, long lastSequenceNumber, int maxSize, boolean ignoreUnknownType) Description copied from interface:EventStore
Retrieves the event stream for an aggregate with full control over behavior.- Specified by:
getEvents
in interfaceEventStore
- Parameters:
aggregateId
- The ID of the aggregate.lastSequenceNumber
- The last known sequence number to resume from.maxSize
- The maximum number of events to return.ignoreUnknownType
- Whether to ignore unknown payload types when deserializing events.- Returns:
- A stream of deserialized messages representing the event history of the aggregate.
-