|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.mongo3.common.AbstractMongoTemplate
org.axonframework.mongo3.eventstore.DefaultMongoTemplate
public class DefaultMongoTemplate
Default implementation for the MongoTemplate. This implementation requires access to the configured MongoClient object. You can influence the names of the collections used to store the events as well as the
snapshot events.
| Constructor Summary | |
|---|---|
DefaultMongoTemplate(com.mongodb.MongoClient mongoClient)
Initializes the MongoTemplate using the given mongo for database access, using default database
and collection names. |
|
DefaultMongoTemplate(com.mongodb.MongoClient mongoClient,
String databaseName,
String domainEventsCollectionName,
String snapshotEventsCollectionName)
Creates a template connecting to given mongo instance, and loads events in the collection with given
domainEventsCollectionName and snapshot events from snapshotEventsCollectionName, in a
database with given databaseName. |
|
| Method Summary | |
|---|---|
com.mongodb.client.MongoCollection<org.bson.Document> |
domainEventCollection()
Returns a reference to the collection containing the domain events. |
com.mongodb.client.MongoCollection<org.bson.Document> |
snapshotEventCollection()
Returns a reference to the collection containing the snapshot events. |
| Methods inherited from class org.axonframework.mongo3.common.AbstractMongoTemplate |
|---|
database |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultMongoTemplate(com.mongodb.MongoClient mongoClient)
mongo for database access, using default database
and collection names.
Database name: DefaultMongoTemplate(com.mongodb.MongoClient, String, String, String) to
provide different names for database and/or collections.
mongoClient - The actual connection to a MongoDB instance
public DefaultMongoTemplate(com.mongodb.MongoClient mongoClient,
String databaseName,
String domainEventsCollectionName,
String snapshotEventsCollectionName)
mongo instance, and loads events in the collection with given
domainEventsCollectionName and snapshot events from snapshotEventsCollectionName, in a
database with given databaseName. When not null, the given userName and
password are used to authenticate against the database.
mongoClient - The Mongo instance configured to connect to the Mongo ServerdatabaseName - The name of the database containing the datadomainEventsCollectionName - The name of the collection containing domain eventssnapshotEventsCollectionName - The name of the collection containing snapshot events| Method Detail |
|---|
public com.mongodb.client.MongoCollection<org.bson.Document> domainEventCollection()
domainEventCollection in interface MongoTemplatepublic com.mongodb.client.MongoCollection<org.bson.Document> snapshotEventCollection()
snapshotEventCollection in interface MongoTemplate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||