@Deprecated public class DBApiLayer extends DB
DB class.| Modifier | Constructor and Description |
|---|---|
protected |
DBApiLayer(Mongo mongo,
java.lang.String name,
DBConnector connector)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
WriteResult |
addUser(java.lang.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(java.lang.String name)
Deprecated.
Gets a collection with a given name.
|
java.util.Set<java.lang.String> |
getCollectionNames()
Deprecated.
Returns a set containing the names of all collections in this database.
|
WriteResult |
removeUser(java.lang.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, toStringprotected DBApiLayer(Mongo mongo, java.lang.String name, DBConnector connector)
mongo - the Mongo instancename - the database nameconnector - the connector. This must be an instance of DBTCPConnector.public void requestStart()
DBStarts 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 DBpublic void requestDone()
DBrequestDone in class DBpublic void requestEnsureConnection()
DBrequestEnsureConnection in class DBpublic WriteResult addUser(java.lang.String username, char[] passwd, boolean readOnly)
DBpublic WriteResult removeUser(java.lang.String username)
DBremoveUser in class DBusername - user to be removedprotected com.mongodb.DBCollectionImpl doGetCollection(java.lang.String name)
DBGets 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 DBname - the name of the collectionpublic java.util.Set<java.lang.String> getCollectionNames()
DBgetCollectionNames in class DBpublic void cleanCursors(boolean force)
DBDBCursor.closecleanCursors in class DBforce - true if should clean regardless of number of dead cursorsMongoExceptionDBCursor.close()