|
|||||||||||
| 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.files.AbstractFileActivity
|
+--uk.org.ogsadai.activity.indexedfiles.AddAndIndexFileActivity
Imports a flat file into a file system data resource and builds an index using the Jakarta Lucene full-text search engine. The types of flat file that are supported can be configured using the activity configuration mechanism. See the activity user documentation for more details: OGSADAI/doc/interaction/activities/indexedfiles/addIndexFile.html
| Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICECopyright statement |
private static DAILogger |
LOGLogger object for logging in this class |
private java.io.File |
mDirectoryDirectory where the new file resides |
private java.lang.String |
mDirnameName of the directory where the new file resides |
private java.lang.String[] |
mFieldsIndexed fields |
private java.io.File |
mFileNew file to be added and indexed |
private java.lang.String |
mFilenameName of the new file to be added and indexed |
private java.io.FileOutputStream |
mFileOutputStream to the new file to be added and indexed |
private java.lang.String |
mFiletypeType of flat file |
private java.io.File |
mIndexIndex directory |
private FlatFileIndexWriter |
mIndexHelperIndex helper class used for indexing certain file types |
private java.lang.String |
mIndexNameIndex directory name |
private org.apache.lucene.index.IndexWriter |
mIndexWriterCurrent index writer for this activity |
private BlockReader |
mInputActivity input - new data file |
| Fields inherited from class uk.org.ogsadai.activity.files.AbstractFileActivity |
mCredentials, mFileAccessProvider, mTopDir |
| Fields inherited from class uk.org.ogsadai.activity.Activity |
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs |
| Constructor Summary | |
AddAndIndexFileActivity(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. |
ActivityConfiguration |
createActivityConfiguration()Creates the ActivityConfiguration object for a particular activity. |
private void |
indexFile()Indexes a file using the file indexer and closes the index. |
void |
initialise()Gets the data resource accessor for the files data resource according to whether the users credentials permit this access. |
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.activity.Activity |
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 final DAILogger LOG
private java.lang.String mFilename
private java.io.File mFile
private java.io.FileOutputStream mFileOutput
private java.lang.String mDirname
private java.io.File mDirectory
private java.lang.String mFiletype
private java.lang.String mIndexName
private java.io.File mIndex
private java.lang.String[] mFields
private org.apache.lucene.index.IndexWriter mIndexWriter
private FlatFileIndexWriter mIndexHelper
private BlockReader mInput
| Constructor Detail |
public AddAndIndexFileActivity(org.w3c.dom.Element element)
throws ActivityCreationException,
ActivitySpecificationException
| Method Detail |
public void initialise()
throws ActivitySpecificationException,
ActivityExecutionException
AbstractFileActivityinitialise in class AbstractFileActivityActivitySpecificationException - If the user is not permitted to access the resource.ActivityExecutionException - If some internal problem occurs.Activity.initialise()protected void processFirst()
ActivityprocessFirst in class Activityprotected void processBlock()
ActivitysetCompleted 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 Activityprotected void cleanUp()
ActivityActivity implementations that need to free up resources in the event of an error or intermediate termination of the activity processing.
cleanUp in class Activityprivate void indexFile()
public ActivityConfiguration createActivityConfiguration()
ActivityConfigurationCreatorActivityConfiguration object for a particular activity. The intialise method of the ActivityConfiguration object will be invoked by an ActivityCreator.
createActivityConfiguration in interface ActivityConfigurationCreatorActivityConfiguration object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||