org.modeshape.jcr.query

## Class CompositeIndexWriter

- java.lang.Object
- - org.modeshape.jcr.query.CompositeIndexWriter

- All Implemented Interfaces:
    IndexWriter

      public class CompositeIndexWriter
      extends Object
      implements IndexWriter

  A composition of multiple QueryIndexWriter instances.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `CompositeIndexWriter.Context`

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

      `IndexWriter.IndexingContext`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CompositeIndexWriter(List<IndexWriter> writers)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBinaryToIndex(Binary binary, IndexWriter.IndexingContext txnCtx)`
    `void` | `addToIndex(String workspace, NodeKey key, Path path, Name primaryType, Set<Name> mixinTypes, Iterator<Property> propertiesIterator, NodeTypeSchemata schemata, IndexWriter.IndexingContext txnCtx)` Add to the index the information about a node.
    `boolean` | `canBeSkipped()` Flag that defines whether this index may be skipped.
    `void` | `clearAllIndexes()` Clear all indexes of content.
    `static IndexWriter` | `create(Iterable<IndexProvider> providers)`
    `IndexWriter.IndexingContext` | `createIndexingContext(Transaction txn)` Create a new indexing context in which a set of indexing operations will be performed.
    `void` | `removeBinariesFromIndex(Iterable<String> sha1s, IndexWriter.IndexingContext txnCtx)`
    `void` | `removeFromIndex(String workspace, Iterable<NodeKey> keys, IndexWriter.IndexingContext txnCtx)`
    `void` | `updateIndex(String workspace, NodeKey key, Path path, Name primaryType, Set<Name> mixinTypes, Iterator<Property> properties, NodeTypeSchemata schemata, IndexWriter.IndexingContext txnCtx)` Update the index to reflect the new state of the node.

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

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

- - ### Constructor Detail

    - #### CompositeIndexWriter

          protected CompositeIndexWriter(List<IndexWriter> writers)

  - ### Method Detail

    - #### create

          public static IndexWriter create(Iterable<IndexProvider> providers)

    - #### createIndexingContext

          public IndexWriter.IndexingContext createIndexingContext(Transaction txn)

      Description copied from interface: `IndexWriter`
      Create a new indexing context in which a set of indexing operations will be performed. Each indexing context is presumed to be all-or-nothing, and is often based upon or part of the underlying transaction.
      Specified by:
        `createIndexingContext` in interface `IndexWriter`
      Parameters:
        `txn` - the transaction that this context is to participate in
      Returns:
        the indexing context, or null if there is no such transactional context

    - #### clearAllIndexes

          public void clearAllIndexes()

      Description copied from interface: `IndexWriter`
      Clear all indexes of content. This method is typically called prior to a re-indexing operation.
      Specified by:
        `clearAllIndexes` in interface `IndexWriter`

    - #### canBeSkipped

          public boolean canBeSkipped()

      Description copied from interface: `IndexWriter`
      Flag that defines whether this index may be skipped. This is usually the case when the writer has no indexes behind it.
      Specified by:
        `canBeSkipped` in interface `IndexWriter`
      Returns:
        true if this index writer does not need to be called, or false otherwise

    - #### addToIndex

          public void addToIndex(String workspace,
                        NodeKey key,
                        Path path,
                        Name primaryType,
                        Set<Name> mixinTypes,
                        Iterator<Property> propertiesIterator,
                        NodeTypeSchemata schemata,
                        IndexWriter.IndexingContext txnCtx)

      Description copied from interface: `IndexWriter`
      Add to the index the information about a node.
      Specified by:
        `addToIndex` in interface `IndexWriter`
      Parameters:
        `workspace` - the workspace in which the node information should be available; may not be null
        `key` - the unique key for the node; may not be null
        `path` - the path of the node; may not be null
        `primaryType` - the primary type of the node; may not be null
        `mixinTypes` - the mixin types for the node; may not be null but may be empty
        `propertiesIterator` - the iterator over the properties of a node; may not be null but may be empty
        `schemata` - the node type schemata that should be used to determine how the node is to be indexed; may not be null
        `txnCtx` - the transaction context in which the index updates should be made; may not be null

    - #### updateIndex

          public void updateIndex(String workspace,
                         NodeKey key,
                         Path path,
                         Name primaryType,
                         Set<Name> mixinTypes,
                         Iterator<Property> properties,
                         NodeTypeSchemata schemata,
                         IndexWriter.IndexingContext txnCtx)

      Description copied from interface: `IndexWriter`
      Update the index to reflect the new state of the node.
      Specified by:
        `updateIndex` in interface `IndexWriter`
      Parameters:
        `workspace` - the workspace in which the node information should be available; may not be null
        `key` - the unique key for the node; may not be null
        `path` - the path of the node; may not be null
        `primaryType` - the primary type of the node; may not be null
        `mixinTypes` - the mixin types for the node; may not be null but may be empty
        `properties` - the properties of the node; may not be null but may be empty
        `schemata` - the node type schemata that should be used to determine how the node is to be indexed; may not be null
        `txnCtx` - the transaction context in which the index updates should be made; may not be null

    - #### removeFromIndex

          public void removeFromIndex(String workspace,
                             Iterable<NodeKey> keys,
                             IndexWriter.IndexingContext txnCtx)

      Specified by:
        `removeFromIndex` in interface `IndexWriter`

    - #### addBinaryToIndex

          public void addBinaryToIndex(Binary binary,
                              IndexWriter.IndexingContext txnCtx)

      Specified by:
        `addBinaryToIndex` in interface `IndexWriter`

    - #### removeBinariesFromIndex

          public void removeBinariesFromIndex(Iterable<String> sha1s,
                                     IndexWriter.IndexingContext txnCtx)

      Specified by:
        `removeBinariesFromIndex` in interface `IndexWriter`

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