ajax.exec
Class AjaxImpl

java.lang.Object
  |
  +--ajax.exec.AjaxImpl
All Implemented Interfaces:
AjaxAPI

public class AjaxImpl
extends java.lang.Object
implements AjaxAPI


Field Summary
static java.util.List functionsToSQL
          list of functions that need to be called from within an SQL statement
static java.lang.String programSummary
          To initialize the summary of program execution
static java.lang.String programSummaryMessage
           
 
Constructor Summary
AjaxImpl()
          Starts the Ajax system.
 
Method Summary
 void clean()
          Starts the cleaning program by invoking the scheduler.
 void customize(TransformationExecutionObserver obs, int nbTuples, boolean blocking)
          Parameterize Ajax Partially implemented for the moment.
 void deleteTuple(java.lang.String transformation, int tupleId)
          Deletes one output tuple of a transformation
 ExecutionSummary execute(java.lang.String transformationName)
          Executes a transformation
 java.lang.String executeAll()
          Executes all the transformations
 java.lang.String getAllSummary()
          Returns a String representing the summary of program execution in HTML format
 java.util.List getExecutionTree()
          Gets the graph of transformations and data flows that compose the cleaning program.
 GraphParameter getGraphParameter()
          Prepares and returns the parameter object that should be used as by the applet for displaying the graph.
 ExecutionSummary getSummary(java.lang.String transformationName)
           
 Table getTable(java.lang.String tableName)
          Returns the table object associated to this table name.
 java.lang.String getTransformationCode(java.lang.String transformation)
          Gets the transformation code.
 java.lang.String getTransformationHtmlCode(java.lang.String transformation)
          Gets the transformation code into html format
 java.util.List getTransformations()
          Returns a list of ajax.gui.graph.TransformationInfo objects which represent the list of the transformations applied.
 long getTupleCount(java.lang.String tableName)
          Returns the number of tuples from a TABLE (working with RDBMS only)
 java.util.Enumeration listTablesNames()
           
 java.util.List listTransformationsNames()
           
 void load(java.lang.String location)
          Loads the cleaning specification program, parses and optimizes it.
static void main(java.lang.String[] args)
          Starts the Ajax system
 void modifyTransformationCode(java.lang.String transformation, java.lang.String newCode)
          Modifies the transformation code.
 void resetJDBCConnection()
          To reset the connection to the RDBMS
 void resume()
          Resumes the cleaning process after handling the Exceptions of one transformation
 void saveWeaveFiles()
          Saves generated Weave specification files
 void setWeaveRunTimePolicies(java.io.BufferedWriter bfw)
          Generates and writes the specification runtime policy file, needed by Weave to implement the Explainer.
 void setWeaveSchemas(java.io.BufferedWriter bfw)
          Generates and writes the specification schemas file, needed by Weave to implement the Explainer.
 void undo(java.lang.String transformation)
          Undo the transformation actions
 void updateTuple(java.lang.String transformation, int tupleId)
          Update one output tuple of a transformation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

functionsToSQL

public static java.util.List functionsToSQL
list of functions that need to be called from within an SQL statement

programSummary

public static java.lang.String programSummary
To initialize the summary of program execution

programSummaryMessage

public static java.lang.String programSummaryMessage
Constructor Detail

AjaxImpl

public AjaxImpl()
Starts the Ajax system. It inits the connection to the database.
Method Detail

load

public void load(java.lang.String location)
          throws AjaxException
Loads the cleaning specification program, parses and optimizes it. Also initializes the catalog manager.
Specified by:
load in interface AjaxAPI

customize

public void customize(TransformationExecutionObserver obs,
                      int nbTuples,
                      boolean blocking)
               throws AjaxException
Parameterize Ajax Partially implemented for the moment. Only the observer variable is considered.
Specified by:
customize in interface AjaxAPI

clean

public void clean()
           throws AjaxException
Starts the cleaning program by invoking the scheduler.
Specified by:
clean in interface AjaxAPI

execute

public ExecutionSummary execute(java.lang.String transformationName)
                         throws AjaxException
Executes a transformation
Specified by:
execute in interface AjaxAPI
Returns:
an ExecutionSummary object

