org.weborganic.bastille.flint.config
Class FlintConfig

java.lang.Object
  extended by org.weborganic.bastille.flint.config.FlintConfig

public final class FlintConfig
extends Object

Centralizes the configuration for flint.

Since:
0.7.9

Method Summary
static File directory()
           
static IFlintConfig get()
          Returns the flint configuration used by default.
static IndexManager getManager()
           
static IndexMaster getMaster()
          Returns the index master for a single index.
static IndexMaster getMaster(String name)
          Returns the Index master for the specified name.
static List<IndexMaster> getMasters()
           
static IndexMaster getOrCreateMaster(File index)
           
static boolean hasMultiple()
          Indicates whether flint is configured for multiple indexes.
static Analyzer newAnalyzer()
          Returns a new analyser form the specifies AnalyzerFactory or a new StandardAnalyser otherwise.
static void setAnalyzerFactory(AnalyzerFactory factory)
          Set the default analyzer factory.
static void setup(IFlintConfig config)
          Allows implementation to setup the Flint config and bypass the default auto setup.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setup

public static void setup(IFlintConfig config)
Allows implementation to setup the Flint config and bypass the default auto setup.

This method can only be called once.

Parameters:
config - The global configuration to use for Flint.
Throws:
IllegalStateException - if the setup method has already been called once.

directory

public static File directory()
Returns:
the default location of the index.

hasMultiple

public static boolean hasMultiple()
Indicates whether flint is configured for multiple indexes.

Returns:
true if Flint is configured for multiple indexes; false for a single index.

getMaster

public static IndexMaster getMaster()
Returns the index master for a single index.

Returns:
the index master for a single index.

getMaster

public static IndexMaster getMaster(String name)
Returns the Index master for the specified name.

Parameters:
name - the name of the index or null for a single index.
Returns:
the index master for the specified index.

get

public static IFlintConfig get()
Returns the flint configuration used by default.

Returns:
the flint configuration used by default.

setAnalyzerFactory

public static void setAnalyzerFactory(AnalyzerFactory factory)
Set the default analyzer factory.

Parameters:
factory - the AnalyzerFactory to use as default.

getMasters

public static List<IndexMaster> getMasters()
Returns:
the list of index masters currently in use.

newAnalyzer

public static Analyzer newAnalyzer()
Returns a new analyser form the specifies AnalyzerFactory or a new StandardAnalyser otherwise.

This method always returns a value.

Returns:
A new Analyzer.

getManager

public static IndexManager getManager()
Returns:
the index manager

getOrCreateMaster

public static IndexMaster getOrCreateMaster(File index)
Parameters:
index - The directory containing the index to return
Returns:
the master for the given index root