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 should help VSA in the view synchronization. Now, in VSA we can do following schema evolutions:

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

Variable Index

 o mkb
The reference of MKB this VKB based on.
 o View_index
Index of view definition on View Name.

Constructor Index

 o VKB()
Default constructor.
 o VKB(String, MKB)
Parse E-SQL/SQL String and create the VKB object.

Method Index

 o addViewDefinition(View_Definition)
Add one view definition to this VKB

It will affect the index structure.

 o changeAttributeName(String, String, String, String)
This function will call MKB to change the specific attribute.
 o changeRelationName(String, String, String)
This function will call MKB to change the specific relation.
 o dropSetOfVDs(Vector)
Drop a vector of view definitions specified by Vector VDs.
 o dropViewDefinition(String)
Remove one view definition from this VKB with specific view name.
 o dropViewDefinition(View_Definition)
Remove one view definition from this VKB.
 o getESQL(String)
returns the E-SQl definition fo the view with the given name
 o getMKB()
Get the MKB of this VKB
 o getSQL(String)
returns the SQl definition fo the view with the given name
 o getVD(String)
Get View Definition for a View of a specific name
 o getViewDefinitions(String)
Get a vector of ViewDefinitions mentioning a specific Information Source (IS) name.
 o getViewDefinitions(String, String)
Get a vector of all ViewDefinitions mentioning a Relation of a specific Relation Name.
 o getViewDefinitions(String, String, String)
Get a vector of ViewDefinitions mentioning an Attribute of the given name.
 o getViewNames()
Get a Vector of ViewNames in this VKB
 o replaceViewDefinition(View_Definition, View_Definition)
Replace view V with bestV.
 o setMKB(MKB)
Set the MKB of this VKB
 o setViewIndex(Hashtable)
Set View_Index Hashtable of this VKB
 o toString()
Display VKB in ESQL mode

Variables

 o View_index
 Hashtable View_index
Index of view definition on View Name.

 o mkb
 MKB mkb
The reference of MKB this VKB based on.

Constructors

 o VKB
 public VKB()
Default constructor.

 o 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

Methods

 o getMKB
 public MKB getMKB()
Get the MKB of this VKB

 o setMKB
 public void setMKB(MKB ref)
Set the MKB of this VKB

 o 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

 o setViewIndex
 public void setViewIndex(Hashtable index)
Set View_Index Hashtable of this VKB

Parameters:
index - New index of view definitions
 o 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.

 o 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.

 o 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.

 o dropSetOfVDs
 public void dropSetOfVDs(Vector VDs)
Drop a vector of view definitions specified by Vector VDs.

 o 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.
 o 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
 o 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
 o 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
 o 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
 o 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.
 o 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
 o 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
 o getViewNames
 public Vector getViewNames()
Get a Vector of ViewNames in this VKB

Returns:
null no view stores; else return a vector of view names.
 o toString
 public String toString()
Display VKB in ESQL mode

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index