ch.agent.crnickl.mongodb
Class WriteMethodsForProperty
java.lang.Object
ch.agent.crnickl.impl.DatabaseMethodsImpl
ch.agent.crnickl.mongodb.MongoDatabaseMethods
ch.agent.crnickl.mongodb.ReadMethodsForProperty
ch.agent.crnickl.mongodb.WriteMethodsForProperty
- All Implemented Interfaces:
- ch.agent.crnickl.impl.DatabaseMethods, ch.agent.crnickl.impl.PermissionChecker
public class WriteMethodsForProperty
- extends ReadMethodsForProperty
A stateless object with methods providing write access to properties.
A property in MongoDB is stored as:
{ _id : OID,
name : STRING,
type : OID,
indexed : BOOLEAN
}
The type field identifies the value type.
- Author:
- Jean-Paul Vetterli
|
Method Summary |
|
createProperty(ch.agent.crnickl.api.Property<T> prop)
Create a new property and return its key. |
|
deleteProperty(ch.agent.crnickl.api.Property<T> prop,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
Delete the property. |
void |
updateProperty(ch.agent.crnickl.api.Property<?> prop,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
Update the name of the property. |
| Methods inherited from class ch.agent.crnickl.mongodb.MongoDatabaseMethods |
addOperation, asQuery, compositeName, extractRegexp, getId, getId, getIdOrZero, getMongoDB, getMongoDB, getMongoDB, getObject, getObjectId, makeSurrogate, mongoObject, operation |
| 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 |
WriteMethodsForProperty
public WriteMethodsForProperty()
createProperty
public <T> void createProperty(ch.agent.crnickl.api.Property<T> prop)
throws ch.agent.crnickl.T2DBException
- Create a new property and return its key.
If creation fails throw an exception.
- Parameters:
prop - a property
- Throws:
ch.agent.crnickl.T2DBException
deleteProperty
public <T> void deleteProperty(ch.agent.crnickl.api.Property<T> prop,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
throws ch.agent.crnickl.T2DBException
- Delete the property.
If deleting fails throw an exception.
- Parameters:
prop - a propertypolicy - a schema updating policy
- Throws:
ch.agent.crnickl.T2DBException
updateProperty
public void updateProperty(ch.agent.crnickl.api.Property<?> prop,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
throws ch.agent.crnickl.T2DBException
- Update the name of the property.
If updating fails throw an exception.
- Parameters:
prop - a propertypolicy - a schema updating policy
- Throws:
ch.agent.crnickl.T2DBException
Copyright © 2013. All Rights Reserved.