uk.org.ogsadai.client.toolkit.activity.delivery
Class AbstractOutputStreamActivity

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.delivery.AbstractOutputStreamActivity
Direct Known Subclasses:
OutputStreamActivity

public abstract class AbstractOutputStreamActivity
extends Activity

This activity delivers receives data from an activity and passes this out to a client program or via DataTransport operations.

It has one input and no output.

Author:
The OGSA-DAI Project Team

Constructor Summary
AbstractOutputStreamActivity()
          Constructs a request to read file from URL.
AbstractOutputStreamActivity(ActivityOutput input)
          Constructs a request to read file from URL.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
abstract  DataTransport getDataTransport()
          Gets a DataTransport object which can be used to pull data from the data service where this OutputStream is running, via the getFully, getBlock and getNBlocks DataTransport operations.
 java.sql.ResultSet getResultSet()
          Provided that this output stream activity is outputting a WebRowSet xml document, this method may be used to obtain a forward-only ResultSet object which fetches rows from the DataTransport output stream as and when required.
 java.sql.ResultSet getResultSet(int numberOfRowsToFetch)
          Provided that this output stream activity is outputting a WebRowSet xml document, this method may be used to obtain a forward-only ResultSet object which fetches a defined number of rows from the DataTransport output stream as and when required.
 void setInput(ActivityOutput input)
          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.Activity
addInput, addOutput, addOutputs, 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

AbstractOutputStreamActivity

public AbstractOutputStreamActivity()
Constructs a request to read file from URL.


AbstractOutputStreamActivity

public AbstractOutputStreamActivity(ActivityOutput input)
Constructs a request to read file from URL.

Parameters:
input - input from another activity that will provide the input to this activity.
Throws:
java.lang.IllegalArgumentException - If the argument is null.
Method Detail

setInput

public void setInput(ActivityOutput input)
Sets the name of the output that will provide the specified input to this activity.

Parameters:
input - input from another activity.
Throws:
java.lang.IllegalArgumentException - If the argument is null.

generateXML

protected 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 Activity
Returns:
the XML for the activity
See Also:
Activity.generateXML()

getResultSet

public java.sql.ResultSet getResultSet()
                                throws ResourceException,
                                       DataFormatException,
                                       ServiceCommsException
Provided that this output stream activity is outputting a WebRowSet xml document, this method may be used to obtain a forward-only ResultSet object which fetches rows from the DataTransport output stream as and when required.

If this output stream activity is not outputting a WebRowSet, a SAXException will be thrown.

Returns:
a forward-only result set which only fetches data from the DataTransport output stream when requested
Throws:
DataFormatException
ServiceCommsException
ResourceException

getResultSet

public java.sql.ResultSet getResultSet(int numberOfRowsToFetch)
                                throws ResourceException,
                                       DataFormatException,
                                       ServiceCommsException
Provided that this output stream activity is outputting a WebRowSet xml document, this method may be used to obtain a forward-only ResultSet object which fetches a defined number of rows from the DataTransport output stream as and when required. This can be faster than getting a single row at a time (as the getResultSet() method does), as a SOAP message does not have to be generated for every row.

If this output stream activity is not outputting a WebRowSet, a SAXException will be thrown.

Parameters:
numberOfRowsToFetch - number of rows to fetch in one go. This can speed up the transport of data from an OutputStream, as a SOAP message does not have to be generated for every row.
Returns:
a forward-only result set which only fetches data from the DataTransport output stream when requested
Throws:
DataFormatException
ServiceCommsException
ResourceException
java.lang.IllegalArgumentException - if numberOfRowsToFetch is less than, or equal to zero.

getDataTransport

public abstract DataTransport getDataTransport()
Gets a DataTransport object which can be used to pull data from the data service where this OutputStream is running, via the getFully, getBlock and getNBlocks DataTransport operations.

Returns:
the DataTransport object which can be used to pull data from the data service.