@Deprecated public class DBApiLayer extends DB
DB
class.Modifier | Constructor and Description |
---|---|
protected |
DBApiLayer(Mongo mongo,
String name,
DBConnector connector)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
WriteResult |
addUser(String username,
char[] passwd,
boolean readOnly)
Deprecated.
Adds or updates a user for this database
|
void |
cleanCursors(boolean force)
Deprecated.
Forcefully kills any cursors leaked by neglecting to call
DBCursor.close |
protected com.mongodb.DBCollectionImpl |
doGetCollection(String name)
Deprecated.
Gets a collection with a given name.
|
WriteResult |
removeUser(String username)
Deprecated.
Removes the specified user from the database.
|
void |
requestDone()
Deprecated.
Ends the current 'consistent request'.
|
void |
requestEnsureConnection()
Deprecated.
Ensure that a connection is assigned to the current 'consistent request'
(from primary pool, if connected to a replica set)
|
void |
requestStart()
Deprecated.
Starts a new 'consistent request'.
|
addOption, addUser, authenticate, authenticateCommand, collectionExists, command, command, command, command, command, command, command, command, command, command, command, createCollection, doEval, dropDatabase, eval, forceError, getCollection, getCollectionFromString, getCollectionNames, getLastError, getLastError, getLastError, getMongo, getName, getOptions, getPreviousError, getReadPreference, getSisterDB, getStats, getWriteConcern, isAuthenticated, resetError, resetOptions, setOptions, setReadOnly, setReadPreference, setWriteConcern, slaveOk, toString
protected DBApiLayer(Mongo mongo, String name, DBConnector connector)
mongo
- the Mongo instancename
- the database nameconnector
- the connector. This must be an instance of DBTCPConnector.public void requestStart()
DB
DB.requestDone()
is called,
all db operations will use the same underlying connection.
This is useful to ensure that operations happen in a certain order with predictable results.requestStart
in class DB
public void requestDone()
DB
requestDone
in class DB
public void requestEnsureConnection()
DB
requestEnsureConnection
in class DB
public WriteResult addUser(String username, char[] passwd, boolean readOnly)
DB
public WriteResult removeUser(String username)
DB
removeUser
in class DB
username
- user to be removedprotected com.mongodb.DBCollectionImpl doGetCollection(String name)
DB
doGetCollection
in class DB
name
- the name of the collectionpublic void cleanCursors(boolean force)
DB
DBCursor.close
cleanCursors
in class DB
force
- true if should clean regardless of number of dead cursorsMongoException
DBCursor.close()