public class MongoOptions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
boolean |
autoConnectRetry
If true, the driver will keep trying to connect to the same server in case that the socket cannot be established.
|
int |
connectionsPerHost
The maximum number of connections allowed per host for this Mongo instance.
|
int |
connectTimeout
The connection timeout in milliseconds.
|
DBDecoderFactory |
dbDecoderFactory
Override the DBCallback factory.
|
java.lang.String |
description
The description for
Mongo instances created with these options. |
boolean |
fsync
The "fsync" value of the global WriteConcern.
|
boolean |
j
The "j" value of the global WriteConcern.
|
long |
maxAutoConnectRetryTime
The maximum amount of time in MS to spend retrying to open connection to the same server.
|
int |
maxWaitTime
The maximum wait time in ms that a thread may wait for a connection to become available.
|
boolean |
safe
If true the driver will use a WriteConcern of WriteConcern.SAFE for all operations.
|
boolean |
slaveOk
This flag specifies if the driver is allowed to read from secondary (slave) servers.
|
javax.net.SocketFactory |
socketFactory
sets the socket factory for creating sockets to mongod
Default is SocketFactory.getDefault()
|
boolean |
socketKeepAlive
This flag controls the socket keep alive feature that keeps a connection alive through firewalls
Socket.setKeepAlive(boolean)
Default is false. |
int |
socketTimeout
The socket timeout in milliseconds
It is used for I/O socket read and write operations
Socket.setSoTimeout(int)
Default is 0 and means no timeout. |
int |
threadsAllowedToBlockForConnectionMultiplier
this multiplier, multiplied with the connectionsPerHost setting, gives the maximum number of threads that
may be waiting for a connection to become available from the pool.
|
int |
w
The "w" value of the global WriteConcern.
|
int |
wtimeout
The "wtimeout" value of the global WriteConcern.
|
Constructor and Description |
---|
MongoOptions() |
Modifier and Type | Method and Description |
---|---|
WriteConcern |
getWriteConcern()
Helper method to return the appropriate WriteConcern instance based
on the current related options settings.
|
void |
reset() |
java.lang.String |
toString() |
public java.lang.String description
The description for Mongo
instances created with these options. This is used in various places like logging.
public int connectionsPerHost
MongoOptions#threadsAllowedToBlockForConnectionMultiplier}
public int threadsAllowedToBlockForConnectionMultiplier
public int maxWaitTime
public int connectTimeout
Socket.connect(java.net.SocketAddress, int)
Default is 0 and means no timeout.public int socketTimeout
Socket.setSoTimeout(int)
Default is 0 and means no timeout.public boolean socketKeepAlive
Socket.setKeepAlive(boolean)
Default is false.public boolean autoConnectRetry
public long maxAutoConnectRetryTime
public boolean slaveOk
public DBDecoderFactory dbDecoderFactory
public boolean safe
public int w
public int wtimeout
public boolean fsync
public boolean j
public javax.net.SocketFactory socketFactory
public void reset()
public WriteConcern getWriteConcern()
public java.lang.String toString()
toString
in class java.lang.Object