| java.lang.Object org.griphyn.vdl.dbschema.DatabaseSchema org.griphyn.vdl.dbschema.NXDSchema
NXDSchema | public class NXDSchema extends DatabaseSchema implements XDC(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 $ |
Constructor Summary | |
public | NXDSchema(String dbDriver) Default constructor for the NXD schema. |
Method Summary | |
public boolean | cachingMakesSense() pass-thru to driver.
true, if it is feasible to cache results from the driverfalse, if requerying the driver is sufficiently fast (e.g. | public void | close() | public boolean | containsDefinition(Definition definition) Search the database for the existence of a definition. | public boolean | deleteAnnotation(String primary, Object secondary, int kind, String key) Deletes an annotation with the specified key.
Parameters: primary - is the primary object specifier for the class. | public boolean | deleteAnnotationCall(String fqdi, int index, String key) Deletes a specific key for a call statement. | public boolean | deleteAnnotationDeclare(String fqdi, String farg, String key) Deletes a specific key in an annotated formal argument. | public boolean | deleteAnnotationDerivation(String fqdi, String key) Deletes a specific key in an annotated derivation. | public boolean | deleteAnnotationFilename(String filename, String key) Deletes a specific key in an annotated filename. | public boolean | deleteAnnotationTransformation(String fqdi, String key) Deletes a specific key in an annotated transformation. | 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. | public java.util.List | deleteDefinitionEx(String namespace, String name, String version, int type) Delete one or more definitions from the backend database. | public XMLResource | findAnnotation(String xquery) Searches the database for annotations that satisfies a certain query. | public java.util.List | getFQDNList(int type) Searches the database for a list of fully-qualified names of
the definitions sorted in ascending order.
Parameters: type - type of definition, see below, or -1 for both. | public java.util.List | getNamespaceList(int type) Searches the database for a list of namespaces of the definitions
Sorted in ascending order. | public Tuple | loadAnnotation(String primary, Object secondary, int kind, String key) Retrieves a specific annotation from an annotatable classes with
the specified tuple. | public java.util.List | loadAnnotation(String primary, Object secondary, int kind) Retrieves all annotations from an annotatable classes with
the specified tuple. | public Tuple | loadAnnotationCall(String fqdi, int index, String key) Obtains the value to a specific key for a call statement. | public java.util.List | loadAnnotationCall(String fqdi, int index) Lists all annotations for a call statement.
Parameters: fqdi - is the FQDI of the transformation Parameters: index - is the number of the call to annotate. | public Tuple | loadAnnotationDeclare(String fqdi, String farg, String key) Obtains the value to a specific key in an annotated formal argument. | public java.util.List | loadAnnotationDeclare(String fqdi, String farg) Lists all annotations for a formal argument. | public Tuple | loadAnnotationDerivation(String fqdi, String key) Obtains the value to a specific key in an annotated derivation. | public java.util.List | loadAnnotationDerivation(String fqdi) Lists all annotations for a derivation. | public Tuple | loadAnnotationFilename(String filename, String key) Obtains the value to a specific key in an annotated filename. | public java.util.List | loadAnnotationFilename(String filename) Lists all annotations for a logical filename.
Parameters: filename - is the logical filename. | protected Tuple | loadAnnotationResource(XMLResource res) | public Tuple | loadAnnotationTransformation(String fqdi, String key) Obtains the value to a specific key in an annotated transformation. | public java.util.List | loadAnnotationTransformation(String fqdi) Lists all annotations for a transformation. | 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 long | saveAnnotation(String primary, Object secondary, int kind, Tuple annotation, boolean overwrite) Annotates any of the annotatable classes with the specified tuple.
This is an interface method to the various class-specific methods.
Parameters: primary - is the primary object specifier for the class. | public long | saveAnnotationCall(String fqdi, int index, Tuple annotation, boolean overwrite) Annotates a transformation call with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: index - is the number of the call to annotate. Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. | public long | saveAnnotationDeclare(String fqdi, String formalname, Tuple annotation, boolean overwrite) Annotates a transformation argument with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: formalname - is the name of the formal argument to annotoate. Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. | public long | saveAnnotationDerivation(String fqdi, Tuple annotation, boolean overwrite) Annotates a derivation with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. | public long | saveAnnotationFilename(String filename, Tuple annotation, boolean overwrite) Annotates a logical filename with a tuple.
Parameters: filename - is the FQDI to annotate Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. | public long | saveAnnotationTransformation(String fqdi, Tuple annotation, boolean overwrite) Annotates a transformation with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. | 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 | searchAnnotation(int kind, Object arg, QueryTree tree) Search for LFNs or Definitions that has certain annotations
Parameters: kind - defines the kind/class of object annotated. Parameters: arg - is used only for TR ARG and TR CALL. | 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 | searchDefinition(String xquery) Searches the database for all derivations that satisfies a certain query. | public java.util.List | searchDefinitionEx(String namespace, String name, String version, int type) Searches the database for definitions by ns::name:version triple
and by type (either Transformation or Derivation). | public java.util.List | searchElements(String xquery) Searches the database for elements that satisfies a certain query. | public java.util.List | searchFilename(String lfn, int link) | public java.util.List | searchLFN(String lfn, int link) Searches the database for all LFNs that match a certain pattern.
The linkage is an additional constraint. |
m_cache | protected Cache m_cache(Code) | | A cache for definitions to avoid reloading from the database.
|
m_db | protected Collection m_db(Code) | | reference to collection '/db/vdc';
|
m_dbColService | protected CollectionManagementService m_dbColService(Code) | | |
m_dbQrySvc | protected XPathQueryService m_dbQrySvc(Code) | | |
m_meta | protected Collection m_meta(Code) | | |
m_metaQrySvc | protected XPathQueryService m_metaQrySvc(Code) | | |
m_vdc | protected Collection m_vdc(Code) | | |
m_vdcColService | protected CollectionManagementService m_vdcColService(Code) | | |
m_vdcQrySvc | protected XPathQueryService m_vdcQrySvc(Code) | | |
m_xupdQrySvc | protected XUpdateQueryService m_xupdQrySvc(Code) | | |
cachingMakesSense | public boolean cachingMakesSense()(Code) | | pass-thru to driver.
true, if it is feasible to cache results from the driverfalse, if requerying the driver is sufficiently fast (e.g. driveris in main memory, or driver does caching itself). |
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 |
deleteAnnotation | public boolean deleteAnnotation(String primary, Object secondary, int kind, String key) throws SQLException, IllegalArgumentException(Code) | | Deletes an annotation with the specified key.
Parameters: primary - is the primary object specifier for the class. According to the type, this is either the FQDI, or the filename. Parameters: secondary - is a helper argument for annotations to callsand formal arguments, and should be null for all other classes.For calls, the argument must be packed into java.lang.Integer. Parameters: kind - defines the kind/class of object to annotate. Parameters: key - is the annotation key. true, if the database was modified, false otherwise. exception: SQLException - , if something went wrong during databaseaccess. |
deleteAnnotationCall | public boolean deleteAnnotationCall(String fqdi, int index, String key) throws SQLException, IllegalArgumentException(Code) | | Deletes a specific key for a call statement.
Parameters: fqdi - is the FQDI of the transformation Parameters: index - is the number of the call to annotate. Parameters: key - is the key to search for true, if the database was modified, false otherwise. See Also: org.griphyn.vdl.classes.Call |
findAnnotation | public XMLResource findAnnotation(String xquery) throws SQLException(Code) | | Searches the database for annotations that satisfies a certain query.
Parameters: xquery - the query statement true if found, false otherwise |
loadAnnotation | public Tuple loadAnnotation(String primary, Object secondary, int kind, String key) throws SQLException, IllegalArgumentException(Code) | | Retrieves a specific annotation from an annotatable classes with
the specified tuple. This is an interface method to the various
class-specific methods.
Parameters: primary - is the primary object specifier for the class. According to the type, this is either the FQDI, or the filename. Parameters: secondary - is a helper argument for annotations to callsand formal arguments, and should be null for all other classes.For calls, the argument must be packed into java.lang.Integer. Parameters: kind - defines the kind/class of object to annotate. Parameters: key - is the key to look for. null if not found, otherwise the annotation tuple. See Also: NXDSchema.loadAnnotationTransformation(String,String) See Also: NXDSchema.loadAnnotationDerivation(String,String) See Also: NXDSchema.loadAnnotationCall(String,int,String) See Also: NXDSchema.loadAnnotationDeclare(String,String,String) See Also: NXDSchema.loadAnnotationFilename(String,String) |
loadAnnotation | public java.util.List loadAnnotation(String primary, Object secondary, int kind) throws SQLException, IllegalArgumentException(Code) | | Retrieves all annotations from an annotatable classes with
the specified tuple. This is an interface method to the various
class-specific methods.
Parameters: primary - is the primary object specifier for the class. According to the type, this is either the FQDI, or the filename. Parameters: secondary - is a helper argument for annotations to callsand formal arguments, and should be null for all other classes.For calls, the argument must be packed into java.lang.Integer. Parameters: kind - defines the kind/class of object to annotate. null if not found, otherwise the annotation tuple. See Also: NXDSchema.loadAnnotationTransformation(String) See Also: NXDSchema.loadAnnotationDerivation(String) See Also: NXDSchema.loadAnnotationCall(String,int) See Also: NXDSchema.loadAnnotationDeclare(String,String) See Also: NXDSchema.loadAnnotationFilename(String) |
loadAnnotationResource | protected Tuple loadAnnotationResource(XMLResource res) throws SQLException(Code) | | get the annotation from a XML resource
|
saveAnnotation | public long saveAnnotation(String primary, Object secondary, int kind, Tuple annotation, boolean overwrite) throws SQLException, IllegalArgumentException(Code) | | Annotates any of the annotatable classes with the specified tuple.
This is an interface method to the various class-specific methods.
Parameters: primary - is the primary object specifier for the class. According to the type, this is either the FQDI, or the filename. Parameters: secondary - is a helper argument for annotations to callsand formal arguments, and should be null for all other classes.For calls, the argument must be packed into java.lang.Integer. Parameters: kind - defines the kind/class of object to annotate. Parameters: annotation - is the value to place into the class. Parameters: overwrite - is a predicate on replace or maintain. the insertion id, or -1, if the database was untouched See Also: NXDSchema.saveAnnotationTransformation(String,Tuple,boolean) See Also: NXDSchema.saveAnnotationDerivation(String,Tuple,boolean) See Also: NXDSchema.saveAnnotationCall(String,int,Tuple,boolean) See Also: NXDSchema.saveAnnotationDeclare(String,String,Tuple,boolean) See Also: NXDSchema.saveAnnotationFilename(String,Tuple,boolean) |
saveAnnotationCall | public long saveAnnotationCall(String fqdi, int index, Tuple annotation, boolean overwrite) throws SQLException, IllegalArgumentException(Code) | | Annotates a transformation call with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: index - is the number of the call to annotate. Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. the insertion id, or -1, if the database was untouched See Also: org.griphyn.vdl.classes.Call |
saveAnnotationDeclare | public long saveAnnotationDeclare(String fqdi, String formalname, Tuple annotation, boolean overwrite) throws SQLException, IllegalArgumentException(Code) | | Annotates a transformation argument with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: formalname - is the name of the formal argument to annotoate. Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. the insertion id, or -1, if the database was untouched See Also: org.griphyn.vdl.classes.Declare |
saveAnnotationDerivation | public long saveAnnotationDerivation(String fqdi, Tuple annotation, boolean overwrite) throws SQLException, IllegalArgumentException(Code) | | Annotates a derivation with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. the insertion id, or -1, if the database was untouched See Also: org.griphyn.vdl.classes.Derivation |
saveAnnotationFilename | public long saveAnnotationFilename(String filename, Tuple annotation, boolean overwrite) throws SQLException, IllegalArgumentException(Code) | | Annotates a logical filename with a tuple.
Parameters: filename - is the FQDI to annotate Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. the insertion id, or -1, if the database was untouched See Also: org.griphyn.vdl.classes.LFN |
saveAnnotationTransformation | public long saveAnnotationTransformation(String fqdi, Tuple annotation, boolean overwrite) throws SQLException, IllegalArgumentException(Code) | | Annotates a transformation with a tuple.
Parameters: fqdi - is the FQDI to annotate Parameters: annotation - is the value to place Parameters: overwrite - is a predicate on replace or maintain. the insertion id, or -1, if the database was untouched See Also: org.griphyn.vdl.classes.Transformation |
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: NXDSchema.loadDefinition(String,String,String,int) |
searchAnnotation | public java.util.List searchAnnotation(int kind, Object arg, QueryTree tree) throws SQLException(Code) | | Search for LFNs or Definitions that has certain annotations
Parameters: kind - defines the kind/class of object annotated. Parameters: arg - is used only for TR ARG and TR CALL. For the formerit is the name of the argument (String), for the latter the position of the call (Integer). Parameters: tree - stores the query tree to query the annotation a list of LFNs if search for filenames, otherwise a list ofdefinitions. exception: SQLException - if something goes wrong with the database. See Also: org.griphyn.vdl.annotation.QueryTree |
searchDefinition | public java.util.List searchDefinition(String xquery) throws SQLException(Code) | | Searches the database for all derivations that satisfies a certain query.
Parameters: xquery - the query statement a list of definitions |
searchDefinitionEx | public java.util.List searchDefinitionEx(String namespace, String name, String version, int type) throws SQLException(Code) | | Searches the database for definitions by ns::name:version triple
and by type (either Transformation or Derivation). This version of
the search allows for jokers expressed as null value
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 - type of definition, see below, or -1 as wildcard a list of Definition items, which may be empty See Also: org.griphyn.vdl.classes.Definition.TRANSFORMATION See Also: org.griphyn.vdl.classes.Definition.DERIVATION See Also: NXDSchema.loadDefinition(String,String,String,int) |
searchElements | public java.util.List searchElements(String xquery) throws SQLException(Code) | | Searches the database for elements that satisfies a certain query.
Parameters: xquery - the query statement a list of string |
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)
|
|
|