Class MongoClientSettings
MongoClient
.- Since:
- 3.7
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Deprecated.Usage of this API is not supported in AEM as a Cloud Service. -
Method Summary
Modifier and TypeMethodDescriptionstatic MongoClientSettings.Builder
builder()
Deprecated.Convenience method to create a Builder.static MongoClientSettings.Builder
builder
(MongoClientSettings settings) Deprecated.Convenience method to create a from an existingMongoClientSettings
.Deprecated.Gets the logical name of the application using this MongoClient.Deprecated.Gets the auto-encryption settings.Deprecated.Gets the cluster settings.Deprecated.The codec registry to use, or null if not set.Deprecated.Gets the list of addedCommandListener
.Deprecated.Gets the compressors to use for compressing messages to the server.Deprecated.Gets the settings for the connection provider in a settings object.Deprecated.Gets the credential.static CodecRegistry
Deprecated.Gets the default codec registry.Deprecated.Gets the connection settings for the heartbeat thread (the background task that checks the state of the cluster) wrapped in a settings object.Deprecated.The read concern to use.Deprecated.The read preference to use for queries, map-reduce, aggregation, and count.boolean
Deprecated.Returns true if reads should be retried if they fail due to a network error or other retryable error.boolean
Deprecated.Returns true if writes should be retried if they fail due to a network error or other retryable error.Deprecated.Gets the server-specific settings wrapped in a settings object.Deprecated.Gets the connection-specific settings wrapped in a settings object.Deprecated.Gets the SSL settings.Deprecated.Gets the factory to use to create aStreamFactory
.Deprecated.Gets the UUID representation to use when encoding instances ofUUID
and when decoding BSON binary values with subtype of 3.Deprecated.The write concern to use.
-
Method Details
-
getDefaultCodecRegistry
Deprecated.Gets the default codec registry. It includes the following providers:- Returns:
- the default codec registry
-
builder
Deprecated.Convenience method to create a Builder.- Returns:
- a builder
-
builder
Deprecated.Convenience method to create a from an existingMongoClientSettings
.- Parameters:
settings
- create a builder from existing settings- Returns:
- a builder
-
getReadPreference
Deprecated.The read preference to use for queries, map-reduce, aggregation, and count.Default is
ReadPreference.primary()
.- Returns:
- the read preference
- See Also:
-
getCredential
Deprecated.Gets the credential.- Returns:
- the credential, which may be null
-
getWriteConcern
Deprecated.The write concern to use.Default is
WriteConcern.ACKNOWLEDGED
.- Returns:
- the write concern
- See Also:
-
getRetryWrites
public boolean getRetryWrites()Deprecated.Returns true if writes should be retried if they fail due to a network error or other retryable error.Starting with the 3.11.0 release, the default value is true
- Returns:
- the retryWrites value
-
getRetryReads
public boolean getRetryReads()Deprecated.Returns true if reads should be retried if they fail due to a network error or other retryable error. The default value is true.- Returns:
- the retryReads value
- Since:
- 3.11
-
getReadConcern
Deprecated.The read concern to use.- Returns:
- the read concern
-
getCodecRegistry
Deprecated.The codec registry to use, or null if not set.- Returns:
- the codec registry
-
getStreamFactoryFactory
Deprecated.Gets the factory to use to create aStreamFactory
.- Returns:
- the stream factory factory
-
getCommandListeners
Deprecated.Gets the list of addedCommandListener
.The default is an empty list.
- Returns:
- the unmodifiable list of command listeners
-
getApplicationName
Deprecated.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
-
getCompressorList
Deprecated.Gets 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.Default is the empty list.
- Returns:
- the compressors
-
getUuidRepresentation
Deprecated.Gets the UUID representation to use when encoding instances ofUUID
and when decoding BSON binary values with subtype of 3.The default is
UuidRepresentation.JAVA_LEGACY
, but it will be changing toUuidRepresentation.UNSPECIFIED
in the next major release. If your application stores UUID values in MongoDB, consider setting this value to the desired representation in order to avoid a breaking change when upgrading. New applications should preferUuidRepresentation.STANDARD
, while existing Java applications should preferUuidRepresentation.JAVA_LEGACY
. Applications wishing to interoperate with existing Python or .NET applications should preferUuidRepresentation.PYTHON_LEGACY
orUuidRepresentation.C_SHARP_LEGACY
, respectively. Applications that do not store UUID values in MongoDB don't need to set this value.- Returns:
- the UUID representation, which may not be null
- Since:
- 3.12
-
getAutoEncryptionSettings
Deprecated.Gets the auto-encryption settings.Client side encryption enables an application to specify what fields in a collection must be encrypted, and the driver automatically encrypts commands and decrypts results.
Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view and will result in error. To bypass automatic encryption, set bypassAutoEncryption=true in ClientSideEncryptionOptions.
Explicit encryption/decryption and automatic decryption is a community feature, enabled with the new
com.mongodb.client.vault .ClientEncryption
type. A MongoClient configured with bypassAutoEncryption=true will still automatically decrypt.Automatic encryption requires the authenticated user to have the listCollections privilege action.
Note: support for client side encryption is in beta. Backwards-breaking changes may be made before the final release.
- Returns:
- the auto-encryption settings, which may be null
- Since:
- 3.11
-
getClusterSettings
Deprecated.Gets the cluster settings.- Returns:
- the cluster settings
-
getSslSettings
Deprecated.Gets the SSL settings.- Returns:
- the SSL settings
-
getSocketSettings
Deprecated.Gets the connection-specific settings wrapped in a settings object. This settings object uses the values for connectTimeout, socketTimeout and socketKeepAlive.- Returns:
- a SocketSettings object populated with the connection settings from this
MongoClientSettings
instance. - See Also:
-
getHeartbeatSocketSettings
Deprecated.Gets the connection settings for the heartbeat thread (the background task that checks the state of the cluster) wrapped in a settings object.- Returns:
- the SocketSettings for the heartbeat thread
- See Also:
-
getConnectionPoolSettings
Deprecated.Gets the settings for the connection provider in a settings object. This settings object wraps the values for minConnectionPoolSize, maxConnectionPoolSize, maxWaitTime, maxConnectionIdleTime and maxConnectionLifeTime, and uses maxConnectionPoolSize and threadsAllowedToBlockForConnectionMultiplier to calculate maxWaitQueueSize.- Returns:
- a ConnectionPoolSettings populated with the settings from this
MongoClientSettings
instance that relate to the connection provider. - See Also:
-
getServerSettings
Deprecated.Gets the server-specific settings wrapped in a settings object. This settings object uses the heartbeatFrequency and minHeartbeatFrequency values from thisMongoClientSettings
instance.- Returns:
- a ServerSettings
- See Also:
-