org.exist.indexing
Class IndexManager

java.lang.Object
  extended by org.exist.indexing.IndexManager

public class IndexManager
extends Object

Manages all custom indexes registered with the database instance.


Field Summary
static String CONFIGURATION_ELEMENT_NAME
           
static String CONFIGURATION_MODULE_ELEMENT_NAME
           
static String INDEXER_MODULES_CLASS_ATTRIBUTE
           
static String INDEXER_MODULES_ID_ATTRIBUTE
           
static String PROPERTY_INDEXER_MODULES
           
 
Constructor Summary
IndexManager(BrokerPool pool, Configuration config)
          Constructs a new IndexManager and registers the indexes specified in the global configuration object, i.e.
 
Method Summary
 void backupToArchive(RawDataBackup backup)
           
 BrokerPool getBrokerPool()
          Returns the BrokerPool on with this IndexManager operates.
 Index getIndexById(String indexId)
          Returns the index registered with the provided ID.
 Index getIndexByName(String indexName)
          Returns the index registered with the provided human-readable name.
 void removeIndexes()
          Physically destroy the registered indexes by calling Index.remove() on them.
 void reopenIndexes()
          Reopens the registered index in case they have been closed by a previous operation such as Index.close() by calling Index.open() on them.
 void shutdown()
          Shutdowns all registered indexes by calling Index.close() on them.
 void sync()
          Call indexes to flush all data to disk.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_ELEMENT_NAME

public static final String CONFIGURATION_ELEMENT_NAME
See Also:
Constant Field Values

CONFIGURATION_MODULE_ELEMENT_NAME

public static final String CONFIGURATION_MODULE_ELEMENT_NAME
See Also:
Constant Field Values

INDEXER_MODULES_CLASS_ATTRIBUTE

public static final String INDEXER_MODULES_CLASS_ATTRIBUTE
See Also:
Constant Field Values

INDEXER_MODULES_ID_ATTRIBUTE

public static final String INDEXER_MODULES_ID_ATTRIBUTE
See Also:
Constant Field Values

PROPERTY_INDEXER_MODULES

public static final String PROPERTY_INDEXER_MODULES
See Also:
Constant Field Values
Constructor Detail

IndexManager

public IndexManager(BrokerPool pool,
                    Configuration config)
             throws DatabaseConfigurationException
Constructs a new IndexManager and registers the indexes specified in the global configuration object, i.e. in the :
 <modules>
   <module id="foo" class="bar" foo1="bar1" ... />
 </modules>
 
section of the configuration file.

Parameters:
pool - the BrokerPool representing the current database instance
config - the configuration object
Throws:
DatabaseConfigurationException
Method Detail

getBrokerPool

public BrokerPool getBrokerPool()
Returns the BrokerPool on with this IndexManager operates.

Returns:
the broker pool

getIndexById

public Index getIndexById(String indexId)
Returns the index registered with the provided ID.

Parameters:
indexId - the ID
Returns:
the index

getIndexByName

public Index getIndexByName(String indexName)
Returns the index registered with the provided human-readable name.

Parameters:
indexName - the name
Returns:
the index

shutdown

public void shutdown()
              throws DBException
Shutdowns all registered indexes by calling Index.close() on them.

Throws:
DBException

sync

public void sync()
          throws DBException
Call indexes to flush all data to disk.

Throws:
DBException

removeIndexes

public void removeIndexes()
                   throws DBException
Physically destroy the registered indexes by calling Index.remove() on them.

Throws:
DBException

reopenIndexes

public void reopenIndexes()
                   throws DatabaseConfigurationException
Reopens the registered index in case they have been closed by a previous operation such as Index.close() by calling Index.open() on them.

Throws:
DatabaseConfigurationException

backupToArchive

public void backupToArchive(RawDataBackup backup)
                     throws IOException
Throws:
IOException


Copyright (C) Wolfgang Meier. All rights reserved.