|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--uk.ac.ic.doc.automed.ModelDefinitionsRepository
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 | |
static java.lang.String |
MDR_DataSourceName
|
static java.lang.String |
userName
|
| Constructor Summary | |
ModelDefinitionsRepository()
|
|
| 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 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 |
getConstructClass(int cid)
|
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 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 java.lang.String |
getMDR_DataSourceName()
Deprecated, use getDataSourceName instead |
static int |
getModelByName(java.lang.String name)
|
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 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 ModelDefinitionsRepository. |
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 |
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 |
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 |
setMDR_DataSourceName(java.lang.String mdr)
Deprecated. use setDataSourceName() |
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
| Constructor Detail |
public ModelDefinitionsRepository()
| 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()
public static void setMDR_DataSourceName(java.lang.String mdr)
public static void main(java.lang.String[] args)
public static int createModel(java.lang.String name)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
name - The name of the modelling language
ModelDefinitionsRepositoryException - If the model name is already in use
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static void removeModel(int mid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
mid - The model identifier of the modelling language to remove
ModelDefinitionsRepositoryException - If the model with MID=mid does not exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int[] getModels()
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
java.sql.SQLException
DataSourceRepositoryException
ModelDefinitionsRepositoryException
java.io.IOException
public static int getModelByName(java.lang.String name)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
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
ModelDefinitionsRepositoryException - If the model with MID=mid does not exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static java.lang.String[] getModelNames()
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
java.sql.SQLException
DataSourceRepositoryException
ModelDefinitionsRepositoryException
java.io.IOException
public static java.lang.String getModelName(int mid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
mid - The model identifier
ModelDefinitionsRepositoryException - If the model with MID=mid does not exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static void setModelName(int mid,
java.lang.String name)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
mid - The model identifiername - The new name for the modelling language
ModelDefinitionsRepositoryException - If the model with MID=mid does not exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int createConstruct(int mid,
java.lang.String name,
int constructClass,
boolean isRoot)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
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 -
ModelDefinitionsRepositoryException - 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
DataSourceRepositoryException
java.io.IOException
public static void removeConstruct(int cid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifier
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int[] getConstructs(int mid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
mid - The identifier of model
ModelDefinitionsRepositoryException - If the model with MID=mid does not exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static java.lang.String[] getConstructNames(int mid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
ModelDefinitionsRepositoryException - If the model with MID=mid does not exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static java.lang.String getConstructName(int cid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifier
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static void setConstructName(int cid,
java.lang.String name)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifiername - The new name for the construct
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int getConstructMID(int cid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifier
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static void setConstructMID(int cid,
int mid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifiermid - The new MID for the construct
ModelDefinitionsRepositoryException - if the construct
or the new model doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int getConstructClass(int cid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifier
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS types
public static void setConstructClass(int cid,
int constructClass)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierconstructClass - The new class for the construct
ModelDefinitionsRepositoryException - if the construct
doesn't exist or the constructClass is out of range
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS types
public static boolean isConstructRoot(int cid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifier
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static void setConstructRoot(int cid,
boolean isRoot)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierisRoot - Is this construct a root construct
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
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,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
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.
ModelDefinitionsRepositoryException - If the construct with
CID=cid does not exist or the type or HDMType is out of range.
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS,
SCHEME_HDM and SCHEME_TYPE types.
public static void removeConstructScheme(int cid,
int pos)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The position of the scheme argument
ModelDefinitionsRepositoryException - if the constructScheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int getConstructSchemeCount(int cid)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int getConstructSchemeType(int cid,
int pos)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of th construct scheme
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeType(int cid,
int pos,
int schemeType)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of the construct scheme
ModelDefinitionsRepositoryException - if the construct
doesn't exist or the constructClass is out of range
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS types
public static int getConstructSchemeArgCID(int cid,
int pos)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of the construct scheme
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static void setConstructSchemeArgCID(int cid,
int pos,
int argCID)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
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
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist or the argCID is not 0 and doesn't exist.
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static boolean isConstructSchemeKey(int cid,
int pos)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of th construct scheme
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static void setConstructSchemeKey(int cid,
int pos,
boolean isKey)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
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
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
public static int getConstructSchemeHDMType(int cid,
int pos)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of th construct scheme
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeHDMType(int cid,
int pos,
int HDMType)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of the construct schemeHDMType - The new HDMType for the construct
ModelDefinitionsRepositoryException - if the construct
doesn't exist or the HDMType is out of range
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for SCHEME_HDM_TYPEs
public static int getConstructSchemeLowerBound(int cid,
int pos)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of th construct scheme
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeLowerBound(int cid,
int pos,
int lowerBound)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of the construct schemelowerBound - the least number of times this argument
must be repeated
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for SCHEME_HDM_TYPEs
public static int getConstructSchemeUpperBound(int cid,
int pos)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of th construct scheme
ModelDefinitionsRepositoryException - if the construct scheme
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for CONSTRUCT_CLASS types
public static void setConstructSchemeUpperBound(int cid,
int pos,
int upperBound)
throws java.sql.SQLException,
DataSourceRepositoryException,
ModelDefinitionsRepositoryException,
java.io.IOException
cid - The construct identifierpos - The argument position of the construct schemeupperBound - the least number of times this argument
must be repeated
ModelDefinitionsRepositoryException - if the construct
doesn't exist
java.sql.SQLException
DataSourceRepositoryException
java.io.IOExceptionInterface Constants for SCHEME_HDM_TYPEs
public static void cidExists(int cid)
throws ModelDefinitionsRepositoryException,
java.sql.SQLException,
DataSourceRepositoryException,
java.io.IOException
cid - construct identifier (CID) of the construct.
ModelDefinitionsRepositoryException - if no record for
the specified CID is found in the MDR.
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||