|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.data.document.mongodb.MongoDbUtils
public abstract class MongoDbUtils
Helper class featuring helper methods for internal MongoDb classes.
Mainly intended for internal use within the framework.
Field Summary | |
---|---|
private static Log |
LOGGER
|
Constructor Summary | |
---|---|
private |
MongoDbUtils()
Private constructor to prevent instantiation. |
Method Summary | |
---|---|
static void |
closeDB(DB db)
Perform actual closing of the Mongo DB object, catching and logging any cleanup exceptions thrown. |
static DB |
doGetDB(Mongo mongo,
java.lang.String databaseName,
java.lang.String username,
char[] password,
boolean allowCreate)
|
static DB |
getDB(Mongo mongo,
java.lang.String databaseName)
Obtains a DB connection for the given Mongo instance and database name |
static DB |
getDB(Mongo mongo,
java.lang.String databaseName,
java.lang.String username,
char[] password)
Obtains a DB connection for the given Mongo instance and database name |
static boolean |
isDBTransactional(DB db,
Mongo mongo)
Return whether the given DB instance is transactional, that is, bound to the current thread by Spring's transaction facilities. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Log LOGGER
Constructor Detail |
---|
private MongoDbUtils()
Method Detail |
---|
public static DB getDB(Mongo mongo, java.lang.String databaseName)
DB
connection for the given Mongo
instance and database name
mongo
- The Mongo
instancedatabaseName
- The database name
DB
connectionpublic static DB getDB(Mongo mongo, java.lang.String databaseName, java.lang.String username, char[] password)
DB
connection for the given Mongo
instance and database name
mongo
- The Mongo
instancedatabaseName
- The database nameusername
- The username to authenticate withpassword
- The password to authenticate with
DB
connectionpublic static DB doGetDB(Mongo mongo, java.lang.String databaseName, java.lang.String username, char[] password, boolean allowCreate)
public static boolean isDBTransactional(DB db, Mongo mongo)
db
- the DB to checkmongo
- the Mongo instance that the DB was created with
(may be null
)
public static void closeDB(DB db)
db
- the DB to close (may be null
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |