@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.
|
Set<String> |
getCollectionNames()
Deprecated.
Returns a set containing the names of all collections in this database.
|
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, 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
Starts a new 'consistent request'
.Following this call and until DB.requestDone()
is called, all db operations will use the same underlying
connection.
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
Gets a collection with a given name. If the collection does not exist, a new collection is created.
This class is NOT part of the public API. Be prepared for non-binary compatible changes in minor releases.
doGetCollection
in class DB
name
- the name of the collectionpublic Set<String> getCollectionNames()
DB
getCollectionNames
in class DB
public void cleanCursors(boolean force)
DB
DBCursor.close
cleanCursors
in class DB
force
- true if should clean regardless of number of dead cursorsMongoException
DBCursor.close()