com.mongodb
Class DBApiLayer

java.lang.Object
  extended by com.mongodb.DB
      extended by com.mongodb.DBApiLayer

public class DBApiLayer
extends DB

Database API This cannot be directly instantiated, but the functions are available through instances of Mongo.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.mongodb.DB
DB.WriteConcern
 
Field Summary
 
Fields inherited from class com.mongodb.DB
_readOnly
 
Constructor Summary
protected DBApiLayer(String root, DBConnector connector)
           
 
Method Summary
protected  com.mongodb.DBApiLayer.MyCollection doGetCollection(String name)
           
 DBCollection getCollectionFromFull(String fullNameSpace)
          Get a collection from a <databaseName>.<collectionName>.
 DB getSisterDB(String dbName)
           
 void requestDone()
           
 void requestEnsureConnection()
           
 void requestStart()
           
 
Methods inherited from class com.mongodb.DB
addUser, authenticate, collectionExists, command, command, createCollection, doEval, dropDatabase, eval, forceError, getCollection, getCollectionFromString, getCollectionNames, getLastError, getName, getPreviousError, getWriteConcern, resetError, resetIndexCache, setReadOnly, setWriteConcern, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBApiLayer

protected DBApiLayer(String root,
                     DBConnector connector)
Method Detail

requestStart

public void requestStart()
Specified by:
requestStart in class DB

requestDone

public void requestDone()
Specified by:
requestDone in class DB

requestEnsureConnection

public void requestEnsureConnection()
Specified by:
requestEnsureConnection in class DB

doGetCollection

protected com.mongodb.DBApiLayer.MyCollection doGetCollection(String name)
Specified by:
doGetCollection in class DB

getCollectionFromFull

public DBCollection getCollectionFromFull(String fullNameSpace)
Get a collection from a <databaseName>.<collectionName>. If fullNameSpace does not contain any "."s, this will find a collection called fullNameSpace and return it. Otherwise, it will find the collecton collectionName and return it.

Specified by:
getCollectionFromFull in class DB
Parameters:
fullNameSpace - the full name to find
Returns:
the collection
Throws:
RuntimeException - if the database named is not this database

getSisterDB

public DB getSisterDB(String dbName)
Specified by:
getSisterDB in class DB