Interface MongoDBConnectionService

All Known Implementing Classes:
MongoDBComponent

public interface MongoDBConnectionService
Service used to get a database connection to MongoDB.
Since:
9.1
  • Method Details

    • getClient

      com.mongodb.client.MongoClient getClient(String id)
      Gets the MongoDB client for the given id.
      Parameters:
      id - the connection id
      Returns:
      the client configured by MongoDBConnectionConfig for the input id, or the default one if it doesn't exist
      Since:
      11.1
    • getConfig

      Gets the MongoDB configuration for the given id.
      Since:
      11.1
    • getDatabaseName

      String getDatabaseName(String id)
      Gets the MongoDB database name for the given id.
      Parameters:
      id - the connection id
      Returns:
      the database name configured by MongoDBConnectionConfig for the input id, or the default one if it doesn't exist
      Since:
      11.1
    • getDatabase

      com.mongodb.client.MongoDatabase getDatabase(String id)
      Parameters:
      id - the connection id
      Returns:
      the database configured by MongoDBConnectionConfig for the input id, or the default one if it doesn't exist
    • getDatabases

      @Deprecated Iterable<com.mongodb.client.MongoDatabase> getDatabases()
      Deprecated.
      since 11.1, unused
      Returns:
      all configured databases