org.apache.cocoon.components.search.components.impl
Class IndexManagerImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.search.components.impl.IndexManagerImpl
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, IndexManager

public class IndexManagerImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements IndexManager, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.configuration.Configurable

Index Manager Component. Configure and Manage the differents indexes.

Version:
1.0
Author:
Maisonneuve Nicolas

Field Summary
static java.lang.String DATEFORMAT_ATTRIBUTE
          The date Format when the field type is a date
static java.lang.String FIELD_ELEMENT
          Field declaration element
static java.lang.String ID_ATTRIBUTE
          field name
static java.lang.String INDEX_CONF_FILE
          The name of the index configuration file.
static java.lang.String INDEX_DEFAULTANALZER_ATTRIBUTE
          default analyzer of a index
static java.lang.String INDEX_DIRECTORY_ATTRIBUTE
          directory where the index is stored
static java.lang.String INDEX_ELEMENT
          Index declaration element
static java.lang.String INDEXER_ELEMENT
          indexer element
static java.lang.String INDEXER_ROLE_ATTRIBUTE
          indexer element
static java.lang.String INDEXES_ELEMENT
          set of indexes
static java.lang.String STORE_ATTRIBUTE
          store information or not (true/false)
static java.lang.String STRUCTURE_ELEMENT
          Index Structure element
static java.lang.String TYPE_ATTRIBUTE
          type of the field: "text, "keyword", "date" (see
 
Fields inherited from interface org.apache.cocoon.components.search.components.IndexManager
ROLE
 
Constructor Summary
IndexManagerImpl()
           
 
Method Summary
 void addIndex(Index base)
          add a index in the indexmanager
 void addIndexes(org.apache.excalibur.source.Source confSource)
          Adds indexes from the given configuration file to the index manager.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 boolean contains(java.lang.String id)
          Check if the index exist
 Index[] getIndex()
          Return all indexes
 Index getIndex(java.lang.String id)
          Return the index with the id
 java.lang.String getServletContextPath()
           
protected  java.util.Map indexes()
           
protected  void loadIndexes()
           
 void remove(java.lang.String id)
          remove a index
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEXER_ELEMENT

public static final java.lang.String INDEXER_ELEMENT
indexer element

See Also:
Constant Field Values

INDEXER_ROLE_ATTRIBUTE

public static final java.lang.String INDEXER_ROLE_ATTRIBUTE
indexer element

See Also:
Constant Field Values

INDEXES_ELEMENT

public static final java.lang.String INDEXES_ELEMENT
set of indexes

See Also:
Constant Field Values

INDEX_ELEMENT

public static final java.lang.String INDEX_ELEMENT
Index declaration element

See Also:
Constant Field Values

INDEX_DEFAULTANALZER_ATTRIBUTE

public static final java.lang.String INDEX_DEFAULTANALZER_ATTRIBUTE
default analyzer of a index

See Also:
Constant Field Values

INDEX_DIRECTORY_ATTRIBUTE

public static final java.lang.String INDEX_DIRECTORY_ATTRIBUTE
directory where the index is stored

See Also:
Constant Field Values

STRUCTURE_ELEMENT

public static final java.lang.String STRUCTURE_ELEMENT
Index Structure element

See Also:
Constant Field Values

FIELD_ELEMENT

public static final java.lang.String FIELD_ELEMENT
Field declaration element

See Also:
Constant Field Values

ID_ATTRIBUTE

public static final java.lang.String ID_ATTRIBUTE
field name

See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final java.lang.String TYPE_ATTRIBUTE
type of the field: "text, "keyword", "date" (see

See Also:
class), Constant Field Values

STORE_ATTRIBUTE

public static final java.lang.String STORE_ATTRIBUTE
store information or not (true/false)

See Also:
Constant Field Values

DATEFORMAT_ATTRIBUTE

public static final java.lang.String DATEFORMAT_ATTRIBUTE
The date Format when the field type is a date

See Also:
Constant Field Values

INDEX_CONF_FILE

public static final java.lang.String INDEX_CONF_FILE
The name of the index configuration file.

See Also:
Constant Field Values
Constructor Detail

IndexManagerImpl

public IndexManagerImpl()
Method Detail

indexes

protected java.util.Map indexes()

contains

public boolean contains(java.lang.String id)
Description copied from interface: IndexManager
Check if the index exist

Specified by:
contains in interface IndexManager
Parameters:
id - ID de l'index
Returns:
true if the index exist

getIndex

public Index getIndex(java.lang.String id)
               throws IndexException
Description copied from interface: IndexManager
Return the index with the id

Specified by:
getIndex in interface IndexManager
Parameters:
id - the index ID
Returns:
l'index, null if no found
Throws:
IndexException

addIndex

public void addIndex(Index base)
Description copied from interface: IndexManager
add a index in the indexmanager

Specified by:
addIndex in interface IndexManager

remove

public void remove(java.lang.String id)
Description copied from interface: IndexManager
remove a index

Specified by:
remove in interface IndexManager
Parameters:
id - ID de l'index

loadIndexes

protected void loadIndexes()

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

addIndexes

public void addIndexes(org.apache.excalibur.source.Source confSource)
Adds indexes from the given configuration file to the index manager.

Specified by:
addIndexes in interface IndexManager
Parameters:
confSource -

getServletContextPath

public java.lang.String getServletContextPath()
                                       throws java.lang.Exception
Returns:
The servlet context path.
Throws:
java.lang.Exception - if an error occurs.

getIndex

public Index[] getIndex()
Description copied from interface: IndexManager
Return all indexes

Specified by:
getIndex in interface IndexManager
Returns:
Array of indexes

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException


Copyright $ Apache Software Foundation. All Rights Reserved.