|
|||||||||||
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.xmldb.XMLDBActivity | +--uk.org.ogsadai.activity.xmldb.XMLBulkLoadActivity
An XMLDBActivity
for bulk loading data into a XMLDB
compliant database collection.
For information on this activity see the OGSA-DAI user doc:
OGSA-DAI/doc/interaction/activities/xml/xmlBulkLoad.html
Field Summary | |
static java.lang.String |
ATTRIBUTE_CREATE
Constant for parsing activity XML - create new resource |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
static java.lang.String |
ELEMENT_FROM_LOCAL
Constant for parsing activity XML - activity input |
static java.lang.String |
ELEMENT_OUTPUT
Constant for parsing activity XML - activity output |
static java.lang.String |
FOOTER
Footer for the XML representation of a set of resources. |
static java.lang.String |
HEADER
Header for the XML representation of a set of resources. |
private static DAILogger |
LOG
Logger object for logging in this class |
private org.xmldb.api.base.Collection |
mCollection
Collection into which the resources will be loaded |
private boolean |
mCreateCollectionIfNotExists
should we create a new collection if it doesn't exist? |
private int |
mCurrentResource
Number of the resource we are currently processing |
private BlockReader |
mInput
Input stream from another activity, providing the resources |
private org.w3c.dom.NodeList |
mResources
Resources for bulk loading if they are included in the request |
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 | |
XMLBulkLoadActivity(org.w3c.dom.Element element)
Constructs an XMLBulkLoad activity using the specified XML element. |
Method Summary | |
private void |
addDocument(org.w3c.dom.Element element)
Add a resource to the current collection. |
void |
initialise()
This method should be overridden by subclasses to perform any initialisation they require before the process
method invocations begin. |
void |
processBlock()
Performs an iteration of the processing of an activity. |
void |
processFirst()
This method is called during the first iteration of processing an activity. |
private java.lang.String |
resultsToXML(int numResources)
Converts the results of the bulk load execution into an XML string representation. |
Methods inherited from class uk.org.ogsadai.activity.Activity |
cleanUp, connectsTo, createOutputPipe, getActivityConfiguration, getActivityName, getCause, getName, getObservableStatus, getProperties, getSession, getStatus, hasActivityConfiguration, hasProperties, process, 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 ELEMENT_FROM_LOCAL
public static final java.lang.String ELEMENT_OUTPUT
public static final java.lang.String ATTRIBUTE_CREATE
public static final java.lang.String HEADER
public static final java.lang.String FOOTER
private org.w3c.dom.NodeList mResources
private int mCurrentResource
private BlockReader mInput
private org.xmldb.api.base.Collection mCollection
private boolean mCreateCollectionIfNotExists
Constructor Detail |
public XMLBulkLoadActivity(org.w3c.dom.Element element) throws ActivitySpecificationException, ActivityCreationException
element
- Element
to configure the activity with - from
a perform document.
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 |
public void initialise() throws ActivitySpecificationException, ActivityExecutionException
Activity
process
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 XMLDBActivity
ActivityExecutionException
- 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 void processFirst()
Activity
processFirst
in class Activity
public void processBlock()
Activity
setCompleted
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 XMLDBActivity
private void addDocument(org.w3c.dom.Element element) throws ActivityExecutionException
element
- The resource as a DOM object.
ActivityExecutionException
- If any problem occurs.private java.lang.String resultsToXML(int numResources)
<resultCount>N<l/resultCount>
numResources
- the number of resources in the result count.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |