uk.org.ogsadai.client.toolkit.activity.indexedfiles
Class IndexedFileSearch

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.indexedfiles.IndexedFileSearch

public class IndexedFileSearch
extends Activity

This activity evaluates a search activity across an indexed file or an indexed set of files within a file system data service resource.

The activity has no input and two outputs - the search results from the activity and the data output from the activity:


Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static int DATA_OUTPUT_INDEX
          Index of search data output
private  java.lang.String mIndexDirectory
          Relative path to directory containing index files
private  java.lang.String mQuery
          Search query
private static int STATUS_OUTPUT_INDEX
          Index of search status output
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
IndexedFileSearch()
          Default constructor.
IndexedFileSearch(java.lang.String query)
          Constructor.
IndexedFileSearch(java.lang.String query, java.lang.String index)
          Constructor.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getDataOutput()
          Gets the activity's data output.
 java.lang.String getIndex()
          Gets the relative path to the index directory.
 java.lang.String getQuery()
          Gets the query expression.
 long getResultCount()
          Gets the number of results as recorded in the search status output.
 ActivityOutput getSearchStatus()
          Gets the activity's search status output.
 void setIndex(java.lang.String index)
          Sets the relative path to the index directory.
 void setQuery(java.lang.String query)
          Sets the query expression.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getDataService, getName, getSession, setDataService, setSession
 
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

DATA_OUTPUT_INDEX

private static final int DATA_OUTPUT_INDEX
Index of search data output

See Also:
Constant Field Values

STATUS_OUTPUT_INDEX

private static final int STATUS_OUTPUT_INDEX
Index of search status output

See Also:
Constant Field Values

mQuery

private java.lang.String mQuery
Search query


mIndexDirectory

private java.lang.String mIndexDirectory
Relative path to directory containing index files

Constructor Detail

IndexedFileSearch

public IndexedFileSearch()
Default constructor.


IndexedFileSearch

public IndexedFileSearch(java.lang.String query)
Constructor.

Parameters:
query - Query expression
Throws:
java.lang.IllegalArgumentException - If query is null.

IndexedFileSearch

public IndexedFileSearch(java.lang.String query,
                         java.lang.String index)
Constructor.

Parameters:
query - Query expression.
index - The index directory to search.
Throws:
java.lang.IllegalArgumentException - If query is null.
Method Detail

getQuery

public java.lang.String getQuery()
Gets the query expression.

Returns:
the query expression.

setQuery

public void setQuery(java.lang.String query)
Sets the query expression.

Parameters:
query - Query expression.
Throws:
java.lang.IllegalArgumentException - If query is null.

getIndex

public java.lang.String getIndex()
Gets the relative path to the index directory.

Returns:
the index directory.

setIndex

public void setIndex(java.lang.String index)
Sets the relative path to the index directory.

Parameters:
index - The index directory to search.

getDataOutput

public ActivityOutput getDataOutput()
Gets the activity's data output.

Returns:
the activity output.

getSearchStatus

public ActivityOutput getSearchStatus()
Gets the activity's search status output.

Returns:
the search status.

getResultCount

public long getResultCount()
                    throws NoActivityOutputException,
                           DataFormatException
Gets the number of results as recorded in the search status output.

Returns:
number of search results.
Throws:
DataFormatException - if the XML output data for the activity's output cannot be parsed.
NoActivityOutputException - if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.

generateXML

protected java.lang.String generateXML()
Description copied from class: RequestComponent
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Specified by:
generateXML in class Activity
Returns:
the XML for the activity