|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type used to store serialized objectspublic interface EventEntryStore<T>
Interface describing the mechanism that stores Events into the backing data store.
Method Summary | |
---|---|
Iterator<? extends SerializedDomainEventData<T>> |
fetchAggregateStream(String aggregateType,
Object identifier,
long firstSequenceNumber,
int batchSize)
Creates an iterator that iterates through the events for an aggregate of given type and given
identifier starting at given firstSequenceNumber . |
Iterator<? extends SerializedDomainEventData<T>> |
fetchFiltered(String whereClause,
List<Object> parameters,
int batchSize)
Creates an iterator that iterates through the Events that conform to the given sql whereClause . |
Class<T> |
getDataType()
Returns the type used to store serialized payloads. |
SerializedDomainEventData<T> |
loadLastSnapshotEvent(String aggregateType,
Object identifier)
Load the last known snapshot event for aggregate of given type with given identifier . |
void |
persistEvent(String aggregateType,
DomainEventMessage event,
SerializedObject<T> serializedPayload,
SerializedObject<T> serializedMetaData)
Stores the given event (serialized as serializedPayload and
serializedMetaData in the Event Store. |
void |
persistSnapshot(String aggregateType,
DomainEventMessage snapshotEvent,
SerializedObject<T> serializedPayload,
SerializedObject<T> serializedMetaData)
Persists the given event which has been serialized into serializedEvent . |
void |
pruneSnapshots(String type,
DomainEventMessage mostRecentSnapshotEvent,
int maxSnapshotsArchived)
Removes old snapshots from the storage for an aggregate of given type that generated the given
mostRecentSnapshotEvent . |
Method Detail |
---|
void persistEvent(String aggregateType, DomainEventMessage event, SerializedObject<T> serializedPayload, SerializedObject<T> serializedMetaData)
event
(serialized as serializedPayload
and
serializedMetaData
in the Event Store.
aggregateType
- The type identifier of the aggregate that generated the eventevent
- The actual event instance. May be used to extract relevant meta dataserializedPayload
- The serialized payload of the eventserializedMetaData
- The serialized MetaData of the eventSerializedDomainEventData<T> loadLastSnapshotEvent(String aggregateType, Object identifier)
type
with given identifier
.
aggregateType
- The type identifier of the aggregate that generated the eventidentifier
- The identifier of the aggregate to load the snapshot for
Iterator<? extends SerializedDomainEventData<T>> fetchAggregateStream(String aggregateType, Object identifier, long firstSequenceNumber, int batchSize)
type
and given
identifier
starting at given firstSequenceNumber
. When using batched fetching, the
given batchSize
should be used.
Note that the result is expected to be ordered by sequence number, with the lowest number first.
aggregateType
- The type identifier of the aggregate that generated the eventidentifier
- The identifier of the aggregate to load the snapshot forfirstSequenceNumber
- The sequence number of the first event to include in the batchbatchSize
- The number of entries to include in the batch (if available)
Iterator<? extends SerializedDomainEventData<T>> fetchFiltered(String whereClause, List<Object> parameters, int batchSize)
whereClause
.
When the implementation uses batched fetching, it should use given batchSize
. The given
parameters
provide the values for the placeholders used in the where clause.
The "WHERE" keyword must not be included in the whereClause
. If the clause is null or an empty
String, no filters are applied, and an iterator is returned that scans all events in the event store.
The iterator should return events in the order they were added to the event store. In either case, it must
ensure that events originating from the same aggregate are always returned with the lowest sequence number
first.
whereClause
- The JPA clause to be included after the WHERE keywordparameters
- A map containing all the parameter values for parameter keys included in the where clausebatchSize
- The total number of events to return in this batch
void pruneSnapshots(String type, DomainEventMessage mostRecentSnapshotEvent, int maxSnapshotsArchived)
type
that generated the given
mostRecentSnapshotEvent
. A number of maxSnapshotsArchived
is expected to remain in the
archive after pruning, unless that number of snapshots has not been created yet.
type
- the type of the aggregate for which to prune snapshotsmostRecentSnapshotEvent
- the last appended snapshot eventmaxSnapshotsArchived
- the number of snapshots that may remain archivedvoid persistSnapshot(String aggregateType, DomainEventMessage snapshotEvent, SerializedObject<T> serializedPayload, SerializedObject<T> serializedMetaData)
event
which has been serialized into serializedEvent
.
These snapshot events should be returned by the loadLastSnapshotEvent(...)
methods.
aggregateType
- The type identifier of the aggregate that generated the eventsnapshotEvent
- The actual snapshot event instance. May be used to extract relevant meta dataserializedPayload
- The serialized payload of the eventserializedMetaData
- The serialized MetaData of the eventClass<T> getDataType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |