ch.agent.crnickl.mongodb
Class WriteMethodsForValueType

java.lang.Object
  extended by ch.agent.crnickl.impl.DatabaseMethodsImpl
      extended by ch.agent.crnickl.mongodb.MongoDatabaseMethods
          extended by ch.agent.crnickl.mongodb.WriteMethodsForValueType
All Implemented Interfaces:
ch.agent.crnickl.impl.DatabaseMethods, ch.agent.crnickl.impl.PermissionChecker

public class WriteMethodsForValueType
extends MongoDatabaseMethods

A stateless object with methods providing write access to value types.

A value type in MongoDB is stored as:


 { _id : OID, 
   name : STRING, 
   type : STRING, 
   values? : { 
      STRING : STRING, ... 
    } 
 }
 
The values field exists only in restricted value types.

Author:
Jean-Paul Vetterli

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.agent.crnickl.mongodb.MongoDatabaseMethods
MongoDatabaseMethods.Operator
 
Constructor Summary
WriteMethodsForValueType()
           
 
Method Summary
<T> void
createValueType(ch.agent.crnickl.api.ValueType<T> vt)
          Create a value type in the database.
<T> void
deleteValueType(ch.agent.crnickl.api.ValueType<T> vt, ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
          Delete a value type from the database.
<T> void
updateValueType(ch.agent.crnickl.api.ValueType<T> vt, ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
          Update a value type in the database.
 
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
 

Constructor Detail

WriteMethodsForValueType

public WriteMethodsForValueType()
Method Detail

createValueType

public <T> void createValueType(ch.agent.crnickl.api.ValueType<T> vt)
                     throws ch.agent.crnickl.T2DBException
Create a value type in the database. Throw an exception if the operation fails.

Parameters:
vt - a value type
Throws:
ch.agent.crnickl.T2DBException

deleteValueType

public <T> void deleteValueType(ch.agent.crnickl.api.ValueType<T> vt,
                                ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
                     throws ch.agent.crnickl.T2DBException
Delete a value type from the database. Throw an exception if the operation fails.

Parameters:
vt - a value type
policy - a schema udpdating policy
Throws:
ch.agent.crnickl.T2DBException

updateValueType

public <T> void updateValueType(ch.agent.crnickl.api.ValueType<T> vt,
                                ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
                     throws ch.agent.crnickl.T2DBException
Update a value type in the database. Throw an exception if the operation cannot be done. Updating a value type is an expensive operation, because in case

Parameters:
vt - a value type
policy - a schema udpdating policy
Throws:
ch.agent.crnickl.T2DBException


Copyright © 2013. All Rights Reserved.