Package com.mongodb
Class AutoEncryptionSettings.Builder
- java.lang.Object
-
- com.mongodb.AutoEncryptionSettings.Builder
-
- Enclosing class:
- AutoEncryptionSettings
@NotThreadSafe public static final class AutoEncryptionSettings.Builder extends Object
A builder forAutoEncryptionSettings
so thatAutoEncryptionSettings
can be immutable, and to support easier construction through chaining.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoEncryptionSettings
build()
Build an instance ofAutoEncryptionSettings
.AutoEncryptionSettings.Builder
bypassAutoEncryption(boolean bypassAutoEncryption)
Sets whether auto-encryption should be bypassed.AutoEncryptionSettings.Builder
extraOptions(Map<String,Object> extraOptions)
Sets the extra options.AutoEncryptionSettings.Builder
keyVaultMongoClientSettings(MongoClientSettings keyVaultMongoClientSettings)
Sets the key vault settings.AutoEncryptionSettings.Builder
keyVaultNamespace(String keyVaultNamespace)
Sets the key vault namespaceAutoEncryptionSettings.Builder
kmsProviders(Map<String,Map<String,Object>> kmsProviders)
Sets the KMS providers map.AutoEncryptionSettings.Builder
kmsProviderSslContextMap(Map<String,SSLContext> kmsProviderSslContextMap)
Sets the KMS provider to SSLContext mapAutoEncryptionSettings.Builder
schemaMap(Map<String,BsonDocument> schemaMap)
Sets the map from namespace to local schema document
-
-
-
Method Detail
-
keyVaultMongoClientSettings
public AutoEncryptionSettings.Builder keyVaultMongoClientSettings(MongoClientSettings keyVaultMongoClientSettings)
Sets the key vault settings.- Parameters:
keyVaultMongoClientSettings
- the key vault mongo client settings, which may be null.- Returns:
- this
- See Also:
AutoEncryptionSettings.getKeyVaultMongoClientSettings()
-
keyVaultNamespace
public AutoEncryptionSettings.Builder keyVaultNamespace(String keyVaultNamespace)
Sets the key vault namespace- Parameters:
keyVaultNamespace
- the key vault namespace, which may not be null- Returns:
- this
- See Also:
AutoEncryptionSettings.getKeyVaultNamespace()
-
kmsProviders
public AutoEncryptionSettings.Builder kmsProviders(Map<String,Map<String,Object>> kmsProviders)
Sets the KMS providers map.- Parameters:
kmsProviders
- the KMS providers map, which may not be null- Returns:
- this
- See Also:
AutoEncryptionSettings.getKmsProviders()
-
kmsProviderSslContextMap
public AutoEncryptionSettings.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:
AutoEncryptionSettings.getKmsProviderSslContextMap()
-
schemaMap
public AutoEncryptionSettings.Builder schemaMap(Map<String,BsonDocument> schemaMap)
Sets the map from namespace to local schema document- Parameters:
schemaMap
- the map from namespace to local schema document- Returns:
- this
- See Also:
AutoEncryptionSettings.getSchemaMap()
-
extraOptions
public AutoEncryptionSettings.Builder extraOptions(Map<String,Object> extraOptions)
Sets the extra options.- Parameters:
extraOptions
- the extra options, which may not be null- Returns:
- this
- See Also:
AutoEncryptionSettings.getExtraOptions()
-
bypassAutoEncryption
public AutoEncryptionSettings.Builder bypassAutoEncryption(boolean bypassAutoEncryption)
Sets whether auto-encryption should be bypassed.- Parameters:
bypassAutoEncryption
- whether auto-encryption should be bypassed- Returns:
- this
- See Also:
AutoEncryptionSettings.isBypassAutoEncryption()
-
build
public AutoEncryptionSettings build()
Build an instance ofAutoEncryptionSettings
.- Returns:
- the settings from this builder
-
-