org.axonframework.saga.repository.mongo
Class DefaultMongoTemplate

java.lang.Object
  extended by org.axonframework.common.mongo.AuthenticatingMongoTemplate
      extended by org.axonframework.saga.repository.mongo.DefaultMongoTemplate
All Implemented Interfaces:
MongoTemplate

public class DefaultMongoTemplate
extends AuthenticatingMongoTemplate
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.Mongo mongo)
          Initialize a template for the given mongoDb instance, using default database name ("axonframework") and collection name ("sagas").
DefaultMongoTemplate(com.mongodb.Mongo mongo, String databaseName, String sagasCollectionName, String userName, char[] password)
          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.DBCollection sagaCollection()
          Returns a reference to the collection containing the saga instances.
 
Methods inherited from class org.axonframework.common.mongo.AuthenticatingMongoTemplate
database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMongoTemplate

public DefaultMongoTemplate(com.mongodb.Mongo mongo)
Initialize a template for the given mongoDb instance, using default database name ("axonframework") and collection name ("sagas").

Parameters:
mongo - The Mongo instance providing access to the database

DefaultMongoTemplate

public DefaultMongoTemplate(com.mongodb.Mongo mongo,
                            String databaseName,
                            String sagasCollectionName,
                            String userName,
                            char[] password)
Creates a template connecting to given mongo instance, and loads sagas in the collection with given sagasCollectionName, in a database with given databaseName. When not null, the given userName and password are used to authenticate against the database.

Parameters:
mongo - The Mongo instance configured to connect to the Mongo Server
databaseName - The name of the database containing the data
sagasCollectionName - The collection containing the saga instance
userName - The username to authenticate with. Use null to skip authentication
password - The password to authenticate with. Use null to skip authentication
Method Detail

sagaCollection

public com.mongodb.DBCollection sagaCollection()
Description copied from interface: MongoTemplate
Returns a reference to the collection containing the saga instances.

Specified by:
sagaCollection in interface MongoTemplate
Returns:
DBCollection containing the sagas


Copyright © 2010-2016. All Rights Reserved.