org.modeshape.jcr.api.index

## Interface IndexManager

- All Known Subinterfaces:
    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.
    `Set<String>` | `getProviderNames()` Get the names of the available index providers.
    `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` | `unregisterIndex(String indexName)` Removes an existing index definition.

- - ### Method Detail

    - #### getProviderNames

          Set<String> getProviderNames()

      Get the names of the available index providers.
      Returns:
        the names of the providers; never null but possibly empty

    - #### 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

    - #### 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.