|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectch.agent.crnickl.impl.DatabaseMethodsImpl
ch.agent.crnickl.mongodb.MongoDatabaseMethods
public class MongoDatabaseMethods
| Nested Class Summary | |
|---|---|
static class |
MongoDatabaseMethods.Operator
|
| Constructor Summary | |
|---|---|
MongoDatabaseMethods()
|
|
| Method Summary | ||
|---|---|---|
protected void |
addOperation(com.mongodb.DBObject operation,
MongoDatabaseMethods.Operator op,
Object... arg)
Add an update operation to a DBObject. |
|
protected
|
asQuery(ch.agent.crnickl.api.DBObjectId id)
|
|
protected String |
compositeName(String... names)
Return a composite mongodb identifier. |
|
protected String |
extractRegexp(String pattern)
Remove enclosing slashes from the input pattern. |
|
protected org.bson.types.ObjectId |
getId(ch.agent.crnickl.api.DBObject dBObject)
Return the internal ID of a database object. |
|
org.bson.types.ObjectId |
getId(ch.agent.crnickl.api.Surrogate surrogate)
Extract the internal ID of a database object from its surrogate. |
|
org.bson.types.ObjectId |
getIdOrZero(ch.agent.crnickl.api.DBObject dBObject)
Return the internal ID of a database object or 0 if the object is null or is in construction. |
|
MongoDB |
getMongoDB(ch.agent.crnickl.api.Database db)
|
|
MongoDB |
getMongoDB(ch.agent.crnickl.api.DBObject dbObj)
|
|
MongoDB |
getMongoDB(ch.agent.crnickl.api.Surrogate surr)
|
|
com.mongodb.DBObject |
getObject(ch.agent.crnickl.api.Surrogate s,
boolean mustExist)
Return the MongoDB database object corresponding to a surrogate. |
|
org.bson.types.ObjectId |
getObjectId(com.mongodb.BasicDBObject bdo)
|
|
ch.agent.crnickl.api.Surrogate |
makeSurrogate(ch.agent.crnickl.api.Database db,
ch.agent.crnickl.api.DBObjectType dot,
org.bson.types.ObjectId id)
Create a surrogate for a database object. |
|
protected com.mongodb.DBObject |
mongoObject(Object... arg)
Return an array of key-value pairs as a DBObject. |
|
protected com.mongodb.DBObject |
operation(MongoDatabaseMethods.Operator op,
Object... arg)
Return a com.mongodb.DbObject representing an operation object for an operator and list of arguments. |
|
| Methods inherited from class ch.agent.crnickl.impl.DatabaseMethodsImpl |
|---|
check, check, check, check, checkIntegrity, makeSurrogate, makeSurrogate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MongoDatabaseMethods()
| Method Detail |
|---|
public MongoDB getMongoDB(ch.agent.crnickl.api.Database db)
public MongoDB getMongoDB(ch.agent.crnickl.api.DBObject dbObj)
public MongoDB getMongoDB(ch.agent.crnickl.api.Surrogate surr)
public com.mongodb.DBObject getObject(ch.agent.crnickl.api.Surrogate s,
boolean mustExist)
throws ch.agent.crnickl.T2DBException
mustExist is false the method returns null if the object cannot be found,
else an exception is thrown.
s - a surrogatemustExist - if true throw an exception when the object cannot be found
ch.agent.crnickl.T2DBExceptionpublic org.bson.types.ObjectId getObjectId(com.mongodb.BasicDBObject bdo)
bdo - a BasicDBObject
ObjectIdpublic org.bson.types.ObjectId getIdOrZero(ch.agent.crnickl.api.DBObject dBObject)
This method is for use inside the MongoDB implementation
and its argument must have a DBObjectId implemented
by MongoDBObjectId.
dBObject - a database object or null
protected org.bson.types.ObjectId getId(ch.agent.crnickl.api.DBObject dBObject)
This method is for use inside the MongoDB implementation
and its argument must have a DBObjectId implemented
by MongoDBObjectId.
dBObject - a non-null database object
public org.bson.types.ObjectId getId(ch.agent.crnickl.api.Surrogate surrogate)
This method is for use inside the MongoDB implementation
and its argument must have a DBObjectId implemented
by MongoDBObjectId.
surrogate - the surrogate of a database object
public ch.agent.crnickl.api.Surrogate makeSurrogate(ch.agent.crnickl.api.Database db,
ch.agent.crnickl.api.DBObjectType dot,
org.bson.types.ObjectId id)
db - the database of the objectdot - the type of the objectid - the internal ID of the database object
protected <T> com.mongodb.DBObject asQuery(ch.agent.crnickl.api.DBObjectId id)
throws ch.agent.crnickl.T2DBException
ch.agent.crnickl.T2DBExceptionprotected String extractRegexp(String pattern)
pattern -
protected void addOperation(com.mongodb.DBObject operation,
MongoDatabaseMethods.Operator op,
Object... arg)
mongoObject(Object...) for restrictions on the list of arguments.
operation - the operation objectop - the operatorarg - the list of arguments
IllegalArgumentException
protected com.mongodb.DBObject operation(MongoDatabaseMethods.Operator op,
Object... arg)
mongoObject(Object...) for
restrictions on the list of arguments.
op - the operatorarg - the list of arguments
IllegalArgumentExceptionprotected com.mongodb.DBObject mongoObject(Object... arg)
arg - an non-empty array of arguments of even length
IllegalArgumentExceptionprotected String compositeName(String... names)
names - series of zero or more names
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||