public interface

DBConnector

com.mongodb.DBConnector
Known Indirect Subclasses

Class Overview

Interface that provides the ability to exchange request/response with the database

Summary

Public Methods
abstract Response call(DB db, DBCollection coll, OutMessage m, ServerAddress hostNeeded, int retries)
does a read operation on the database
abstract Response call(DB db, DBCollection coll, OutMessage m, ServerAddress hostNeeded, DBDecoder decoder)
does a read operation on the database
abstract Response call(DB db, DBCollection coll, OutMessage m, ServerAddress hostNeeded, int retries, ReadPreference readPref, DBDecoder decoder)
does a read operation on the database
abstract boolean isOpen()
returns true if the connector is in a usable state
abstract void requestDone()
terminates the "consistent request".
abstract void requestEnsureConnection()
Ensures that a connection exists for the "consistent request"
abstract void requestStart()
initiates a "consistent request" on the thread.
abstract WriteResult say(DB db, OutMessage m, WriteConcern concern, ServerAddress hostNeeded)
does a write operation
abstract WriteResult say(DB db, OutMessage m, WriteConcern concern)
does a write operation

Public Methods

public abstract Response call (DB db, DBCollection coll, OutMessage m, ServerAddress hostNeeded, int retries)

does a read operation on the database

Parameters
db the database
coll the collection
m the request message
hostNeeded specific server to connect to
retries the number of retries in case of an error
Returns
  • the read result

public abstract Response call (DB db, DBCollection coll, OutMessage m, ServerAddress hostNeeded, DBDecoder decoder)

does a read operation on the database

Parameters
db the database
coll the collection
m the request message
hostNeeded specific server to connect to
decoder the decoder to use
Returns
  • the read result

public abstract Response call (DB db, DBCollection coll, OutMessage m, ServerAddress hostNeeded, int retries, ReadPreference readPref, DBDecoder decoder)

does a read operation on the database

Parameters
db the database
coll the collection
m the request message
hostNeeded specific server to connect to
retries number of retries in case of error
readPref the read preferences
decoder the decoder to use
Returns
  • the read result

public abstract boolean isOpen ()

returns true if the connector is in a usable state

public abstract void requestDone ()

terminates the "consistent request".

public abstract void requestEnsureConnection ()

Ensures that a connection exists for the "consistent request"

public abstract void requestStart ()

initiates a "consistent request" on the thread. Once this has been called, the connector will ensure that the same underlying connection is always used for a given thread. This happens until requestStop() is called.

public abstract WriteResult say (DB db, OutMessage m, WriteConcern concern, ServerAddress hostNeeded)

does a write operation

Parameters
db the database
m the request message
concern the write concern
hostNeeded specific server to connect to
Returns
  • the write result

public abstract WriteResult say (DB db, OutMessage m, WriteConcern concern)

does a write operation

Parameters
db the database
m the request message
concern the write concern
Returns
  • the write result