org.modeshape.jcr.spi.index

## Interface IndexChangeSetListeners.MultiColumnIndexOperations

- Enclosing class:
    IndexChangeSetListeners

      @NotThreadSafe
      public static interface IndexChangeSetListeners.MultiColumnIndexOperations

  A predicate function that determines whether the changes in a specified workspace should be processed. The operations will always be called in the following order:
  1. `start(String, boolean)` for each of the set of changes; if this method returns `false`, then no other methods will be called for that set of changes.
  2. Zero or more calls to `add(NodeKey, Property[])`, `change(NodeKey, Property[], Property[])`, and `remove(NodeKey)` that reflect each of the changes in the set of changes for the workspace identified in `start(String, boolean)`
  3. `end()` to signal that all of the changes in the change set have been processed.
  It is possible for `start(String, boolean)` to be called and return `true`, but for `end()` to be called immediately after that. In such cases, no indexed properties were changed in the set of changes.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(NodeKey nodeKey, Property[] newProperties)` Record the addition of the indexed properties on a node.
    `void` | `change(NodeKey nodeKey, Property[] newProperties, Property[] oldProperties)` Record the change in the indexed properties for the given node.
    `void` | `end()` Signal the end of the set of changes for the workspace identified in the previous `start(String, boolean)` call that returned true.
    `void` | `remove(NodeKey nodeKey)` Record the removal of the node or the indexed properties.
    `boolean` | `start(String workspaceName, boolean local)` Signal the beginning of a set of changes for a given workspace.

- - ### Method Detail

    - #### start

          boolean start(String workspaceName,
                      boolean local)

      Signal the beginning of a set of changes for a given workspace. The response dicates whether the changes should be processed or skipped entirely. Only if this method returns true might `add(NodeKey, Property[])`, `change(NodeKey, Property[], Property[])`, and `remove(NodeKey)` be called; `end()` will always be called if this method returns true.
      Parameters:
        `workspaceName` - the name of the workspace; never null
        `local` - true if the changes originated from this same repository instance, or false if they originated on a different repository instance
      Returns:
        true if the set of changes should be processed, or false if they should be ignored

    - #### add

          void add(NodeKey nodeKey,
                 Property[] newProperties)

      Record the addition of the indexed properties on a node. It is possible that only some of the indexed properties are provided, and in such cases this means that only the provided properties were added and the missing properties are not yet set on the given node.
      Parameters:
        `nodeKey` - the key for the node to which the property was added; never null
        `newProperties` - the newly-added properties (which may be multi-valued), in the same order as defined by the IndexDefinition; never null

    - #### change

          void change(NodeKey nodeKey,
                    Property[] newProperties,
                    Property[] oldProperties)

      Record the change in the indexed properties for the given node. Only those properties that are altered will be provided.

      For example, if an index tracks two properties, A and B, then this method might be called with the new and old A if only A is changed.

      Parameters:
        `nodeKey` - the key for the node on which the property was changed; never null
        `newProperties` - the new properties (each of which may be multi-valued), in the same order as defined by the IndexDefinition; never null
        `oldProperties` - the old properties (each of which may be multi-valued), in the same order as defined by the IndexDefinition; never null

    - #### remove

          void remove(NodeKey nodeKey)

      Record the removal of the node or the indexed properties.
      Parameters:
        `nodeKey` - the key for the node to which the property was added; never null

    - #### end

          void end()

      Signal the end of the set of changes for the workspace identified in the previous `start(String, boolean)` call that returned true.

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