EVEDemo.MW
Class Main

java.lang.Object
  |
  +--EVEDemo.MW.Main

public class Main
extends java.lang.Object

The main class in the "middleware" layer.
Here, we initialize the object structure by loading all the views from the VKB, the ISs from the MKB. Instantiating an object of the IS class reads the appropriate information from the DB
The RMI-support has been discontinued.


Field Summary
private static int AliveCounter
          The Flag which will be changed by the alived user.
private  boolean changed
          has there been a change made?
(package private)  java.util.Vector DBManagers
          a vector of DBManager objects to connect to physical databases
static boolean DEBUG
          Debug flag
static double expTime
          The Global variable to terminate the process.
static int lcount
          XIN: Please explain or remove
count total local queries.
(package private)  DBManager localDBManager
          a handle (type DBManager) for the local DB-Manager
private  MKB mainMKB
          the MKB object
private  VKB mainVKB
          the VKB object
private  VSA mainVSA
          the VSA object
(package private)  java.util.Properties props
          handle to eve.properties
private  QueryEngine queryEngine
          a handle to the Query Engine
static int rcount
          XIN: Please explain or remove.
count total remote queries.
private  java.util.Vector Views
          the vector of View objects
 
Constructor Summary
Main()
          Constructed for create Main object in the Start class.
 
Method Summary
 boolean addAttribute(java.lang.String isName, java.lang.String relName, java.lang.String attName, java.lang.String attType)
           
 boolean addRelation(java.lang.String isName, java.lang.String relName, java.util.Vector attNames, java.util.Vector attTypes)
          Adds a relation by calling the appropriate method in the MKB
 void AliveMsg()
          The current connect user will use this function to increase the counter.
 boolean changeAttributeName(java.lang.String isName, java.lang.String relName, java.lang.String attName, java.lang.String newName)
          Renames an attribute by calling the appropriate method in the MKB
 boolean changeRelationName(java.lang.String isName, java.lang.String relName, java.lang.String newName)
          Renames a relation by calling the appropriate method in the MKB
 DBManager createDBManager(java.lang.String ISName, java.lang.String sDBType, java.lang.String sDBURL, java.lang.String sUsername, java.lang.String sPassword)
          Constructed used by MKBParser.
 boolean deleteAttribute(java.lang.String isName, java.lang.String relName, java.lang.String attName)
          Deletes an attribute by calling the appropriate method in the MKB.
 boolean deleteRelation(java.lang.String isName, java.lang.String relName)
          Deletes a relation by calling the appropriate method in the MKB
 java.util.Vector getAllViews()
          return the collection of views.
private  java.util.Vector getAllViewsFromVKB()
          Get all view names from the VKB and create View objects for each name.
 boolean getChangeStatus()
          Returns if there has been a capability change and resets "changed" bit to false.
 java.lang.String getCorrectDefinitionx(java.lang.String theViewName)
          An attempt at fixing some RMI problem.
 java.lang.String getCorrectOldDefinitionx(java.lang.String theViewName)
          An attempt at fixing some RMI problem.
 DBManager getDBManagerFromISName(java.lang.String theIS)
          searches for a DBManager from an IS name
 java.util.Vector getDBManagers()
          this vector contains objects of class DBManager
 IS getISfromName(java.lang.String theIS)
          searches for an IS object by name
 DBManager getLocalDBManager()
           
 MKB getMKB()
          returns a handle to the Main MKB
 com.sun.java.swing.ImageIcon getMyIcon(java.lang.String filename)
           
 QueryEngine getQueryEngine()
           
 Table getTable(java.lang.String isName, java.lang.String SQL)
          Get extent of a single relation as a Table object.
 Table getViewExtent(java.lang.String viewName, boolean old_view_extent)
          Get Extent of a specific view.
 VKB getVKB()
           
static void incLcount()
          XIN: Please explain or remove
increase the lcount
static void incRcount()
          XIN: Please explain or remove.
increase the rcount
 boolean isISChangeRunning()
          Returns if a user is currently able to make capability changes
 void reset()
          Reset Middle Layer.
 void saveViews(Main something)
          Save all Views
 void startUpdate()
          this method is used to demonstrate incremental view maintenance and is currently not used.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
Debug flag

rcount

public static int rcount
XIN: Please explain or remove.
count total remote queries.

lcount

public static int lcount
XIN: Please explain or remove
count total local queries.

Views

private java.util.Vector Views
the vector of View objects

DBManagers

java.util.Vector DBManagers
a vector of DBManager objects to connect to physical databases

localDBManager

DBManager localDBManager
a handle (type DBManager) for the local DB-Manager

mainMKB

private MKB mainMKB
the MKB object

mainVKB

private VKB mainVKB
the VKB object

mainVSA

private VSA mainVSA
the VSA object

queryEngine

private QueryEngine queryEngine
a handle to the Query Engine

changed

private boolean changed
has there been a change made?

props

java.util.Properties props
handle to eve.properties

expTime

public static double expTime
The Global variable to terminate the process. it's only used for batch mode of data update detection. It will stores the time spend on a specific experiments.

AliveCounter

private static int AliveCounter
The Flag which will be changed by the alived user.
Constructor Detail

