Regain 2.1.0-STABLE API

net.sf.regain.search.config
Class XmlSearchConfig

java.lang.Object
  extended by net.sf.regain.search.config.XmlSearchConfig
All Implemented Interfaces:
SearchConfig

public class XmlSearchConfig
extends Object
implements SearchConfig

Author:
Tilman Schneider, STZ-IDA an der FH Karlsruhe

Field Summary
private  String[] mAllIndexNameArr
          The names of all indexes in search configuration.
private  String[] mDefaultIndexNameArr
          The names of the default indexes.
private  HashMap mIndexHash
          All configured indexes.
 
Constructor Summary
XmlSearchConfig(File xmlFile)
          Creates a new instance of XmlSearchConfig.
 
Method Summary
 String[] getAllIndexNameArr()
          Gets the names of the default indexes.
 String[] getDefaultIndexNameArr()
          Gets the names of the default indexes.
 IndexConfig getIndexConfig(String indexName)
          Gets the configuration for an index.
private  void readIndexList(org.w3c.dom.Element config)
          Reads the search indexes from the config.
private  String[][] readRewriteRules(org.w3c.dom.Node node)
          Reads the URL rewrite rules from a node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mIndexHash

private HashMap mIndexHash
All configured indexes.


mDefaultIndexNameArr

private String[] mDefaultIndexNameArr
The names of the default indexes.


mAllIndexNameArr

private String[] mAllIndexNameArr
The names of all indexes in search configuration.

Constructor Detail

XmlSearchConfig

public XmlSearchConfig(File xmlFile)
                throws RegainException
Creates a new instance of XmlSearchConfig.

Parameters:
xmlFile - The XML file to read the config from.
Throws:
RegainException - If reading the config failed.
Method Detail

readIndexList

private void readIndexList(org.w3c.dom.Element config)
                    throws RegainException
Reads the search indexes from the config.

Parameters:
config - The configuration to read from.
Throws:
RegainException - If the configration has errors.

readRewriteRules

private String[][] readRewriteRules(org.w3c.dom.Node node)
                             throws RegainException
Reads the URL rewrite rules from a node

Parameters:
node - The node to read from.
Returns:
The rewrite rules. May be null.
Throws:
RegainException - If the configration has errors.

getIndexConfig

public IndexConfig getIndexConfig(String indexName)
Gets the configuration for an index.

Specified by:
getIndexConfig in interface SearchConfig
Parameters:
indexName - The name of the index to get the config for.
Returns:
The configuration for the wanted index or null if there is no such index configured.

getDefaultIndexNameArr

public String[] getDefaultIndexNameArr()
Gets the names of the default indexes.

Specified by:
getDefaultIndexNameArr in interface SearchConfig
Returns:
The names of the default indexes or an empty array if no default index was specified.

getAllIndexNameArr

public String[] getAllIndexNameArr()
Gets the names of the default indexes.

Specified by:
getAllIndexNameArr in interface SearchConfig
Returns:
The names of the default indexes or an empty array if no default index was specified.

Regain 2.1.0-STABLE API

Regain 2.1.0-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info