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

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.delivery.DTOutputStream

public class DTOutputStream
extends Activity

This activity exposes data through a data service's get operations.

It has one input - the data to expose - and no outputs.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
DTOutputStream()
          Constructs a request to read file from URL.
DTOutputStream(ActivityOutput input)
          Constructs a request to read file from URL.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 DataTransport getDataTransport()
          Gets an object which can be used to get data from the data service which received the request containing this activity.
 java.sql.ResultSet getResultSet()
           
 java.sql.ResultSet getResultSet(int numberOfRowsToFetch)
          Coverts data exposed by this activity into a forward-only java.sql.ResultSet only if the activity providing input to this activity outputs data in WebRowSet XML format.
 Session getSession()
          Gets the session that the request to which this request component belongs has been executed within.
 void setInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to be exposed.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getDataService, getName, 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
Constructor Detail

DTOutputStream

public DTOutputStream()
Constructs a request to read file from URL. The activity providing the input data must be set using setInput.


DTOutputStream

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

Parameters:
input - Output from another activity.
Throws:
java.lang.IllegalArgumentException - If input is null.
Method Detail

setInput

public final void setInput(ActivityOutput input)
Sets the input of this activity to be the output from another activity that will provide the data to be exposed.

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

getDataTransport

public DataTransport getDataTransport()
Gets an object which can be used to get data from the data service which received the request containing this activity. Note that this method must not be invoked before the response to the request containing this activity has been received.

Returns:
DataTransport object.
Throws:
java.lang.IllegalStateException - If invoked before the response for the request containing this activity has been received.

getSession

public Session getSession()
Description copied from class: RequestComponent
Gets the session that the request to which this request component belongs has been executed within.

Overrides:
getSession in class RequestComponent

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 StreamDataException,
                                       DataFormatException
StreamDataException
DataFormatException

getResultSet

public java.sql.ResultSet getResultSet(int numberOfRowsToFetch)
                                throws StreamDataException,
                                       DataFormatException
Coverts data exposed by this activity into a forward-only java.sql.ResultSet only if the activity providing input to this activity outputs data in WebRowSet XML format. The ResultSet will fetch rows from this activity server-side on demand.

Parameters:
numberOfRowsToFetch - Number of rows to fetch from service at a time.
Returns:
a forward-only result set which only fetches data from this activity server-side when requested
Throws:
java.lang.IllegalArgumentException - If numberOfRowsToFetch is <= 0.
StreamDataException - If there is a problem when streaming the data from the service.
DataFormatException