org.tm4j.topicmap.index
Interface IndexManager


public interface IndexManager

An IndexManager controls access to all of the indexes for a particular topic map. Depending upon the implementation, this manager may be responsible for initialising indexes when it is created (or initialisation may be deferred until a specific index is requested). As well as managing the Index objects, this class also manages real-time meta data about the indexes - this meta data includes whether or not the index is already initialised, whether or not an explicit runtime initialisation is required and whether or not the index automatically updates itself as the topic map contents change. It also defines short cut access methods to all regular (part of tm4j and available for all backends) indices


Method Summary
 AssociationTypesIndex getAssociationTypesIndex()
          Shortcut access method for the AssociationTypesIndex
 BaseNameDataIndex getBaseNameDataIndex()
          Shortcut access method for BaseNameDataIndex
 Index getIndex(java.lang.Class ixClass)
          Returns the index which implements the specified interface.
 Index getIndex(java.lang.String ixInterface)
          Returns the index which implements the specified interface
 IndexMeta getIndexMeta(java.lang.Class ixClass)
          Returns meta data about the specified index.
 IndexMeta getIndexMeta(java.lang.String ixInterface)
          Returns meta data about the specified index.
 MemberTypesIndex getMemberTypesIndex()
          Shortcut access method for the MemberTypesIndex
 OccurrenceDataIndex getOccurrenceDataIndex()
          Shortcut access method for OccurrenceDataIndex
 OccurrenceLocatorIndex getOccurrenceLocatorIndex()
          Shortcut access method for the OccurrenceLocatorIndex
 OccurrenceTypesIndex getOccurrenceTypesIndex()
          Shortcut access method for the OccurrenceTypesIndex
 ThemesIndex getThemesIndex()
          Shortcut access method for the ThemesIndex
 TopicTypesIndex getTopicTypesIndex()
          Shortcut access method for the TopicTypesIndex
 VariantDataIndex getVariantDataIndex()
          Shortcut access method for VariantDataIndex
 boolean isRegistered(java.lang.Class ixClass)
          Determines whether or not an Index implementing the specified interface is registered with this IndexManager.
 boolean isRegistered(java.lang.String ixInterface)
          Determines whether or not an implementation of the specified Index interface is registered with this IndexManager.
 void registerIndexProvider(IndexProvider index)
          Plugin interface for index service providers.
 

Method Detail

registerIndexProvider

public void registerIndexProvider(IndexProvider index)
                           throws DuplicateIndexNameException,
                                  IndexManagerException
Plugin interface for index service providers. This method registers a new index serivce provider with the manager. The index service provider will be retrievable by the name of each interface it supports which is derived from the Index interface.

Parameters:
index - The index service provider to be registered.
Throws:
DuplicateIndexNameException - if name is already assigned to an index managed by this IndexManager.
java.lang.IllegalArgumentException - If index does not support ant interfaces derived from Index.
IndexManagerException - If the index could not be registered with the manager for some other reason.

isRegistered

public boolean isRegistered(java.lang.String ixInterface)
Determines whether or not an implementation of the specified Index interface is registered with this IndexManager.

Parameters:
ixInterface - The fully qualified class name of the index
Returns:
True if the index with the name ixName is registered, false otherwise.

isRegistered

public boolean isRegistered(java.lang.Class ixClass)
Determines whether or not an Index implementing the specified interface is registered with this IndexManager.

Parameters:
ixClass - The interface to which the requested class must conform.
Returns:
true if an index implementing the specified index interface is registered, false otherwise.
Throws:
java.lang.IllegalArgumentException - If ixClass is not an interface derived from Index

getIndexMeta

public IndexMeta getIndexMeta(java.lang.String ixInterface)
                       throws UnsupportedIndexException
Returns meta data about the specified index.

Parameters:
ixInterface - The fully qualified Java class name of the index interface to return meta data for.
Returns:
An IndexMeta object containing the meta data for the index or null if no index with the name ixName is registered.
Throws:
UnsupportedIndexException - If the specified index is not managed by this index manager or if the provider.

