ch.agent.crnickl.jdbc
Class WriteMethodsForSchema

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

public class WriteMethodsForSchema
extends ReadMethodsForSchema

A stateless object with methods providing write access to schemas.

Author:
Jean-Paul Vetterli

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.agent.crnickl.jdbc.ReadMethodsForSchema
ReadMethodsForSchema.RawSchema
 
Constructor Summary
WriteMethodsForSchema()
           
 
Method Summary
 void createSchema(ch.agent.crnickl.api.UpdatableSchema schema)
          Create an empty schema in the database.
 void deleteSchema(ch.agent.crnickl.api.UpdatableSchema schema)
          Delete a schema from the database.
 ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.Property<?> property, ch.agent.crnickl.api.Schema schema)
          Find a chronicle with an explicit attribute value for a given property and schema.
 ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.Schema schema)
          Find a chronicle referencing the schema.
 ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.SeriesDefinition ss, ch.agent.crnickl.api.Schema schema)
          Find a chronicle depending one a given series in a schema.
 boolean updateSchema(ch.agent.crnickl.api.UpdatableSchema schema)
          Update the schema in the database.
 
Methods inherited from class ch.agent.crnickl.jdbc.ReadMethodsForSchema
getRawSchema, getSchema, getSchemaSurrogateList
 
Methods inherited from class ch.agent.crnickl.jdbc.JDBCDatabaseMethods
close, executeAndGetNewId, getId, getId, getIdOrZero, makeSurrogate, open, open, open
 
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

WriteMethodsForSchema

public WriteMethodsForSchema()
Method Detail

createSchema

public void createSchema(ch.agent.crnickl.api.UpdatableSchema schema)
                  throws ch.agent.crnickl.T2DBException
Create an empty schema in the database. Throw an exception if the operation cannot be done.

Parameters:
schema - a schema
Throws:
ch.agent.crnickl.T2DBException

deleteSchema

public void deleteSchema(ch.agent.crnickl.api.UpdatableSchema schema)
                  throws ch.agent.crnickl.T2DBException
Delete a schema from the database. Throw an exception if the operation fails.

Parameters:
schema - a schema
Throws:
ch.agent.crnickl.T2DBException

updateSchema

public boolean updateSchema(ch.agent.crnickl.api.UpdatableSchema schema)
                     throws ch.agent.crnickl.T2DBException
Update the schema in the database. Throw an exception if the operation cannot be done.

Parameters:
schema - a schema
Returns:
true if the schema was updated
Throws:
ch.agent.crnickl.T2DBException

findChronicle

public ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.Schema schema)
                                             throws ch.agent.crnickl.T2DBException
Find a chronicle referencing the schema. This looks like a "reading" method but is used in the context of schema updating.

Parameters:
schema - a schema
Returns:
a chronicle surrogate or null
Throws:
ch.agent.crnickl.T2DBException

findChronicle

public ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.Property<?> property,
                                                    ch.agent.crnickl.api.Schema schema)
                                             throws ch.agent.crnickl.T2DBException
Find a chronicle with an explicit attribute value for a given property and schema. This looks like a "reading" method but is used in the context of schema updating.

Parameters:
property - a property
schema - a schema
Returns:
a surrogate or null
Throws:
ch.agent.crnickl.T2DBException

findChronicle

public ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.SeriesDefinition ss,
                                                    ch.agent.crnickl.api.Schema schema)
                                             throws ch.agent.crnickl.T2DBException
Find a chronicle depending one a given series in a schema. This looks like a "reading" method but is used in the context of schema updating.

Parameters:
ss - a series definition
schema - a schema
Returns:
a surrogate or null
Throws:
ch.agent.crnickl.T2DBException


Copyright © 2013. All Rights Reserved.