org.cdlib.xtf.textIndexer
Class IndexerConfig

Object
  extended by IndexerConfig

public class IndexerConfig
extends Object

This class records configuration information about the current state of the TextIndexer application.

The main TextIndexer class uses this class to maintain information about its current processing state. This information includes:

- The path to the configuration file that defines indices to be created or updated.
- The output (trace) level to display while processing indices.
- Whether or not the current index should be rebuilt from scratch (clean build).
- Whether or not the indexes should be optimized after being built.
- The source text and index database directories to use for the current index being processed. (This information is actually stored in a separate IndexInfo sub-structure within IndexerConfig.)



Field Summary
 boolean buildLazyFiles
          Flag indicating whether to build lazy files during the indexing process.
 String cfgFilePath
          Path to the config file.
 boolean clean
          Flag indicating whether or not to build index from scratch or incrementally.
 boolean force
          Flag indicating whether or not to "force" indexing of items.
 IndexInfo indexInfo
          Index specific information for the current index being created or updated.
 boolean mustClean
          Flag indicating whether or not index must still be cleaned or not.
 boolean optimize
          Flag indicating whether or not to optimize the index after building it.
 boolean rotate
          Flag indicating whether or not to perform rotation (on indexes which are so marked).
 boolean skipIndexing
          Flag indicating whether or not to skip the main indexing pass.
 int traceLevel
          Trace level to output.
 boolean updateSpellDict
          Flag indicating whether or not to build spelling dictionaries for the index after building it.
 boolean validate
          Flag indicating whether or not to perform validation (on indexes which are so marked).
 String xtfHomePath
          Path of the XTF home directory
 
Constructor Summary
IndexerConfig()
          Default constructor.
 
Method Summary
 int readCmdLine(String[] args, int startArg)
          Processes command line arguments to set the corresponding data members in this class.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xtfHomePath

public String xtfHomePath
Path of the XTF home directory


cfgFilePath

public String cfgFilePath
Path to the config file.


traceLevel

public int traceLevel
Trace level to output. Should be one or more of the trace constants defined by the class org.cdlib.xtf.util.Trace .


clean

public boolean clean
Flag indicating whether or not to build index from scratch or incrementally.

true = Build index from scratch.
false = Build index incrementally.


mustClean

public boolean mustClean
Flag indicating whether or not index must still be cleaned or not. Set to the value of clean just prior to processing each index listed in the config file.

true = Build index from scratch.
false = Build index incrementally.


force

public boolean force
Flag indicating whether or not to "force" indexing of items.

true = Ignore file mod times during incremental indexing.
false = Normal file mod time check.


buildLazyFiles

public boolean buildLazyFiles
Flag indicating whether to build lazy files during the indexing process.

true = Build lazy files.
False = Do not build lazy files.


optimize

public boolean optimize
Flag indicating whether or not to optimize the index after building it.

true = Optimize index after building.
false = Do not optimize index.


updateSpellDict

public boolean updateSpellDict
Flag indicating whether or not to build spelling dictionaries for the index after building it.

true = Build spelling dictionaries for index after building.
false = Do not build spelling dictionaries index.


skipIndexing

public boolean skipIndexing
Flag indicating whether or not to skip the main indexing pass. Useful for debugging later phases, such as optimization or spelling.

true = Skip the main indexing pass.
false = Perform the main indexing pass.


validate

public boolean validate
Flag indicating whether or not to perform validation (on indexes which are so marked).

true = Validate indexes.
false = Do not validate.


rotate

public boolean rotate
Flag indicating whether or not to perform rotation (on indexes which are so marked).

true = Rotate indexes.
false = Do not rotate.


indexInfo

public IndexInfo indexInfo
Index specific information for the current index being created or updated.

Constructor Detail

IndexerConfig

public IndexerConfig()
Default constructor.

Initializes data members for this calls to reasonable default values.

Method Detail

readCmdLine

public int readCmdLine(String[] args,
                       int startArg)
Processes command line arguments to set the corresponding data members in this class.

Parameters:
args - A string containing the command line arguments passed to the text indexer.
startArg - The character index at which to begin processing the next command line argument.
Returns:
The character index at which to resume command line argument processing the next time this function is called.
Notes:
This function looks for the following command line flags:

-config {path} (exactly one required)
The path/name of the configuration file describing the index(s) to process.

-clean (optional)
A flag indicating that the index names that follow should be rebuilt from scratch. If not specified, the index names that follow will be added to or updated incrementally.

-incremental (optional)
A flag indicating that the index names that follow should be added to or updated incrementally. If this flag and the -clean flag are both omitted, incremental updating will be used by default.

-index {name} (one or more required)
The name of an index defined in the configuration file to create or update.

-trace [errors | warnings | info | debug] (optional)
Identifies the level of output the indexer should echo back to the user. If not specified, info level output is used as the default.