Class MongoDBImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.mongodb.MongoDBImpl
-
- All Implemented Interfaces:
java.util.EventListener,ThreadCleanupListener,MongoDB
public class MongoDBImpl extends java.lang.Object implements MongoDB, ThreadCleanupListener
Default implementation forMongoDB
-
-
Constructor Summary
Constructors Constructor Description MongoDBImpl(org.slf4j.Logger logger, MongoDBSource mongoDBSource, java.lang.String defaultDbName, boolean consistentRequest, boolean secureMode, java.lang.String dbUsername, java.lang.String dbPassword)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.mongodb.DBgetDefaultMongoDb()Obtain a shared instance of the MongoDB database connection object connected to the default databasecom.mongodb.DBgetMongoDb(java.lang.String dbname)Obtain a shared instance of the MongoDB database connection object for the specific databasevoidthreadDidCleanup()Invoked byPerthreadManagerservice when a thread performs and end-of-request cleanup.
-
-
-
Constructor Detail
-
MongoDBImpl
public MongoDBImpl(org.slf4j.Logger logger, MongoDBSource mongoDBSource, java.lang.String defaultDbName, boolean consistentRequest, boolean secureMode, java.lang.String dbUsername, java.lang.String dbPassword)
-
-
Method Detail
-
getDefaultMongoDb
public com.mongodb.DB getDefaultMongoDb()
Description copied from interface:MongoDBObtain a shared instance of the MongoDB database connection object connected to the default database- Specified by:
getDefaultMongoDbin interfaceMongoDB- Returns:
- the
DBconnection object
-
getMongoDb
public com.mongodb.DB getMongoDb(java.lang.String dbname)
Description copied from interface:MongoDBObtain a shared instance of the MongoDB database connection object for the specific database- Specified by:
getMongoDbin interfaceMongoDB- Parameters:
dbname- the database name to connect to- Returns:
- the
DBconnection object
-
threadDidCleanup
public void threadDidCleanup()
Description copied from interface:ThreadCleanupListenerInvoked byPerthreadManagerservice when a thread performs and end-of-request cleanup.- Specified by:
threadDidCleanupin interfaceThreadCleanupListener
-
-