@NotThreadSafe public static final class MongoClientSettings.Builder extends Object
MongoClientSettings
so that MongoClientSettings
can be immutable, and to support easier construction
through chaining.public MongoClientSettings.Builder clusterSettings(ClusterSettings clusterSettings)
clusterSettings
- the cluster settingsthis
MongoClientSettings.getClusterSettings()
public MongoClientSettings.Builder socketSettings(SocketSettings socketSettings)
socketSettings
- the socket settingsthis
MongoClientSettings.getSocketSettings()
public MongoClientSettings.Builder heartbeatSocketSettings(SocketSettings heartbeatSocketSettings)
heartbeatSocketSettings
- the socket settingsthis
MongoClientSettings.getHeartbeatSocketSettings()
public MongoClientSettings.Builder connectionPoolSettings(ConnectionPoolSettings connectionPoolSettings)
connectionPoolSettings
- the connection settingsthis
()
public MongoClientSettings.Builder serverSettings(ServerSettings serverSettings)
serverSettings
- the server settingsthis
()
public MongoClientSettings.Builder sslSettings(SslSettings sslSettings)
sslSettings
- the SSL settingsthis
()
public MongoClientSettings.Builder readPreference(ReadPreference readPreference)
readPreference
- read preferencethis
MongoClientSettings.getReadPreference()
public MongoClientSettings.Builder writeConcern(WriteConcern writeConcern)
writeConcern
- the write concernthis
MongoClientSettings.getWriteConcern()
public MongoClientSettings.Builder readConcern(ReadConcern readConcern)
readConcern
- the read concernthis
public MongoClientSettings.Builder credentialList(List<MongoCredential> credentialList)
credentialList
- the credential listthis
MongoClientSettings.getCredentialList()
public MongoClientSettings.Builder codecRegistry(CodecRegistry codecRegistry)
codecRegistry
- the codec registrythis
MongoClientSettings.getCodecRegistry()
public MongoClientSettings.Builder streamFactoryFactory(StreamFactoryFactory streamFactoryFactory)
StreamFactory
.streamFactoryFactory
- the stream factory factorypublic MongoClientSettings.Builder addCommandListener(CommandListener commandListener)
commandListener
- the command listenerpublic MongoClientSettings.Builder applicationName(String applicationName)
applicationName
- the logical name of the application using this MongoClient. It may be null.
The UTF-8 encoding may not exceed 128 bytes.this
MongoClientSettings.getApplicationName()
public MongoClientSettings build()
MongoClientSettings
.