org.modeshape.jcr.spi.index.provider

## Interface IndexWriter

- All Known Implementing Classes:
    CompositeIndexWriter, NoOpQueryIndexWriter

      public interface IndexWriter

  Interface used to record in the indexes the changes to content.
  See Also:
    `IndexProvider.getIndexWriter()`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `IndexWriter.IndexingContext` The context of a set of indexing operations, typically aligned with and part of a single transaction.

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

- - ### Method Detail

    - #### canBeSkipped

          boolean canBeSkipped()

      Flag that defines whether this index may be skipped. This is usually the case when the writer has no indexes behind it.
      Returns:
        true if this index writer does not need to be called, or false otherwise

    - #### createIndexingContext

          IndexWriter.IndexingContext createIndexingContext(Transaction txn)

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

          void clearAllIndexes()

      Clear all indexes of content. This method is typically called prior to a re-indexing operation.

    - #### addToIndex

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

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

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

    - #### addBinaryToIndex

          void addBinaryToIndex(Binary binary,
                              IndexWriter.IndexingContext txnCtx)

    - #### removeBinariesFromIndex

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

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