|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.MDR
public class MDR
Properties used from the MDR data source
SQLDelime | String used to seperate multi-statement SQL strings, defaults to a semicolon at the end of its line | Optional |
TestDB | SQL Query to assert existence of repository | Required |
Field Summary | |
---|---|
private static java.lang.String[][] |
commandHelp
|
private static java.util.HashMap |
constructPropertyName
|
static java.lang.String |
MDR_DataSourceName
|
(package private) static int |
queryCount
|
static java.lang.String |
userName
|
Constructor Summary | |
---|---|
MDR()
|
Method Summary | |
---|---|
static void |
cidExists(int cid)
Checks if a particular construct identifier (CID) exists in the MDR. |
static int |
createConstruct(int mid,
java.lang.String name,
int constructClass,
boolean isRoot)
Creates a new construct for a modelling language |
static void |
createConstructConstraint(int cid,
java.lang.String cname,
java.lang.String def)
Create a new construct constraint |
static int |
createConstructScheme(int cid,
int type,
int argCID,
boolean isKey,
int HDMType,
int lowerBound,
int upperBound)
Creates a new constructScheme argument for a construct |
static int |
createModel(java.lang.String name)
Creates a new data modelling language which can then have constructs added. |
static int |
createType(int modelID,
java.lang.String typeName,
int hdmEquiv,
int parentType)
Create a new record in type hierarchy table |
static java.util.Vector |
executeQuery(java.lang.String sql)
Execute a SQL query on the repository, and return the result in a Vector |
private static java.lang.Object |
executeStatement(java.lang.String sql,
boolean feedback,
java.lang.Class expectedClass)
|
static int |
executeUpdate(java.lang.String sql)
Execute a SQL update on the repository. |
static DBResultSet |
getAllTypes(int mid)
Get the complete rows of TypeHierarchy objects. |
static int |
getConstructClass(int cid)
|
static java.lang.String |
getConstructConstraint(int cid,
java.lang.String constraint_name)
|
static DBResultSet |
getConstructConstraints(int cid)
Get all constraints associated to a construct |
static int |
getConstructMID(int cid)
Gets the Model Identifier for a given construct |
static java.lang.String |
getConstructName(int cid)
|
static java.lang.String[] |
getConstructNames(int mid)
Gets a list of all construct names for a modelling language |
static java.lang.Object |
getConstructProperty(int mid,
int cid,
java.lang.String name,
boolean textual)
|
static int[] |
getConstructs(int mid)
Get the CIDs of all constructs for a modelling language |
static int |
getConstructSchemeArgCID(int cid,
int pos)
|
static int |
getConstructSchemeCount(int cid)
Gets the count of construct scheme arguments for this construct, the number is also the highest index (argument pos) usable as the construct scheme numbering starts at 1 |
static int |
getConstructSchemeHDMType(int cid,
int pos)
|
static int |
getConstructSchemeLowerBound(int cid,
int pos)
|
static int |
getConstructSchemeType(int cid,
int pos)
|
static int |
getConstructSchemeUpperBound(int cid,
int pos)
|
static java.lang.String |
getDataSourceName()
Returns the name of the repository in the local database. |
static int |
getEquivHDMType(int tid)
|
static int[] |
getEquivHighLevelType(int tid,
int mid)
|
static java.lang.Integer |
getIntegerConstructProperty(int mid,
int cid,
java.lang.String name)
|
static java.lang.String |
getMDR_DataSourceName()
Deprecated. use getDataSourceName() instead |
static int |
getModelByName(java.lang.String name)
|
static int |
getModelForSchema(java.lang.String schemaName)
Retrieve a model for a schema |
static java.lang.String |
getModelName(int mid)
|
static java.lang.String[] |
getModelNames()
Gets a list of all modelling language names in the MDR |
static int[] |
getModels()
Gets a list of all modelling language identifiers in the MDR |
static int |
getParentType(int tid)
|
static java.lang.String |
getStringConstructProperty(int mid,
int cid,
java.lang.String name)
|
static int |
getTypeId(int mid,
java.lang.String typeName)
|
static int[] |
getTypeIds()
Get the type id of @param type_name in model @param mid |
static int |
getTypeMID(int tid)
|
static java.lang.String |
getTypeName(int tid)
|
static DBResultSet |
getTypesForModel(java.lang.String modelName)
Get the complete rows of TypeHierarchy objects for a specific Model . |
static boolean |
isConstructRoot(int cid)
|
static boolean |
isConstructSchemeKey(int cid,
int pos)
|
static void |
main(java.lang.String[] args)
Executing this class invokes this method which supplies a command line interface to the MDR. |
static void |
removeConstruct(int cid)
Remove the construct. |
static void |
removeConstructScheme(int cid,
int pos)
Remove the construct. |
static void |
removeModel(int mid)
Remove the modelling language. |
static void |
setConstructClass(int cid,
int constructClass)
|
static void |
setConstructConstraint(int cid,
java.lang.String constraint_name,
java.lang.String constraint_definition)
|
static void |
setConstructMID(int cid,
int mid)
Changes the modelling language that a construct belongs to |
static void |
setConstructName(int cid,
java.lang.String name)
|
static void |
setConstructProperty(int mid,
int cid,
java.lang.String name,
java.lang.Integer ivalue,
java.lang.String svalue)
|
static void |
setConstructRoot(int cid,
boolean isRoot)
|
static void |
setConstructSchemeArgCID(int cid,
int pos,
int argCID)
|
static void |
setConstructSchemeHDMType(int cid,
int pos,
int HDMType)
|
static void |
setConstructSchemeKey(int cid,
int pos,
boolean isKey)
|
static void |
setConstructSchemeLowerBound(int cid,
int pos,
int lowerBound)
|
static void |
setConstructSchemeType(int cid,
int pos,
int schemeType)
|
static void |
setConstructSchemeUpperBound(int cid,
int pos,
int upperBound)
|
static void |
setDataSourceName(java.lang.String str)
Sets the name of the repository in the local database. |
static void |
setHdmEquiv(int tid,
int hdmEquiv)
Update the hdmEquiv value for a given type |
static void |
setMDR_DataSourceName(java.lang.String mdr)
Deprecated. use setDataSourceName() instead |
static void |
setModelName(int mid,
java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String MDR_DataSourceName
public static java.lang.String userName
private static final java.lang.String[][] commandHelp
static int queryCount
private static java.util.HashMap constructPropertyName
Constructor Detail |
---|
public MDR()
Method Detail |
---|
public static java.lang.String getDataSourceName()
public static void setDataSourceName(java.lang.String str)
MDR
by default.
str
- the name of the repository in the local database.public static java.lang.String getMDR_DataSourceName()
getDataSourceName()
instead
public static void setMDR_DataSourceName(java.lang.String mdr)
setDataSourceName()
instead
public static void main(java.lang.String[] args)
private static java.lang.Object executeStatement(java.lang.String sql, boolean feedback, java.lang.Class expectedClass) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
java.sql.SQLException
DSRException
MDRException
java.io.IOException
public static int createModel(java.lang.String name) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
name
- The name of the modelling language
MDRException
- If the model name is already in use
java.sql.SQLException
DSRException
java.io.IOException
public static void removeModel(int mid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
mid
- The model identifier of the modelling language to remove
MDRException
- If the model with MID=mid does not exist
java.sql.SQLException
DSRException
java.io.IOException
public static int[] getModels() throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
java.sql.SQLException
DSRException
MDRException
java.io.IOException
public static int getModelByName(java.lang.String name) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
name
- The name of the modelling language. This can include
SQL wildcards, if there are more than one matches then the one
with the lowest MID will be returned
MDRException
- If the model with MID=mid does not exist
java.sql.SQLException
DSRException
java.io.IOException
public static int getModelForSchema(java.lang.String schemaName) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
schemaName
- a string representing the schema in question
java.sql.SQLException
DSRException
MDRException
java.io.IOException
public static java.lang.String[] getModelNames() throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
java.sql.SQLException
DSRException
MDRException
java.io.IOException
public static java.lang.String getModelName(int mid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
mid
- The model identifier
MDRException
- If the model with MID=mid does not exist
java.sql.SQLException
DSRException
java.io.IOException
public static void setModelName(int mid, java.lang.String name) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
mid
- The model identifiername
- The new name for the modelling language
MDRException
- If the model with MID=mid does not exist
java.sql.SQLException
DSRException
java.io.IOException
public static int createConstruct(int mid, java.lang.String name, int constructClass, boolean isRoot) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
mid
- The modelling language this construct belongs toname
- The name of the new construct,this must not already
be in use for this modelling languageisRoot
-
MDRException
- If the model with
MID=mid does not exist, the constructClass is out of range or
the construct name is already in use for the specified model
java.sql.SQLException
DSRException
java.io.IOException
public static void removeConstruct(int cid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifier
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static int[] getConstructs(int mid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
mid
- The identifier of model
MDRException
- If the model with MID=mid does not exist
java.sql.SQLException
DSRException
java.io.IOException
public static java.lang.String[] getConstructNames(int mid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
The
- model identifier
MDRException
- If the model with MID=mid does not exist
java.sql.SQLException
DSRException
java.io.IOException
public static java.lang.String getConstructName(int cid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- identifier of an existing construct
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static void setConstructName(int cid, java.lang.String name) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- identifier of an existing constructname
- The new name for the construct
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static int getConstructMID(int cid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifier
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static void setConstructMID(int cid, int mid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifiermid
- The new MID for the construct
MDRException
- if the construct
or the new model doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static int getConstructClass(int cid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifier
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS types
public static void setConstructClass(int cid, int constructClass) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierconstructClass
- The new class for the construct
MDRException
- if the construct
doesn't exist or the constructClass is out of range
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS types
public static boolean isConstructRoot(int cid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifier
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static void setConstructRoot(int cid, boolean isRoot) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierisRoot
- Is this construct a root construct
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static int createConstructScheme(int cid, int type, int argCID, boolean isKey, int HDMType, int lowerBound, int upperBound) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct this scheme is fortype
- The type of the scheme argumentargCID
- If type is not SCHEME_TYPE_NAME the CID of the
construct this type refers toisKey
- Whether or not this argument is required when
referring to a construct of type CIDHDMType
- The postion and function in the HDM template for
the Construct's type that this argument represents or
SCHEME_HDM_TYPE_C if it doesn't represent part of the HDM
template. Meaningless if the Construct's type is
CONSTRUCT_CLASS_CONSTRAINTlowerBound
- The lower bound to how many times this argument
can occur in the HDMType positionupperBound
- The lower bound to how many times this argument
can occur in the HDMType position. If upperBound < lowerBound then
there is no upper bound.
MDRException
- If the construct with
CID=cid does not exist or the type or HDMType is out of range.
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS,
SCHEME_HDM and SCHEME_TYPE types.
public static void removeConstructScheme(int cid, int pos) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The position of the scheme argument
MDRException
- if the constructScheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static int getConstructSchemeCount(int cid) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
mid
- The identifier of model
MDRException
- if the construct scheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static int getConstructSchemeType(int cid, int pos) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of th construct scheme
MDRException
- if the construct scheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeType(int cid, int pos, int schemeType) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of the construct schemeconstructClass
- The new class for the construct
MDRException
- if the construct
doesn't exist or the constructClass is out of range
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS types
public static int getConstructSchemeArgCID(int cid, int pos) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of the construct scheme
MDRException
- if the construct scheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static void setConstructSchemeArgCID(int cid, int pos, int argCID) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of the construct schemeargCID
- The CID of the construct that should be given as
the argument in this position of the scheme or 0 to denote none
MDRException
- if the construct scheme
doesn't exist or the argCID is not 0 and doesn't exist.
java.sql.SQLException
DSRException
java.io.IOException
public static boolean isConstructSchemeKey(int cid, int pos) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of th construct scheme
MDRException
- if the construct scheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static void setConstructSchemeKey(int cid, int pos, boolean isKey) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of the construct schemeisKey
- if the construct scheme argument is needed
to identify an instance of the construct
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
public static int getConstructSchemeHDMType(int cid, int pos) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of th construct scheme
MDRException
- if the construct scheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeHDMType(int cid, int pos, int HDMType) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of the construct schemeHDMType
- The new HDMType for the construct
MDRException
- if the construct
doesn't exist or the HDMType is out of range
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for SCHEME_HDM_TYPEs
public static int getConstructSchemeLowerBound(int cid, int pos) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of th construct scheme
MDRException
- if the construct scheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeLowerBound(int cid, int pos, int lowerBound) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of the construct schemelowerBound
- the least number of times this argument
must be repeated
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for SCHEME_HDM_TYPEs
public static int getConstructSchemeUpperBound(int cid, int pos) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of th construct scheme
MDRException
- if the construct scheme
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeUpperBound(int cid, int pos, int upperBound) throws java.sql.SQLException, DSRException, MDRException, java.io.IOException
cid
- The construct identifierpos
- The argument position of the construct schemeupperBound
- the least number of times this argument
must be repeated
MDRException
- if the construct
doesn't exist
java.sql.SQLException
DSRException
java.io.IOException
Interface Constants for SCHEME_HDM_TYPEs
public static void cidExists(int cid) throws MDRException, java.sql.SQLException, DSRException, java.io.IOException
cid
- construct identifier (CID) of the construct.
MDRException
- if no record for
the specified CID is found in the MDR.
java.sql.SQLException
DSRException
java.io.IOException
public static java.util.Vector executeQuery(java.lang.String sql)
Vector
Vector
or Vector
, each of the later
representing one row in the result of the SQL query.public static int executeUpdate(java.lang.String sql)
sql
- Statement to execute on the repository
public static java.lang.Integer getIntegerConstructProperty(int mid, int cid, java.lang.String name) throws NotFoundException
NotFoundException
public static java.lang.String getStringConstructProperty(int mid, int cid, java.lang.String name) throws NotFoundException
NotFoundException
public static java.lang.Object getConstructProperty(int mid, int cid, java.lang.String name, boolean textual) throws NotFoundException
NotFoundException
public static void setConstructProperty(int mid, int cid, java.lang.String name, java.lang.Integer ivalue, java.lang.String svalue) throws NotFoundException
NotFoundException
public static java.lang.String getConstructConstraint(int cid, java.lang.String constraint_name) throws NotFoundException
NotFoundException
public static DBResultSet getConstructConstraints(int cid) throws NotFoundException
NotFoundException
public static void createConstructConstraint(int cid, java.lang.String cname, java.lang.String def)
public static void setConstructConstraint(int cid, java.lang.String constraint_name, java.lang.String constraint_definition) throws NotFoundException
NotFoundException
public static int getEquivHDMType(int tid) throws NotFoundException
tid
- The type identifier of a high level type
NotFoundException
- no HDM equivalent foundpublic static int[] getEquivHighLevelType(int tid, int mid) throws NotFoundException
tid
- The type identifier of an HDM type
NotFoundException
- no high level equivalent foundpublic static int getParentType(int tid) throws NotFoundException
tid
- The type identifier
NotFoundException
- no parent foundpublic static int getTypeMID(int tid) throws NotFoundException
tid
- The type identifier
NotFoundException
- no model id foundpublic static java.lang.String getTypeName(int tid) throws NotFoundException
tid
- The type identifier
NotFoundException
- If the type with TID=tid does not existpublic static int getTypeId(int mid, java.lang.String typeName) throws NotFoundException
mid
- The model identifier, @param typeName the type name
NotFoundException
- If no type foundpublic static int[] getTypeIds() throws NotFoundException
NotFoundException
public static void setHdmEquiv(int tid, int hdmEquiv) throws NotFoundException
tid
- - the type id of the type to be updatedhdmEquiv
- - the id of the equivalent HDM type to this one
NotFoundException
public static DBResultSet getTypesForModel(java.lang.String modelName) throws NotFoundException
TypeHierarchy
objects for a specific Model
. This saves database connection time compared to the method of
modelName
- the model name used as alternative key to mid
DBResultSet
a db result set object{@link
- NotFoundException} if no types were found for the associated model
NotFoundException
public static DBResultSet getAllTypes(int mid) throws NotFoundException
TypeHierarchy
objects. This saves database
DBResultSet
a db result set object{@link
- NotFoundException} if no types were foundl
NotFoundException
public static int createType(int modelID, java.lang.String typeName, int hdmEquiv, int parentType) throws NotFoundException
TypeHierarchy
object
NotFoundException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |