public class DefaultMongoTemplate extends Object implements MongoTemplate
Default implementation for the MongoTemplate. This implementation requires access to the configured
| Constructor and Description |
|---|
DefaultMongoTemplate(com.mongodb.Mongo mongoDb)
The helper requires an actual
Mongo connection provided by the java driver. |
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.DB |
database()
Returns the database for the axon event store.
|
com.mongodb.DBCollection |
domainEventCollection()
Returns a reference to the collection containing the domain events.
|
void |
setDatabaseName(String databaseName)
Changes the name of the database where axon events will be stored.
|
void |
setDomainEventsCollectionName(String domainEventsCollectionName)
Changes the name of the collection to store the domain events.
|
void |
setSnapshotEventsCollectionName(String snapshotEventsCollectionName)
Changes the name of the collection to store the snapshot events in.
|
com.mongodb.DBCollection |
snapshotEventCollection()
Returns a reference to the collection containing the snapshot events.
|
public DefaultMongoTemplate(com.mongodb.Mongo mongoDb)
Mongo connection provided by the java driver.mongoDb - The actual connection to a MongoDB instancepublic com.mongodb.DBCollection domainEventCollection()
domainEventCollection in interface MongoTemplatepublic com.mongodb.DBCollection snapshotEventCollection()
snapshotEventCollection in interface MongoTemplatepublic com.mongodb.DB database()
database in interface MongoTemplatepublic void setDatabaseName(String databaseName)
databaseName - String containing the name of the database for axon eventspublic void setDomainEventsCollectionName(String domainEventsCollectionName)
domainEventsCollectionName - String containing the name of the collection containing the domain eventspublic void setSnapshotEventsCollectionName(String snapshotEventsCollectionName)
snapshotEventsCollectionName - String containing the name of the collection containing the snapshot eventsCopyright © 2012. All Rights Reserved.