|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mongodb.MongoClientOptions.Builder
public static class MongoClientOptions.Builder
A builder for MongoClientOptions so that MongoClientOptions can be immutable, and to support easier construction through chaining.
| Constructor Summary | |
|---|---|
MongoClientOptions.Builder()
|
|
| Method Summary | |
|---|---|
MongoClientOptions.Builder |
alwaysUseMBeans(boolean alwaysUseMBeans)
Sets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is Java 6 or greater. |
MongoClientOptions.Builder |
autoConnectRetry(boolean autoConnectRetry)
Sets whether auto connect retry is enabled. |
MongoClientOptions |
build()
Build an instance of MongoClientOptions. |
MongoClientOptions.Builder |
connectionsPerHost(int connectionsPerHost)
Sets the maximum number of connections per host. |
MongoClientOptions.Builder |
connectTimeout(int connectTimeout)
Sets the connection timeout. |
MongoClientOptions.Builder |
cursorFinalizerEnabled(boolean cursorFinalizerEnabled)
Sets whether cursor finalizers are enabled. |
MongoClientOptions.Builder |
dbDecoderFactory(DBDecoderFactory dbDecoderFactory)
Sets the decoder factory. |
MongoClientOptions.Builder |
dbEncoderFactory(DBEncoderFactory dbEncoderFactory)
Sets the encoder factory. |
MongoClientOptions.Builder |
description(String description)
Sets the description. |
MongoClientOptions.Builder |
legacyDefaults()
Sets defaults to be what they are in MongoOptions. |
MongoClientOptions.Builder |
maxAutoConnectRetryTime(long maxAutoConnectRetryTime)
Sets the maximum auto connect retry time. |
MongoClientOptions.Builder |
maxWaitTime(int maxWaitTime)
Sets the maximum time that a thread will block waiting for a connection. |
MongoClientOptions.Builder |
readPreference(ReadPreference readPreference)
Sets the read preference. |
MongoClientOptions.Builder |
socketFactory(SocketFactory socketFactory)
Sets the socket factory. |
MongoClientOptions.Builder |
socketKeepAlive(boolean socketKeepAlive)
Sets whether socket keep alive is enabled. |
MongoClientOptions.Builder |
socketTimeout(int socketTimeout)
Sets the socket timeout. |
MongoClientOptions.Builder |
threadsAllowedToBlockForConnectionMultiplier(int threadsAllowedToBlockForConnectionMultiplier)
Sets the multiplier for number of threads allowed to block waiting for a connection. |
MongoClientOptions.Builder |
writeConcern(WriteConcern writeConcern)
Sets the write concern. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MongoClientOptions.Builder()
| Method Detail |
|---|
public MongoClientOptions.Builder description(String description)
description - the description of this MongoClient
thisMongoClientOptions.getDescription()public MongoClientOptions.Builder connectionsPerHost(int connectionsPerHost)
connectionsPerHost - maximum number of connections
this
IllegalArgumentException - if connnectionsPerHost < 1MongoClientOptions.getConnectionsPerHost()public MongoClientOptions.Builder threadsAllowedToBlockForConnectionMultiplier(int threadsAllowedToBlockForConnectionMultiplier)
threadsAllowedToBlockForConnectionMultiplier - the multiplier
this
IllegalArgumentException - if threadsAllowedToBlockForConnectionMultiplier < 1MongoClientOptions.getThreadsAllowedToBlockForConnectionMultiplier()public MongoClientOptions.Builder maxWaitTime(int maxWaitTime)
maxWaitTime - the maximum wait time
this
IllegalArgumentException - if maxWaitTime < 0MongoClientOptions.getMaxWaitTime()public MongoClientOptions.Builder connectTimeout(int connectTimeout)
connectTimeout - the connection timeout
thisMongoClientOptions.getConnectTimeout()public MongoClientOptions.Builder socketTimeout(int socketTimeout)
socketTimeout - the socket timeout
thisMongoClientOptions.getSocketTimeout()public MongoClientOptions.Builder socketKeepAlive(boolean socketKeepAlive)
socketKeepAlive - keep alive
thisMongoClientOptions.isSocketKeepAlive()public MongoClientOptions.Builder autoConnectRetry(boolean autoConnectRetry)
autoConnectRetry - auto connect retry
thisMongoClientOptions.isAutoConnectRetry()public MongoClientOptions.Builder maxAutoConnectRetryTime(long maxAutoConnectRetryTime)
maxAutoConnectRetryTime - the maximum auto connect retry time
thisMongoClientOptions.getMaxAutoConnectRetryTime()public MongoClientOptions.Builder readPreference(ReadPreference readPreference)
readPreference - read preference
thisMongoClientOptions.getReadPreference()public MongoClientOptions.Builder dbDecoderFactory(DBDecoderFactory dbDecoderFactory)
dbDecoderFactory - the decoder factory
thisMongoClientOptions.getDbDecoderFactory()public MongoClientOptions.Builder dbEncoderFactory(DBEncoderFactory dbEncoderFactory)
dbEncoderFactory - the encoder factory
thisMongoClientOptions.getDbEncoderFactory()public MongoClientOptions.Builder writeConcern(WriteConcern writeConcern)
writeConcern - the write concern
thisMongoClientOptions.getWriteConcern()public MongoClientOptions.Builder socketFactory(SocketFactory socketFactory)
socketFactory - the socket factory
thisMongoClientOptions.getSocketFactory()public MongoClientOptions.Builder cursorFinalizerEnabled(boolean cursorFinalizerEnabled)
cursorFinalizerEnabled - whether cursor finalizers are enabled.
thisMongoClientOptions.isCursorFinalizerEnabled()public MongoClientOptions.Builder alwaysUseMBeans(boolean alwaysUseMBeans)
alwaysUseMBeans - true if driver should always use MBeans, regardless of VM version
MongoClientOptions.isAlwaysUseMBeans()public MongoClientOptions.Builder legacyDefaults()
MongoOptions.
thisMongoOptionspublic MongoClientOptions build()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||