uk.org.ogsadai.activity.indexedfiles
Class SearchIndexedFileActivity

java.lang.Object
  |
  +--uk.org.ogsadai.engine.Activity
        |
        +--uk.org.ogsadai.activity.files.AbstractFileActivity
              |
              +--uk.org.ogsadai.activity.indexedfiles.SearchIndexedFileActivity

public class SearchIndexedFileActivity
extends AbstractFileActivity

Searches an index that has been built by the Jakarta Lucene full-text search engine. Once the search has been performed each hit is processed as one block.

Author:
The OGSA-DAI Project Team

Field Summary
 
Fields inherited from class uk.org.ogsadai.activity.files.AbstractFileActivity
mConnectionManager, mTopDir
 
Fields inherited from class uk.org.ogsadai.engine.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
SearchIndexedFileActivity(org.w3c.dom.Element element)
           
 
Method Summary
protected  void cleanUp()
          This method can be overridden by any Activity implementations that need to free up resources in the event of an error or intermediate termination of the activity processing.
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.
protected  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.engine.Activity
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
 

Constructor Detail

SearchIndexedFileActivity

public SearchIndexedFileActivity(org.w3c.dom.Element element)
                          throws ActivitySystemException,
                                 ActivityUserException
Method Detail

initialise

protected void initialise()
                   throws ActivitySystemException,
                          ActivityUserException
Description copied from class: AbstractFileActivity
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 AbstractFileActivity
Throws:
ActivityUserException - If there is a user problem intialising the activity, like the top-level directory specified in the connection configuration does not exist.
ActivitySystemException - If there is a problem intialising the activity, like not using the FileSystemConnectionManager connection manager.

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

processBlock

protected 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

cleanUp

protected void cleanUp()
Description copied from class: Activity
This method can be overridden by any Activity implementations that need to free up resources in the event of an error or intermediate termination of the activity processing.

Overrides:
cleanUp in class Activity