Main Page | Class Hierarchy | Class List | Class Members

kddml.Interpreter.QueryExecutor Class Reference

Inheritance diagram for kddml.Interpreter.QueryExecutor:

kddml.Interpreter.InterpreterRunner kddml.Interpreter.InterpreterChecker kddml.Interpreter.InterpreterIO List of all members.

Public Member Functions

 QueryExecutor (String query_path) throws InvalidKDDMLQueryException
 QueryExecutor (Document DOMQuery)
void enableVerboseMode (boolean enable)
void enableLogFile (boolean enable)
void run ()
KDDMLObject getResult ()
String getMessageResult ()
void resolve () throws ExecutionException, TypeCheckingException, NotYetImplementedException, EmptyResultsException, InvalidKDDMLQueryException, UnsupportedAlgorithmException
void validateQuery () throws InvalidKDDMLQueryException, UnsupportedAlgorithmException, DBMSConnectionException

Static Public Member Functions

static Element clone (Element tag)
static void removeTmpResults ()
static void main (String args[])

Protected Member Functions

KDDMLObject resolve (Element query, KDDMLObjectType type) throws NotYetImplementedException, ExecutionException, TypeCheckingException, EmptyResultsException, InvalidKDDMLQueryException, UnsupportedAlgorithmException
KDDMLObject resolveCore (Element query) throws ExecutionException, TypeCheckingException, NotYetImplementedException, EmptyResultsException, InvalidKDDMLQueryException, UnsupportedAlgorithmException

Detailed Description

KDDML Interpreter.
The interpreter accepts a validated KDDML query (either in XML or as a DOM tree), evaluates it, save the final result in the repository and returns it as KDDMLObject. The result can be further processed by standard XML management tools and libraries. This class implements the core algorithm of the interpreter. The interpreter recursively traverse the DOM tree representation of the query, yielding a KDDMLObject as a result. At each tag, the strict functional interpretation is applied. A KDDMLOperator object is constructed from the XML tag using a factory of objects from the operators layer. This is performed by means Java reflection, comparing the tag name with the class name implementing the operator. Each sub-element is evaluated, returning a vector of KDDMLObject. If the operator claims for dynamic type checking, the returned results is checked against the expected type. Exceptions are raised on critical situations.

Title: KDDML

Description: Knowledge Discovery in Database Environment

Copyright: Copyright (c) 2003-2005

Company: Universita' di Pisa - Dipartimento di Informatica

Author:
Andrea Romei (romei@di.unipi.it)
Version:
2.0.16


Constructor & Destructor Documentation

kddml.Interpreter.QueryExecutor.QueryExecutor String  query_path  )  throws InvalidKDDMLQueryException
 

Constructor given the string containing the KDDML query path. Parses the query after the interpreter loads it form the repository. Throws an exception it the query is not found or if the XML parser returns an error.

Parameters:
query_path String
Exceptions:
InvalidKDDMLQueryException 

kddml.Interpreter.QueryExecutor.QueryExecutor Document  DOMQuery  ) 
 

Constructor given the DOM element representing the query.

Parameters:
DOMQuery Document


Member Function Documentation

void kddml.Interpreter.QueryExecutor.enableVerboseMode boolean  enable  ) 
 

Prints output messages in the standard output.

Parameters:
enable boolean if true prints messages in the standard output. Otherwise, do not print messages in output.

Implements kddml.Interpreter.InterpreterIO.

void kddml.Interpreter.QueryExecutor.enableLogFile boolean  enable  ) 
 

Prints output messages in the log file stored in the root directory.

Parameters:
enable boolean if true prints messages in the log file output. Otherwise, do not print messages in log the file.

Implements kddml.Interpreter.InterpreterIO.

void kddml.Interpreter.QueryExecutor.run  ) 
 

Starts the interpreter on the KDDML query as separated thread. The interpreter recursively traverse the DOM tree representation of the query, yielding a KDDMLObject as result that is stored in the result field.

KDDMLObject kddml.Interpreter.QueryExecutor.getResult  ) 
 

