org.apache.ode.bpel.common

## Class CorrelationKeySet

- java.lang.Object
- - org.apache.ode.bpel.common.CorrelationKeySet

- All Implemented Interfaces:
    java.io.Serializable

      public class CorrelationKeySet
      extends java.lang.Object
      implements java.io.Serializable

  This class implements a set of correlation keys. The example of canonical forms of correlation key sets are:
  - @2
  - @2[12~a~b]
  - @2[12~a~b],[25~b~c]
  The first example shows an empty correlation key set. The second shows a set with one correlation key inside. The third shows a set with two keys inside. The correlation keys are sorted by the correlation set ids.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `VERSION_1`
    `static java.lang.String` | `VERSION_2`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CorrelationKeySet()` Default Constructor
    `CorrelationKeySet(java.lang.String canonicalForm)` Restores the state by parsing the given canonical form of correlation key set.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CorrelationKeySet` | `add(CorrelationKey ck)` Adds a correlation key to this correlation key set.
    `void` | `clear()` Removes all correlation keys in this correlation keys.
    `boolean` | `contains(CorrelationKey correlationKey)` Returns true if this correlation key set contains the give correlation key.
    `boolean` | `containsAll(CorrelationKeySet c)` Checks if this correlation key set contains all correlation keys from the given correlation key set.
    `boolean` | `equals(java.lang.Object o)`
    `java.util.List<CorrelationKeySet>` | `findSubSets()` Finds all subsets of this correlation key set.
    `boolean` | `isEmpty()` Returns true if this correlation key set contains no correlation keys.
    `boolean` | `isOpaque()` Checks if this correlation key set contains the opaque correlation key as the only key in this correlation key set.
    `boolean` | `isRoutableTo(CorrelationKeySet candidateKeySet, boolean isAllRoute)` Checks if an incoming message with this correlation key set can be accepted by the given correlation key set.
    `java.util.Iterator<CorrelationKey>` | `iterator()` Returns an iterator on the correlation keys that this correlation key set contains.
    `void` | `restore(java.lang.String canonicalForm)` Restores the state of this correlation key set from a canonical form.
    `java.lang.String` | `toCanonicalString()` Returns a canonical form of this correlation key set.
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### VERSION_1

          public static final java.lang.String VERSION_1

      See Also:
        Constant Field Values

    - #### VERSION_2

          public static final java.lang.String VERSION_2

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CorrelationKeySet

          public CorrelationKeySet()

      Default Constructor

    - #### CorrelationKeySet

          public CorrelationKeySet(java.lang.String canonicalForm)

      Restores the state by parsing the given canonical form of correlation key set.
      Parameters:
        `canonicalForm` - canonical form of correlation key set

  - ### Method Detail

    - #### add

          public CorrelationKeySet add(CorrelationKey ck)

      Adds a correlation key to this correlation key set. If a correlation key with the same correlation set id already exists, the old one is replaced with the given new one.
      Parameters:
        `ck` - a correlation key to add
      Returns:
        returns this correlation key set

    - #### isOpaque

          public boolean isOpaque()

      Checks if this correlation key set contains the opaque correlation key as the only key in this correlation key set.
      Returns:
        returns true if the correlation key set is opaque

    - #### isRoutableTo

          public boolean isRoutableTo(CorrelationKeySet candidateKeySet,
                             boolean isAllRoute)

      Checks if an incoming message with this correlation key set can be accepted by the given correlation key set.
      Parameters:
        `candidateKeySet` - a correlation key set stored in a route
        `isAllRoute` - use true if the route="all" is set
      Returns:
        return true if routable

    - #### containsAll

          public boolean containsAll(CorrelationKeySet c)

      Checks if this correlation key set contains all correlation keys from the given correlation key set.
      Parameters:
        `c` - a correlation key set
      Returns:
        return true if this correlation key set is a superset

    - #### isEmpty

          public boolean isEmpty()

      Returns true if this correlation key set contains no correlation keys.
      Returns:
        returns true if empty

    - #### contains

          public boolean contains(CorrelationKey correlationKey)

      Returns true if this correlation key set contains the give correlation key.
      Parameters:
        `correlationKey` - a correlation key
      Returns:

    - #### iterator

          public java.util.Iterator<CorrelationKey> iterator()

      Returns an iterator on the correlation keys that this correlation key set contains.
      Returns:
        an iterator

    - #### clear

          public void clear()

      Removes all correlation keys in this correlation keys.

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### findSubSets

          public java.util.List<CorrelationKeySet> findSubSets()

      Finds all subsets of this correlation key set.
      Returns:
        a list of all subset correlation key sets

    - #### toCanonicalString

          public java.lang.String toCanonicalString()

      Returns a canonical form of this correlation key set.
      Returns:

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### restore

          public void restore(java.lang.String canonicalForm)

      Restores the state of this correlation key set from a canonical form.
      Parameters:
        `canonicalForm` - a canonical form of correlation key set