executeAll

public java.lang.String executeAll()
                            throws AjaxException
Executes all the transformations
Returns:
a String containing the execution summary in HTML format

listTransformationsNames

public java.util.List listTransformationsNames()
Specified by:
listTransformationsNames in interface AjaxAPI

listTablesNames

public java.util.Enumeration listTablesNames()
Specified by:
listTablesNames in interface AjaxAPI

getExecutionTree

public java.util.List getExecutionTree()
                                throws AjaxException
Gets the graph of transformations and data flows that compose the cleaning program. Each element of this graph is represented by an object of the class Node.
Specified by:
getExecutionTree in interface AjaxAPI

modifyTransformationCode

public void modifyTransformationCode(java.lang.String transformation,
                                     java.lang.String newCode)
                              throws AjaxException
Modifies the transformation code.
Specified by:
modifyTransformationCode in interface AjaxAPI

getTransformationCode

public java.lang.String getTransformationCode(java.lang.String transformation)
Gets the transformation code.
Specified by:
getTransformationCode in interface AjaxAPI

getTransformationHtmlCode

public java.lang.String getTransformationHtmlCode(java.lang.String transformation)
Gets the transformation code into html format

resume

public void resume()
            throws AjaxException
Resumes the cleaning process after handling the Exceptions of one transformation
Specified by:
resume in interface AjaxAPI

undo

public void undo(java.lang.String transformation)
          throws AjaxException
Undo the transformation actions
Specified by:
undo in interface AjaxAPI

updateTuple

public void updateTuple(java.lang.String transformation,
                        int tupleId)
                 throws AjaxException
Update one output tuple of a transformation
Specified by:
updateTuple in interface AjaxAPI

deleteTuple

public void deleteTuple(java.lang.String transformation,
                        int tupleId)
                 throws AjaxException
Deletes one output tuple of a transformation
Specified by:
deleteTuple in interface AjaxAPI

getGraphParameter

public GraphParameter getGraphParameter()
                                 throws AjaxException
Prepares and returns the parameter object that should be used as by the applet for displaying the graph. The parameter object will be obtained by the applet through a URL Connection.
Specified by:
getGraphParameter in interface AjaxAPI
Returns:
GraphParameter the graph parameter object

getTransformations

public java.util.List getTransformations()
                                  throws AjaxException
Returns a list of ajax.gui.graph.TransformationInfo objects which represent the list of the transformations applied. For each transformation there is information concerning the type, the name, the input data flows names and the output data flows names
Specified by:
getTransformations in interface AjaxAPI
Returns:
the transformation List

getSummary

public ExecutionSummary getSummary(java.lang.String transformationName)

getAllSummary

public java.lang.String getAllSummary()
Returns a String representing the summary of program execution in HTML format

setWeaveSchemas

public void setWeaveSchemas(java.io.BufferedWriter bfw)
                     throws CatalogException,
                            java.io.IOException
Generates and writes the specification schemas file, needed by Weave to implement the Explainer. This represents the content of the Weave's schema file .sch
Parameters:
bfw - a BufferedWriter object where to write the generated sch code

setWeaveRunTimePolicies

public void setWeaveRunTimePolicies(java.io.BufferedWriter bfw)
                             throws CatalogException,
                                    java.io.IOException
Generates and writes the specification runtime policy file, needed by Weave to implement the Explainer. This represents the content of the Weave's runtime policy file .rtp
Parameters:
bfw - a BufferedWriter object where to write the generated rtp code

saveWeaveFiles

public void saveWeaveFiles()
                    throws CatalogException,
                           java.io.IOException
Saves generated Weave specification files

getTupleCount

public long getTupleCount(java.lang.String tableName)
Returns the number of tuples from a TABLE (working with RDBMS only)

getTable

public Table getTable(java.lang.String tableName)
Returns the table object associated to this table name. The table object should be a data flow from the cleaning program.
Parameters:
name - the name of the table

resetJDBCConnection

public void resetJDBCConnection()
To reset the connection to the RDBMS

main

public static void main(java.lang.String[] args)
Starts the Ajax system