Package com.mongodb
Class MongoClientSettings.Builder
java.lang.Object
com.mongodb.MongoClientSettings.Builder
- Enclosing class:
MongoClientSettings
@NotThreadSafe
@Deprecated(since="2021-05-27")
public static final class MongoClientSettings.Builder
extends Object
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
A builder for
MongoClientSettings
so that MongoClientSettings
can be immutable, and to support easier construction
through chaining.-
Method Summary
Modifier and TypeMethodDescriptionaddCommandListener
(CommandListener commandListener) Deprecated.Adds the given command listener.applicationName
(String applicationName) Deprecated.Sets the logical name of the application using this MongoClient.applyConnectionString
(ConnectionString connectionString) Deprecated.Takes the settings from the givenConnectionString
and applies them to the builderDeprecated.Applies theClusterSettings.Builder
block and then sets the clusterSettings.Deprecated.Applies theConnectionPoolSettings.Builder
block and then sets the connectionPoolSettings.Deprecated.Applies theServerSettings.Builder
block and then sets the serverSettings.Deprecated.Applies theSocketSettings.Builder
block and then sets the socketSettings.Deprecated.Applies theSslSettings.Builder
block and then sets the sslSettings.autoEncryptionSettings
(AutoEncryptionSettings autoEncryptionSettings) Deprecated.Sets the auto-encryption settingsbuild()
Deprecated.Build an instance ofMongoClientSettings
.codecRegistry
(CodecRegistry codecRegistry) Deprecated.Sets the codec registrycommandListenerList
(List<CommandListener> commandListeners) Deprecated.Sets the the command listenerscompressorList
(List<MongoCompressor> compressorList) Deprecated.Sets the compressors to use for compressing messages to the server.credential
(MongoCredential credential) Deprecated.Sets the credential.readConcern
(ReadConcern readConcern) Deprecated.Sets the read concern.readPreference
(ReadPreference readPreference) Deprecated.Sets the read preference.retryReads
(boolean retryReads) Deprecated.Sets whether reads should be retried if they fail due to a network error.retryWrites
(boolean retryWrites) Deprecated.Sets whether writes should be retried if they fail due to a network error.streamFactoryFactory
(StreamFactoryFactory streamFactoryFactory) Deprecated.Sets the factory to use to create aStreamFactory
.uuidRepresentation
(UuidRepresentation uuidRepresentation) Deprecated.Sets the UUID representation to use when encoding instances ofUUID
and when decoding BSON binary values with subtype of 3.writeConcern
(WriteConcern writeConcern) Deprecated.Sets the write concern.
-
Method Details
-
applyConnectionString
Deprecated.Takes the settings from the givenConnectionString
and applies them to the builder- Parameters:
connectionString
- the connection string containing details of how to connect to MongoDB- Returns:
- this
-
applyToClusterSettings
Deprecated.Applies theClusterSettings.Builder
block and then sets the clusterSettings.- Parameters:
block
- the block to apply to the ClusterSettings.- Returns:
- this
- See Also:
-
applyToSocketSettings
Deprecated.Applies theSocketSettings.Builder
block and then sets the socketSettings.- Parameters:
block
- the block to apply to the SocketSettings.- Returns:
- this
- See Also:
-
applyToConnectionPoolSettings
public MongoClientSettings.Builder applyToConnectionPoolSettings(Block<ConnectionPoolSettings.Builder> block) Deprecated.Applies theConnectionPoolSettings.Builder
block and then sets the connectionPoolSettings.- Parameters:
block
- the block to apply to the ConnectionPoolSettings.- Returns:
- this
- See Also:
-
applyToServerSettings
Deprecated.Applies theServerSettings.Builder
block and then sets the serverSettings.- Parameters:
block
- the block to apply to the ServerSettings.- Returns:
- this
- See Also:
-
applyToSslSettings
Deprecated.Applies theSslSettings.Builder
block and then sets the sslSettings.- Parameters:
block
- the block to apply to the SslSettings.- Returns:
- this
- See Also:
-
readPreference
Deprecated.Sets the read preference.- Parameters:
readPreference
- read preference- Returns:
- this
- See Also:
-
writeConcern
Deprecated.Sets the write concern.- Parameters:
writeConcern
- the write concern- Returns:
- this
- See Also:
-
retryWrites
Deprecated.Sets whether writes should be retried if they fail due to a network error.Starting with the 3.11.0 release, the default value is true
- Parameters:
retryWrites
- sets if writes should be retried if they fail due to a network error.- Returns:
- this
- See Also:
-
retryReads
Deprecated.Sets whether reads should be retried if they fail due to a network error.- Parameters:
retryReads
- sets if reads should be retried if they fail due to a network error.- Returns:
- this
- Since:
- 3.11
- See Also:
-
readConcern
Deprecated.Sets the read concern.- Parameters:
readConcern
- the read concern- Returns:
- this
-
credential
Deprecated.Sets the credential.- Parameters:
credential
- the credential- Returns:
- this
-
codecRegistry
Deprecated.Sets the codec registry- Parameters:
codecRegistry
- the codec registry- Returns:
- this
- See Also:
-
streamFactoryFactory
Deprecated.Sets the factory to use to create aStreamFactory
.- Parameters:
streamFactoryFactory
- the stream factory factory- Returns:
- this
-
addCommandListener
Deprecated.Adds the given command listener.- Parameters:
commandListener
- the command listener- Returns:
- this
-
commandListenerList
Deprecated.Sets the the command listeners- Parameters:
commandListeners
- the list of command listeners- Returns:
- this
-
applicationName
Deprecated.Sets 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.- Parameters:
applicationName
- the logical name of the application using this MongoClient. It may be null. The UTF-8 encoding may not exceed 128 bytes.- Returns:
- this
- See Also:
-
compressorList
Deprecated.Sets the compressors to use for compressing messages to the server. The driver will use the first compressor in the list that the server is configured to support.- Parameters:
compressorList
- the list of compressors to request- Returns:
- this
- See Also:
-
uuidRepresentation
Deprecated.Sets the UUID representation to use when encoding instances ofUUID
and when decoding BSON binary values with subtype of 3.See
MongoClientSettings.getUuidRepresentation()
for recommendations on settings this value- Parameters:
uuidRepresentation
- the UUID representation, which may not be null- Returns:
- this
- Since:
- 3.12
-
autoEncryptionSettings
public MongoClientSettings.Builder autoEncryptionSettings(AutoEncryptionSettings autoEncryptionSettings) Deprecated.Sets the auto-encryption settings- Parameters:
autoEncryptionSettings
- the auto-encryption settings- Returns:
- this
- Since:
- 3.11
- See Also:
-
build
Deprecated.Build an instance ofMongoClientSettings
.- Returns:
- the settings from this builder
-