org.springframework.data.document.mongodb
Class SimpleMongoDbFactory
java.lang.Object
org.springframework.data.document.mongodb.SimpleMongoDbFactory
- All Implemented Interfaces:
- MongoDbFactory
public class SimpleMongoDbFactory
- extends Object
- implements MongoDbFactory
Field Summary |
protected org.apache.commons.logging.Log |
logger
Logger, available to subclasses. |
Constructor Summary |
SimpleMongoDbFactory(Mongo mongo,
String databaseName)
Create an instance of SimpleMongoDbFactory given the Mongo instance and database name |
SimpleMongoDbFactory(Mongo mongo,
String databaseName,
org.springframework.data.authentication.UserCredentials userCredentials)
Create an instance of SimpleMongoDbFactory given the Mongo instance, database name, and username/password |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
- Logger, available to subclasses.
SimpleMongoDbFactory
public SimpleMongoDbFactory(Mongo mongo,
String databaseName)
- Create an instance of SimpleMongoDbFactory given the Mongo instance and database name
- Parameters:
mongo
- Mongo instance, not nulldatabaseName
- Database name, not null
SimpleMongoDbFactory
public SimpleMongoDbFactory(Mongo mongo,
String databaseName,
org.springframework.data.authentication.UserCredentials userCredentials)
- Create an instance of SimpleMongoDbFactory given the Mongo instance, database name, and username/password
- Parameters:
mongo
- Mongo instance, not nulldatabaseName
- Database name, not nulluserCredentials
- username and password
getDb
public DB getDb()
throws DataAccessException
- Specified by:
getDb
in interface MongoDbFactory
- Throws:
DataAccessException
getDb
public DB getDb(String dbName)
throws DataAccessException
- Specified by:
getDb
in interface MongoDbFactory
- Throws:
DataAccessException
Copyright © 2011. All Rights Reserved.