public class DefaultMongoTemplate extends AbstractMongoTemplate implements MongoTemplate
Constructor and Description |
---|
DefaultMongoTemplate(com.mongodb.MongoClient mongo)
Initialize a template for the given
mongoDb instance, using default database name ("axonframework")
and collection names ("domainevents", "snapshotevents", "sagas" and "trackingtokens"). |
DefaultMongoTemplate(com.mongodb.MongoClient mongo,
String databaseName)
Initialize a template for the given
mongoDb instance, using given databaseName and default
collection names ("domainevents", "snapshotevents", "sagas" and "trackingtokens"). |
Modifier and Type | Method and Description |
---|---|
com.mongodb.client.MongoCollection<org.bson.Document> |
eventCollection()
Returns a reference to the collection containing the events.
|
com.mongodb.client.MongoCollection<org.bson.Document> |
sagaCollection()
Returns a reference to the collection containing the saga instances.
|
com.mongodb.client.MongoCollection<org.bson.Document> |
snapshotCollection()
Returns a reference to the collection containing the snapshot events.
|
com.mongodb.client.MongoCollection<org.bson.Document> |
trackingTokensCollection()
Returns a reference to the collection containing the Tracking Tokens.
|
DefaultMongoTemplate |
withDomainEventsCollection(String domainEventsCollectionName) |
DefaultMongoTemplate |
withSagasCollection(String sagasCollectionName) |
DefaultMongoTemplate |
withSnapshotCollection(String snapshotEventsCollectionName) |
DefaultMongoTemplate |
withTrackingTokenCollection(String trackingTokensCollectionName) |
database
public DefaultMongoTemplate(com.mongodb.MongoClient mongo)
mongoDb
instance, using default database name ("axonframework")
and collection names ("domainevents", "snapshotevents", "sagas" and "trackingtokens").mongo
- The Mongo instance providing access to the databasepublic DefaultMongoTemplate(com.mongodb.MongoClient mongo, String databaseName)
mongoDb
instance, using given databaseName
and default
collection names ("domainevents", "snapshotevents", "sagas" and "trackingtokens").mongo
- The Mongo instance providing access to the databasedatabaseName
- The name of the database to connect topublic DefaultMongoTemplate withSnapshotCollection(String snapshotEventsCollectionName)
public DefaultMongoTemplate withDomainEventsCollection(String domainEventsCollectionName)
public DefaultMongoTemplate withSagasCollection(String sagasCollectionName)
public DefaultMongoTemplate withTrackingTokenCollection(String trackingTokensCollectionName)
public com.mongodb.client.MongoCollection<org.bson.Document> trackingTokensCollection()
MongoTemplate
trackingTokensCollection
in interface MongoTemplate
public com.mongodb.client.MongoCollection<org.bson.Document> eventCollection()
MongoTemplate
eventCollection
in interface MongoTemplate
public com.mongodb.client.MongoCollection<org.bson.Document> snapshotCollection()
MongoTemplate
snapshotCollection
in interface MongoTemplate
public com.mongodb.client.MongoCollection<org.bson.Document> sagaCollection()
MongoTemplate
sagaCollection
in interface MongoTemplate
Copyright © 2010–2018. All rights reserved.