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

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
Direct Known Subclasses:
AbstractDeliverFromDTActivity, AbstractDeliverToDTActivity, AbstractInputStreamActivity, AbstractOutputStreamActivity, AddAndIndexFile, BlockAggregator, DataStore, DeliverFromFile, DeliverFromGFTP, DeliverFromURL, DeliverToFile, DeliverToGFTP, DeliverToSMTP, DeliverToStream, DeliverToURL, ExampleActivity, FileWriting, GZIPCompression, IndexedFileSearch, Notification, ParameterizedActivity, ReadFile, SQLBulkLoad, SQLCreateDatabase, SQLDropDatabase, StringTokenizerActivity, XMLBulkLoad, XMLCreateCollection, XMLCreateResource, XMLCreateResourceFromActivityOutput, XMLListCollections, XMLListResources, XMLRemoveCollection, XMLRemoveResource, XPathQuery, XSLTransform, XUpdate, ZIPArchive

public abstract class Activity
extends RequestComponent

An OGSA-DAI activity.

An activity is a operation than can be manipulate data in some way. OGSA-DAI requests consist of a sequence of activities with connected inputs and outputs. Example activites are:

Author:
The OGSA-DAI Project Team

Constructor Summary
protected Activity()
          Constructs an activity with no outputs.
 
Method Summary
protected  ActivityInputParameterInternal addInput(java.lang.String parameterName)
          Adds a new input to the activity.
protected  ActivityOutputParameterInternal addOutput(java.lang.String parameterName)
          Adds a new output to the activity.
protected  void addOutputs(java.util.Map allOutputs)
          Adds the outputs of this component to the given hash map.
protected abstract  java.lang.String generateXML()
          Generates the XML representing the activity.
protected  ResourceID getDataResourceID()
          Returns the resource ID of the data service resource executing this activity, or null if there is no associated resource.
protected  Stub getDataServiceStub()
          Returns the DataService object executing this activity, or null if there is no associated service.
 ActivityInputParameter[] getInputParameters()
          Gets details relating to the activity's input parameters.
 ActivityOutputParameter[] getOutputParameters()
          Gets details relating to the activity's output parameters.
protected  ActivityOutput[] getOutputs()
          Gets the activity outputs.
protected  java.lang.String replaceSpecialCharacters(java.lang.String input)
          Replaces the special characters in the given input with the equivalent predefined entities.
protected  void setDataResourceID(ResourceID id)
          Sets the ResourceID object which this activity is being executed with.
protected  void setDataServiceStub(Stub stub)
          Sets the DataService object which this activity is being executed with.
 void setInput(int index, java.lang.String outputName)
          Sets the name of the output that will provide the specified input to this activity.
 
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

Activity

protected Activity()
Constructs an activity with no outputs.

Method Detail

addInput

protected ActivityInputParameterInternal addInput(java.lang.String parameterName)
Adds a new input to the activity.

Parameters:
parameterName - Name of input parameter
Returns:
details of the input parameter - this object allows the caller to specify other details of the input parameter.
Throws:
java.lang.IllegalArgumentException - If argument is null.

addOutput

protected ActivityOutputParameterInternal addOutput(java.lang.String parameterName)
Adds a new output to the activity.

Parameters:
parameterName - Name of the output parameter.
Returns:
details of the output parameter - this object allows the caller to specify other details of the output parameter.
Throws:
java.lang.IllegalArgumentException - If argument is null.

getOutputs

protected ActivityOutput[] getOutputs()
Gets the activity outputs.

This mechanism to obtain the activity outputs is required so that these outputs can be populated appropriate result data when a response document is received.

Returns:
an array of activity outputs

getInputParameters

public ActivityInputParameter[] getInputParameters()
Gets details relating to the activity's input parameters.

Client programmers usually have no need for this method. The details returned are useful for Request classes that wish to validate its activities, for example to check for cycles or unspecified inputs. The details would also be useful in developing a tool that allows users to interactively connect activities.

Returns:
An array containing details of each of the activity's input parameters.

getOutputParameters

public ActivityOutputParameter[] getOutputParameters()
Gets details relating to the activity's output parameters.

Client programmers usually have no need for this method. The details returned are useful for Request classes that wish to validate its activities, for example to check for cycles or unspecified inputs. The details would also be useful in developing a tool that allows users to interactively connect activities.

Returns:
An array containing details of each of the activity's output parameters.

setInput

public void setInput(int index,
                     java.lang.String outputName)
Sets the name of the output that will provide the specified input to this activity.

Parameters:
index - index of the input - corresponds to the appropriate index into the array returned by getInputParameters. Value must be in range 0..n-1 where n is the number of inputs.
outputName - name of output to use as input
Throws:
java.lang.IndexOutOfBoundsException - If the index value is out of bounds.
java.lang.IllegalArgumentException - If any of the arguments are null.

setDataResourceID

protected void setDataResourceID(ResourceID id)
Description copied from class: RequestComponent
Sets the ResourceID object which this activity is being executed with. If there is exactly one resource then this method need not be called, and the ResourceID object will be null.

Overrides:
setDataResourceID in class RequestComponent
Parameters:
id - the resource ID

getDataResourceID

protected ResourceID getDataResourceID()
Description copied from class: RequestComponent
Returns the resource ID of the data service resource executing this activity, or null if there is no associated resource. This method may be called by activities which need to know the service object.

Overrides:
getDataResourceID in class RequestComponent
Returns:
the resource ID.

getDataServiceStub

protected Stub getDataServiceStub()
Description copied from class: RequestComponent
Returns the DataService object executing this activity, or null if there is no associated service. This method may be called by activities which need to know the service object.

Overrides:
getDataServiceStub in class RequestComponent
Returns:
the DataService object

setDataServiceStub

protected void setDataServiceStub(Stub stub)
Description copied from class: RequestComponent
Sets the DataService object which this activity is being executed with. If there is no service (i.e. the Activity Engine is executing in a stand-alone environment) then this method need not be called, and the DataService object will be null.

Overrides:
setDataServiceStub in class RequestComponent
Parameters:
stub - the service object

generateXML

protected abstract java.lang.String generateXML()
Description copied from class: RequestComponent
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Specified by:
generateXML in class RequestComponent
Returns:
the XML for the activity

replaceSpecialCharacters

protected java.lang.String replaceSpecialCharacters(java.lang.String input)
Replaces the special characters in the given input with the equivalent predefined entities.

Parameters:
input - string to process
Returns:
the input string, with special characters replaced by the equivalent predefined entities.

addOutputs

protected void addOutputs(java.util.Map allOutputs)
Description copied from class: RequestComponent
Adds the outputs of this component to the given hash map.

Specified by:
addOutputs in class RequestComponent
Parameters:
allOutputs -