public class DocumentPerEventStorageStrategy extends AbstractMongoEventStorageStrategy
ORDER_ASC, ORDER_DESC| Constructor and Description |
|---|
DocumentPerEventStorageStrategy()
Initializes a
DocumentPerEventStorageStrategy with default configuration. |
DocumentPerEventStorageStrategy(EventEntryConfiguration eventConfiguration,
Duration lookBackTime)
Initializes a
DocumentPerEventStorageStrategy with given eventConfiguration. |
| Modifier and Type | Method and Description |
|---|---|
protected Stream<org.bson.Document> |
createEventDocuments(List<? extends EventMessage<?>> events,
Serializer serializer)
Returns a stream of Mongo documents that represent the given batch of events.
|
protected org.bson.Document |
createSnapshotDocument(DomainEventMessage<?> snapshot,
Serializer serializer)
Returns a Mongo document for given snapshot event.
|
protected Stream<? extends DomainEventData<?>> |
extractEvents(org.bson.Document object)
Retrieves event data from the given Mongo
object. |
protected DomainEventData<?> |
extractSnapshot(org.bson.Document object)
Retrieves snapshot event data from the given Mongo
object. |
appendEvents, appendSnapshot, deleteSnapshots, ensureIndexes, eventConfiguration, findDomainEvents, findLastSnapshot, findTrackedEventspublic DocumentPerEventStorageStrategy()
DocumentPerEventStorageStrategy with default configuration.public DocumentPerEventStorageStrategy(EventEntryConfiguration eventConfiguration, Duration lookBackTime)
DocumentPerEventStorageStrategy with given eventConfiguration.eventConfiguration - object that configures the naming of event entry propertieslookBackTime - the maximum time to look back when fetching new events while tracking.protected Stream<org.bson.Document> createEventDocuments(List<? extends EventMessage<?>> events, Serializer serializer)
AbstractMongoEventStorageStrategyevents
represents events produced in the context of a single unit of work. Uses the given serializer to
serialize event payload and metadata.createEventDocuments in class AbstractMongoEventStorageStrategyevents - the events to convert to Mongo documentsserializer - the serializer to convert the events' payload and metadataprotected org.bson.Document createSnapshotDocument(DomainEventMessage<?> snapshot, Serializer serializer)
AbstractMongoEventStorageStrategyserializer to serialize event payload
and metadata.createSnapshotDocument in class AbstractMongoEventStorageStrategysnapshot - the snapshot to convertserializer - the to convert the snapshot's payload and metadataprotected Stream<? extends DomainEventData<?>> extractEvents(org.bson.Document object)
AbstractMongoEventStorageStrategyobject.extractEvents in class AbstractMongoEventStorageStrategyobject - the object to convert to event dataprotected DomainEventData<?> extractSnapshot(org.bson.Document object)
AbstractMongoEventStorageStrategyobject.extractSnapshot in class AbstractMongoEventStorageStrategyobject - the object to convert to snapshot dataCopyright © 2010–2017. All rights reserved.