uk.org.ogsadai.activity.files
Class AbstractFileActivity

java.lang.Object
  |
  +--uk.org.ogsadai.engine.Activity
        |
        +--uk.org.ogsadai.activity.files.AbstractFileActivity
Direct Known Subclasses:
AddAndIndexFileActivity, DirectoryAccessActivity, FileAccessActivity, FileManipulationActivity, FileReadingActivity, FileWritingActivity, SearchIndexedFileActivity

public abstract class AbstractFileActivity
extends Activity

Abstract superclass for all activities which are intended for use with the FileSystemConnectionManager connection manager.

Sub-classes may override the initialise() method, but call super.initialise() in order to perform some checks on the connection managers's configuration.

Author:
The OGSA-DAI Project Team

Field Summary
protected  FileSystemConnectionManager mConnectionManager
          The filesystem connection manager that this GDS is associated with.
protected  java.io.File mTopDir
          The directory in the filesystem which this GDS is associated with.
 
Fields inherited from class uk.org.ogsadai.engine.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
protected AbstractFileActivity(org.w3c.dom.Element element)
          Invokes the Activity superclass's constructor.
 
Method Summary
protected  void initialise()
          Perform some checks on the connection managers's configuration, including whether the connection manager is a FileSystemConnectionManager and the top-level directory exists and really is a directory.
 
Methods inherited from class uk.org.ogsadai.engine.Activity
cleanUp, connectsTo, getActivityConfiguration, getName, getObservableStatus, getProperties, getStatus, hasActivityConfiguration, hasProperties, processBlock, processFirst, setCompleted, setError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mConnectionManager

protected FileSystemConnectionManager mConnectionManager
The filesystem connection manager that this GDS is associated with.


mTopDir

protected java.io.File mTopDir
The directory in the filesystem which this GDS is associated with.

Constructor Detail

AbstractFileActivity

protected AbstractFileActivity(org.w3c.dom.Element element)
                        throws ActivitySystemException,
                               ActivityUserException
Invokes the Activity superclass's constructor.

Parameters:
element - the perform document
Throws:
ActivitySystemException - If there is a problem constructing the activity.
ActivityUserException - If there is a user problem constructing the activity.
Method Detail

initialise

protected void initialise()
                   throws ActivitySystemException,
                          ActivityUserException
Perform some checks on the connection managers's configuration, including whether the connection manager is a FileSystemConnectionManager and the top-level directory exists and really is a directory. It exposes this directory in the protected field mTopDir which sub-classes should use in order to obtain the context within which their file access may occur.

Sub-classes may override this method if they want to perform additional initialisation, but should call super.initialise() to ensure that the checks contained here are executed.

Overrides:
initialise in class Activity
Throws:
ActivitySystemException - If there is a problem intialising the activity, like not using the FileSystemConnectionManager connection manager.
ActivityUserException - If there is a user problem intialising the activity, like the top-level directory specified in the connection configuration does not exist.