|
|||||||||
| 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.
| Constructor Summary | |
|---|---|
MongoEventStore(EventSerializer eventSerializer,
com.mongodb.Mongo mongo)
Deprecated. Use MongoEventStore(org.axonframework.serializer.Serializer, com.mongodb.Mongo) instead. |
|
MongoEventStore(com.mongodb.Mongo mongo)
Constructor that uses the default EventSerializer. |
|
MongoEventStore(Serializer<? super DomainEvent> eventSerializer,
com.mongodb.Mongo mongo)
Constructor that accepts an EventSerializer, the MongoTemplate and a string containing the testContext. |
|
| Method Summary | |
|---|---|
void |
appendEvents(String type,
DomainEventStream events)
|
void |
appendSnapshotEvent(String type,
DomainEvent snapshotEvent)
|
void |
ensureIndexes()
Make sure an index is created on the collection that stores domain events. |
DomainEventStream |
readEvents(String type,
AggregateIdentifier identifier)
|
void |
setDatabaseName(String databaseName)
Sets the name of the database in which the event store should create the event collections. |
void |
setDomainEventsCollectionName(String domainEventsCollectionName)
Sets the name of the collection where this event store should store domain events. |
void |
setSnapshotEventsCollectionName(String snapshotEventsCollectionName)
Sets the name of the collection where this event store should store snapshot events. |
void |
visitEvents(EventVisitor visitor)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated
public MongoEventStore(EventSerializer eventSerializer,
com.mongodb.Mongo mongo)
MongoEventStore(org.axonframework.serializer.Serializer, com.mongodb.Mongo) instead.
eventSerializer - Your own EventSerializermongo - Mongo instance to obtain the database and the collections.
public MongoEventStore(Serializer<? super DomainEvent> eventSerializer,
com.mongodb.Mongo mongo)
eventSerializer - Your own EventSerializermongo - Mongo instance to obtain the database and the collections.public MongoEventStore(com.mongodb.Mongo mongo)
mongo - Mongo instance to obtain the database and the collections.| Method Detail |
|---|
@PostConstruct public void ensureIndexes()
public void appendEvents(String type,
DomainEventStream events)
appendEvents in interface EventStore
public DomainEventStream readEvents(String type,
AggregateIdentifier identifier)
readEvents in interface EventStore
public void appendSnapshotEvent(String type,
DomainEvent snapshotEvent)
appendSnapshotEvent in interface SnapshotEventStorepublic void visitEvents(EventVisitor visitor)
visitEvents in interface EventStoreManagementpublic void setDatabaseName(String databaseName)
databaseName - the name of the database where events should be storedpublic void setDomainEventsCollectionName(String domainEventsCollectionName)
snapshot events collection.
domainEventsCollectionName - The name of the collection that stores domain events.public void setSnapshotEventsCollectionName(String snapshotEventsCollectionName)
domain events collection.
snapshotEventsCollectionName - The name of the collection that stores snapshot events.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||