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

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

public class GZIPDecompression
extends Activity

This activity decompresses data from another activity that produces a GZIP archive. In addition to the uncompressed data it also produces metadata about the decompression.

The activity has one input - the data to be decompressed - and two outputs - the uncompressed data and metadata about the decompression. The meta data output has a format analogous to the following example:

<gzipDecompressionMetadata> <checksum type="adler32" value="7615263"/> </gzipDecompressionMetadata>

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static int DECOMPRESSED_OUTPUT_INDEX
          Index of compressed output.
private  ZIPChecksum mChecksumType
          GZIP checksum type.
private static int META_DATA_OUTPUT_INDEX
          Index of meta data output.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
GZIPDecompression()
          Constructs a request to decompress GZIP archive data from another activity.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 java.lang.String getChecksumType()
          Gets the checksum type from the activity's meta data output.
 long getChecksumValue()
          Gets the checksum value from the activity's meta data output.
 ActivityOutput getDecompressedDataOutput()
          Gets the activity's compressed data output.
 ActivityOutput getMetaDataOutput()
          Gets the activity's meta data output.
 void setChecksumType(ZIPChecksum checksumType)
          Sets the GZIP checksum type.
 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

DECOMPRESSED_OUTPUT_INDEX

private static final int DECOMPRESSED_OUTPUT_INDEX
Index of compressed output.

See Also:
Constant Field Values

META_DATA_OUTPUT_INDEX

private static final int META_DATA_OUTPUT_INDEX
Index of meta data output.

See Also:
Constant Field Values

mChecksumType

private ZIPChecksum mChecksumType
GZIP checksum type.

Constructor Detail

GZIPDecompression

public GZIPDecompression()
Constructs a request to decompress GZIP archive data from another activity.

setInput should be called to set the activity that provides input to this activity and setChecksumType to set the type of the checksum. If not then the default of Adler will be used.

Method Detail

setChecksumType

public void setChecksumType(ZIPChecksum checksumType)
Sets the GZIP checksum type.

Parameters:
checksumType - The checksum type.
Throws:
java.lang.IllegalArgumentException - If type is null.

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.

getDecompressedDataOutput

public ActivityOutput getDecompressedDataOutput()
Gets the activity's compressed data output.

Returns:
the compressed data output.

getMetaDataOutput

public ActivityOutput getMetaDataOutput()
Gets the activity's meta data output.

Returns:
the meta data output.

getChecksumValue

public long getChecksumValue()
                      throws NoActivityOutputException,
                             DataFormatException
Gets the checksum value from the activity's meta data output.

Returns:
checksum value.
Throws:
NoActivityOutputException - if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.
DataFormatException - if the output from the activity cannot be parsed into a checksum value.

getChecksumType

public java.lang.String getChecksumType()
                                 throws NoActivityOutputException,
                                        DataFormatException
Gets the checksum type from the activity's meta data output.

Returns:
checksum type.
Throws:
NoActivityOutputException - if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.
DataFormatException - if the output from the activity cannot be parsed into a checksum type.

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()