|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uk.org.ogsadai.activity.Activity
|
+--uk.org.ogsadai.activity.transform.BytesToTempFileActivity
This activity takes an stream of byte arrays and writes them to a temporary file on the server. A reference to this file is written to the output.
This activity is useful when writing BLOBs to relational databases. The output of this activity can be passed to one of the parameterized inputs of the SQLUpdateStatement activity in order to write BLOBS to a database.
The activity has a one input. This input passed blocks of type byte[]. The bytes in the input blocks will be written to the temporary file in the order in which they are received.
The activity has one output to which the java.io.File object that refers to the temporary file.
For information on this activity see the OGSA-DAI user doc: OGSA-DAI/doc/interaction/activities/transform/bytesToTempFile.html
| Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICECopyright statement |
static java.lang.String |
FROM_ATTRIBUTE |
static java.lang.String |
INPUT_ELEMENT |
private static DAILogger |
LOGLogger object for logging in this class |
protected java.io.OutputStream |
mFileOutputStream |
protected BlockReader |
mInputReader that provides the activity's only input |
protected java.lang.String |
mInputStreamNameName of the activity's only input stream |
protected BlockWriter |
mOutputWrite to which the activity's output is written |
protected java.io.File |
mOutputFile |
protected java.lang.String |
mOutputStreamNameName of the activity's only output stream |
static java.lang.String |
NAME_ATTRIBUTE |
static java.lang.String |
OUTPUT_ELEMENT |
| Fields inherited from class uk.org.ogsadai.activity.Activity |
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs |
| Constructor Summary | |
BytesToTempFileActivity(org.w3c.dom.Element element)Constructs an instance of the BytesToTempFileActivity activity. |
|
| Method Summary | |
java.lang.String |
getInputStreamName()Gets the activity's input stream name. |
java.lang.String |
getOutputStreamName()Gets the activity's output stream name. |
void |
initialise()This method should be overridden by subclasses to perform any initialisation they require before the process method invocations begin. |
protected void |
processBlock()Performs an iteration of the processing of an activity. |
| Methods inherited from class uk.org.ogsadai.activity.Activity |
cleanUp, connectsTo, createOutputPipe, getActivityConfiguration, getActivityName, getCause, getName, getObservableStatus, getProperties, getSession, getStatus, hasActivityConfiguration, hasProperties, process, processFirst, setActivityName, setCompleted, setError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static DAILogger LOG
public static final java.lang.String INPUT_ELEMENT
public static final java.lang.String OUTPUT_ELEMENT
public static final java.lang.String FROM_ATTRIBUTE
public static final java.lang.String NAME_ATTRIBUTE
protected java.lang.String mInputStreamName
protected BlockReader mInput
protected java.lang.String mOutputStreamName
protected BlockWriter mOutput
protected java.io.File mOutputFile
protected java.io.OutputStream mFileOutputStream
| Constructor Detail |
public BytesToTempFileActivity(org.w3c.dom.Element element)
throws ActivitySpecificationException,
ActivityCreationException
The schema of the input XML element is defined in bytes_to_temp_file.xsd. An example is:
<bytesToTempFile name="myActivityInstance"> <input from="inputStream"/> <output name="outputStream"/> </bytesToTempFile>The
input element specifies the input to this activity. The output element output stream.
element - parameters for the activity expressed in XML format.ActivitySpecificationException - if an error occurs due to the user's incorrect input.ActivityCreationException - if a error occurs beyond the specification of the input parameters.| Method Detail |
public void initialise()
throws ActivitySpecificationException,
ActivityExecutionException
Activityprocess method invocations begin. This might be used for setting up convenient fields to reference objects contained in the context. It shouldn't be used for opening resources. That should be done in processFirst.
initialise in class ActivityActivityExecutionException - If some system problem prevents the activity from initialising.ActivitySpecificationException - If a problem with settings provided by a client prevents the activity from initialising.public java.lang.String getInputStreamName()
public java.lang.String getOutputStreamName()
protected void processBlock()
ActivitysetCompleted method to indicate that processing is complete, or the setError method if an error occurs that will prevent the processing from completing.
processBlock in class Activity
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||