uk.org.ogsadai.client.toolkit
Interface ActivityOutput

All Known Implementing Classes:
GenericActivityActivityOutput, SimpleActivityOutput

public interface ActivityOutput

Client-side representation of activity output.

Provides a means of connecting activities in a request and also of accessing the data output by an activity when the request is executed by a service.

Author:
The OGSA-DAI Project Team

Method Summary
 DataValueIterator getDataValueIterator()
          Gets an iterator to the data values written to the first output occurrence.
 DataValueIterator getDataValueIterator(int index)
          Gets a DataValueIterator.
 int getNumberOfOutputs()
          Gets the number of output occurrences
 java.lang.String getOutputName()
          Gets the name of the output.
 java.lang.String getPipeName()
          Gets the name of the pipe associated with the first output occurrence.
 java.lang.String getPipeName(int index)
          Gets the pipe name that the occurrence at the specified index is connected to.
 SingleActivityOutput[] getSingleActivityOutputs()
          Gets an array of SingleActivityOutput
 boolean hasData()
          Gets whether data is available for the first output occurrence.
 boolean hasData(int index)
          Indicates whether occurrence at the specified index has more data
 void setDataSourceResource(DataSourceResource dataSourceResource)
          Deprecated. this method is equivalent to calling setDataValueIterator with argument new DataSourceDataValueIterator(dataSourceResource). That is now the recommended means of providing this functionality.
 void setDataSourceResource(int index, DataSourceResource dataSourceResource)
          Deprecated. this method is equivalent to calling setDataValueIterator with argument new DataSourceDataValueIterator(dataSourceResource) for the same index. That is now the recommended means of providing this functionality.
 void setDataSourceResourceBlocksSize(int numBlocks)
          Deprecated. this method simply calls the setNumBlocksPerCall method of the DataSourceResource object given to this object by the setDataSourceResource call, assuming that object implements the DataSourceDataValueIterator interface. The recommended approach is to call that method directly on the DataSourceDataValueIterator object and pass it to this object using the setDataValueIterator method.
 void setDataSourceResourceBlocksSize(int index, int numBlocks)
          Deprecated. this method simply calls the setNumBlocksPerCall method of the DataSourceResource object given to this object by the setDataSourceResource call, assuming that object implements the DataSourceDataValueIterator interface. The recommended approach is to call that method directly on the DataSourceDataValueIterator object and pass it to this object using the setDataValueIterator method.
 void setDataValueIterator(DataValueIterator dataValueIterator)
          Sets the data value iterator to use when reading data from this input.
 void setDataValueIterator(int index, DataValueIterator dataValueIterator)
          Sets the data value iterator to use when reading data from this output.
 void setNumberOfOutputs(int count)
          Sets the occurrences of this output.
 void validateState()
          Validates the state of the output by validating all the occurtences of the output.
 

Method Detail

getOutputName

java.lang.String getOutputName()
Gets the name of the output. This is label used to identify the various outputs from an activity. It is only unique within the activity.

Returns:
activity output name.

getPipeName

java.lang.String getPipeName()
Gets the name of the pipe associated with the first output occurrence. This pipe name will be unique to this output instance.

Returns:
pipe name.

hasData

boolean hasData()
Gets whether data is available for the first output occurrence.

Returns:
true if data is available, false otherwise.

getDataValueIterator

DataValueIterator getDataValueIterator()
                                       throws ActivityOutputUnreadableException
Gets an iterator to the data values written to the first output occurrence.

Returns:
iterator to the data values written to this output.
Throws:
ActivityOutputUnreadableException - if the activity output cannot be read because the final request status has yet to be received data from server.

validateState

void validateState()
                   throws ActivityIOIllegalStateException
Validates the state of the output by validating all the occurtences of the output.

Throws:
ActivityIOIllegalStateException - if the output is in an illegal state.

setNumberOfOutputs

void setNumberOfOutputs(int count)
Sets the occurrences of this output.

Parameters:
count - the count of output occurrences

getNumberOfOutputs

