Class MongoClientSettings



  • @Immutable
    public final class MongoClientSettings
    extends Object
    Various settings to control the behavior of an Embedded MongoClient.
    Since:
    3.8
    Since server release
    4.0
    • Method Detail

      • builder

        public static MongoClientSettings.Builder builder​(MongoClientSettings settings)
        Convenience method to create a from an existing MongoClientSettings.
        Parameters:
        settings - create a builder from existing settings
        Returns:
        a builder
      • getApplicationName

        public String getApplicationName​()
        Gets the logical name of the application using this MongoClient. The application name may be used by the client to identify the application to the server, for use in server logs, slow query logs, and profile collection.

        Default is null.

        Returns:
        the application name, which may be null
      • getCodecRegistry

        public CodecRegistry getCodecRegistry​()
        The codec registry to use, or null if not set.
        Returns:
        the codec registry
      • getCommandListeners

        public List<CommandListener> getCommandListeners​()
        Gets the list of added CommandListener.

        The default is an empty list.

        Returns:
        the unmodifiable list of command listeners
      • getDbPath

        public String getDbPath​()
        Gets the dbPath for the embedded mongod.
        Returns:
        the dbPath
      • getWrappedMongoClientSettings

        public MongoClientSettings getWrappedMongoClientSettings​()
        Returns the wrapped MongoClientSettings instance
        Returns:
        the wrapped MongoClient Settings instance.