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

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

public class ZIPArchive
extends Activity

This activity archives data from other activities producing a ZIP archive and also metadata about the compression.

It has one or more inputs and two outputs. The meta data output has a format analogous to the following example: <zipArchiveMetadata> <checksum type="adler32" value="7615263"/> </zipArchiveMetadata>

Author:
The OGSA-DAI Project Team

Constructor Summary
ZIPArchive()
          Constructs a request to ZIP archive data from another activities.
 
Method Summary
 void addEntry(ActivityOutput input)
          Sets the name of an output that will provide input to this activity.
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getArchivedDataOutput()
          Gets the activity's archived data output.
 java.lang.String getChecksumType()
          Get the checksum type.
 long getChecksumValue()
          Get the checksum value.
 ActivityOutput getMetaDataOutput()
          Gets the activity's meta data output.
 void setChecksumType(ZIPChecksum checksumType)
          Set the ZIP checksum type.
 void setComment(java.lang.String comment)
          Set the ZIP archive comment.
 void setLevel(int level)
          Set the ZIP archive level.
 
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

ZIPArchive

public ZIPArchive()
Constructs a request to ZIP archive data from another activities.

Method Detail

setChecksumType

public void setChecksumType(ZIPChecksum checksumType)
Set the ZIP checksum type.

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

setComment

public void setComment(java.lang.String comment)
Set the ZIP archive comment.

Parameters:
comment - the comment associated with the zip archive
Throws:
java.lang.IllegalArgumentException - if the comment is null

setLevel

public void setLevel(int level)
Set the ZIP archive level.

Parameters:
level - the level of compression where 0 is the minimum and 9 the maximum
Throws:
java.lang.IllegalArgumentException - if level is < 0 or > 9

getChecksumValue

public long getChecksumValue()
                      throws ActivityOutputException,
                             DataFormatException
Get the checksum value.

Returns:
checksum value.
Throws:
DataFormatException - If the output data is not in the expected format.
ActivityOutputException - If there is no output data.

getChecksumType

public java.lang.String getChecksumType()
                                 throws ActivityOutputException,
                                        DataFormatException
Get the checksum type.

Returns:
checksum type.
Throws:
DataFormatException - If the output data is not in the expected format.
ActivityOutputException - If there is no output data.

addEntry

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

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

getArchivedDataOutput

public ActivityOutput getArchivedDataOutput()
Gets the activity's archived data output.

Returns:
the archived data output.

getMetaDataOutput

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

Returns:
the meta data output.

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