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:
AddAndIndexFile, BlockAggregator, BytesToTempFile, CopyFile, CreateFile, CSV, CSVProjection, DatabaseSchemaToXML, DataStore, DeleteFile, DeliverFromDT, DeliverFromFile, DeliverFromGFTP, DeliverFromURL, DeliverToAttachment, DeliverToDT, DeliverToFile, DeliverToGFTP, DeliverToNull, DeliverToResourceProperty, DeliverToSMTP, DeliverToStream, DeliverToURL, DemoCreateInstance, DemoCreateTransientInstance, DemoExternalInput, DemoQueryInstance, DirectoryAccess, DTInputStream, DTOutputStream, ExampleActivity, ExtractDatabaseSchema, ExtractPhysicalSchema, FileWriting, FrequencyDistributor, GZIPCompression, GZIPDecompression, IndexedFileSearch, MoveFile, Notification, ParameterizedActivity, RandomSample, ReadFile, RemoveDataServiceResource, RemoveDuplicatesWebRowSet, ResultsetProjection, SQLBag, SQLBulkLoad, SQLResilientQuery, SQLResultToBytes, StringTokenizerActivity, WebRowSet, WebRowSetProjection, XMLBulkLoad, XMLCreateCollection, XMLCreateResource, XMLCreateResourceFromActivityOutput, XMLListCollections, XMLListResources, XMLRemoveCollection, XMLRemoveResource, XPathQuery, XQuery, XSLTransform, XUpdate, ZIPArchive

public abstract class Activity
extends RequestComponent

An OGSA-DAI activity - a request component.

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

Field Summary
private static?java.lang.String COPYRIGHT_NOTICE
??????????Copyright statement
private ?java.util.List mInputParams
??????????A list of the activity's input parameters (ActivityInputParameter)
private ?java.util.List mOutputParams
??????????A list of the activity's output parameters (ActivityOuyputParameter)
?
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
?
Constructor Summary
protected Activity()
??????????Constructs an activity with no inputs or 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)
??????????Add the outputs of this request component to the given map.
protected abstract ?java.lang.String generateXML()
??????????Generates the XML representing the activity.
protected ?ResourceID getDataResourceID()
??????????Gets the ID of the data service resource executing this activity, or null if there is no associated resource.
?ActivityInputParameter[] getInputParameters()
??????????Gets the activity's input parameters.
?ActivityOutputParameter[] getOutputParameters()
??????????Gets 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 XML entities.
protected ?void setDataResourceID(ResourceID?id)
??????????Sets the ID of the data service resource executing this activity, or null if there is no associated resource.
?void setInput(int?index, java.lang.String?outputName)
??????????Sets the name of the output of another activity in the same request that will provide data for a specific input of this activity.
?
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

mInputParams

private java.util.List mInputParams
A list of the activity's input parameters (ActivityInputParameter)


mOutputParams

private java.util.List mOutputParams
A list of the activity's output parameters (ActivityOuyputParameter)

Constructor Detail

Activity

protected Activity()
Constructs an activity with no inputs or 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 parameterName is null.

addOutput

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

Parameters:
parameterName - Name of output parameter.
Returns:
details of the input parameter - this object allows the caller to specify other details of the output parameter.
Throws:
java.lang.IllegalArgumentException - If parameterName 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 to a request is received.

Returns:
an array of activity outputs.

getInputParameters

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

Client programmers usually have no need for this method. The details returned are useful for uk.org.ogsadai.client.toolkit.Request classes that wish to validate their 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 the activity's output parameters.

Client programmers usually have no need for this method. The details returned are useful for uk.org.ogsadai.client.toolkit.Request classes that wish to validate their activities, for example to check for cycles. 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 of another activity in the same request that will provide data for a specific input of 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 of another activity that will provide the input data.
Throws:
java.lang.IndexOutOfBoundsException - If index is out of bounds.
java.lang.IllegalArgumentException - If outputName is null.

setDataResourceID

protected void setDataResourceID(ResourceID?id)
Description copied from class: RequestComponent
Sets the ID of the data service resource executing this activity, or null if there is no associated resource.

Overrides:
setDataResourceID in class RequestComponent
Parameters:
id - Resource ID

getDataResourceID

protected ResourceID getDataResourceID()
Description copied from class: RequestComponent
Gets the 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 information about the resource.

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

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 XML 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
Add the outputs of this request component to the given map. The map is assumed to map java.lang.String to uk.org.ogsadai.client.toolkit.activity.ActivityOutput.

Specified by:
addOutputs in class RequestComponent
Parameters:
allOutputs - Map from strings to activity outputs.