Package org.graylog2.database
Class MongoConnectionImpl
java.lang.Object
org.graylog2.database.MongoConnectionImpl
- All Implemented Interfaces:
MongoConnection
MongoDB connection singleton
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.MongoClient
connect()
Connect the instance.com.mongodb.DB
Returns the raw database object.com.mongodb.client.MongoDatabase
Get instance of the configured MongoDB database.
-
Constructor Details
-
MongoConnectionImpl
-
-
Method Details
-
connect
public com.mongodb.MongoClient connect()Connect the instance.- Specified by:
connect
in interfaceMongoConnection
-
getDatabase
public com.mongodb.DB getDatabase()Returns the raw database object.- Specified by:
getDatabase
in interfaceMongoConnection
- Returns:
- database
-
getMongoDatabase
public com.mongodb.client.MongoDatabase getMongoDatabase()Description copied from interface:MongoConnection
Get instance of the configured MongoDB database.- Specified by:
getMongoDatabase
in interfaceMongoConnection
- Returns:
- The configured MongoDB database.
-