Class MongoConnectionImpl

java.lang.Object
org.graylog2.database.MongoConnectionImpl
All Implemented Interfaces:
MongoConnection

@Singleton public class MongoConnectionImpl extends Object implements MongoConnection
MongoDB connection singleton
  • Constructor Details

  • Method Details

    • connect

      public com.mongodb.MongoClient connect()
      Connect the instance.
      Specified by:
      connect in interface MongoConnection
    • getDatabase

      public com.mongodb.DB getDatabase()
      Returns the raw database object.
      Specified by:
      getDatabase in interface MongoConnection
      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 interface MongoConnection
      Returns:
      The configured MongoDB database.