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

java.lang.Object
  extended byuk.org.ogsadai.client.toolkit.activity.RequestComponent
      extended byuk.org.ogsadai.client.toolkit.activity.Activity
          extended byuk.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 sql query and an output stream 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.

This activity has one input - the data to be aggregated - and one output - the aggregated data.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  int mBlockSize
          The number of blocks to aggregate into each larger block.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
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 an activity 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 - the aggregated data.
 void setBlockSize(int blockSize)
          Sets the number of blocks to aggregate together into each larger block.
 void setInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to be aggregated.
 
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, getSession, 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

mBlockSize

private int mBlockSize
The number of blocks to aggregate into each larger block.

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 a default size of 10.

setInput should be called to set the activity that provides input to this activity.

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

BlockAggregator

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

Parameters:
input - Output from another activity that will provide input to this activity.
blockSize - Number of blocks to aggregate together to form a larger block.
Throws:
java.lang.IllegalArgumentException - If input is null or blockSize < 1.
Method Detail

getOutput

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

Returns:
the activity output

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 aggregated.

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

setBlockSize

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

Parameters:
blockSize - Number of blocks to aggregate together to form a larger block.
Throws:
java.lang.IllegalArgumentException - If blockSize < 1.

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