Xindice API
version 1.1

org.apache.xindice.core.indexer
Class IndexManager

java.lang.Object
  |
  +--org.apache.xindice.util.SimpleConfigurable
        |
        +--org.apache.xindice.core.indexer.IndexManager
All Implemented Interfaces:
Configurable

public final class IndexManager
extends SimpleConfigurable

IndexManager is a class that manages Indexes. Good description, eh? I should win a Pulitzer Prize for that one.

Version:
$Revision: 517983 $, $Date: 2007-03-13 23:21:58 -0400 (Tue, 13 Mar 2007) $

Fields inherited from class org.apache.xindice.util.SimpleConfigurable
config
 
Constructor Summary
IndexManager(Collection collection, Timer timer)
          Create IndexManager for a given collection
 
Method Summary
 void addDocument(Key key, org.w3c.dom.Document doc)
           
 void close()
          Closes all indexers managed by this index manager.
 Indexer create(Configuration cfg)
          create creates a new Indexer object and any associated system resources that the Indexer will need.
 void drop()
          Drop all indexers
 boolean drop(String name)
          drop physically removes the specified Indexer and any associated system resources that the Indexer uses.
 Indexer get(String name)
          get retrieves an Indexer by name.
 Indexer getBestIndexer(String style, IndexPattern pattern)
          getBestIndexer retrieves the best Indexer to use for the specified IndexPattern.
 String[] list()
          list returns a list of the Indexers that this IndexerManager has registered.
 Indexer register(Class c, Configuration cfg)
           
 void removeDocument(Key key, org.w3c.dom.Document doc)
           
 void setConfig(Configuration config)
          Configure index manager, register all indexes specified in the configuration
 void unregister(String name)
           
 
Methods inherited from class org.apache.xindice.util.SimpleConfigurable
getConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexManager

public IndexManager(Collection collection,
                    Timer timer)
             throws DBException
Create IndexManager for a given collection
Parameters:
collection - Collection for this IndexManager
Throws:
DBException - if can't get collection's symbols
Method Detail

setConfig

public void setConfig(Configuration config)
               throws XindiceException
Configure index manager, register all indexes specified in the configuration
Overrides:
setConfig in class SimpleConfigurable
Parameters:
config - IndexManager configuration

list

public String[] list()
list returns a list of the Indexers that this IndexerManager has registered.
Returns:
An array containing the Indexer names

drop

public boolean drop(String name)
drop physically removes the specified Indexer and any associated system resources that the Indexer uses.
Parameters:
name - The Indexer to drop
Returns:
Whether or not the Indexer was dropped

drop

public void drop()
Drop all indexers

create

public Indexer create(Configuration cfg)
               throws DBException
create creates a new Indexer object and any associated system resources that the Indexer will need.
Parameters:
cfg - The Indexer's configuration
Returns:
The Indexer that was created

close

public void close()
Closes all indexers managed by this index manager.

register

public Indexer register(Class c,
                        Configuration cfg)
                 throws DBException

unregister

public void unregister(String name)

get

public Indexer get(String name)
get retrieves an Indexer by name.
Parameters:
name - The Indexer name
Returns:
The Indexer

getBestIndexer

public Indexer getBestIndexer(String style,
                              IndexPattern pattern)
getBestIndexer retrieves the best Indexer to use for the specified IndexPattern.
Parameters:
style - The Indexer Style (ex: Node, Value)
pattern - The IndexPattern to use
Returns:
The best Indexer (or null)

addDocument

public void addDocument(Key key,
                        org.w3c.dom.Document doc)

removeDocument

public void removeDocument(Key key,
                           org.w3c.dom.Document doc)

Xindice API
version 1.1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.