Package com.mongodb
Class ClientEncryptionSettings.Builder
java.lang.Object
com.mongodb.ClientEncryptionSettings.Builder
- Enclosing class:
- ClientEncryptionSettings
A builder for
ClientEncryptionSettings
so that ClientEncryptionSettings
can be immutable, and to support easier
construction through chaining.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build an instance ofClientEncryptionSettings
.keyVaultMongoClientSettings
(MongoClientSettings keyVaultMongoClientSettings) Sets theMongoClientSettings
that will be used to access the key vault.keyVaultNamespace
(String keyVaultNamespace) Sets the key vault namespaceThis method is similar tokmsProviders(Map)
, but instead of setting properties for KMS providers, it setsSupplier
s of properties.Sets the KMS providers map.kmsProviderSslContextMap
(Map<String, SSLContext> kmsProviderSslContextMap) Sets the KMS provider to SSLContext mapSets the time limit for the full execution of an operation.
-
Method Details
-
keyVaultMongoClientSettings
public ClientEncryptionSettings.Builder keyVaultMongoClientSettings(MongoClientSettings keyVaultMongoClientSettings) Sets theMongoClientSettings
that will be used to access the key vault.- Parameters:
keyVaultMongoClientSettings
- the key vault mongo client settings, which may not be null.- Returns:
- this
- See Also:
-
keyVaultNamespace
Sets the key vault namespace- Parameters:
keyVaultNamespace
- the key vault namespace, which may not be null- Returns:
- this
- See Also:
-
kmsProviders
Sets the KMS providers map.- Parameters:
kmsProviders
- the KMS providers map, which may not be null- Returns:
- this
- See Also:
-
kmsProviderPropertySuppliers
public ClientEncryptionSettings.Builder kmsProviderPropertySuppliers(Map<String, Supplier<Map<String, Object>>> kmsProviderPropertySuppliers) This method is similar tokmsProviders(Map)
, but instead of setting properties for KMS providers, it setsSupplier
s of properties. -
kmsProviderSslContextMap
public ClientEncryptionSettings.Builder kmsProviderSslContextMap(Map<String, SSLContext> kmsProviderSslContextMap) Sets the KMS provider to SSLContext map- Parameters:
kmsProviderSslContextMap
- the KMS provider to SSLContext map, which may not be null- Returns:
- this
- Since:
- 4.4
- See Also:
-
timeout
Sets the time limit for the full execution of an operation.null
means that the timeout mechanism for operations will defer to using:waitQueueTimeoutMS
: The maximum wait time in milliseconds that a thread may wait for a connection to become availablesocketTimeoutMS
: How long a send or receive on a socket can take before timing out.wTimeoutMS
: How long the server will wait for the write concern to be fulfilled before timing out.maxTimeMS
: The cumulative time limit for processing operations on a cursor. See: cursor.maxTimeMS.maxCommitTimeMS
: The maximum amount of time to allow a singlecommitTransaction
command to execute. See:TransactionOptions.getMaxCommitTime(java.util.concurrent.TimeUnit)
.
0
means infinite timeout.> 0
The time limit to use for the full execution of an operation.
Note: The timeout set through this method overrides the timeout defined in the key vault client settings specified in
keyVaultMongoClientSettings(MongoClientSettings)
. Essentially, for operations that require accessing the key vault, the remaining timeout from the initial operation determines the duration allowed for key vault access.- Parameters:
timeout
- the timeouttimeUnit
- the time unit- Returns:
- this
- Since:
- 5.2
- See Also:
-
build
Build an instance ofClientEncryptionSettings
.- Returns:
- the settings from this builder
-