org.modeshape.jcr.index.local

## Class ManagedLocalIndexBuilder<T>

- java.lang.Object
- - org.modeshape.jcr.index.local.ManagedLocalIndexBuilder<T>

- Type Parameters:
    `T` - the type of value that is indexed
  Direct Known Subclasses:
    ManagedLocalIndexBuilder.SingleColumnIndexBuilder

      public abstract class ManagedLocalIndexBuilder<T>
      extends Object

  A builder for `local indexes`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `ManagedLocalIndexBuilder.SingleColumnIndexBuilder<T>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ExecutionContext` | `context`
    `protected IndexDefinition` | `defn`
    `protected ChangeSetAdapter.NodeTypePredicate` | `matcher`
    `protected NodeTypes.Supplier` | `nodeTypesSupplier`
    `protected MapDB.Serializers` | `serializers`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ManagedLocalIndexBuilder(ExecutionContext context, IndexDefinition defn, NodeTypes.Supplier nodeTypesSupplier, ChangeSetAdapter.NodeTypePredicate matcher)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract ManagedLocalIndex` | `build(String workspaceName, org.mapdb.DB localDatabase)` Build the managed index.
    `static <T> ManagedLocalIndexBuilder<T>` | `create(ExecutionContext context, IndexDefinition defn, NodeTypes.Supplier nodeTypesSupplier, ChangeSetAdapter.NodeTypePredicate matcher)` Create a builder for the supplied index definition.
    `protected static PropertyType` | `determineActualPropertyType(IndexColumnDefinition columnDefn)`
    `protected IndexColumnDefinition` | `firstColumn()`
    `protected abstract org.mapdb.BTreeKeySerializer<T>` | `getBTreeKeySerializer()`
    `protected abstract Comparator<T>` | `getComparator()`
    `protected abstract IndexValues.Converter<T>` | `getConverter()`
    `protected NodeTypes.Supplier` | `getNodeTypesSupplier()`
    `protected abstract org.mapdb.Serializer<T>` | `getSerializer()`
    `protected abstract Class<T>` | `getValueClass()`
    `protected boolean` | `hasSingleColumn()`
    `protected String` | `indexName()`
    `protected boolean` | `isMixinTypesIndex()`
    `protected boolean` | `isNodeDepthIndex()`
    `protected boolean` | `isNodeLocalNameIndex()`
    `protected boolean` | `isNodeNameIndex()`
    `protected boolean` | `isNodePathIndex()`
    `protected boolean` | `isNodeTypesIndex()`
    `protected boolean` | `isPrimaryTypeIndex()`
    `protected boolean` | `isType(PropertyType propType, PropertyType expected)`
    `protected boolean` | `isType(PropertyType propType, PropertyType expected1, PropertyType expected2)`
    `protected boolean` | `matches(IndexColumnDefinition defn, Name name)`
    `protected boolean` | `matches(String actual, Name name)`
    `protected Name` | `name(String name)`
    `abstract void` | `validate(Problems problems)` Validate whether the index definition is acceptable for this provider.

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

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

- - ### Field Detail

    - #### context

          protected final ExecutionContext context

    - #### serializers

          protected final MapDB.Serializers serializers

    - #### nodeTypesSupplier

          protected final NodeTypes.Supplier nodeTypesSupplier

    - #### defn

          protected final IndexDefinition defn

    - #### matcher

          protected final ChangeSetAdapter.NodeTypePredicate matcher

  - ### Constructor Detail

    - #### ManagedLocalIndexBuilder

          protected ManagedLocalIndexBuilder(ExecutionContext context,
                                  IndexDefinition defn,
                                  NodeTypes.Supplier nodeTypesSupplier,
                                  ChangeSetAdapter.NodeTypePredicate matcher)

  - ### Method Detail

    - #### create

          public static <T> ManagedLocalIndexBuilder<T> create(ExecutionContext context,
                                               IndexDefinition defn,
                                               NodeTypes.Supplier nodeTypesSupplier,
                                               ChangeSetAdapter.NodeTypePredicate matcher)

      Create a builder for the supplied index definition.
      Parameters:
        `context` - the execution context in which the index should operate; may not be null
        `defn` - the index definition; may not be null
        `nodeTypesSupplier` - the supplier of the `NodeTypes` instance; may not be null
        `matcher` - the node type matcher used to determine which nodes should be included in the index; may not be null
      Returns:
        the index builder; never null

    - #### determineActualPropertyType

          protected static PropertyType determineActualPropertyType(IndexColumnDefinition columnDefn)

    - #### build

          public abstract ManagedLocalIndex build(String workspaceName,
                                org.mapdb.DB localDatabase)
                                           throws LocalIndexException

      Build the managed index.
      Parameters:
        `workspaceName` - the name of the workspace; may not be null
        `localDatabase` - the local database; may not be null
      Returns:
        the managed local index
      Throws:
        `LocalIndexException` - if there is a problem creating the index

    - #### validate

          public abstract void validate(Problems problems)

      Validate whether the index definition is acceptable for this provider.
      Parameters:
        `problems` - the component to record any problems, errors, or warnings; may not be null

    - #### getNodeTypesSupplier

          protected final NodeTypes.Supplier getNodeTypesSupplier()

    - #### indexName

          protected final String indexName()

    - #### getSerializer

          protected abstract org.mapdb.Serializer<T> getSerializer()

    - #### getBTreeKeySerializer

          protected abstract org.mapdb.BTreeKeySerializer<T> getBTreeKeySerializer()

    - #### getComparator

          protected abstract Comparator<T> getComparator()

    - #### getConverter

          protected abstract IndexValues.Converter<T> getConverter()

    - #### getValueClass

          protected abstract Class<T> getValueClass()

    - #### isNodeTypesIndex

          protected boolean isNodeTypesIndex()

    - #### isPrimaryTypeIndex

          protected boolean isPrimaryTypeIndex()

    - #### isMixinTypesIndex

          protected boolean isMixinTypesIndex()

    - #### isNodeNameIndex

          protected boolean isNodeNameIndex()

    - #### isNodeLocalNameIndex

          protected boolean isNodeLocalNameIndex()

    - #### isNodeDepthIndex

          protected boolean isNodeDepthIndex()

    - #### isNodePathIndex

          protected boolean isNodePathIndex()

    - #### hasSingleColumn

          protected boolean hasSingleColumn()

    - #### firstColumn

          protected IndexColumnDefinition firstColumn()

    - #### name

          protected final Name name(String name)

    - #### matches

          protected final boolean matches(IndexColumnDefinition defn,
                        Name name)

    - #### matches

          protected final boolean matches(String actual,
                        Name name)

    - #### isType

          protected final boolean isType(PropertyType propType,
                       PropertyType expected)

    - #### isType

          protected final boolean isType(PropertyType propType,
                       PropertyType expected1,
                       PropertyType expected2)

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