org.weborganic.bastille.flint.config
Class ComplexConfig

java.lang.Object
  extended by org.weborganic.bastille.flint.config.BaseDefaultConfig
      extended by org.weborganic.bastille.flint.config.ComplexConfig
All Implemented Interfaces:
IFlintConfig

public final class ComplexConfig
extends BaseDefaultConfig
implements IFlintConfig

A configuration for multiple indexes which uses templates depending on the index.

This configuration is suitable for when:


Method Summary
 IndexConfig getIndexConfig(String name)
           
 List<File> getTemplates()
           
static ComplexConfig newInstance()
          Returns a new legacy config instance loading the setting from the global settings.
 void reload()
          Causes the config to be reloaded.
 File toFile(Document doc)
          Returns the file corresponding to the specified document.
 String toPath(File f)
          Returns the value of the path field for the specified file.
 
Methods inherited from class org.weborganic.bastille.flint.config.BaseDefaultConfig
getDefaultConfig, getDirectory, getIndexNames, getTemplatesDirectory, hasMultiple
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.weborganic.bastille.flint.config.IFlintConfig
getDirectory, getIndexNames, hasMultiple
 

Method Detail

reload

public void reload()
Description copied from interface: IFlintConfig
Causes the config to be reloaded.

Specified by:
reload in interface IFlintConfig

getTemplates

public final List<File> getTemplates()
Specified by:
getTemplates in interface IFlintConfig
Returns:
the list of templates to generate iXML.

getIndexConfig

public IndexConfig getIndexConfig(String name)
Specified by:
getIndexConfig in interface IFlintConfig
Parameters:
name - The name of the index
Returns:
the index configuration for the specified index.

toPath

public String toPath(File f)
Description copied from interface: IFlintConfig
Returns the value of the path field for the specified file.

Specified by:
toPath in interface IFlintConfig
Parameters:
f - for the specified file.
Returns:
the corresponding path or "" if an error occurs

toFile

public File toFile(Document doc)
Description copied from interface: IFlintConfig
Returns the file corresponding to the specified document.

This method is used to determine whether changes in some files require reindexing and is typically used by the indexing process.

Specified by:
toFile in interface IFlintConfig
Parameters:
doc - The Lucene document
Returns:
The file that was used to generate it.

newInstance

public static ComplexConfig newInstance()
Returns a new legacy config instance loading the setting from the global settings.

Returns:
a new legacy config instance.