MongoClientOptions
instead.@Deprecated
public class MongoOptions
extends java.lang.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.
|
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.
|
java.lang.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.
|
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. |
javax.net.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.
|
Modifier and Type | Method and Description |
---|---|
MongoOptions |
copy()
Deprecated.
Copy this MongoOptions instance into a new instance.
|
boolean |
equals(java.lang.Object o)
Deprecated.
|
int |
getConnectionsPerHost()
Deprecated.
Gets the maximum number of connections allowed per host for this Mongo instance.
|
int |
getConnectTimeout()
Deprecated.
Gets the connection timeout in milliseconds.
|
DBDecoderFactory |
getDbDecoderFactory()
Deprecated.
Gets the DBCallback factory.
|
DBEncoderFactory |
getDbEncoderFactory()
Deprecated.
Gets the encoding factory.
|
java.lang.String |
getDescription()
Deprecated.
Gets the description for
Mongo instances created with these options. |
int |
getMaxWaitTime()
Deprecated.
Gets the maximum wait time in milliseconds that a thread may wait for a connection to become available.
|
ReadPreference |
getReadPreference()
Deprecated.
Gets the read preference.
|
java.lang.String |
getRequiredReplicaSetName()
Deprecated.
Gets the required replica set name that this client should be connecting to.
|
javax.net.SocketFactory |
getSocketFactory()
Deprecated.
Gets the socket factory for creating sockets to mongod.
|
int |
getSocketTimeout()
Deprecated.
Gets the socket timeout in milliseconds.
|
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.
Gets the "w" value, (number of writes), of the global WriteConcern.
|
WriteConcern |
getWriteConcern()
Deprecated.
Helper method to return the appropriate WriteConcern instance based on the current related options settings.
|
int |
getWtimeout()
Deprecated.
Gets the "wtimeout" value of the global WriteConcern.
|
int |
hashCode()
Deprecated.
|
boolean |
isAlwaysUseMBeans()
Deprecated.
Gets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is Java 6 or greater.
|
boolean |
isCursorFinalizerEnabled()
Deprecated.
Gets whether there is a a finalize method created that cleans up instances of DBCursor that the client does not close.
|
boolean |
isFsync()
Deprecated.
Gets the "fsync" value of the global WriteConcern.
|
boolean |
isJ()
Deprecated.
Gets the "j" value of the global WriteConcern.
|
boolean |
isSafe()
Deprecated.
Returns whether the driver will use a WriteConcern of WriteConcern.ACKNOWLEDGED for all operations.
|
boolean |
isSocketKeepAlive()
Deprecated.
Gets the flag that controls the socket keep alive feature that keeps a connection alive through firewalls.
|
void |
reset()
Deprecated.
Reset all settings to the default.
|
void |
setAlwaysUseMBeans(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.
|
void |
setConnectionsPerHost(int connections)
Deprecated.
Sets the maximum number of connections allowed per host for this Mongo instance.
|
void |
setConnectTimeout(int timeoutMS)
Deprecated.
Sets the connection timeout in milliseconds.
|
void |
setCursorFinalizerEnabled(boolean cursorFinalizerEnabled)
Deprecated.
Sets whether there is a a finalize method created that cleans up instances of DBCursor that the client does not close.
|
void |
setDbDecoderFactory(DBDecoderFactory factory)
Deprecated.
Override the DBCallback factory.
|
void |
setDbEncoderFactory(DBEncoderFactory factory)
Deprecated.
Override the encoding factory.
|
void |
setDescription(java.lang.String desc)
Deprecated.
Sets the description for
Mongo instances created with these options. |
void |
setFsync(boolean sync)
Deprecated.
Sets the "fsync" value of the global WriteConcern.
|
void |
setJ(boolean safe)
Deprecated.
Sets the "j" value of the global WriteConcern.
|
void |
setMaxWaitTime(int timeMS)
Deprecated.
Sets the maximum wait time in milliseconds that a thread may wait for a connection to become available.
|
void |
setReadPreference(ReadPreference readPreference)
Deprecated.
Specifies the read preference.
|
void |
setSafe(boolean isSafe)
Deprecated.
If
true the driver will use a WriteConcern of WriteConcern.SAFE for all operations. |
void |
setSocketFactory(javax.net.SocketFactory factory)
Deprecated.
Sets the socket factory for creating sockets to mongod.
|
void |
setSocketKeepAlive(boolean keepAlive)
Deprecated.
Sets the flag that controls the socket keep alive feature that keeps a connection alive through firewalls
Socket.setKeepAlive(boolean) Default is false. |
void |
setSocketTimeout(int timeoutMS)
Deprecated.
Sets the socket timeout in milliseconds It is used for I/O socket read and write operations
(int) Default is 0 and means no timeout. |
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.
Sets the "w" value, (number of writes), of the global WriteConcern.
|
void |
setWriteConcern(WriteConcern writeConcern)
Deprecated.
Sets the write concern.
|
void |
setWtimeout(int timeoutMS)
Deprecated.
Sets the "wtimeout" value of the global WriteConcern.
|
java.lang.String |
toString()
Deprecated.
|
public java.lang.String description
Mongo
instances created with these options. This is used in various places like logging.public int connectionsPerHost
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.public ReadPreference readPreference
public DBDecoderFactory dbDecoderFactory
public DBEncoderFactory dbEncoderFactory
public boolean safe
true
the driver will use a WriteConcern of WriteConcern.SAFE for all operations. If w, wtimeout, fsync or j are specified,
this setting is ignored. Default is false.public int w
public int wtimeout
public boolean fsync
public boolean j
public javax.net.SocketFactory socketFactory
public boolean cursorFinalizerEnabled
Sets whether there is a a finalize method created that cleans up instances of DBCursor that the client does not close. If you are careful to always call the close method of DBCursor, then this can safely be set to false.
Default is true.
DBCursor.close()
public WriteConcern writeConcern
public boolean alwaysUseMBeans
Default is false.
@Deprecated public MongoOptions()
MongoClientOptions
MongoOptions
. This class is deprecated, use MongoClientOptions
.@Deprecated public MongoOptions(MongoClientOptions options)
MongoClientOptions
MongoOptions
with the given options. This class is deprecated, use MongoClientOptions
.options
- the MongoClientOptions to copy values from into the new MongoOptions.public void reset()
public MongoOptions copy()
public WriteConcern getWriteConcern()
public void setWriteConcern(WriteConcern writeConcern)
writeConcern
- sets the write concernpublic javax.net.SocketFactory getSocketFactory()
public void setSocketFactory(javax.net.SocketFactory factory)
factory
- sets the socket factory for creating sockets to mongodpublic java.lang.String getDescription()
Mongo
instances created with these options.MongoClient
instances created with these optionspublic void setDescription(java.lang.String desc)
Mongo
instances created with these options. This is used in various places like logging.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)
Socket.connect(java.net.SocketAddress, int)
Default is 10,000.timeoutMS
- set the connection timeout in milliseconds.public int getSocketTimeout()
public void setSocketTimeout(int timeoutMS)
(int)
Default is 0 and means no timeout.timeoutMS
- set the socket timeout in millisecondspublic boolean isSocketKeepAlive()
public void setSocketKeepAlive(boolean keepAlive)
Socket.setKeepAlive(boolean)
Default is false.keepAlive
- set connection keep-alive flagpublic 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)
true
the driver will use a WriteConcern of WriteConcern.SAFE for all operations. If w, wtimeout, fsync or j are specified,
this setting is ignored. Default is false.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 in millis 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 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 java.lang.String getRequiredReplicaSetName()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object