@Deprecated public class DBApiLayer extends DB
DB class.| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
DBApiLayer.DeadCursor
Deprecated.
|
DB.CommandResultPair| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.concurrent.ConcurrentHashMap<java.lang.String,DBCollectionImpl> |
_collections
Deprecated.
|
(package private) DBTCPConnector |
_connector
Deprecated.
|
(package private) java.util.concurrent.ConcurrentLinkedQueue<DBApiLayer.DeadCursor> |
_deadCursorIds
Deprecated.
|
(package private) java.lang.String |
_root
Deprecated.
|
(package private) java.lang.String |
_rootPlusDot
Deprecated.
|
(package private) static int |
NUM_CURSORS_BEFORE_KILL
Deprecated.
The maximum number of cursors allowed
|
(package private) static int |
NUM_CURSORS_PER_BATCH
Deprecated.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DBApiLayer(Mongo mongo,
java.lang.String name,
DBConnector connector)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addDeadCursor(DBApiLayer.DeadCursor deadCursor)
Deprecated.
|
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 |
(package private) CommandResult |
doAuthenticate(MongoCredential credentials)
Deprecated.
|
protected 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.
|
(package private) DBTCPConnector |
getConnector()
Deprecated.
|
private DBObject |
getUserCommandDocument(java.lang.String username,
char[] passwd,
boolean readOnly,
java.lang.String commandName)
Deprecated.
|
private java.lang.String |
getUserRoleName(boolean readOnly)
Deprecated.
|
(package private) boolean |
isServerVersionAtLeast(java.util.List<java.lang.Integer> versionList)
Deprecated.
|
(package private) void |
killCursors(ServerAddress addr,
java.util.List<java.lang.Long> all)
Deprecated.
|
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'
|
_hash, addOption, addUser, authenticate, authenticateCommand, collectionExists, command, command, command, command, command, command, command, command, command, command, command, createCollection, doEval, dropDatabase, eval, forceError, getAuthenticationCredentials, getCollection, getCollectionFromString, getCommandReadPreference, getLastError, getLastError, getLastError, getMongo, getName, getOptions, getPreviousError, getReadPreference, getSisterDB, getStats, getWriteConcern, isAuthenticated, resetError, resetOptions, setOptions, setReadOnly, setReadPreference, setWriteConcern, slaveOk, toString, wrapCommandstatic final int NUM_CURSORS_BEFORE_KILL
static final int NUM_CURSORS_PER_BATCH
final java.lang.String _root
final java.lang.String _rootPlusDot
final DBTCPConnector _connector
final java.util.concurrent.ConcurrentHashMap<java.lang.String,DBCollectionImpl> _collections
java.util.concurrent.ConcurrentLinkedQueue<DBApiLayer.DeadCursor> _deadCursorIds
protected 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.DBTCPConnector getConnector()
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 removedprivate DBObject getUserCommandDocument(java.lang.String username, char[] passwd, boolean readOnly, java.lang.String commandName)
private java.lang.String getUserRoleName(boolean readOnly)
protected 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()void killCursors(ServerAddress addr, java.util.List<java.lang.Long> all)
CommandResult doAuthenticate(MongoCredential credentials)
doAuthenticate in class DBboolean isServerVersionAtLeast(java.util.List<java.lang.Integer> versionList)
void addDeadCursor(DBApiLayer.DeadCursor deadCursor)