getIndexMeta

public IndexMeta getIndexMeta(java.lang.Class ixClass)
                       throws java.lang.IllegalArgumentException,
                              UnsupportedIndexException
Returns meta data about the specified index.

Parameters:
ixClass - The interface implemented by the index for which meta data is requested.
Throws:
java.lang.IllegalArgumentException - if ixClass is not an interface derived from Index
UnsupportedIndexException - If the specified index is not managed by this index manager or if the provider.

getIndex

public Index getIndex(java.lang.String ixInterface)
               throws IndexManagerException
Returns the index which implements the specified interface

Parameters:
ixInterface - The fully qualified Java class name of the index interface to retrieve.
Returns:
An Index object implementing the specified interface, or null if no such interface is registered with the IndexManager
Throws:
IndexManagerException - If the index could not be initialised for some reason.

getIndex

public Index getIndex(java.lang.Class ixClass)
               throws IndexManagerException,
                      java.lang.IllegalArgumentException
Returns the index which implements the specified interface.

Parameters:
ixClass - The interface implemented by the index to be returned.
Returns:
An Index object implementing the specified interface, or null if no such interface is registered with the IndexManager
Throws:
IndexManagerException - If the index could not be initialised for some reason.
java.lang.IllegalArgumentException - if ixClass is not an interface derived from Index

getTopicTypesIndex

public TopicTypesIndex getTopicTypesIndex()
                                   throws IndexManagerException
Shortcut access method for the TopicTypesIndex

Returns:
an TopicTypesIndex
Throws:
IndexManagerException - If the index could not be initialised for some reason.

getThemesIndex

public ThemesIndex getThemesIndex()
                           throws IndexManagerException
Shortcut access method for the ThemesIndex

Returns:
an ThemesIndex
Throws:
IndexManagerException - If the index could not be initialised for some reason.

getOccurrenceTypesIndex

public OccurrenceTypesIndex getOccurrenceTypesIndex()
                                             throws IndexManagerException
Shortcut access method for the OccurrenceTypesIndex

Returns:
an OccurrenceTypesIndex
Throws:
IndexManagerException - If the index could not be initialised for some reason.

getOccurrenceLocatorIndex

public OccurrenceLocatorIndex getOccurrenceLocatorIndex()
                                                 throws IndexManagerException
Shortcut access method for the OccurrenceLocatorIndex

Returns:
an OccurrenceLocatorIndex
Throws:
IndexManagerException - If the index could not be initialised for some reason.

getMemberTypesIndex

public MemberTypesIndex getMemberTypesIndex()
                                     throws IndexManagerException
Shortcut access method for the MemberTypesIndex

Returns:
an MemberTypesIndex
Throws:
IndexManagerException - If the index could not be initialised for some reason.

getAssociationTypesIndex

public AssociationTypesIndex getAssociationTypesIndex()
                                               throws IndexManagerException
Shortcut access method for the AssociationTypesIndex

Returns:
an AssociationTypesIndex
Throws:
IndexManagerException - If the index could not be initialised for some reason.

getBaseNameDataIndex

public BaseNameDataIndex getBaseNameDataIndex()
                                       throws IndexManagerException
Shortcut access method for BaseNameDataIndex

Returns:
a BaseNameDataIndex instance
Throws:
IndexManagerException - if the index could not be initialised for some reason
Since:
0.9.5

getOccurrenceDataIndex

public OccurrenceDataIndex getOccurrenceDataIndex()
                                           throws IndexManagerException
Shortcut access method for OccurrenceDataIndex

Returns:
an OccurrenceDataIndex instance
Throws:
IndexManagerException - if the index could not be initialised for some reason
Since:
0.9.5

getVariantDataIndex

public VariantDataIndex getVariantDataIndex()
                                     throws IndexManagerException
Shortcut access method for VariantDataIndex

Returns:
an VariantDataIndex instance
Throws:
IndexManagerException - if the index could not be initialised for some reason
Since:
0.9.7