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 Summary
Modifier and TypeFieldDescriptionprotected com.mongodb.MongoClientSettings.Builder
protected com.mongodb.connection.ClusterSettings.Builder
protected com.mongodb.connection.ConnectionPoolSettings.Builder
protected com.mongodb.connection.ServerSettings.Builder
protected com.mongodb.connection.SocketSettings.Builder
protected com.mongodb.connection.SslSettings.Builder
-
Constructor Summary
ConstructorDescriptionDefaultMongoConfiguration
(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) Constructor.DefaultMongoConfiguration
(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.context.env.Environment environment) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
codecRegistries
(List<org.bson.codecs.configuration.CodecRegistry> codecRegistries) Additional codecs to register.void
Additional codecs to register.void
commandListeners
(List<com.mongodb.event.CommandListener> commandListeners) Additional command listeners to register.void
connectionPoolListeners
(List<com.mongodb.event.ConnectionPoolListener> connectionPoolListeners) Additional command listeners to register.com.mongodb.MongoClientSettings.Builder
com.mongodb.connection.ClusterSettings.Builder
com.mongodb.connection.ConnectionPoolSettings.Builder
com.mongodb.connection.ServerSettings.Builder
com.mongodb.connection.SocketSettings.Builder
com.mongodb.connection.SslSettings.Builder
void
setCodecRegistryBuilder
(CodecRegistryBuilder codecRegistryBuilder) void
setHost
(com.mongodb.ServerAddress serverAddress) Sets the server MongoDB server address.void
Sets the server MongoDB server address.toString()
Methods inherited from class io.micronaut.configuration.mongo.core.AbstractMongoConfiguration
addDefaultCodecRegistry, buildSettings, getApplicationName, getCodecRegistries, getCodecs, getCommandListeners, getConnectionPoolListeners, getConnectionString, getPackageNames, getUri, isAutomaticClassModels, isUseSerde, packages, setAutomaticClassModels, setPackageNames, setUri, setUseSerde
-
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
- applicationConfigurationenvironment
- the environment
-
-
Method Details
-
codecs
Description copied from class:AbstractMongoConfiguration
Additional codecs to register.- Overrides:
codecs
in classAbstractMongoConfiguration
- 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 classAbstractMongoConfiguration
- Parameters:
codecRegistries
- The list of codecs
-
setCodecRegistryBuilder
- Overrides:
setCodecRegistryBuilder
in classAbstractMongoConfiguration
- Parameters:
codecRegistryBuilder
- The builder
-
commandListeners
Description copied from class:AbstractMongoConfiguration
Additional command listeners to register.- Overrides:
commandListeners
in classAbstractMongoConfiguration
- 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 classAbstractMongoConfiguration
- 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
Sets the server MongoDB server address.- Parameters:
serverAddresses
- The server addresses
-
getClusterSettings
public com.mongodb.connection.ClusterSettings.Builder getClusterSettings()- Specified by:
getClusterSettings
in classAbstractMongoConfiguration
- Returns:
- The
ClusterSettings.builder()
-
getClientSettings
public com.mongodb.MongoClientSettings.Builder getClientSettings()- Specified by:
getClientSettings
in classAbstractMongoConfiguration
- Returns:
- The
MongoClientSettings.builder()
-
getServerSettings
public com.mongodb.connection.ServerSettings.Builder getServerSettings()- Specified by:
getServerSettings
in classAbstractMongoConfiguration
- Returns:
- The
ServerSettings.builder()
-
getPoolSettings
public com.mongodb.connection.ConnectionPoolSettings.Builder getPoolSettings()- Specified by:
getPoolSettings
in classAbstractMongoConfiguration
- Returns:
- The
ConnectionPoolSettings.builder()
-
getSocketSettings
public com.mongodb.connection.SocketSettings.Builder getSocketSettings()- Specified by:
getSocketSettings
in classAbstractMongoConfiguration
- Returns:
- The
SocketSettings.builder()
-
getSslSettings
public com.mongodb.connection.SslSettings.Builder getSslSettings()- Specified by:
getSslSettings
in classAbstractMongoConfiguration
- Returns:
- The
SslSettings.builder()
-
toString
-