Main

public Main()
Constructed for create Main object in the Start class.
Method Detail

incRcount

public static void incRcount()
XIN: Please explain or remove.
increase the rcount

incLcount

public static void incLcount()
XIN: Please explain or remove
increase the lcount

getMKB

public MKB getMKB()
returns a handle to the Main MKB

getAllViewsFromVKB

private java.util.Vector getAllViewsFromVKB()
Get all view names from the VKB and create View objects for each name.
We construct a view object for each view name that we find in the VKB and then instantiate it with default parameters (the handles to InformationSources, ISs, MKB, VKB)

deleteAttribute

public boolean deleteAttribute(java.lang.String isName,
                               java.lang.String relName,
                               java.lang.String attName)
Deletes an attribute by calling the appropriate method in the MKB.
Parameters:
isName - name of the IS the attribute is in
relName - name of the relation the attribute is in
attName - name of the attribute to delete

addAttribute

public boolean addAttribute(java.lang.String isName,
                            java.lang.String relName,
                            java.lang.String attName,
                            java.lang.String attType)

changeAttributeName

public boolean changeAttributeName(java.lang.String isName,
                                   java.lang.String relName,
                                   java.lang.String attName,
                                   java.lang.String newName)
Renames an attribute by calling the appropriate method in the MKB
Parameters:
isName - name of the IS the attribute is in
relName - name of the relation the attribute is in
attName - name of the attribute to rename
newName - new name of the attribute

addRelation

public boolean addRelation(java.lang.String isName,
                           java.lang.String relName,
                           java.util.Vector attNames,
                           java.util.Vector attTypes)
Adds a relation by calling the appropriate method in the MKB
Parameters:
isName - name of the IS the relation is in
relName - name of the relation to add
attNames - names of the attribute to add to relName
attTypes - types of the attributes

deleteRelation

public boolean deleteRelation(java.lang.String isName,
                              java.lang.String relName)
Deletes a relation by calling the appropriate method in the MKB
Parameters:
isName - name of the IS the relation is in
relName - name of the relation to delete

changeRelationName

public boolean changeRelationName(java.lang.String isName,
                                  java.lang.String relName,
                                  java.lang.String newName)
Renames a relation by calling the appropriate method in the MKB
Parameters:
isName - name of the IS the relation is in
relName - name of the relation to rename
newName - new name of the relation

getISfromName

public IS getISfromName(java.lang.String theIS)
searches for an IS object by name
Returns:
null if IS with this name not found

getChangeStatus

public boolean getChangeStatus()
Returns if there has been a capability change and resets "changed" bit to false.

isISChangeRunning

public boolean isISChangeRunning()
Returns if a user is currently able to make capability changes

reset

public void reset()
Reset Middle Layer.
To do: change static trade-off parameters to something more dynamic. The database is not being reset here anymore, this is done with the separate class "resetDB" from a shell script.

AliveMsg

public void AliveMsg()
The current connect user will use this function to increase the counter.

getCorrectDefinitionx

public java.lang.String getCorrectDefinitionx(java.lang.String theViewName)
An attempt at fixing some RMI problem. Not needed anymore? (koeller 030799)

getCorrectOldDefinitionx

public java.lang.String getCorrectOldDefinitionx(java.lang.String theViewName)
An attempt at fixing some RMI problem. Not needed anymore? (koeller 030799)

getAllViews

public java.util.Vector getAllViews()
return the collection of views.
if it doesn't exist yet, get it through getAllViewsFromVKB() If it does exist, refresh the views.

koeller 030799: Added support for the QC-Module. This is a new function aimed at selecting one of several view version suggested by the QC-Module. The vector Views contains views like before, but here the new "Versions" attribute (a vector of objects of class "version") is initialized.


saveViews

public void saveViews(Main something)
Save all Views

getViewExtent

public Table getViewExtent(java.lang.String viewName,
                           boolean old_view_extent)
Get Extent of a specific view. Calls the QueryEngine class.
Parameters:
viewName - Name of the View.

getTable

public Table getTable(java.lang.String isName,
                      java.lang.String SQL)
Get extent of a single relation as a Table object. this is for displaying a relation extent in the applet
Parameters:
isName, - SQL-query

startUpdate

public void startUpdate()
this method is used to demonstrate incremental view maintenance and is currently not used. Will have to be fixed later. It's disabled now.

getMyIcon

public com.sun.java.swing.ImageIcon getMyIcon(java.lang.String filename)

createDBManager

public DBManager createDBManager(java.lang.String ISName,
                                 java.lang.String sDBType,
                                 java.lang.String sDBURL,
                                 java.lang.String sUsername,
                                 java.lang.String sPassword)
Constructed used by MKBParser. It used to create an IS object with associated DBManager.

getDBManagerFromISName

public DBManager getDBManagerFromISName(java.lang.String theIS)
searches for a DBManager from an IS name
Returns:
null if IS with this name not found

getDBManagers

public java.util.Vector getDBManagers()
this vector contains objects of class DBManager

getLocalDBManager

public DBManager getLocalDBManager()

getVKB

public VKB getVKB()

getQueryEngine

public QueryEngine getQueryEngine()