uk.org.ogsadai.client.toolkit
Interface SingleActivityOutput

All Known Subinterfaces:
TraversableSingleActivityOutput
All Known Implementing Classes:
NamedSingleActivityOutput, SimpleSingleActivityOutput, SimpleTraversableSingleActivityOutput

public interface SingleActivityOutput

Client-side representation of single 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 this output.
 boolean getIsConnected()
          Gets whether the output has been connected to an input.
 java.lang.String getOutputName()
          Gets the name of the output.
 java.lang.String getPipeName()
          Gets the name of the pipe associated with this output.
 ActivityOutputRequestStatusHandler getRequestStatusHandler()
          Gives access to the methods required process a request status.
 boolean hasData()
          Gets whether data is available for this output.
 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 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 setDataValueIterator(DataValueIterator dataValueIterator)
          Sets the data value iterator to use when reading data from this output.
 void setDeliverToRequestStatusActivity(DeliverToRequestStatus deliverToRequestStatus)
          Deprecated. Use setResultActivity(uk.org.ogsadai.client.toolkit.ResultActivity).
 void setIsConnected()
          Sets that the output has been connected to an input.
 void setResultActivity(ResultActivity activity)
          Sets the activity that was used to write data to the request status.
 void validateState()
          Validates the state 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 this output. This pipe name will be unique to this output instance.

Returns:
pipe name.

setIsConnected

void setIsConnected()
Sets that the output has been connected to an input.


getIsConnected

boolean getIsConnected()
Gets whether the output has been connected to an input.

Returns:
true if the output has been connected, false otherwise.

hasData

boolean hasData()
Gets whether data is available for this output.

Returns:
true if data is available, false otherwise.

getDataValueIterator

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

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.

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 can be read. 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.

Parameters:
dataSourceResource - client proxy for the data source resource to which the output has been written.

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 resource via each call to the resource. This method must only be used in conjunction with the setDataSourceResource method.

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

setDataValueIterator

void setDataValueIterator(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:
dataValueIterator - data value iterator that gives access to the data the output produced.

setDeliverToRequestStatusActivity

void setDeliverToRequestStatusActivity(DeliverToRequestStatus deliverToRequestStatus)
Deprecated. Use setResultActivity(uk.org.ogsadai.client.toolkit.ResultActivity).

Sets the deliver to request status activity that was used to write data to the request status. Details from the activity will be used to identify the appropriate data in the request status.

If this output is written directly to a DeliverToRequestStatus activity then the client toolkit framework will automatically associate the output with that activity. This method is only required when the output is not connected directly to the DeliverToRequestStaus activity, for example when there is a Tee activity, or some other activity, between this output and the DeliverToRequestStatus activity.

Parameters:
deliverToRequestStatus - activity used to write this data to the request status.

setResultActivity

void setResultActivity(ResultActivity activity)
Sets the activity that was used to write data to the request status. Details from the activity will be used to identify the appropriate data in the request status.

If this output is written directly to a ResultActivity e.g. DeliverToRequestStatus then the client toolkit will automatically associate the output with that activity. This method is only required when the output is not connected directly to a ResultActivity activity, for example when there is a Tee activity, or some other activity, between this output and the DeliverToRequestStatus activity.

Parameters:
activity - Activity used to write this data to the request status.

getRequestStatusHandler

ActivityOutputRequestStatusHandler getRequestStatusHandler()
Gives access to the methods required process a request status. These method should only be called from within client-side activity implementations.

Returns:
interface containing methods for handling request status.

validateState

void validateState()
                   throws ActivityIOIllegalStateException
Validates the state of the output. An output that is not optional but is unconnected would be in an illegal state.

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