org.tm4j.topicmap.index
Interface IndexProvider

All Known Implementing Classes:
ConfigurableIndexProvider

public interface IndexProvider

This is the SPI for new index implementations which must be supported by all implementations of indexes. An IndexProvider provides one or more indexes to the IndexManager and is responsible for managing the internal caches, database connections and so on that are used by the Indexes (although this responsibility may be delegated through to the Index implementations themselves).


Method Summary
 Index getIndex(java.lang.String interfaceName)
          Returns the Index implementation which supports the Java interface specified by interfaceName.
 IndexMeta getIndexMeta(java.lang.String interfaceName)
          Returns an IndexMeta object providing meta data about the index which implements interfaceName
 java.lang.String[] getIndexNames()
          Returns the names of all of the indexes supported by this IndexProvider.
 void initialise(TopicMap tm)
          Called by the topic map which contains this IndexManager This method will be invoked before any calls to other methods of this interface are invoked.
 

Method Detail

initialise

public void initialise(TopicMap tm)
                throws IndexProviderException
Called by the topic map which contains this IndexManager This method will be invoked before any calls to other methods of this interface are invoked. This method provides a "hook" for the IndexProvider to do any session-scope initialisation.

Parameters:
tm - The topic map which this IndexManager will be handling indexes for
Throws:
IndexProviderException - If an error prevents initialisation.

getIndexMeta

public IndexMeta getIndexMeta(java.lang.String interfaceName)
                       throws UnsupportedIndexException,
                              IndexProviderException
Returns an IndexMeta object providing meta data about the index which implements interfaceName

Returns:
An IndexMeta object providing meta data about the specified index.
Throws:
UnsupportedIndexException - If no index with the specified name is supported by this provider.
IndexProviderException - If another error occurred while retrieving meta data about the index.

getIndex

public Index getIndex(java.lang.String interfaceName)
               throws UnsupportedIndexException,
                      IndexProviderException
Returns the Index implementation which supports the Java interface specified by interfaceName.

Parameters:
interfaceName - The fully qualified Java class name of the index interface to be returned.
Returns:
The Index object which implements the named interface
Throws:
UnsupportedIndexException - If no index with the specified name is supported by this provider.
IndexProviderException - If the index cannot be returned for some reason.

getIndexNames

public java.lang.String[] getIndexNames()
Returns the names of all of the indexes supported by this IndexProvider.

Returns:
An array of fully qualified Java class names of the index interfaces supported by this IndexProvider.