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 . |
MAX_DOCUMENT_SIZE
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.
|
MongoClientConfiguration |
getConfig()
Returns the configuration being used by the logical MongoDB connection.
|
Durability |
getDefaultDurability()
Returns the
Durability from the MongoClientConfiguration . |
ReadPreference |
getDefaultReadPreference()
Returns the
ReadPreference from the
MongoClientConfiguration . |
send, send
protected 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 MongoClientConfiguration getConfig()
Overridden to return the configuration used when the client was constructed.
public Durability getDefaultDurability()
Durability
from the MongoClientConfiguration
.
Overridden to return the configurations default durability.
MongoClientConfiguration
.Client.getDefaultDurability()
public ReadPreference getDefaultReadPreference()
ReadPreference
from the
MongoClientConfiguration
.
Overridden to return the configurations default read preference.
MongoClientConfiguration
.Client.getDefaultReadPreference()
protected Connection findConnection(Message message1, Message message2) throws MongoDbException
ClientImpl
and the result cached for future requests.findConnection
in class AbstractClient
message1
- 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-2013 Allanbank Consulting, Inc.. All Rights Reserved.