MongoClientOptions
.@Deprecated public class MongoOptions extends Object
MongoClientOptions
,
MongoClient
Modifier and Type | Field and Description |
---|---|
boolean |
alwaysUseMBeans
Deprecated.
Sets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is
Java 6 or greater.
|
boolean |
autoConnectRetry
Deprecated.
There is no replacement for this method. Use the connectTimeout property to control connection timeout.
|
int |
connectionsPerHost
Deprecated.
The maximum number of connections allowed per host for this Mongo instance.
|
int |
connectTimeout
Deprecated.
The connection timeout in milliseconds.
|
boolean |
cursorFinalizerEnabled
Deprecated.
Sets whether there is a a finalize method created that cleans up instances of DBCursor that the client
does not close.
|
DBDecoderFactory |
dbDecoderFactory
Deprecated.
Override the DBCallback factory.
|
DBEncoderFactory |
dbEncoderFactory
Deprecated.
Override the encoding factory.
|
String |
description
Deprecated.
The description for
Mongo instances created with these options. |
boolean |
fsync
Deprecated.
The "fsync" value of the global WriteConcern.
|
boolean |
j
Deprecated.
The "j" value of the global WriteConcern.
|
long |
maxAutoConnectRetryTime
Deprecated.
There is no replacement for this method. Use the connectTimeout property to control connection timeout.
|
int |
maxWaitTime
Deprecated.
The maximum wait time in milliseconds that a thread may wait for a connection to become available.
|
ReadPreference |
readPreference
Deprecated.
Specifies the read preference.
|
boolean |
safe
Deprecated.
If true the driver will use a WriteConcern of WriteConcern.SAFE for all operations.
|
boolean |
slaveOk
Deprecated.
Replaced with
ReadPreference.secondaryPreferred() |
SocketFactory |
socketFactory
Deprecated.
sets the socket factory for creating sockets to mongod
Default is SocketFactory.getDefault()
|
boolean |
socketKeepAlive
Deprecated.
This flag controls the socket keep alive feature that keeps a connection alive through firewalls
Socket.setKeepAlive(boolean)
Default is false. |
int |
socketTimeout
Deprecated.
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
Deprecated.
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
Deprecated.
The "w" value, (number of writes), of the global WriteConcern.
|
WriteConcern |
writeConcern
Deprecated.
Sets the write concern.
|
int |
wtimeout
Deprecated.
The "wtimeout" value of the global WriteConcern.
|
Constructor and Description |
---|
MongoOptions()
Deprecated.
|
MongoOptions(MongoClientOptions options)
Deprecated.
Replaced by
MongoClientOptions |
Modifier and Type | Method and Description |
---|---|
MongoOptions |
copy()
Deprecated.
|
boolean |
equals(Object o)
Deprecated.
|
int |
getConnectionsPerHost()
Deprecated.
Gets the maximum number of connections allowed per host for this Mongo instance.
|
int |
getConnectTimeout()
Deprecated.
|
DBDecoderFactory |
getDbDecoderFactory()
Deprecated.
|
DBEncoderFactory |
getDbEncoderFactory()
Deprecated.
|
String |
getDescription()
Deprecated.
|
long |
getMaxAutoConnectRetryTime()
Deprecated.
There is no replacement for this method. Use the connectTimeout property to control connection timeout.
|
int |
getMaxWaitTime()
Deprecated.
|
ReadPreference |
getReadPreference()
Deprecated.
|
String |
getRequiredReplicaSetName()
Deprecated.
Gets the required replica set name that this client should be connecting to.
|
SocketFactory |
getSocketFactory()
Deprecated.
|
int |
getSocketTimeout()
Deprecated.
|
int |
getThreadsAllowedToBlockForConnectionMultiplier()
Deprecated.
Gets the multiplier which, when 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 |
getW()
Deprecated.
|
WriteConcern |
getWriteConcern()
Deprecated.
Helper method to return the appropriate WriteConcern instance based on the current related options settings.
|
int |
getWtimeout()
Deprecated.
|
int |
hashCode()
Deprecated.
|
boolean |
isAlwaysUseMBeans()
Deprecated.
|
boolean |
isAutoConnectRetry()
Deprecated.
There is no replacement for this method. Use the connectTimeout property to control connection timeout.
|
boolean |
isCursorFinalizerEnabled()
Deprecated.
|
boolean |
isFsync()
Deprecated.
|
boolean |
isJ()
Deprecated.
|
boolean |
isSafe()
Deprecated.
|
boolean |
isSocketKeepAlive()
Deprecated.
|
void |
reset()
Deprecated.
|
void |
setAlwaysUseMBeans(boolean alwaysUseMBeans)
Deprecated.
|
void |
setAutoConnectRetry(boolean retry)
Deprecated.
There is no replacement for this method. Use the connectTimeout property to control connection timeout.
|
void |
setConnectionsPerHost(int connections)
Deprecated.
Sets the maximum number of connections allowed per host for this Mongo instance.
|
void |
setConnectTimeout(int timeoutMS)
Deprecated.
|
void |
setCursorFinalizerEnabled(boolean cursorFinalizerEnabled)
Deprecated.
|
void |
setDbDecoderFactory(DBDecoderFactory factory)
Deprecated.
|
void |
setDbEncoderFactory(DBEncoderFactory factory)
Deprecated.
|
void |
setDescription(String desc)
Deprecated.
|
void |
setFsync(boolean sync)
Deprecated.
|
void |
setJ(boolean safe)
Deprecated.
|
void |
setMaxAutoConnectRetryTime(long retryTimeMS)
Deprecated.
There is no replacement for this method. Use the connectTimeout property to control connection timeout.
|
void |
setMaxWaitTime(int timeMS)
Deprecated.
|
void |
setReadPreference(ReadPreference readPreference)
Deprecated.
|
void |
setSafe(boolean isSafe)
Deprecated.
|
void |
setSocketFactory(SocketFactory factory)
Deprecated.
|
void |
setSocketKeepAlive(boolean keepAlive)
Deprecated.
|
void |
setSocketTimeout(int timeoutMS)
Deprecated.
|
void |
setThreadsAllowedToBlockForConnectionMultiplier(int threads)
Deprecated.
Sets the multiplier which, when multiplied with the connectionsPerHost setting, gives the maximum number of threads that may be
waiting for a connection to become available from the pool.
|
void |
setW(int val)
Deprecated.
|
void |
setWriteConcern(WriteConcern writeConcern)
Deprecated.
|
void |
setWtimeout(int timeoutMS)
Deprecated.
|
String |
toString()
Deprecated.
|
public String description
The description for Mongo
instances created with these options. This is used in various places like logging.
public int connectionsPerHost
The maximum number of connections allowed per host for this Mongo instance. Those connections will be kept in a pool when idle. Once the pool is exhausted, any operation requiring a connection will block waiting for an available connection.
Default is 10.
public int threadsAllowedToBlockForConnectionMultiplier
public int maxWaitTime
public int connectTimeout
Socket.connect(java.net.SocketAddress, int)
Default is 10,000.public int socketTimeout
Socket.setSoTimeout(int)
Default is 0 and means no timeout.public boolean socketKeepAlive
Socket.setKeepAlive(boolean)
Default is false.@Deprecated public boolean autoConnectRetry
@Deprecated public long maxAutoConnectRetryTime
@Deprecated public boolean slaveOk
ReadPreference.secondaryPreferred()
ReadPreference.secondaryPreferred()
public ReadPreference readPreference
public DBDecoderFactory dbDecoderFactory
public DBEncoderFactory dbEncoderFactory
public boolean safe
public int w
public int wtimeout
public boolean fsync
public boolean j
public SocketFactory socketFactory
public boolean cursorFinalizerEnabled
Default is true.
public WriteConcern writeConcern
public boolean alwaysUseMBeans
Default is false.
@Deprecated public MongoOptions()
@Deprecated public MongoOptions(MongoClientOptions options)
MongoClientOptions
public void reset()
public MongoOptions copy()
public WriteConcern getWriteConcern()
public String getDescription()
MongoClient
instances created with these optionspublic void setDescription(String desc)
desc
- The description for Mongo
instances created with these optionspublic int getConnectionsPerHost()
public void setConnectionsPerHost(int connections)
connections
- sets the maximum number of connections allowed per host for this Mongo instancepublic int getThreadsAllowedToBlockForConnectionMultiplier()
public void setThreadsAllowedToBlockForConnectionMultiplier(int threads)
threads
- multiplied with connectionsPerHost, sets the maximum number of threads that may be waiting for a connectionpublic int getMaxWaitTime()
public void setMaxWaitTime(int timeMS)
timeMS
- set the maximum time in milliseconds that threads wait for a connectionpublic int getConnectTimeout()
public void setConnectTimeout(int timeoutMS)
timeoutMS
- set the connection timeout in milliseconds.public int getSocketTimeout()
public void setSocketTimeout(int timeoutMS)
timeoutMS
- set the socket timeout in millisecondspublic boolean isSocketKeepAlive()
public void setSocketKeepAlive(boolean keepAlive)
keepAlive
- set connection keep-alive flag@Deprecated public boolean isAutoConnectRetry()
@Deprecated public void setAutoConnectRetry(boolean retry)
retry
- sets keep trying connection flag@Deprecated public long getMaxAutoConnectRetryTime()
@Deprecated public void setMaxAutoConnectRetryTime(long retryTimeMS)
retryTimeMS
- set max time in MS to retrying open connectionpublic DBDecoderFactory getDbDecoderFactory()
public void setDbDecoderFactory(DBDecoderFactory factory)
factory
- sets the DBCallback decoding factorypublic DBEncoderFactory getDbEncoderFactory()
public void setDbEncoderFactory(DBEncoderFactory factory)
factory
- sets the encoding factorypublic boolean isSafe()
public void setSafe(boolean isSafe)
isSafe
- true if driver uses WriteConcern.SAFE for all operations.public int getW()
public void setW(int val)
val
- set the number of writes of the global WriteConcern.public int getWtimeout()
public void setWtimeout(int timeoutMS)
timeoutMS
- sets timeout for write operationpublic boolean isFsync()
public void setFsync(boolean sync)
sync
- sets global write concern's fsync safe valuepublic boolean isJ()
public void setJ(boolean safe)
safe
- sets global write concern's journal safe valuepublic void setWriteConcern(WriteConcern writeConcern)
writeConcern
- sets the write concernpublic SocketFactory getSocketFactory()
public void setSocketFactory(SocketFactory factory)
factory
- sets the socket factory for creating sockets to mongodpublic ReadPreference getReadPreference()
public void setReadPreference(ReadPreference readPreference)
readPreference
- the read preferencepublic boolean isCursorFinalizerEnabled()
public void setCursorFinalizerEnabled(boolean cursorFinalizerEnabled)
cursorFinalizerEnabled
- whether cursor finalizer is enabledpublic boolean isAlwaysUseMBeans()
public void setAlwaysUseMBeans(boolean alwaysUseMBeans)
alwaysUseMBeans
- sets whether the driver should always use MBeans, regardless of VMpublic String getRequiredReplicaSetName()