Returns the final object as output. Can return null if the query do not provide a result (e.g. if an exception occurs).

Returns:
KDDMLObject

Implements kddml.Interpreter.InterpreterRunner.

String kddml.Interpreter.QueryExecutor.getMessageResult  ) 
 

Returns the final message as output.

Returns:
String returns "error: <exception description>" if an exception occurs during the query execution. Returns "success" if no errors occour. Returns an empty string before the method resolve() has been called.

Implements kddml.Interpreter.InterpreterRunner.

void kddml.Interpreter.QueryExecutor.resolve  )  throws ExecutionException, TypeCheckingException, NotYetImplementedException, EmptyResultsException, InvalidKDDMLQueryException, UnsupportedAlgorithmException
 

Starts the interpreter on the KDDML query. The interpreter recursively traverse the DOM tree representation of the query, yielding a KDDMLObject as result that is stored in the xml_dest field. If an error occurs, the method throws an exception.

Exceptions:
ExecutionException if a generic execution exception occurs.
TypeCheckingException if a type checking eception occurs at run-time.
NotYetImplementedException if an operator is not yet implemented.
EmptyResultsException if an operator do not have product results.
InvalidKDDMLQueryException if the query is not valid.
UnsupportedAlgorithmException if a required algorithm in the query is not supported.

Implements kddml.Interpreter.InterpreterRunner.

KDDMLObject kddml.Interpreter.QueryExecutor.resolve Element  query,
KDDMLObjectType  type
throws NotYetImplementedException, ExecutionException, TypeCheckingException, EmptyResultsException, InvalidKDDMLQueryException, UnsupportedAlgorithmException [protected]
 

External resolver.

Parameters:
query Element
type KDDMLObjectType
Returns:
KDDMLObject
Exceptions:
NotYetImplementedException 
ExecutionException 
TypeCheckingException 
EmptyResultsException 
InvalidKDDMLQueryException 
UnsupportedAlgorithmException 

KDDMLObject kddml.Interpreter.QueryExecutor.resolveCore Element  query  )  throws ExecutionException, TypeCheckingException, NotYetImplementedException, EmptyResultsException, InvalidKDDMLQueryException, UnsupportedAlgorithmException [protected]
 

Core interpreter resolver.

Parameters:
query Element
Returns:
KDDMLObject
Exceptions:
ExecutionException 
TypeCheckingException 
NotYetImplementedException 
EmptyResultsException 
InvalidKDDMLQueryException 
UnsupportedAlgorithmException 

void kddml.Interpreter.QueryExecutor.validateQuery  )  throws InvalidKDDMLQueryException, UnsupportedAlgorithmException, DBMSConnectionException
 

Tests if the query is valid. More precisely, it recursively tests that:

  1. the attributes are correct, for each operator belonging to the query;
  2. the parameters are correct, for each algorithm belonging to the query;
  3. the condition proprieties are valid, for each condition belonging to the query.
It the query contains a DATABASE_LOADER or a DATABASE_WRITER operator, then the operator checks for user and password used on the connection via JDBC. If user and password are not specified in the query syntax, then a pop-up frame is open.

Exceptions:
InvalidKDDMLQueryException 
UnsupportedAlgorithmException 
DBMSConnectionException 

Implements kddml.Interpreter.InterpreterChecker.

static Element kddml.Interpreter.QueryExecutor.clone Element  tag  )  [static]
 

Cloning of the input sub-query. When the xml_dest is missing for an input operator, this method adds a new xml_dest attribute labeled with a static temporary counter.

Parameters:
tag Element
Returns:
Element

static void kddml.Interpreter.QueryExecutor.removeTmpResults  )  [static]
 

Removes all temporaly files generated during execution.

static void kddml.Interpreter.QueryExecutor.main String  args[]  )  [static]
 

Cmd interpreter.

Parameters:
args String[] the path of the query.


Generated on Thu Feb 23 13:04:46 2006 for kddml by  doxygen 1.4.3