org.modeshape.jcr.index.local

## Class ManagedLocalIndex

- java.lang.Object
- - org.modeshape.jcr.index.local.ManagedLocalIndex

- All Implemented Interfaces:
    Costable, Filter, ManagedIndex

      public class ManagedLocalIndex
      extends Object
      implements ManagedIndex

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.modeshape.jcr.spi.index.provider.Filter

      `Filter.Results`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `enable(boolean enable)` Mark whether this index is enabled for use, or not enabled meaning it should not be used.
    `long` | `estimateCardinality(Constraint constraint, Map<String,Object> variables)` Compute the cost applying the given constraint.
    `long` | `estimateTotalCount()` Get the estimated number of entries within this index.
    `Filter.Results` | `filter(IndexConstraints constraints)` Return a `Filter.Results` instance from which ModeShape can obtain the nodes that satisfy the supplied constraints.
    `IndexChangeAdapter` | `getIndexChangeAdapter()` Get the ChangeSetAdapter implementation through which changes to content are sent to the index.
    `boolean` | `isEnabled()` Determine if this index is enabled for use.
    `boolean` | `isNew()`
    `void` | `removeAll()` Remove all of the index entries from the index.
    `void` | `shutdown(boolean destroyed)` Shut down this index and release all runtime resources.

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

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

- - ### Method Detail

    - #### isNew

          public boolean isNew()

    - #### estimateTotalCount

          public long estimateTotalCount()

      Description copied from interface: `Costable`
      Get the estimated number of entries within this index.
      Specified by:
        `estimateTotalCount` in interface `Costable`
      Returns:
        the number of entries, or -1 if not known

    - #### estimateCardinality

          public long estimateCardinality(Constraint constraint,
                                 Map<String,Object> variables)

      Description copied from interface: `Costable`
      Compute the cost applying the given constraint.
      Specified by:
        `estimateCardinality` in interface `Costable`
      Parameters:
        `constraint` - the constraint; never null
        `variables` - the bound variables for the query that is being costed; never null
      Returns:
        the approximate number of records that will be returned

    - #### filter

          public Filter.Results filter(IndexConstraints constraints)

      Description copied from interface: `Filter`
      Return a `Filter.Results` instance from which ModeShape can obtain the nodes that satisfy the supplied constraints. This method should return quickly, since no work (or at least very little work) should be done. All of the work should be performed when the `Filter.Results.getNextBatch(ResultWriter, int)` method is called on the results.
      Specified by:
        `filter` in interface `Filter`
      Parameters:
        `constraints` - the constraints to be applied by this index; never null
      Returns:
        the batched node keys; never null

    - #### getIndexChangeAdapter

          public IndexChangeAdapter getIndexChangeAdapter()

      Description copied from interface: `ManagedIndex`
      Get the ChangeSetAdapter implementation through which changes to content are sent to the index. Each local index has an `ChangeSetListener` that is registered on the event bus and kept throughout the lifetime of the index (even if there are changes), and that listener delegates to this adapter.
      Specified by:
        `getIndexChangeAdapter` in interface `ManagedIndex`
      Returns:
        the adapter; never null

    - #### enable

          public void enable(boolean enable)

      Description copied from interface: `ManagedIndex`
      Mark whether this index is enabled for use, or not enabled meaning it should not be used.
      Specified by:
        `enable` in interface `ManagedIndex`
      Parameters:
        `enable` - true if the index is to be enabled, or false otherwise

    - #### isEnabled

          public boolean isEnabled()

      Description copied from interface: `ManagedIndex`
      Determine if this index is enabled for use.
      Specified by:
        `isEnabled` in interface `ManagedIndex`
      Returns:
        true if enabled, or false otherwise

    - #### shutdown

          public void shutdown(boolean destroyed)

      Description copied from interface: `ManagedIndex`
      Shut down this index and release all runtime resources. If `destroyed` is `true`, then this index has been removed from the repository and will not be reused; thus all persistent resources should also be released. If `destroyed` is `false`, then this repository is merely shutting down and the index's persistent resources should be kept so that they are available when the repository is restarted.
      Specified by:
        `shutdown` in interface `ManagedIndex`
      Parameters:
        `destroyed` - true if this index is being permanently removed from the repository and all runtime and persistent resources can/should be released and cleaned up, or false if the repository is being shutdown and this index will be needed the next time the repository is started

    - #### removeAll

          public void removeAll()

      Description copied from interface: `ManagedIndex`
      Remove all of the index entries from the index. This is typically called prior to reindexing.
      Specified by:
        `removeAll` in interface `ManagedIndex`

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