|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--uk.ac.ic.doc.automed.reps.Transformation
The Transformation class
| Field Summary | |
static int |
ACTION_ADD
Transformation action "add" |
static int |
ACTION_CONTRACT
Transformation action "contract" |
static int |
ACTION_DELETE
Transformation action "delete" |
static int |
ACTION_EXTEND
Transformation action "extend" |
static int |
ACTION_IDENT
Transformation action "ident" |
static int |
ACTION_MAXIMUM
|
static int |
ACTION_MINIMUM
|
static int |
ACTION_RENAME
Transformation action "rename" |
| Constructor Summary | |
protected |
Transformation(int action,
int fromOBID,
int toOBID,
int fromSID,
int toSID,
java.lang.String function,
java.lang.String constraint,
boolean addToMap)
Instantiates a transformation. |
| Method Summary | |
int |
compareTo(java.lang.Object o)
|
static Transformation |
createAddTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String function,
java.lang.String constraint)
Creates a new ADD transformation. |
static Transformation |
createAddTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String function,
java.lang.String constraint,
java.lang.String newSchemaName)
Creates an ADD transformation. |
static Transformation |
createContractTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String function,
java.lang.String constraint)
Creates an CONTRACT transformation. |
static Transformation |
createContractTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String newSchemaName,
java.lang.String function,
java.lang.String constraint)
Creates an CONTRACT transformation. |
static Transformation |
createDeleteTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String function,
java.lang.String constraint)
Creates a DELETE transformation. |
static Transformation |
createDeleteTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String function,
java.lang.String constraint,
java.lang.String newSchemaName)
Creates a DELETE transformation. |
static Transformation |
createExtendTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String function,
java.lang.String constraint)
Creates an EXTEND transformation. |
static Transformation |
createExtendTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String newSchemaName,
java.lang.String function,
java.lang.String constraint)
Creates an EXTEND transformation. |
static Transformation[] |
createIdentTransformations(Schema fromSchema,
Schema toSchema,
java.lang.String function,
java.lang.String constraint)
Creates an IDENT transformation. |
static Transformation |
createRenameTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.Object[] toObject)
Creates a RENAME transformation. |
static Transformation |
createRenameTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.Object[] toObject,
java.lang.String newSchemaName)
Creates a RENAME transformation. |
protected Transformation |
duplicateTransformation(Schema fromSchema)
Creates a duplicate of the transformation. |
int |
getActionFrom(Schema s)
Returns the action of the transformation. |
int |
getActionTo(Schema s)
Returns the action of the transformation. |
SchemaObject[] |
getAllReferencedSchemaObjects()
Returns all the schema objects referenced in a transformation, including those referenced in its query. The result of this method is the union of the results returned by the methods getReferencedSchemaObjects() and
getReferencedSchemaObjectsInQuery(). |
static java.util.List |
getAllTrans()
|
Schema |
getCommonSchema(Transformation t)
|
java.lang.String |
getConstraint()
Returns the constraint associated with the transformation. |
protected int |
getFromOBID()
Returns the schema object identifier (OBID) of the input of the transformaiton (fromObject). |
protected int |
getFromSID()
Returns the schema identifier (SID) of the originating schema. |
java.lang.String |
getFunction()
Returns the function of the transformation. |
Schema[] |
getOriginalSchemas()
|
Schema |
getOtherSchema(Schema s)
Returns the schemas of the transformation. |
SchemaObject[] |
getReferencedSchemaObjects()
Returns all the schema objects referenced in a transformation. |
SchemaObject[] |
getReferencedSchemaObjectsInQuery()
Returns all the schema objects referenced in the query of a transformation. |
protected Transformation |
getReverseTransformation()
Returns the reverse transformation of the given transformation. |
SchemaObject |
getSchemaObject(Schema s)
Returns the SchemaObject of the transformation. |
Schema[] |
getSchemas()
Returns the schemas of the transformation. |
protected int |
getToOBID()
Returns the schema object identifier (OBID) of the output of the transformaiton (toObject). |
protected int |
getToSID()
Returns the schema identifier (SID) of the resultant schema. |
protected static Transformation |
getTransformation(int fSID,
int tSID)
Returns the transformation between two given schemas. |
static Transformation |
getTransformation(Schema fs,
Schema ts)
Returns the transformation between two given schemas. |
static java.lang.Object[][] |
getTransformations()
|
static void |
importTransformations(java.io.InputStream is)
|
static void |
importTransformations(java.io.InputStream is,
java.lang.String suffix)
|
protected boolean |
isDependentOn(Transformation tran)
Determines whether or not the transformation is dependent on another transformation. |
protected boolean |
isRedundant(Transformation tran)
Determines whether or not the transformation and the given tran are redundant, e.g., two transformations are redundant if they transform the same schema object and their action is the opposite of the other (add/delete, extend/contract, etc.). |
static Transformation |
read(java.io.InputStream is)
|
void |
remove()
Removes this Transformation from the repository. |
static void |
removeTransformation(java.lang.String fromSchema,
java.lang.String toSchema)
Removes the transformation between two given schemas. |
void |
retract()
|
static void |
syncWithRepository()
|
java.lang.String |
toString()
|
void |
write()
|
void |
write(java.io.OutputStream os)
|
void |
write(java.io.PrintWriter pw)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int ACTION_MINIMUM
public static final int ACTION_ADD
public static final int ACTION_DELETE
public static final int ACTION_RENAME
public static final int ACTION_EXTEND
public static final int ACTION_CONTRACT
public static final int ACTION_IDENT
public static final int ACTION_MAXIMUM
| Constructor Detail |
protected Transformation(int action,
int fromOBID,
int toOBID,
int fromSID,
int toSID,
java.lang.String function,
java.lang.String constraint,
boolean addToMap)
action - the action of the transformation.fromOBID - the schema object identifier (OBID) of the fromObject of
the transformation.toOBID - the schema object identifier (OBID) of the toObject of
the transformation.fromSID - the schema identifier (SID) of the fromSchema of the
transformation.toSID - the schema identifier (SID) of the toSchema of the
transformation.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).addToMap - set to true if the transformation is to be
added to the transformation HashMap; false
otherwise.| Method Detail |
public static Transformation createAddTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String function,
java.lang.String constraint)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.toObjectConstructType - the construct type (see Construct) of
the resulting transformation object.toObject - the scheme (in an Object array) that forms the
output of the transformation.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createAddTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String function,
java.lang.String constraint,
java.lang.String newSchemaName)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.toObjectConstructType - the construct type (see Construct) of
the resulting transformation object.toObject - the scheme (in an Object array) that forms the
output of the transformation.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).newSchemaName - the name of the resultant schema.
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createDeleteTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String function,
java.lang.String constraint)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.fromObject - the SchemaObject to be deleted in the
transformation. Note that this schema object must belong to the given
fromSchema.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createDeleteTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String function,
java.lang.String constraint,
java.lang.String newSchemaName)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.fromObject - the SchemaObject to be deleted in the
transformation. Note that this schema object must belong to the given
fromSchema.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).newSchemaName - the name of the resultant schema.
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createRenameTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.Object[] toObject)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.fromObject - the SchemaObject to be renamed in the
transformation. Note that this schema object must belong to the given
fromSchema.toObject - the scheme (in an Object array) that forms the
output of the transformation. (The construct type of toObject must
be the same as the fromObject).
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createRenameTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.Object[] toObject,
java.lang.String newSchemaName)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.fromObject - the SchemaObject to be renamed in the
transformation. Note that this schema object must belong to the given
fromSchema.toObject - the scheme (in an Object array) that forms the
output of the transformation. (The construct type of toObject must
be the same as the fromObject).newSchemaName - the name of the resultant schema.
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createExtendTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String function,
java.lang.String constraint)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.toObjectConstructType - the construct type (see Construct) of
the resulting transformation object.toObject - the scheme (in an Object array) that forms the
output of the transformation.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createExtendTransformation(Schema fromSchema,
Construct toObjectConstructType,
java.lang.Object[] toObject,
java.lang.String newSchemaName,
java.lang.String function,
java.lang.String constraint)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.toObjectConstructType - the construct type (see Construct) of
the resulting transformation object.toObject - the scheme (in an Object array) that forms the
output of the transformation.newSchemaName - the name of the resultant schema.
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createContractTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String function,
java.lang.String constraint)
throws TypeMismatchException
fromSchema - the originating Schema of the
transformation.fromObject - the SchemaObject to be contracted in the
transformation. Note that this schema object must belong to the given
fromSchema.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation createContractTransformation(Schema fromSchema,
SchemaObject fromObject,
java.lang.String newSchemaName,
java.lang.String function,
java.lang.String constraint)
throws InconsistentException,
TypeMismatchException
fromSchema - the originating Schema of the
transformation.fromObject - the SchemaObject to be contracted in the
transformation. Note that this schema object must belong to the given
fromSchema.newSchemaName - the name of the resultant schema.
Transformation object.
InconsistentException
TypeMismatchException
public static Transformation[] createIdentTransformations(Schema fromSchema,
Schema toSchema,
java.lang.String function,
java.lang.String constraint)
throws InconsistentException,
IntegrityException,
SchemasNotIdenticalException
fromSchema - the originating Schema of the
transformation.toSchema - the resultant Schema of the transformation.function - the query that expresses the extent of the construct
being transformed.constraint - the constraint associated with the transformation
(if any).
Transformation objects.
InconsistentException
IntegrityException
SchemasNotIdenticalException
protected static Transformation getTransformation(int fSID,
int tSID)
throws InconsistentException
fSID - the schema identifier (SID) of the originating schema.tSID - the schema identifier (SID) of the resultant schema.
InconsistentException
public static Transformation getTransformation(Schema fs,
Schema ts)
throws InconsistentException,
IntegrityException
fs - the Schema of the originating schema.ts - the Schema of the resultant schema.
InconsistentException
IntegrityException
public static void removeTransformation(java.lang.String fromSchema,
java.lang.String toSchema)
throws NotFoundException,
IntegrityException
fromSchema - the name of the originating schema.toSchema - the name of the resultant schema.
NotFoundException - if either of the two named schemas do
not exist
IntegrityException
public void remove()
throws IntegrityException
Transformation from the repository. Clearly,
once called, this Transformation object instance should not
be used again.
IntegrityExceptionpublic void retract()
public int getActionFrom(Schema s)
throws InconsistentException,
IntegrityException
InconsistentException
IntegrityException
public int getActionTo(Schema s)
throws InconsistentException,
IntegrityException
InconsistentException
IntegrityException
public SchemaObject getSchemaObject(Schema s)
throws InconsistentException,
IntegrityException
SchemaObject of the transformation.
s - the schema in which the transformation object exists as
a result of applying the transformation.
SchemaObject of the transformation.
InconsistentException
IntegrityExceptionpublic Schema[] getSchemas()
public Schema getOtherSchema(Schema s)
throws IntegrityException
s - one of the schemas associated with the transformation.
InconsistentException
IntegrityExceptionprotected int getFromSID()
protected int getToSID()
protected int getFromOBID()
protected int getToOBID()
public java.lang.String getFunction()
public java.lang.String getConstraint()
protected Transformation getReverseTransformation()
protected boolean isDependentOn(Transformation tran)
throws InconsistentException,
IntegrityException
true.
tran - the Transformation whose transformation object
is to be compared.
true if the transformation is dependent on the given
Transformation; false otherwise.
InconsistentException
IntegrityException
protected boolean isRedundant(Transformation tran)
throws InconsistentException,
IntegrityException
tran - the Transformation whose transformation object
and action are to be compared.
true if the transformation and the given
Transformation are redundant; false otherwise.
InconsistentException
IntegrityExceptionpublic java.lang.String toString()
toString in class java.lang.Object
public static void syncWithRepository()
throws InconsistentException
InconsistentExceptionpublic SchemaObject[] getReferencedSchemaObjects()
SchemaObject instances that are
referenced in the transformation.public SchemaObject[] getReferencedSchemaObjectsInQuery()
SchemaObject instances that are
referenced in the query of the transformation.public SchemaObject[] getAllReferencedSchemaObjects()
getReferencedSchemaObjects() and
getReferencedSchemaObjectsInQuery().
SchemaObject instances that are
referenced in the transformation, plus the SchemaObject
instances referenced in its query.
protected Transformation duplicateTransformation(Schema fromSchema)
throws InconsistentException,
IntegrityException
fromSchema - the originating Schema of the
transformation.
InconsistentException
IntegrityException
public static java.lang.Object[][] getTransformations()
throws InconsistentException
InconsistentException
public static void importTransformations(java.io.InputStream is)
throws java.io.IOException,
AutoRepException,
UnexpectedTokenException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
UnexpectedTokenException
AutoMedException
java.sql.SQLException
public static void importTransformations(java.io.InputStream is,
java.lang.String suffix)
throws java.io.IOException,
AutoRepException,
UnexpectedTokenException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
UnexpectedTokenException
AutoMedException
java.sql.SQLException
public static Transformation read(java.io.InputStream is)
throws java.io.IOException,
AutoRepException,
UnexpectedTokenException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
UnexpectedTokenException
AutoMedException
java.sql.SQLExceptionpublic void write()
public void write(java.io.OutputStream os)
public void write(java.io.PrintWriter pw)
public Schema[] getOriginalSchemas()
public static java.util.List getAllTrans()
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic Schema getCommonSchema(Transformation t)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||