uk.org.ogsadai.activity.xmldb
Class XMLBulkLoadActivity

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

public class XMLBulkLoadActivity
extends XMLDBActivity

An XMLDBActivity for bulk loading data into a XMLDB compliant database collection.

Author:
The OGSA-DAI Project Team

Field Summary
static java.lang.String ATTRIBUTE_CREATE
           
static java.lang.String ELEMENT_FROM_LOCAL
           
static java.lang.String ELEMENT_OUTPUT
           
static java.lang.String FOOTER
          Footer for the XML representation.
static java.lang.String HEADER
          Header for the XML representation.
 
Fields inherited from class uk.org.ogsadai.activity.xmldb.XMLDBActivity
mDataResource, mOutput, mSubCollectionName, mUserCredentials
 
Fields inherited from class uk.org.ogsadai.engine.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
XMLBulkLoadActivity(org.w3c.dom.Element element)
          Constructs an instance for the specified Element.
 
Method Summary
protected  void initialise()
          Initialises the activity prior to processing by retrieving the ConnectionManager, the user credentials and the activity output from the context.
 void processBlock()
          Loads a resource into the open collection.
 void processFirst()
          Starts the processing by opening the collection for bulk loading.
 
Methods inherited from class uk.org.ogsadai.engine.Activity
cleanUp, connectsTo, getActivityConfiguration, getName, getObservableStatus, getProperties, getStatus, hasActivityConfiguration, hasProperties, setCompleted, setError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_FROM_LOCAL

public static final java.lang.String ELEMENT_FROM_LOCAL
See Also:
Constant Field Values

ELEMENT_OUTPUT

public static final java.lang.String ELEMENT_OUTPUT
See Also:
Constant Field Values

ATTRIBUTE_CREATE

public static final java.lang.String ATTRIBUTE_CREATE
See Also:
Constant Field Values

HEADER

public static final java.lang.String HEADER
Header for the XML representation.

See Also:
Constant Field Values

FOOTER

public static final java.lang.String FOOTER
Footer for the XML representation.

See Also:
Constant Field Values
Constructor Detail

XMLBulkLoadActivity

public XMLBulkLoadActivity(org.w3c.dom.Element element)
                    throws ActivitySystemException,
                           ActivityUserException
Constructs an instance for the specified Element.

Parameters:
element - The activity Element, conforming to the associated schema.
Throws:
ActivityUserException - If there is a user problem constructing the activity.
ActivitySystemException - If there is a system problem constructing the activity.
Method Detail

initialise

protected void initialise()
                   throws ActivityUserException
Description copied from class: XMLDBActivity
Initialises the activity prior to processing by retrieving the ConnectionManager, the user credentials and the activity output from the context.

Overrides:
initialise in class XMLDBActivity
Throws:
ActivityUserException - If a user problem prevents the activity from initialising.

processFirst

public void processFirst()
Starts the processing by opening the collection for bulk loading. If the collection doesn't exist it is created (if the createIfNotExists attribute was true) or an error is thrown (if the createIfNotExists attribute was false or not specified).

Overrides:
processFirst in class Activity

processBlock

public void processBlock()
Loads a resource into the open collection. The resource can either be included in the perform document or read from an BlockReader.

Specified by:
processBlock in class XMLDBActivity