uk.org.ogsadai.client.toolkit.activity.transform
Class BlockAggregator

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.transform.BlockAggregator

public class BlockAggregator
extends Activity

This activity aggregates sequences of blocks together to form larger blocks. It can be chained between two activities, such as an SQLQuery and an OutputStream, in order to condense a large number of small blocks generated by a certain SQL query into a smaller number of larger blocks for more optimial delivery from the output stream.

Author:
The OGSA-DAI Project Team

Constructor Summary
BlockAggregator(ActivityOutput input)
          Constructs an activity to perform an aggregation of the blocks generated by the output of another activity.
BlockAggregator(ActivityOutput input, int blockSize)
          Constructs a request to perform an aggregation of the blocks generated by the output of another activity.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getOutput()
          Gets the activity's only output.
 void setBlockSize(int blockSize)
          Sets the number of blocks to aggregate together into each larger block.
 void setInput(ActivityOutput input)
          Sets the name of the output that will provide the 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

BlockAggregator

public BlockAggregator(ActivityOutput input)
Constructs an activity to perform an aggregation of the blocks generated by the output of another activity. Sets the number of blocks to aggregate together into each larger block to the default size of 10.

Parameters:
input - output from another activity

BlockAggregator

public BlockAggregator(ActivityOutput input,
                       int blockSize)
Constructs a request to perform an aggregation of the blocks generated by the output of another activity.

Parameters:
input - output from another activity
blockSize - the number of blocks to aggregate together into each larger block.
Method Detail

getOutput

public ActivityOutput getOutput()
Gets the activity's only output.

Returns:
the activity output

setInput

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

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

setBlockSize

public final void setBlockSize(int blockSize)
Sets the number of blocks to aggregate together into each larger block.

Parameters:
blockSize - the number of blocks

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