public class DBTCPConnector extends java.lang.Object implements DBConnector
| Constructor and Description |
|---|
DBTCPConnector(Mongo m,
java.util.List<ServerAddress> all) |
DBTCPConnector(Mongo m,
ServerAddress... all) |
DBTCPConnector(Mongo m,
ServerAddress addr) |
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.Response |
call(DB db,
DBCollection coll,
com.mongodb.OutMessage m,
ServerAddress hostNeeded,
DBDecoder decoder)
does a read operation on the database
|
com.mongodb.Response |
call(DB db,
DBCollection coll,
com.mongodb.OutMessage m,
ServerAddress hostNeeded,
int retries)
does a read operation on the database
|
com.mongodb.Response |
call(DB db,
DBCollection coll,
com.mongodb.OutMessage m,
ServerAddress hostNeeded,
int retries,
ReadPreference readPref,
DBDecoder decoder)
does a read operation on the database
|
void |
close() |
java.lang.String |
debugString() |
ServerAddress |
getAddress() |
java.util.List<ServerAddress> |
getAllAddress()
Gets the list of seed server addresses
|
java.lang.String |
getConnectPoint() |
DBPortPool |
getDBPortPool(ServerAddress addr)
Gets the DBPortPool associated with a ServerAddress.
|
int |
getMaxBsonObjectSize()
Gets the maximum size for a BSON object supported by the current master server.
|
ReplicaSetStatus |
getReplicaSetStatus() |
java.util.List<ServerAddress> |
getServerAddressList()
Gets the list of server addresses currently seen by the connector.
|
boolean |
isOpen()
returns true if the connector is in a usable state
|
void |
requestDone()
End the current "request", if this thread is in one.
|
void |
requestEnsureConnection()
Ensures that a connection exists for the "consistent request"
|
void |
requestStart()
Start a "request".
|
WriteResult |
say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern)
does a write operation
|
WriteResult |
say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern,
ServerAddress hostNeeded)
does a write operation
|
void |
start() |
void |
updatePortPool(ServerAddress addr)
Assigns a new DBPortPool for a given ServerAddress.
|
public DBTCPConnector(Mongo m, ServerAddress addr) throws MongoException
MongoExceptionpublic DBTCPConnector(Mongo m, ServerAddress... all) throws MongoException
MongoExceptionpublic DBTCPConnector(Mongo m, java.util.List<ServerAddress> all) throws MongoException
MongoExceptionpublic void start()
public void requestStart()
requestStart in interface DBConnectorpublic void requestDone()
requestDone in interface DBConnectorpublic void requestEnsureConnection()
DBConnectorrequestEnsureConnection in interface DBConnectorpublic WriteResult say(DB db, com.mongodb.OutMessage m, WriteConcern concern) throws MongoException
DBConnectorsay in interface DBConnectordb - the databasem - the request messageconcern - the write concernMongoExceptionpublic WriteResult say(DB db, com.mongodb.OutMessage m, WriteConcern concern, ServerAddress hostNeeded) throws MongoException
DBConnectorsay in interface DBConnectordb - the databasem - the request messageconcern - the write concernhostNeeded - specific server to connect toMongoExceptionpublic com.mongodb.Response call(DB db, DBCollection coll, com.mongodb.OutMessage m, ServerAddress hostNeeded, DBDecoder decoder) throws MongoException
DBConnectorcall in interface DBConnectordb - the databasecoll - the collectionm - the request messagehostNeeded - specific server to connect todecoder - the decoder to useMongoExceptionpublic com.mongodb.Response call(DB db, DBCollection coll, com.mongodb.OutMessage m, ServerAddress hostNeeded, int retries) throws MongoException
DBConnectorcall in interface DBConnectordb - the databasecoll - the collectionm - the request messagehostNeeded - specific server to connect toretries - the number of retries in case of an errorMongoExceptionpublic com.mongodb.Response call(DB db, DBCollection coll, com.mongodb.OutMessage m, ServerAddress hostNeeded, int retries, ReadPreference readPref, DBDecoder decoder) throws MongoException
DBConnectorcall in interface DBConnectordb - the databasecoll - the collectionm - the request messagehostNeeded - specific server to connect toretries - number of retries in case of errorreadPref - the read preferencesdecoder - the decoder to useMongoExceptionpublic ServerAddress getAddress()
public java.util.List<ServerAddress> getAllAddress()
public java.util.List<ServerAddress> getServerAddressList()
public ReplicaSetStatus getReplicaSetStatus()
public java.lang.String getConnectPoint()
public java.lang.String debugString()
public void close()
public void updatePortPool(ServerAddress addr)
addr - public DBPortPool getDBPortPool(ServerAddress addr)
addr - public boolean isOpen()
DBConnectorisOpen in interface DBConnectorpublic int getMaxBsonObjectSize()