MongoClientOptions instead.@Deprecated
public class MongoOptions
extends java.lang.Object
MongoClientOptions,
MongoClient| 限定符和类型 | 字段和说明 |
|---|---|
boolean |
alwaysUseMBeans
已过时。
Sets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is Java 6 or greater.
|
int |
connectionsPerHost
已过时。
The maximum number of connections allowed per host for this Mongo instance.
|
int |
connectTimeout
已过时。
The connection timeout in milliseconds.
|
boolean |
cursorFinalizerEnabled
已过时。
Sets whether there is a a finalize method created that cleans up instances of DBCursor that the client does not close.
|
DBDecoderFactory |
dbDecoderFactory
已过时。
Override the DBCallback factory.
|
DBEncoderFactory |
dbEncoderFactory
已过时。
Override the encoding factory.
|
java.lang.String |
description
已过时。
The description for
Mongo instances created with these options. |
boolean |
fsync
已过时。
The "fsync" value of the global WriteConcern. true indicates writes should wait for data to be written to server data file Default is
false.
|
boolean |
j
已过时。
The "j" value of the global WriteConcern. true indicates writes should wait for a journaling group commit Default is false.
|
int |
maxWaitTime
已过时。
The maximum wait time in milliseconds that a thread may wait for a connection to become available.
|
ReadPreference |
readPreference
已过时。
Specifies the read preference.
|
boolean |
safe
已过时。
If
true the driver will use a WriteConcern of WriteConcern.SAFE for all operations. |
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, (number of writes), of the global WriteConcern.
|
WriteConcern |
writeConcern
已过时。
Sets the write concern.
|
int |
wtimeout
已过时。
The "wtimeout" value of the global WriteConcern.
|
| 构造器和说明 |
|---|
MongoOptions()
已过时。
|
MongoOptions(MongoClientOptions options)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
MongoOptions |
copy()
已过时。
Copy this MongoOptions instance into a new instance.
|
boolean |
equals(java.lang.Object o)
已过时。
|
int |
getConnectionsPerHost()
已过时。
Gets the maximum number of connections allowed per host for this Mongo instance.
|
int |
getConnectTimeout()
已过时。
Gets the connection timeout in milliseconds.
|
DBDecoderFactory |
getDbDecoderFactory()
已过时。
Gets the DBCallback factory.
|
DBEncoderFactory |
getDbEncoderFactory()
已过时。
Gets the encoding factory.
|
java.lang.String |
getDescription()
已过时。
Gets the description for
Mongo instances created with these options. |
int |
getMaxWaitTime()
已过时。
Gets the maximum wait time in milliseconds that a thread may wait for a connection to become available.
|
ReadPreference |
getReadPreference()
已过时。
Gets the read preference.
|
java.lang.String |
getRequiredReplicaSetName()
已过时。
Gets the required replica set name that this client should be connecting to.
|
javax.net.SocketFactory |
getSocketFactory()
已过时。
Gets the socket factory for creating sockets to mongod.
|
int |
getSocketTimeout()
已过时。
Gets the socket timeout in milliseconds. 0 means no timeout.
|
int |
getThreadsAllowedToBlockForConnectionMultiplier()
已过时。
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()
已过时。
Gets the "w" value, (number of writes), of the global WriteConcern.
|
WriteConcern |
getWriteConcern()
已过时。
Helper method to return the appropriate WriteConcern instance based on the current related options settings.
|
int |
getWtimeout()
已过时。
Gets the "wtimeout" value of the global WriteConcern.
|
int |
hashCode()
已过时。
|
boolean |
isAlwaysUseMBeans()
已过时。
Gets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is Java 6 or greater.
|
boolean |
isCursorFinalizerEnabled()
已过时。
Gets whether there is a a finalize method created that cleans up instances of DBCursor that the client does not close.
|
boolean |
isFsync()
已过时。
Gets the "fsync" value of the global WriteConcern.
|
boolean |
isJ()
已过时。
Gets the "j" value of the global WriteConcern.
|
boolean |
isSafe()
已过时。
Returns whether the driver will use a WriteConcern of WriteConcern.ACKNOWLEDGED for all operations.
|
boolean |
isSocketKeepAlive()
已过时。
Gets the flag that controls the socket keep alive feature that keeps a connection alive through firewalls.
|
void |
reset()
已过时。
Reset all settings to the default.
|
void |
setAlwaysUseMBeans(boolean alwaysUseMBeans)
已过时。
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)
已过时。
Sets the maximum number of connections allowed per host for this Mongo instance.
|
void |
setConnectTimeout(int timeoutMS)
已过时。
Sets the connection timeout in milliseconds.
|
void |
setCursorFinalizerEnabled(boolean cursorFinalizerEnabled)
已过时。
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)
已过时。
Override the DBCallback factory.
|
void |
setDbEncoderFactory(DBEncoderFactory factory)
已过时。
Override the encoding factory.
|
void |
setDescription(java.lang.String desc)
已过时。
Sets the description for
Mongo instances created with these options. |
void |
setFsync(boolean sync)
已过时。
Sets the "fsync" value of the global WriteConcern.
|
void |
setJ(boolean safe)
已过时。
Sets the "j" value of the global WriteConcern.
|
void |
setMaxWaitTime(int timeMS)
已过时。
Sets the maximum wait time in milliseconds that a thread may wait for a connection to become available.
|
void |
setReadPreference(ReadPreference readPreference)
已过时。
Specifies the read preference.
|
void |
setSafe(boolean isSafe)
已过时。
If
true the driver will use a WriteConcern of WriteConcern.SAFE for all operations. |
void |
setSocketFactory(javax.net.SocketFactory factory)
已过时。
Sets the socket factory for creating sockets to mongod.
|
void |
setSocketKeepAlive(boolean keepAlive)
已过时。
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)
已过时。
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)
已过时。
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)
已过时。
Sets the "w" value, (number of writes), of the global WriteConcern.
|
void |
setWriteConcern(WriteConcern writeConcern)
已过时。
Sets the write concern.
|
void |
setWtimeout(int timeoutMS)
已过时。
Sets the "wtimeout" value of the global WriteConcern.
|
java.lang.String |
toString()
已过时。
|
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()
MongoClientOptionsMongoOptions. This class is deprecated, use MongoClientOptions.@Deprecated public MongoOptions(MongoClientOptions options)
MongoClientOptionsMongoOptions 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 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Object