ch.agent.crnickl.jdbc
Class WriteMethodsForValueType

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

public class WriteMethodsForValueType
extends JDBCDatabaseMethods

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

Version:
1.0.0
Author:
Jean-Paul Vetterli

Constructor Summary
WriteMethodsForValueType()
           
 
Method Summary
 void createValueType(ch.agent.crnickl.api.ValueType<?> vt)
          Create a value type in the database.
 void deleteValueType(ch.agent.crnickl.api.ValueType<?> vt)
          Delete a value type from the database.
 void updateValueType(ch.agent.crnickl.api.ValueType<?> vt)
          Update a value type in the database.
<T> void
updateValueType(ch.agent.crnickl.api.ValueType<T> vt, Map<T,String> added, Map<T,String> edited, Set<T> deleted)
          Add new values to the value type or update the description of existing values.
 
Methods inherited from class ch.agent.crnickl.jdbc.JDBCDatabaseMethods
close, executeAndGetNewId, open, open, open
 
Methods inherited from class ch.agent.crnickl.impl.DatabaseMethodsImpl
check, check, check, check, getId, getId, getIdOrZero, 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 void createValueType(ch.agent.crnickl.api.ValueType<?> vt)
                     throws ch.agent.crnickl.T2DBException
Create a value type in the database. Throw an exception if the operation cannot be done.

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

deleteValueType

public void deleteValueType(ch.agent.crnickl.api.ValueType<?> vt)
                     throws ch.agent.crnickl.T2DBException
Delete a value type from the database. Throw an exception if the operation cannot be done.

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

updateValueType

public void updateValueType(ch.agent.crnickl.api.ValueType<?> vt)
                     throws ch.agent.crnickl.T2DBException
Update a value type in the database. Throw an exception if the operation cannot be done.

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

updateValueType

public <T> void updateValueType(ch.agent.crnickl.api.ValueType<T> vt,
                                Map<T,String> added,
                                Map<T,String> edited,
                                Set<T> deleted)
                     throws ch.agent.crnickl.T2DBException
Add new values to the value type or update the description of existing values. The maps passed as parameter can be empty but cannot be null. Throw an exception if the operation cannot be done.

Parameters:
vt - a value type
added - a map of values to add and their descriptions
edited - a map of values to modify and their descriptions
deleted - a set of values to delete
Throws:
ch.agent.crnickl.T2DBException


Copyright © 2012. All Rights Reserved.