org.modeshape.jcr.spi.index

## Interface IndexChangeSetListeners.SingleColumnIndexOperations

- Enclosing class:
    IndexChangeSetListeners

      @NotThreadSafe
      public static interface IndexChangeSetListeners.SingleColumnIndexOperations

  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 newProperty)` Record the addition of the node key and property value pair to the index for the given workspace.
    `void` | `change(NodeKey nodeKey, Property newProperty, Property oldProperty)` Record the change in the indexed property for the given node in the given workspace.
    `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 property.
    `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 newProperty)

      Record the addition of the node key and property value pair to the index for the given workspace.
      Parameters:
        `nodeKey` - the key for the node to which the property was added; never null
        `newProperty` - the newly-added property (which may be multi-valued); never null

    - #### change

          void change(NodeKey nodeKey,
                    Property newProperty,
                    Property oldProperty)

      Record the change in the indexed property for the given node in the given workspace.
      Parameters:
        `nodeKey` - the key for the node on which the property was changed; never null
        `newProperty` - the new property (which may be multi-valued); never null
        `oldProperty` - the old property (which may be multi-valued); never null

    - #### remove

          void remove(NodeKey nodeKey)

      Record the removal of the node or the indexed property.
      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.