uk.org.ogsadai.activity.sql
Class SQLBagActivity

java.lang.Object
  |
  +--uk.org.ogsadai.activity.Activity
        |
        +--uk.org.ogsadai.activity.sql.SQLQueryMultipleActivity
              |
              +--uk.org.ogsadai.activity.sql.SQLBagActivity

public class SQLBagActivity
extends SQLQueryMultipleActivity

This activity runs queries over two relational data service resources and merges the results into a single WebRowSet document and sends it back as the output of this activity.

Each one of the above data service resources is linked to the multiple data service resource implemented by the SQLMultipleDataResource accessor.

The activity's perform document is defined by schema/ogsadai/xsd/activities/sql_bag.xsd.

The activity calls multiple data service resources each one being executed in its own thread.

For information on this activity see the OGSA-DAI user doc: OGSA-DAI/doc/interaction/activities/relational/sqlBag.html

Author:
The OGSA-DAI Project Team.

Field Summary
static?java.lang.String ACTIVITY_OUTPUT
??????????Constant used to parse request - activity element
private static?java.lang.String COPYRIGHT_NOTICE
??????????Copyright statement
private static?DAILogger LOG
??????????Logger object for this activity
private ?org.w3c.dom.Element mActivityElement
??????????XML element containing activity information from request
private ?boolean mIsAllNull
??????????Check whether all the returned results are null
private ?boolean mIsError
??????????Check whether an error has occured or not
private ?java.lang.Throwable mThrowable
??????????Exception to be forwarded if there is an error and there are no results returned.
static?java.lang.String SQL_STATEMENT
??????????Constant used to parse request - SQL query statement element
static?java.lang.String TIMEOUT
??????????Constant used to parse request - timeout
?
Fields inherited from class uk.org.ogsadai.activity.sql.SQLQueryMultipleActivity
mClientTimeout, mMultipleDS, mOutput, mOutputString, mSqlStatement, mTimeoutStatus, mTimer
?
Fields inherited from class uk.org.ogsadai.activity.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
?
Constructor Summary
SQLBagActivity(org.w3c.dom.Element?element)
???????????
?
Method Summary
private ?java.lang.String mergeResults(java.lang.String[]?rowsets)
??????????Merge N WebRowSets.
?void processBlock()
??????????Performs an iteration of the processing of an activity.
?
Methods inherited from class uk.org.ogsadai.activity.sql.SQLQueryMultipleActivity
cleanUp, initialise, isTimeout, setTimeout
?
Methods inherited from class uk.org.ogsadai.activity.Activity
connectsTo, createOutputPipe, getActivityConfiguration, getActivityName, getCause, getName, getObservableStatus, getProperties, getSession, getStatus, hasActivityConfiguration, hasProperties, process, processFirst, setActivityName, setCompleted, setError
?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
?

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

LOG

private static final DAILogger LOG
Logger object for this activity


mActivityElement

private org.w3c.dom.Element mActivityElement
XML element containing activity information from request


mIsError

private boolean mIsError
Check whether an error has occured or not


mIsAllNull

private boolean mIsAllNull
Check whether all the returned results are null


mThrowable

private java.lang.Throwable mThrowable
Exception to be forwarded if there is an error and there are no results returned.


ACTIVITY_OUTPUT

public static final java.lang.String ACTIVITY_OUTPUT
Constant used to parse request - activity element

See Also:
Constant Field Values

SQL_STATEMENT

public static final java.lang.String SQL_STATEMENT
Constant used to parse request - SQL query statement element

See Also:
Constant Field Values

TIMEOUT

public static final java.lang.String TIMEOUT
Constant used to parse request - timeout

See Also:
Constant Field Values
Constructor Detail

SQLBagActivity

public SQLBagActivity(org.w3c.dom.Element?element)
               throws ActivitySpecificationException,
                      ActivityCreationException
Method Detail

processBlock

public void processBlock()
Description copied from class: Activity
Performs an iteration of the processing of an activity. This may involve reading a block of input data and writing a block of output data, or may involve some other kind of processing. When an activity is processed by the OGSA-DAI engine, this method will be invoked repeatedly until the activity either completes or stops due to an error or termination call. An implementation of this method should invoke the setCompleted method to indicate that processing is complete, or the setError method if an error occurs that will prevent the processing from completing.

Specified by:
processBlock in class Activity

mergeResults

private java.lang.String mergeResults(java.lang.String[]?rowsets)
                               throws XMLDocumentException,
                                      XMLParseException
Merge N WebRowSets.

Parameters:
rowsets - N WebRowSet documents
Returns:
merged WebRowSet result as a string or null if there are no documents.
Throws:
XMLDocumentException - If any of the documents are not valid XML
XMLParseException - If an internal parsing exception occurs