Class DefaultMongoConfiguration

java.lang.Object
io.micronaut.configuration.mongo.core.AbstractMongoConfiguration
io.micronaut.configuration.mongo.core.DefaultMongoConfiguration

@Requires(property="mongodb") @Requires(missingProperty="mongodb.servers") @ConfigurationProperties("mongodb") public class DefaultMongoConfiguration extends AbstractMongoConfiguration
The default MongoDB configuration class.
Since:
1.0
Author:
graemerocher
  • Field Details

    • clientSettings

      @ConfigurationBuilder(prefixes="") protected com.mongodb.MongoClientSettings.Builder clientSettings
    • clusterSettings

      @ConfigurationBuilder(prefixes="", configurationPrefix="cluster") protected com.mongodb.connection.ClusterSettings.Builder clusterSettings
    • serverSettings

      @ConfigurationBuilder(prefixes="", configurationPrefix="server") protected com.mongodb.connection.ServerSettings.Builder serverSettings
    • poolSettings

      @ConfigurationBuilder(prefixes="", configurationPrefix="connection-pool") protected com.mongodb.connection.ConnectionPoolSettings.Builder poolSettings
    • socketSettings

      @ConfigurationBuilder(prefixes="", configurationPrefix="socket") protected com.mongodb.connection.SocketSettings.Builder socketSettings
    • sslSettings

      @ConfigurationBuilder(prefixes="", configurationPrefix="ssl") protected com.mongodb.connection.SslSettings.Builder sslSettings
  • Constructor Details

    • DefaultMongoConfiguration

      public DefaultMongoConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
      Constructor.
      Parameters:
      applicationConfiguration - applicationConfiguration
    • DefaultMongoConfiguration

      @Inject public DefaultMongoConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.context.env.Environment environment)
      Constructor.
      Parameters:
      applicationConfiguration - applicationConfiguration
      environment - the environment
  • Method Details

    • codecs

      @Inject public void codecs(List<org.bson.codecs.Codec<?>> codecList)
      Description copied from class: AbstractMongoConfiguration
      Additional codecs to register.
      Overrides:
      codecs in class AbstractMongoConfiguration
      Parameters:
      codecList - The list of codecs
    • codecRegistries

      @Inject public void codecRegistries(List<org.bson.codecs.configuration.CodecRegistry> codecRegistries)
      Description copied from class: AbstractMongoConfiguration
      Additional codecs to register.
      Overrides:
      codecRegistries in class AbstractMongoConfiguration
      Parameters:
      codecRegistries - The list of codecs
    • setCodecRegistryBuilder

      @Inject public void setCodecRegistryBuilder(CodecRegistryBuilder codecRegistryBuilder)
      Overrides:
      setCodecRegistryBuilder in class AbstractMongoConfiguration
      Parameters:
      codecRegistryBuilder - The builder
    • commandListeners

      @Inject public void commandListeners(List<com.mongodb.event.CommandListener> commandListeners)
      Description copied from class: AbstractMongoConfiguration
      Additional command listeners to register.
      Overrides:
      commandListeners in class AbstractMongoConfiguration
      Parameters:
      commandListeners - The list of command listeners
    • connectionPoolListeners

      @Inject public void connectionPoolListeners(List<com.mongodb.event.ConnectionPoolListener> connectionPoolListeners)
      Description copied from class: AbstractMongoConfiguration
      Additional command listeners to register.
      Overrides:
      connectionPoolListeners in class AbstractMongoConfiguration
      Parameters:
      connectionPoolListeners - The list of command listeners
    • setHost

      public void setHost(com.mongodb.ServerAddress serverAddress)
      Sets the server MongoDB server address.
      Parameters:
      serverAddress - The server address
    • setHosts

      public void setHosts(List<com.mongodb.ServerAddress> serverAddresses)
      Sets the server MongoDB server address.
      Parameters:
      serverAddresses - The server addresses
    • getClusterSettings

      public com.mongodb.connection.ClusterSettings.Builder getClusterSettings()
      Specified by:
      getClusterSettings in class AbstractMongoConfiguration
      Returns:
      The ClusterSettings.builder()
    • getClientSettings

      public com.mongodb.MongoClientSettings.Builder getClientSettings()
      Specified by:
      getClientSettings in class AbstractMongoConfiguration
      Returns:
      The MongoClientSettings.builder()
    • getServerSettings

      public com.mongodb.connection.ServerSettings.Builder getServerSettings()
      Specified by:
      getServerSettings in class AbstractMongoConfiguration
      Returns:
      The ServerSettings.builder()
    • getPoolSettings

      public com.mongodb.connection.ConnectionPoolSettings.Builder getPoolSettings()
      Specified by:
      getPoolSettings in class AbstractMongoConfiguration
      Returns:
      The ConnectionPoolSettings.builder()
    • getSocketSettings

      public com.mongodb.connection.SocketSettings.Builder getSocketSettings()
      Specified by:
      getSocketSettings in class AbstractMongoConfiguration
      Returns:
      The SocketSettings.builder()
    • getSslSettings

      public com.mongodb.connection.SslSettings.Builder getSslSettings()
      Specified by:
      getSslSettings in class AbstractMongoConfiguration
      Returns:
      The SslSettings.builder()
    • toString

      public String toString()
      Overrides:
      toString in class Object