uk.org.ogsadai.client.toolkit.activity
Class ParameterizedActivity

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.ParameterizedActivity
Direct Known Subclasses:
SQLQuery, SQLStoredProcedure, SQLUpdate

public abstract class ParameterizedActivity
extends Activity

An OGSA-DAI parameterized activity. Parameterized activities contains a number of parameters whose values or streams can be set using the methods defined here.

Author:
The OGSA-DAI Project Team

Constructor Summary
protected ParameterizedActivity(java.lang.String elementName)
          Constructor - specified the element name to use when generating the XML.
 
Method Summary
 void clearParameters()
          Clears the parameter values.
protected  java.lang.String generateParametersXML()
          Generates the fragment of XML that specifies the parameter values.
 void setParameter(int index, ActivityOutput output)
          Sets the stream of the specified parameter.
 void setParameter(int index, java.lang.String value)
          Sets the value of the specified parameter.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, generateXML, getDataResourceID, getDataServiceStub, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setDataServiceStub, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterizedActivity

protected ParameterizedActivity(java.lang.String elementName)
Constructor - specified the element name to use when generating the XML.

Parameters:
elementName - element name to use when generating the XML.
Method Detail

setParameter

public void setParameter(int index,
                         java.lang.String value)
Sets the value of the specified parameter.

Parameters:
index - index of parameter (the first parameter is 1)
value - value of the parameter
Throws:
java.lang.IndexOutOfBoundsException - If the index parameter is less than 1.
java.lang.IllegalArgumentException - If value parameter is null.

setParameter

public void setParameter(int index,
                         ActivityOutput output)
Sets the stream of the specified parameter.

Parameters:
index - index of parameter (the first parameter is 1)
output - stream for the parameter to retrieve data from.
Throws:
java.lang.IndexOutOfBoundsException - If the index parameter is less than 1.
java.lang.IllegalArgumentException - If output parameter is null.

clearParameters

public void clearParameters()
Clears the parameter values.


generateParametersXML

protected java.lang.String generateParametersXML()
Generates the fragment of XML that specifies the parameter values.

The XML fragment will contain an element for each parameter. The element will be of the form:
< elementName position="index"> value </elementName>
Where elementName is the is the element name specified in the constructor, index is the parameter index and value is the parameter value.

Returns:
A String of XML.