org.modeshape.jcr.spi.index

## Interface IndexManager

-     public interface IndexManager

  An interface for programmatically adding or removing index providers and index definitions.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IndexColumnDefinitionTemplate` | `createIndexColumnDefinitionTemplate()` Create a new template that can be used to programmatically define a column on an index.
    `IndexDefinitionTemplate` | `createIndexDefinitionTemplate()` Create a new template that can be used to programmatically define an index.
    `Map<String,IndexDefinition>` | `getIndexDefinitions()` Get a map of the registered index definitions keyed by their names.
    `IndexProvider` | `getProvider(String name)` Get the query index provider registered with the given name.
    `Set<String>` | `getProviderNames()` Get the names of the registered `IndexProvider`s.
    `void` | `register(IndexProvider provider)` Register a new already-instantiated `IndexProvider`.
    `void` | `registerIndex(IndexDefinition indexDefinition, boolean allowUpdate)` Register a new definition for an index.
    `void` | `registerIndexes(IndexDefinition[] indexDefinitions, boolean allowUpdate)` Register new definitions for several indexes.
    `void` | `unregister(String providerName)` Unregister the `IndexProvider` with the supplied name.
    `void` | `unregisterIndex(String indexName)` Removes an existing index definition.

- - ### Method Detail

    - #### getProviderNames

          Set<String> getProviderNames()

      Get the names of the registered `IndexProvider`s.
      Returns:
        the names of the providers; never null but possibly empty

    - #### getProvider

          IndexProvider getProvider(String name)

      Get the query index provider registered with the given name.
      Parameters:
        `name` - the name of the query index provider; may not be null
      Returns:
        the query index provider instance, or null if there is no provider registered with the supplied name

    - #### getIndexDefinitions

          Map<String,IndexDefinition> getIndexDefinitions()

      Get a map of the registered index definitions keyed by their names.
      Returns:
        the index definitions; never null but possibly empty

    - #### register

          void register(IndexProvider provider)
                        throws IndexProviderExistsException,
                               RepositoryException

      Register a new already-instantiated `IndexProvider`.
      Parameters:
        `provider` - the new provider instance; may not be null
      Throws:
        `IndexProviderExistsException` - if there is already an existing index provider with the same name
        `RepositoryException` - if there is a problem registering the provider

    - #### unregister

          void unregister(String providerName)
                          throws NoSuchProviderException,
                                 RepositoryException

      Unregister the `IndexProvider` with the supplied name.
      Parameters:
        `providerName` - the name of the query index provider; may not be null
      Throws:
        `NoSuchProviderException` - there is no index provider with the supplied name
        `RepositoryException` - if there is a problem unregistering the provider

    - #### registerIndex

          void registerIndex(IndexDefinition indexDefinition,
                           boolean allowUpdate)
                             throws InvalidIndexDefinitionException,
                                    IndexExistsException,
                                    RepositoryException

      Register a new definition for an index.
      Parameters:
        `indexDefinition` - the definition; may not be null
        `allowUpdate` - true if the definition can update or ovewrite an existing definition with the same name, or false if calling this method when a definition with the same name already exists should result in an exception
      Throws:
        `InvalidIndexDefinitionException` - if the new definition is invalid
        `IndexExistsException` - if `allowUpdate` is `false` and the `NodeTypeDefinition` specifies a node type name that is already registered.
        `RepositoryException` - if there is a problem registering the new definition, or if an existing index

    - #### registerIndexes

          void registerIndexes(IndexDefinition[] indexDefinitions,
                             boolean allowUpdate)
                               throws InvalidIndexDefinitionException,
                                      IndexExistsException,
                                      RepositoryException

      Register new definitions for several indexes.
      Parameters:
        `indexDefinitions` - the definitions; may not be null
        `allowUpdate` - true if each of the definition can update or ovewrite an existing definition with the same name, or false if calling this method when a definition with the same name already exists should result in an exception
      Throws:
        `InvalidIndexDefinitionException` - if the new definition is invalid
        `IndexExistsException` - if `allowUpdate` is `false` and the `NodeTypeDefinition` specifies a node type name that is already registered.
        `RepositoryException` - if there is a problem registering the new definition, or if an existing index

    - #### unregisterIndex

          void unregisterIndex(String indexName)
                               throws NoSuchIndexException,
                                      RepositoryException

      Removes an existing index definition.
      Parameters:
        `indexName` - the name of the index definition to be removed; may not be null
      Throws:
        `NoSuchIndexException` - there is no index with the supplied name
        `RepositoryException` - if there is a problem registering the new definition, or if an existing index

    - #### createIndexDefinitionTemplate

          IndexDefinitionTemplate createIndexDefinitionTemplate()

      Create a new template that can be used to programmatically define an index.
      Returns:
        the new template; may not be null

    - #### createIndexColumnDefinitionTemplate

          IndexColumnDefinitionTemplate createIndexColumnDefinitionTemplate()

      Create a new template that can be used to programmatically define a column on an index.
      Returns:
        the new template; may not be null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.