uk.org.ogsadai.activity.delivery
Class AbstractDTDeliveryActivity

java.lang.Object
  |
  +--uk.org.ogsadai.activity.Activity
        |
        +--uk.org.ogsadai.activity.delivery.AbstractDTDeliveryActivity
Direct Known Subclasses:
AbstractDeliverFromDTActivity, AbstractDeliverToDTActivity

public abstract class AbstractDTDeliveryActivity
extends Activity

This class is an abstract super-class of activities supporting invocation of data transport operations on data services.

For information on this activity see the OGSA-DAI user doc: OGSA-DAI/doc/interaction/activities/delivery/deliverToGDT.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.
protected  boolean mBlockMode
          Is transfer mode block (true) or full (false)?
protected  org.w3c.dom.Node mDeliveryNode
          Node containing target service-related delivery information
protected  java.lang.String mLocalStream
          Name of local stream
protected  java.lang.String mResourceID
          ID of data service resource exposed by the target service
protected  java.lang.String mServiceType
          Type of service - "wsi", "wsrf", "unknown"
protected  java.lang.String mServiceURL
          URL of target service
protected  java.lang.String mStreamID
          ID of stream exposed by the data service resource
 
Fields inherited from class uk.org.ogsadai.activity.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
AbstractDTDeliveryActivity(org.w3c.dom.Element element)
           
 
Method Summary
protected abstract  void contactTargetService()
          Create a stub for the target service.
protected  void getDeliverySettings(org.w3c.dom.Element activity, java.lang.String targetNode, java.lang.String localStreamNode, java.lang.String localStreamAttr)
          Gets the settings for the delivery.
 void initialise()
          This method should be overridden by subclasses to perform any initialisation they require before the process method invocations begin.
protected  boolean isServiceUnknown()
          Return flag indicating that it is unknown whether the target service is an OGSA-DAI WSI or OGSA-DAI WSRF service.
protected  boolean isServiceWSI()
          Return flag indicating whether client has stated that target service is an OGSA-DAI WSI service.
protected  boolean isServiceWSRF()
          Return flag indicating whether client has stated that target service is an OGSA-DAI WSRF service.
protected abstract  void processBlock()
          Performs an iteration of the processing of an activity.
protected  void processFirst()
          This method is called during the first iteration of processing 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, 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 final DAILogger LOG
Logger object for logging in this class.


mServiceURL

protected java.lang.String mServiceURL
URL of target service


mResourceID

protected java.lang.String mResourceID
ID of data service resource exposed by the target service


mStreamID

protected java.lang.String mStreamID
ID of stream exposed by the data service resource


mBlockMode

protected boolean mBlockMode
Is transfer mode block (true) or full (false)?


mLocalStream

protected java.lang.String mLocalStream
Name of local stream


mDeliveryNode

protected org.w3c.dom.Node mDeliveryNode
Node containing target service-related delivery information


mServiceType

protected java.lang.String mServiceType
Type of service - "wsi", "wsrf", "unknown"

Constructor Detail

AbstractDTDeliveryActivity

public AbstractDTDeliveryActivity(org.w3c.dom.Element element)
                           throws ActivityCreationException,
                                  ActivitySpecificationException
Method Detail

processBlock

protected abstract 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 Activity

getDeliverySettings

protected void getDeliverySettings(org.w3c.dom.Element activity,
                                   java.lang.String targetNode,
                                   java.lang.String localStreamNode,
                                   java.lang.String localStreamAttr)
Gets the settings for the delivery.

This includes the URL of the target data service, the ID of a data service resource exposed by the target service, the ID of a session and stream exposed by the data service resource and the data transport mode. In addition to the local activity stream that will provide or receive data. Activity-specific information relating to the target service is extracted as DOM nodes but are not processed.

Parameters:
activity - Activity element from request.
targetNode - Name of element containing target data service information.
localStreamNode - Name of element containing local activity stream name.
localStreamAttr - Name of attribute of localStreamNode containing local activity stream name.

isServiceWSRF

protected boolean isServiceWSRF()
Return flag indicating whether client has stated that target service is an OGSA-DAI WSRF service.

Returns:
true if so, false otherwise.

isServiceWSI

protected boolean isServiceWSI()
Return flag indicating whether client has stated that target service is an OGSA-DAI WSI service.

Returns:
true if so, false otherwise.

isServiceUnknown

protected boolean isServiceUnknown()
Return flag indicating that it is unknown whether the target service is an OGSA-DAI WSI or OGSA-DAI WSRF service.

Returns:
true if unknown, false otherwise.

initialise

public void initialise()
                throws ActivitySpecificationException,
                       ActivityExecutionException
Description copied from class: Activity
This method should be overridden by subclasses to perform any initialisation they require before the 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.

Overrides:
initialise in class Activity
Throws:
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.

processFirst

protected void processFirst()
Description copied from class: Activity
This method is called during the first iteration of processing an activity. It can be overridden by subclasses to define some processing that should be done only once during the first iteration of the activity processing, for example evaluating a database query.

Overrides:
processFirst in class Activity

contactTargetService

protected abstract void contactTargetService()
                                      throws ActivitySpecificationException,
                                             ActivityExecutionException
Create a stub for the target service.

Throws:
ActivitySpecificationException - If an error occurs that is caused by incorrect information in the request e.g. the URL is incorrect or cannot be contacted.
ActivityExecutionException - If some internal problem outwith the client's control occurs.