All Packages Class Hierarchy This Package Previous Next Index
Class DSRG.VKB.VKB
java.lang.Object
|
+----DSRG.VKB.VKB
- public class VKB
- extends Object
- implements Serializable, VSA_VKB
This VKB class represents the VKB of EVE system.
It stores a
hashtable of View_index.
We find the view definitiosn by name
is by traverse List of Functions VKB should provide
-
VKB Overall Functions
- Add one View Definition
- remove one View Definition
- Search View Definition by
View Name
- Search View Definitions by IS name
-
Search View Definitions by Relation name
- Search View
Definitions by Attribute name
- Modify View Component of
Specifice View Definition. We should provide all the functions of
getting and setting the View Component attributes.
- Bulk
Loading a VKB from a ESQL/SQL file.
- View Definition
Overall Functions, please reference View_Definition Document
VKB should help VSA in the view synchronization. Now, in
VSA we can do following schema evolutions:
- Delete Relation
- Delete Attribute
- Change Relation Name
- Change
Attribute Name
I put some feature to MKB to let it help us do
the Change Name functions. I do that by putting a reference of that
object in MKB at every place where need a name. That's makes the
changing name functions simple, but that increase the coupling
between MKB and VKB. The reason why I select this strategy is that
the Changing Name functions will affect both MKB and VKB
anyway. That means, If we seperate the storage of name in the MKB
and VKB, we still need another function to call both parts to change
name synchronized. That will need a lot of more work. As well,
because I specify the VKB/MKB interface in "interface" VKB_MKB, we
can easily know how can VKB access MKB. Sure, if we want to use
Relation and Attribute classes in MKB, we need to know the knowledge
of them. I think that's the only drawback. I try to do all the
class design to help us make the implementation extendable. So, if
in the future MKB needs to be changed, and that change will affect
the Relation and Attribute classes in MKB, like MKB change its
structure to keep the history, we just need to remain the same
interface between VKB and those classes, then everything should be
fine. I need to define another two interfaces between VKB and
Relation and Attribute.
- See Also:
- View_Definition
-
mkb
- The reference of MKB this VKB based on.
-
View_index
- Index of view definition on View Name.
-
VKB()
- Default constructor.
-
VKB(String, MKB)
- Parse E-SQL/SQL String and create the VKB object.
-
addViewDefinition(View_Definition)
- Add one view definition to this VKB
It will affect the index structure.
-
changeAttributeName(String, String, String, String)
- This function will call MKB to change the specific attribute.
-
changeRelationName(String, String, String)
- This function will call MKB to change the specific relation.
-
dropSetOfVDs(Vector)
- Drop a vector of view definitions specified by Vector VDs.
-
dropViewDefinition(String)
- Remove one view definition from this VKB with specific view name.
-
dropViewDefinition(View_Definition)
- Remove one view definition from this VKB.
-
getESQL(String)
- returns the E-SQl definition fo the view with the given name
-
getMKB()
- Get the MKB of this VKB
-
getSQL(String)
- returns the SQl definition fo the view with the given name
-
getVD(String)
- Get View Definition for a View of a specific name
-
getViewDefinitions(String)
- Get a vector of ViewDefinitions mentioning a specific
Information Source (IS) name.
-
getViewDefinitions(String, String)
- Get a vector of all ViewDefinitions mentioning a Relation
of a specific Relation Name.
-
getViewDefinitions(String, String, String)
- Get a vector of ViewDefinitions mentioning an Attribute of
the given name.
-
getViewNames()
- Get a Vector of ViewNames in this VKB
-
replaceViewDefinition(View_Definition, View_Definition)
- Replace view V with bestV.
-
setMKB(MKB)
- Set the MKB of this VKB
-
setViewIndex(Hashtable)
- Set View_Index Hashtable of this VKB
-
toString()
- Display VKB in ESQL mode
View_index
Hashtable View_index
- Index of view definition on View Name.
mkb
MKB mkb
- The reference of MKB this VKB based on.
VKB
public VKB()
- Default constructor.
VKB
public VKB(String ESQL_file,
MKB ref)
- Parse E-SQL/SQL String and create the VKB object.
- Parameters:
- ESQL_file - E-SQL/SQL of this VKB/ or a file name
- ref - MKB of this VKB depends on
getMKB
public MKB getMKB()
- Get the MKB of this VKB
setMKB
public void setMKB(MKB ref)
- Set the MKB of this VKB
replaceViewDefinition
public void replaceViewDefinition(View_Definition V,
View_Definition bestV)
- Replace view V with bestV. This is the place to update the view
definition after selection. MAYA
setViewIndex
public void setViewIndex(Hashtable index)
- Set View_Index Hashtable of this VKB
- Parameters:
- index - New index of view definitions
addViewDefinition
public void addViewDefinition(View_Definition newVD)
- Add one view definition to this VKB
It will affect the index structure. We need to re-index the View definition.
dropViewDefinition
public void dropViewDefinition(String viewName)
- Remove one view definition from this VKB with specific view name.
It will affect the index structure. We need to re-index the View definition.
dropViewDefinition
public void dropViewDefinition(View_Definition view)
- Remove one view definition from this VKB.
It will affect the index structure. We need to re-index the View definition.
dropSetOfVDs
public void dropSetOfVDs(Vector VDs)
- Drop a vector of view definitions specified by Vector VDs.
getViewDefinitions
public Vector getViewDefinitions(String IS_name)
- Get a vector of ViewDefinitions mentioning a specific
Information Source (IS) name.
- Parameters:
- : - IS_name Information Source name.
- Returns:
- null: No View Definition affected by this IS, Vector: View Definitions affected by this IS.
getViewDefinitions
public Vector getViewDefinitions(String IS_name,
String Rel_name)
- Get a vector of all ViewDefinitions mentioning a Relation
of a specific Relation Name.
- Parameters:
- IS_name - Information Source Name
- Rel_name - Relation Name
- Returns:
- null: No View Definition affected, Vector: View Definitions affected by relation
getViewDefinitions
public Vector getViewDefinitions(String IS_name,
String Rel_name,
String Attr_name)
- Get a vector of ViewDefinitions mentioning an Attribute of
the given name.
- Parameters:
- IS_name - Information Source Name
- Rel_name - Relation Name
- Attr_name - Attribute Name
- Returns:
- null: No View Definition affected, Vector: View Definitions affected by attribute
getESQL
public String getESQL(String viewName)
- returns the E-SQl definition fo the view with the given name
- Parameters:
- viewName - the name of the view to be queried
- Returns:
- E-SQL view definition or empty String object
getSQL
public String getSQL(String viewName)
- returns the SQl definition fo the view with the given name
- Parameters:
- viewName - the name of the view to be queried
- Returns:
- SQL view definition or empty String object
getVD
public View_Definition getVD(String view_name)
- Get View Definition for a View of a specific name
- Parameters:
- view_name - name of view definition
- Returns:
- View_Definition or null.
changeAttributeName
public void changeAttributeName(String IS_name,
String Rel_name,
String Attr_name,
String new_name)
- This function will call MKB to change the specific attribute.
It will change all the view_components in all view definitions in VKB
from one attribute name to another name.
It's different from make one attribute_component in one view_definition
reference to another attribute, which will only change one attribute_component
of one view_definition.
- Parameters:
- IS_name - Information Source Name
- Rel_name - Relation Name
- Attr_name - Attribute Name
- new_name - New attribute Name
changeRelationName
public void changeRelationName(String IS_name,
String Rel_name,
String new_name)
- This function will call MKB to change the specific relation.
It will change all hte view_components in all view definitions in VKB
from one relation name to another name.
It's means it will also affect the attribute_component and condition_component.
- Parameters:
- IS_name - Information Source Name
- Rel_name - Relation Name
- new_name - New Relation Name
getViewNames
public Vector getViewNames()
- Get a Vector of ViewNames in this VKB
- Returns:
- null no view stores; else return a vector of view names.
toString
public String toString()
- Display VKB in ESQL mode
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index