uk.org.ogsadai.client.toolkit.activity.sql
Class ResultsetProjection

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.sql.ResultsetProjection

public class ResultsetProjection
extends Activity

This activity projects data referenced in a Resultset onto a column specified by name or index.

The activity has one input - the Resultset - and one output - the projected values.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  int mColumnIndex
          Index of column to project onto
private  java.lang.String mColumnName
          Name of column to project onto
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
ResultsetProjection(ActivityOutput input, int columnIndex)
          Constructor.
ResultsetProjection(ActivityOutput input, java.lang.String columnName)
          Constructor.
 
Method Summary
protected  java.lang.String generateXML()
          Gets something useful from the result data produced by the activity, if there was any result data.
 ActivityOutput getOutput()
          Gets the activity output - the projected column values.
 void setInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to be sampled.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getDataService, getName, getSession, setDataService, setSession
 
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

mColumnName

private java.lang.String mColumnName
Name of column to project onto


mColumnIndex

private int mColumnIndex
Index of column to project onto

Constructor Detail

ResultsetProjection

public ResultsetProjection(ActivityOutput input,
                           java.lang.String columnName)
Constructor.

Parameters:
input - Output from another activity which provides the resultset.
columnName - Name of column to project onto.
Throws:
java.lang.IllegalArgumentException - If input or columnName are null.

ResultsetProjection

public ResultsetProjection(ActivityOutput input,
                           int columnIndex)
Constructor.

Parameters:
input - Output from another activity which provides the resultset.
columnIndex - Index of column to project onto.
Throws:
java.lang.IllegalArgumentException - If input is null or columnIndex < 1.
Method Detail

setInput

public final void setInput(ActivityOutput input)
Sets the input of this activity to be the output from another activity that will provide the data to be sampled.

Parameters:
input - Output from another activity.
Throws:
java.lang.IllegalArgumentException - If input is null.

getOutput

public ActivityOutput getOutput()
Gets the activity output - the projected column values.

Returns:
the activity output

generateXML

protected java.lang.String generateXML()
Gets something useful from the result data produced by the activity, if there was any result data.

Specified by:
generateXML in class Activity
Returns:
something useful
Throws:
DataFormatException - if the result data is not in the expected format
NoActivityOutputException - if there is no result data for this activity.