DefaultMongoTemplate
instead.@Deprecated public class DefaultMongoTemplate extends AbstractMongoTemplate implements MongoTemplate
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 and Description |
---|
DefaultMongoTemplate(com.mongodb.MongoClient mongo)
Deprecated.
Initializes the MongoTemplate using the given
mongo for database access, using default database
and collection names. |
DefaultMongoTemplate(com.mongodb.MongoClient mongo,
String databaseName,
String domainEventsCollectionName,
String snapshotEventsCollectionName)
Deprecated.
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 . |
Modifier and Type | Method and Description |
---|---|
com.mongodb.client.MongoCollection<org.bson.Document> |
eventCollection()
Deprecated.
Returns a reference to the collection containing the events.
|
com.mongodb.client.MongoCollection<org.bson.Document> |
sagaCollection()
Deprecated.
Returns a reference to the collection containing the saga instances.
|
com.mongodb.client.MongoCollection<org.bson.Document> |
snapshotCollection()
Deprecated.
Returns a reference to the collection containing the snapshot events.
|
com.mongodb.client.MongoCollection<org.bson.Document> |
trackingTokensCollection()
Deprecated.
Returns a reference to the collection containing the Tracking Tokens.
|
database
public DefaultMongoTemplate(com.mongodb.MongoClient mongo)
mongo
for database access, using default database
and collection names.
Domain events collection name: "domainevents"
"snapshotsevents"
Consider using DefaultMongoTemplate(com.mongodb.MongoClient, String, String, String)
to
provide different names for database and/or collections.mongo
- The actual connection to a MongoDB instancepublic DefaultMongoTemplate(com.mongodb.MongoClient mongo, 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.mongo
- 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 eventspublic com.mongodb.client.MongoCollection<org.bson.Document> trackingTokensCollection()
MongoTemplate
trackingTokensCollection
in interface MongoTemplate
public com.mongodb.client.MongoCollection<org.bson.Document> eventCollection()
eventCollection
in interface MongoTemplate
public com.mongodb.client.MongoCollection<org.bson.Document> snapshotCollection()
snapshotCollection
in interface MongoTemplate
public com.mongodb.client.MongoCollection<org.bson.Document> sagaCollection()
MongoTemplate
sagaCollection
in interface MongoTemplate
Copyright © 2010–2018. All rights reserved.