|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.eventstore.mongo.MongoEventStore
public class MongoEventStore
Implementation of the EventStore based on a MongoDB instance or replica set. Sharding and pairing
are not explicitly supported.
This event store implementation needs a serializer as well as a MongoTemplate to interact with the mongo database.
Warning: This implementation is still in progress and may be subject to alterations. The implementation works, but has not been optimized to fully leverage MongoDB's features, yet.
| Constructor Summary | |
|---|---|
MongoEventStore(MongoTemplate mongo)
Constructor that uses the default Serializer. |
|
MongoEventStore(MongoTemplate mongoTemplate,
Serializer eventSerializer,
StorageStrategy storageStrategy)
Initialize the mongo event store with given mongoTemplate, eventSerializer and
storageStrategy. |
|
MongoEventStore(MongoTemplate mongoTemplate,
StorageStrategy storageStrategy)
Constructor that accepts a MongoTemplate and a custom StorageStrategy. |
|
MongoEventStore(Serializer eventSerializer,
MongoTemplate mongo)
Constructor that accepts a Serializer and the MongoTemplate. |
|
| Method Summary | |
|---|---|
void |
appendEvents(String type,
DomainEventStream events)
|
void |
appendSnapshotEvent(String type,
DomainEventMessage snapshotEvent)
|
void |
ensureIndexes()
Make sure an index is created on the collection that stores domain events. |
MongoCriteriaBuilder |
newCriteriaBuilder()
|
DomainEventStream |
readEvents(String type,
Object identifier)
|
void |
setUpcasterChain(UpcasterChain upcasterChain)
|
void |
visitEvents(Criteria criteria,
EventVisitor visitor)
|
void |
visitEvents(EventVisitor visitor)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MongoEventStore(Serializer eventSerializer,
MongoTemplate mongo)
eventSerializer - Your own Serializermongo - Mongo instance to obtain the database and the collections.public MongoEventStore(MongoTemplate mongo)
mongo - MongoTemplate instance to obtain the database and the collections.
public MongoEventStore(MongoTemplate mongoTemplate,
StorageStrategy storageStrategy)
mongoTemplate - The template giving access to the required collectionsstorageStrategy - The strategy for storing and retrieving events from the collections
public MongoEventStore(MongoTemplate mongoTemplate,
Serializer eventSerializer,
StorageStrategy storageStrategy)
mongoTemplate, eventSerializer and
storageStrategy.
mongoTemplate - The template giving access to the required collectionseventSerializer - The serializer to serialize events withstorageStrategy - The strategy for storing and retrieving events from the collections| Method Detail |
|---|
@PostConstruct public void ensureIndexes()
public void appendEvents(String type,
DomainEventStream events)
appendEvents in interface EventStore
public DomainEventStream readEvents(String type,
Object identifier)
readEvents in interface EventStore
public void appendSnapshotEvent(String type,
DomainEventMessage snapshotEvent)
appendSnapshotEvent in interface SnapshotEventStorepublic void visitEvents(EventVisitor visitor)
visitEvents in interface EventStoreManagement
public void visitEvents(Criteria criteria,
EventVisitor visitor)
visitEvents in interface EventStoreManagementpublic MongoCriteriaBuilder newCriteriaBuilder()
newCriteriaBuilder in interface EventStoreManagementpublic void setUpcasterChain(UpcasterChain upcasterChain)
setUpcasterChain in interface UpcasterAware
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||