uk.org.ogsadai.activity.sql.parameters
Class StreamInput

java.lang.Object
  |
  +--uk.org.ogsadai.activity.sql.parameters.StreamInput
All Implemented Interfaces:
ParameterInput

public class StreamInput
extends java.lang.Object
implements ParameterInput

Class managing activity stream input to a parameterised SQL statement.

Author:
The OGSA-DAI Project Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  BlockReader mInput
          Activity output stream from another activity
private  boolean mIsClosed
          Is the stream closed (initially false)
private  int mPosition
          Position of this parameter
private  java.lang.String mStreamName
          Name of stream of another activity providing the parameter values
 
Constructor Summary
StreamInput(BlockReader reader)
          Constructor.
StreamInput(java.lang.String streamName)
          Constructor This object must be initialised with a ActivityContext using initialise.
 
Method Summary
 java.lang.Object getNextObject()
          Get the next value for the parameter.
 void initialise(int position, ActivityContext context)
          Optionally initialise a parameter using the current activity context.
 boolean isDone()
          Indicates whether the stream is closed.
 
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

mStreamName

private java.lang.String mStreamName
Name of stream of another activity providing the parameter values


mInput

private BlockReader mInput
Activity output stream from another activity


mIsClosed

private boolean mIsClosed
Is the stream closed (initially false)


mPosition

private int mPosition
Position of this parameter

Constructor Detail

StreamInput

public StreamInput(java.lang.String streamName)
Constructor This object must be initialised with a ActivityContext using initialise.

Parameters:
streamName - Name of output stream name of another activity.

StreamInput

public StreamInput(BlockReader reader)
Constructor. Used for testing.

Parameters:
reader - Output stream of another activity.
Method Detail

getNextObject

public java.lang.Object getNextObject()
                               throws java.util.NoSuchElementException,
                                      ParameterAccessException
Description copied from interface: ParameterInput
Get the next value for the parameter.

Specified by:
getNextObject in interface ParameterInput
Throws:
ParameterAccessException - If a problem occurs.
java.util.NoSuchElementException - If there are no more values.

initialise

public void initialise(int position,
                       ActivityContext context)
                throws ParameterSetupException
Description copied from interface: ParameterInput
Optionally initialise a parameter using the current activity context. Useful if the activity receives its values from another activity's output.

Specified by:
initialise in interface ParameterInput
Parameters:
position - Current position of this parameter
context - Activity context
Throws:
ParameterSetupException - If some error occurs due to the client's settings.

isDone

public boolean isDone()
Indicates whether the stream is closed.

Specified by:
isDone in interface ParameterInput
Returns:
true if this input stream is closed i.e. if the last block has been read.
See Also:
ParameterInput.isDone()