int getNumberOfOutputs()
Gets the number of output occurrences

Returns:
the number of output occurrences

getSingleActivityOutputs

SingleActivityOutput[] getSingleActivityOutputs()
Gets an array of SingleActivityOutput

Returns:
an array of SingleActivityOutput

hasData

boolean hasData(int index)
Indicates whether occurrence at the specified index has more data

Parameters:
index - the index of the output occurrence
Returns:
true if there are more data, false otherwise

getPipeName

java.lang.String getPipeName(int index)
Gets the pipe name that the occurrence at the specified index is connected to.

Parameters:
index - the index of the output occurrence
Returns:
the pipe name

getDataValueIterator

DataValueIterator getDataValueIterator(int index)
                                       throws ActivityOutputUnreadableException,
                                              java.lang.ArrayIndexOutOfBoundsException
Gets a DataValueIterator. It can be iterated to get DataValue objects

Parameters:
index - the index of the output occurrence
Returns:
a DataValueIterator
Throws:
ActivityOutputUnreadableException - if the activity output cannot be read because the final request status has yet to be received data from server.
java.lang.ArrayIndexOutOfBoundsException - if index is out of bounds

setDataValueIterator

void setDataValueIterator(DataValueIterator dataValueIterator)
Sets the data value iterator to use when reading data from this input. This method can be used when the workflow sent to OGSA-DAI has connected this output to a data source resource using the WriteToDataSource activity. In such cases the given data value iterator will be an iterator that gives access to the data from the data source resource.

Parameters:
dataValueIterator - data value iterator that gives access to the data the output produced.

setDataValueIterator

void setDataValueIterator(int index,
                          DataValueIterator dataValueIterator)
Sets the data value iterator to use when reading data from this output. This method can be used when the workflow sent to OGSA-DAI has connected this output to a data source resource using the WriteToDataSource activity. In such cases the given data value iterator will be an iterator that gives access to the data from the data source resource.

Parameters:
index - the index of the output occurrence
dataValueIterator - data value iterator that gives access to the data the output produced.

setDataSourceResource

void setDataSourceResource(DataSourceResource dataSourceResource)
Deprecated. this method is equivalent to calling setDataValueIterator with argument new DataSourceDataValueIterator(dataSourceResource). That is now the recommended means of providing this functionality.

Sets a data source resource through which result data of the first output occurrence can be read.

Parameters:
dataSourceResource - data source resource.

setDataSourceResourceBlocksSize

void setDataSourceResourceBlocksSize(int numBlocks)
Deprecated. this method simply calls the setNumBlocksPerCall method of the DataSourceResource object given to this object by the setDataSourceResource call, assuming that object implements the DataSourceDataValueIterator interface. The recommended approach is to call that method directly on the DataSourceDataValueIterator object and pass it to this object using the setDataValueIterator method.

Sets the maximum number of blocks to retrieve from a data source connected to the first output occurrence resource via each call to the resource.

Parameters:
numBlocks - maximum number of blocks to receive each call.

setDataSourceResource

void setDataSourceResource(int index,
                           DataSourceResource dataSourceResource)
Deprecated. this method is equivalent to calling setDataValueIterator with argument new DataSourceDataValueIterator(dataSourceResource) for the same index. That is now the recommended means of providing this functionality.

Sets a data source resource through which result data of the specified output occurrence can be read.

Parameters:
index - the index of the output occurrence
dataSourceResource - data source resource.

setDataSourceResourceBlocksSize

void setDataSourceResourceBlocksSize(int index,
                                     int numBlocks)
Deprecated. this method simply calls the setNumBlocksPerCall method of the DataSourceResource object given to this object by the setDataSourceResource call, assuming that object implements the DataSourceDataValueIterator interface. The recommended approach is to call that method directly on the DataSourceDataValueIterator object and pass it to this object using the setDataValueIterator method.

Sets the maximum number of blocks to retrieve from a data source connected to the first output occurrence resource via each call to the resource.

Parameters:
index - index of the output occurrence
numBlocks - maximum number of blocks to receive each call.