org.axonframework.mongo3.saga.repository
Class DefaultMongoTemplate

java.lang.Object
  extended by org.axonframework.mongo3.common.AbstractMongoTemplate
      extended by 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 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

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 Server
databaseName - The name of the database containing the data
sagasCollectionName - The collection containing the saga instance
Method Detail

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.