| java.lang.Object org.griphyn.vdl.dbschema.DatabaseSchema org.griphyn.vdl.dbschema.ChunkSchema
ChunkSchema | public class ChunkSchema extends DatabaseSchema implements VDC(Code) | | This class provides basic functionalities to interact with the
backend database, such as insertion, deletion, and search of
entities in the VDC.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ |
Field Summary | |
final protected static String[] | c_lfn_names Name of the four parameter tables in human readable format. | protected Cache | m_cache A cache for definitions to avoid reloading from the database. | protected boolean | m_deferDeleteCommit Communication between saveDefinition and deleteDefinition in
update mode. |
Constructor Summary | |
public | ChunkSchema(String dbDriverName) Default constructor for the "chunk" schema. |
Method Summary | |
public boolean | containsDefinition(Definition definition) Search the database for the existence of a definition. | public boolean | deleteDefinition(Definition definition) Delete a specific Definition objects from the database. | public java.util.List | deleteDefinition(String namespace, String name, String version, int type) Delete Definition objects from the database. | protected Long | getDefinitionId(Definition d) Obtains the primary key id for a given definition. | protected java.util.List | getDefinitionId(String namespace, String name, String version, int type) Obtains the list of primary key ids for a matching definitions.
This method allows for wildcards in the usual fashion. | public Definition | loadDefinition(String namespace, String name, String version, int type) Loads a single Definition from the backend database into an Java object.
This method does not allow wildcarding!
Parameters: namespace - namespace, null will be converted into empty string Parameters: name - name, null will be converted into empty string Parameters: version - version, null will be converted into empty string Parameters: type - type of the definition (TR or DV), must not be -1. | public boolean | saveDefinition(Definition definition, boolean overwrite) Saves a Definition, that is either a Transformation or Derivation,
into the backend database. | public java.util.List | searchDefinition(String namespace, String name, String version, int type) Search the database for definitions by ns::name:version triple
and by type (either Transformation or Derivation). | public java.util.List | searchFilename(String lfn, int link) Searches the database for all derivations that contain a certain LFN.
The linkage is an additional constraint. |
c_lfn_names | final protected static String[] c_lfn_names(Code) | | Name of the four parameter tables in human readable format.
|
m_cache | protected Cache m_cache(Code) | | A cache for definitions to avoid reloading from the database.
|
m_deferDeleteCommit | protected boolean m_deferDeleteCommit(Code) | | Communication between saveDefinition and deleteDefinition in
update mode.
|
containsDefinition | public boolean containsDefinition(Definition definition) throws SQLException(Code) | | Search the database for the existence of a definition.
Parameters: definition - the definition object to search for true, if the definition exists, false if not found |
deleteDefinition | public java.util.List deleteDefinition(String namespace, String name, String version, int type) throws SQLException(Code) | | Delete Definition objects from the database. This method allows for
wildcards in the usual fashion. Use null for strings as wildcards,
and -1 for the type wildcard. For efficiency reasons, this method
will return an empty list.
Parameters: namespace - namespace, null to match any namespace Parameters: name - name, null to match any name Parameters: version - version, null to match any version Parameters: type - definition type (TR or DV) a list containing all Definitions that were deleted See Also: org.griphyn.vdl.classes.Definition.TRANSFORMATION See Also: org.griphyn.vdl.classes.Definition.DERIVATION See Also: |
saveDefinition | public boolean saveDefinition(Definition definition, boolean overwrite) throws SQLException(Code) | | Saves a Definition, that is either a Transformation or Derivation,
into the backend database. This method, of course, does not allow
wildcarding. The definition has to be completely specified and
valid.
Parameters: definition - is the new Definition to store. Parameters: overwrite - true, if existing defitions will be overwritten bynew ones with the same primary (or secondary) key (-set), or false,if a new definition will be rejected on key matches. true, if the backend database was changed, orfalse, if the definition was not accepted into the backend. See Also: org.griphyn.vdl.classes.Definition See Also: org.griphyn.vdl.classes.Transformation See Also: org.griphyn.vdl.classes.Derivation See Also: ChunkSchema.loadDefinition(String,String,String,int) |
Methods inherited from org.griphyn.vdl.dbschema.DatabaseSchema | public boolean cachingMakesSense()(Code)(Java Doc) public void close() throws SQLException(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public static DatabaseSchema loadSchema(String dbSchemaName, String propertyPrefix, Object[] arguments) throws ClassNotFoundException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException(Code)(Java Doc) public static DatabaseSchema loadSchema(String propertyPrefix) throws ClassNotFoundException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException(Code)(Java Doc) protected void longOrNull(PreparedStatement ps, int pos, long l) throws SQLException(Code)(Java Doc) protected String makeNotNull(String s)(Code)(Java Doc) protected void stringOrNull(PreparedStatement ps, int pos, String s) throws SQLException(Code)(Java Doc)
|
|
|