public class SerialClientImpl extends AbstractClient
ClientImpl to always try to use the same
connection.| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
ASSERTIONS_ENABLED
If true then assertions have been enabled for the class.
|
protected static Logger |
LOG
The logger for the
SerialClientImpl. |
| Constructor and Description |
|---|
SerialClientImpl(ClientImpl client)
Create a new SerialClientImpl.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the client.
|
protected Connection |
findConnection(Message message1,
Message message2)
Tries to reuse the last connection used.
|
ClusterType |
getClusterType()
Returns the type of cluster the client is connected to.
|
MongoDbConfiguration |
getConfig()
Returns the configuration being used by the logical MongoDB connection.
|
Durability |
getDefaultDurability()
Returns the
Durability from the MongoDbConfiguration. |
ReadPreference |
getDefaultReadPreference()
Returns the
ReadPreference from the MongoDbConfiguration. |
send, sendprotected static final boolean ASSERTIONS_ENABLED
protected static final Logger LOG
SerialClientImpl.public SerialClientImpl(ClientImpl client)
client - The delegate client for accessing connections.public void close()
Overridden to close all of the open connections.
Closeable.close()public ClusterType getClusterType()
Overridden to return the ClusterType of delegate
ClientImpl.
public MongoDbConfiguration getConfig()
Overridden to return the configuration used when the client was constructed.
public Durability getDefaultDurability()
Durability from the MongoDbConfiguration.
Overridden to return the configurations default durability.
MongoDbConfiguration.Client.getDefaultDurability()public ReadPreference getDefaultReadPreference()
ReadPreference from the MongoDbConfiguration.
Overridden to return the configurations default read preference.
MongoDbConfiguration
.Client.getDefaultReadPreference()protected Connection findConnection(Message message1, Message message2) throws MongoDbException
ClientImpl
and the result cached for future requests.findConnection in class AbstractClientmessage1 - The first message that will be sent. The connection return
should be compatible with all of the messages
ReadPreference.message2 - The second message that will be sent. The connection return
should be compatible with all of the messages
ReadPreference. May be null.MongoDbException - On a failure to talk to the MongoDB servers.Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.