org.modeshape.jcr.index.local

## Class LocalIndexProvider

- java.lang.Object
- - org.modeshape.jcr.spi.index.provider.IndexProvider
  - - org.modeshape.jcr.index.local.LocalIndexProvider

-     public class LocalIndexProvider
      extends IndexProvider

  An `IndexProvider` implementation that maintains indexes on the local file system using MapDB.

  This provider maintains a separate

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalIndexProvider()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected ManagedIndex` | `createIndex(IndexDefinition defn, String workspaceName, NodeTypes.Supplier nodeTypesSupplier, IndexFeedback feedback)` Method called when this provider needs to create a new index given the unique pair of workspace name and index definition.
    `protected void` | `doInitialize()` Method that should do the provider-specific initialization work.
    `String` | `getDirectory()` Get the absolute or relative path to the directory where this provider should store the indexes.
    `IndexPlanner` | `getIndexPlanner()` Get the planner that, during the query planning/optimization phase, evaluates for a single source the AND-ed query constraints and defines indexes that may be used.
    `protected void` | `postShutdown()` Method called during #shutdown() after each of the managed indexes have been shutdown.
    `protected void` | `removeIndex(IndexDefinition oldDefn, ManagedIndex existingIndex, String workspaceName)` Method called when this provider needs to remove an existing index given the unique pair of workspace name and index definition.
    `protected ManagedIndex` | `updateIndex(IndexDefinition oldDefn, IndexDefinition updatedDefn, ManagedIndex existingIndex, String workspaceName, NodeTypes.Supplier nodeTypesSupplier, IndexFeedback feedback)` Method called when this provider needs to update an existing index given the unique pair of workspace name and index definition.

    - ### Methods inherited from class org.modeshape.jcr.spi.index.provider.IndexProvider

      `context, getIndex, getIndexWriter, getName, getRepositoryName, initialize, logger, names, namespaces, notify, notify, preShutdown, shutdown, valueFactories`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LocalIndexProvider

          public LocalIndexProvider()

  - ### Method Detail

    - #### getDirectory

          public String getDirectory()

      Get the absolute or relative path to the directory where this provider should store the indexes.
      Returns:
        the path to the directory

    - #### doInitialize

          protected void doInitialize()
                               throws RepositoryException

      Description copied from class: `IndexProvider`
      Method that should do the provider-specific initialization work. This is called by ModeShape once for each provider instance, and should not be called by the provider itself.
      Specified by:
        `doInitialize` in class `IndexProvider`
      Throws:
        `RepositoryException` - if there is a problem initializing the provider

    - #### postShutdown

          protected void postShutdown()

      Description copied from class: `IndexProvider`
      Method called during #shutdown() after each of the managed indexes have been shutdown.
      Overrides:
        `postShutdown` in class `IndexProvider`

    - #### getIndexPlanner

          public IndexPlanner getIndexPlanner()

      Description copied from class: `IndexProvider`
      Get the planner that, during the query planning/optimization phase, evaluates for a single source the AND-ed query constraints and defines indexes that may be used.

      This method is typically called only once after the provider has been `initialized`.

      Specified by:
        `getIndexPlanner` in class `IndexProvider`
      Returns:
        the index planner; may not be null

    - #### createIndex

          protected ManagedIndex createIndex(IndexDefinition defn,
                                 String workspaceName,
                                 NodeTypes.Supplier nodeTypesSupplier,
                                 IndexFeedback feedback)

      Description copied from class: `IndexProvider`
      Method called when this provider needs to create a new index given the unique pair of workspace name and index definition. An index definition can apply to multiple workspaces, and when it does this method will be called once for each applicable workspace.
      Specified by:
        `createIndex` in class `IndexProvider`
      Parameters:
        `defn` - the definition of the index; never null
        `workspaceName` - the name of the actual workspace to which the new index applies; never null
        `nodeTypesSupplier` - the supplier for the current node types cache; never null
        `feedback` - the feedback mechanism for this provider to signal to ModeShape that portions of the repository content must be scanned to build/populate the new index; never null
      Returns:
        the implementation-specific `ManagedIndex` for the new index; may not be null

    - #### updateIndex

          protected ManagedIndex updateIndex(IndexDefinition oldDefn,
                                 IndexDefinition updatedDefn,
                                 ManagedIndex existingIndex,
                                 String workspaceName,
                                 NodeTypes.Supplier nodeTypesSupplier,
                                 IndexFeedback feedback)

      Description copied from class: `IndexProvider`
      Method called when this provider needs to update an existing index given the unique pair of workspace name and index definition. An index definition can apply to multiple workspaces, and when it is changed this method will be called once for each applicable workspace.
      Specified by:
        `updateIndex` in class `IndexProvider`
      Parameters:
        `oldDefn` - the previous definition of the index; never null
        `updatedDefn` - the updated definition of the index; never null
        `existingIndex` - the existing index prior to this update, as returned from `IndexProvider.createIndex(org.modeshape.jcr.api.index.IndexDefinition, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)` or `IndexProvider.updateIndex(org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.spi.index.provider.ManagedIndex, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)` ; never null
        `workspaceName` - the name of the actual workspace to which the new index applies; never null
        `nodeTypesSupplier` - the supplier for the current node types cache; never null
        `feedback` - the feedback mechanism for this provider to signal to ModeShape that portions of the repository content must be scanned to rebuild/repopulate the updated index; never null
      Returns:
        the operations and provider-specific state for this index; never null

    - #### removeIndex

          protected void removeIndex(IndexDefinition oldDefn,
                         ManagedIndex existingIndex,
                         String workspaceName)

      Description copied from class: `IndexProvider`
      Method called when this provider needs to remove an existing index given the unique pair of workspace name and index definition. An index definition can apply to multiple workspaces, and when it does this method will be called once for each applicable workspace.
      Specified by:
        `removeIndex` in class `IndexProvider`
      Parameters:
        `oldDefn` - the previous definition of the index; never null
        `existingIndex` - the existing index prior to this update, as returned from `IndexProvider.createIndex(org.modeshape.jcr.api.index.IndexDefinition, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)` or `IndexProvider.updateIndex(org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.spi.index.provider.ManagedIndex, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)` ; never null
        `workspaceName` - the name of the actual workspace to which the new index applies; never null

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