org.axonframework.mongo3.saga.repository
Class DefaultMongoTemplate
java.lang.Object
org.axonframework.mongo3.common.AbstractMongoTemplate
org.axonframework.mongo3.saga.repository.DefaultMongoTemplate
- All Implemented Interfaces:
- MongoTemplate
public class DefaultMongoTemplate
- extends AbstractMongoTemplate
- implements MongoTemplate
MongoTemplate instance providing access to the MongoDB Collection containing stored Sagas.
- Since:
- 2.0
- Author:
- Jettro Coenradie, Allard Buijze
Constructor Summary |
DefaultMongoTemplate(com.mongodb.MongoClient mongoClient)
Initialize a template for the given mongoDb instance, using default database name ("axonframework")
and collection name ("sagas"). |
DefaultMongoTemplate(com.mongodb.MongoClient mongoClient,
String databaseName,
String sagasCollectionName)
Creates a template connecting to given mongo instance, and loads sagas in the collection with given
sagasCollectionName , in a database with given databaseName . |
Method Summary |
com.mongodb.client.MongoCollection<org.bson.Document> |
sagaCollection()
Returns a reference to the collection containing the saga instances. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultMongoTemplate
public DefaultMongoTemplate(com.mongodb.MongoClient mongoClient)
- Initialize a template for the given
mongoDb
instance, using default database name ("axonframework")
and collection name ("sagas").
- Parameters:
mongoClient
- The MongoClient instance providing access to the database
DefaultMongoTemplate
public DefaultMongoTemplate(com.mongodb.MongoClient mongoClient,
String databaseName,
String sagasCollectionName)
- Creates a template connecting to given
mongo
instance, and loads sagas in the collection with given
sagasCollectionName
, in a database with given databaseName
.
- Parameters:
mongoClient
- The MongoClient instance configured to connect to the Mongo ServerdatabaseName
- The name of the database containing the datasagasCollectionName
- The collection containing the saga instance
sagaCollection
public com.mongodb.client.MongoCollection<org.bson.Document> sagaCollection()
- Description copied from interface:
MongoTemplate
- Returns a reference to the collection containing the saga instances.
- Specified by:
sagaCollection
in interface MongoTemplate
- Returns:
- MongoCollection containing the sagas
Copyright © 2010-2016. All Rights Reserved.