uk.org.ogsadai.activity.xmldb
Class XUpdateStatementActivity

java.lang.Object
  |
  +--uk.org.ogsadai.activity.Activity
        |
        +--uk.org.ogsadai.activity.xmldb.XMLDBActivity
              |
              +--uk.org.ogsadai.activity.xmldb.XUpdateStatementActivity

public class XUpdateStatementActivity
extends XMLDBActivity

An XMLDBActivity for performing XUpdate statements on XMLDB compliant database Collections and specified resources within them.

For information on this activity see the OGSA-DAI user doc: OGSA-DAI/doc/interaction/activities/xml/xUpdateStatement.html

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static DAILogger LOG
          Logger object for logging in this class
private  java.lang.String mExpression
          The XUpdate expression.
private  java.lang.String mResourceID
          The resource ID to update or null to update the whole collection.
 
Fields inherited from class uk.org.ogsadai.activity.xmldb.XMLDBActivity
mDataResource, mOutput, mSubCollectionName, mUserCredentials
 
Fields inherited from class uk.org.ogsadai.activity.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
XUpdateStatementActivity(org.w3c.dom.Element element)
          Constructs an XUpdate activity using the specified XML element.
 
Method Summary
 void processBlock()
          Performs an iteration of the processing of an activity.
private  java.lang.String resultsToXML(long modifiedNodes)
          Converts the results of the XUpdate execution into an XML string representation.
private  long update()
          This method executes the XUpdate expression.
 
Methods inherited from class uk.org.ogsadai.activity.xmldb.XMLDBActivity
initialise
 
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

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

LOG

private static DAILogger LOG
Logger object for logging in this class


mExpression

private java.lang.String mExpression
The XUpdate expression.


mResourceID

private java.lang.String mResourceID
The resource ID to update or null to update the whole collection.

Constructor Detail

XUpdateStatementActivity

public XUpdateStatementActivity(org.w3c.dom.Element element)
                         throws ActivitySpecificationException,
                                ActivityCreationException
Constructs an XUpdate activity using the specified XML element.

Parameters:
element - Element to configure the activity with - from a perform document.
Throws:
ActivityCreationException - If there is a problem constructing the activity due to an implementation error or OGSA-DAI confguration problem.
ActivitySpecificationException - If there is a problem constructing the activity due to an invalid setting in element. mistake such as an invalid setting.
Method Detail

processBlock

public void processBlock()
Description copied from class: Activity
Performs an iteration of the processing of an activity. This may involve reading a block of input data and writing a block of output data, or may involve some other kind of processing. When an activity is processed by the OGSA-DAI engine, this method will be invoked repeatedly until the activity either completes or stops due to an error or termination call. An implementation of this method should invoke the setCompleted method to indicate that processing is complete, or the setError method if an error occurs that will prevent the processing from completing.

Specified by:
processBlock in class XMLDBActivity

update

private long update()
             throws ActivityExecutionException,
                    ActivitySpecificationException
This method executes the XUpdate expression.

Returns:
the number of nodes that were modified.
Throws:
ActivitySpecificationException - If some problem arises due to incorrect data from the client.
ActivityExecutionException - If some internal problem arises.

resultsToXML

private java.lang.String resultsToXML(long modifiedNodes)
Converts the results of the XUpdate execution into an XML string representation. The format is:
 <modifiedNodes>N<l/modifiedNodes>
 

Parameters:
modifiedNodes - number of modified nodes.
Returns:
string representation