org.apache.ode.bpel.common

## Class InstanceFilter

- java.lang.Object
- - org.apache.ode.bpel.common.Filter<org.apache.ode.bpel.common.InstanceFilter.Criteria>
  - - org.apache.ode.bpel.common.InstanceFilter

- All Implemented Interfaces:
    java.io.Serializable

      public class InstanceFilter
      extends Filter<org.apache.ode.bpel.common.InstanceFilter.Criteria>
      implements java.io.Serializable

  Holds a filter that will get interpreted when listing processe instances. The semantic of the filtering is somewhat different than the one used in the ProcessQuery class. Here we're introducing a pseudo process querying language.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `InstanceFilter.StatusKeys`

    - ### Nested classes/interfaces inherited from class org.apache.ode.bpel.common.Filter

      `Filter.Restriction<V>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `LOG`
    `java.util.List<java.lang.String>` | `orders` Orders to use when sorting the result (no particular order if not set).

    - ### Fields inherited from class org.apache.ode.bpel.common.Filter

      `__msgs, _criteria`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InstanceFilter(java.lang.String filter)`
    `InstanceFilter(java.lang.String filter, java.lang.String orderKeys, int limit)` Initializes properly the InstanceFilter attributes by pre-parsing the filter and orderKeys strings and setting the limit.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `arePidsNegative()`
    `java.util.List<java.lang.Short>` | `convertFilterState()` Converts the status filter value as given by a filter ('active', 'suspended', ...) to an instance state as defined in the ProcessState class.
    `protected org.apache.ode.bpel.common.InstanceFilter.Criteria[]` | `getFilterKeys()` Get the list of known (recognized) filter keys.
    `java.util.List<java.lang.String>` | `getIidFilter()`
    `java.util.List<java.lang.String>` | `getLastActiveDateFilter()`
    `int` | `getLimit()`
    `java.lang.String` | `getNameFilter()`
    `java.lang.String` | `getNamespaceFilter()`
    `java.util.List<java.lang.String>` | `getOrders()`
    `java.util.List<java.lang.String>` | `getPidFilter()`
    `java.util.Map<java.lang.String,java.lang.String>` | `getPropertyValuesFilter()`
    `java.util.List<java.lang.String>` | `getStartedDateFilter()`
    `java.util.List<java.lang.String>` | `getStatusFilter()`
    `static void` | `main(java.lang.String[] args)`
    `protected org.apache.ode.bpel.common.InstanceFilter.Criteria` | `parseKey(java.lang.String keyVal)` Parse the string representation of a key into an enumeration value.
    `protected void` | `process(org.apache.ode.bpel.common.InstanceFilter.Criteria key, Filter.Restriction<java.lang.String> rest)` Perform additional parsing/processing.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.apache.ode.bpel.common.Filter

      `getDateWithoutOp, init`

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

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

- - ### Field Detail

    - #### LOG

          protected static org.slf4j.Logger LOG

    - #### orders

          public java.util.List<java.lang.String> orders

      Orders to use when sorting the result (no particular order if not set). Currently /supported keys are:
      - pid
      - name
      - namespace
      - version
      - status
      - started
      - last-active
      Each key can be prefixed with a + or - sign for ascending or descending orders (ascending if no sign specified)..

  - ### Constructor Detail

    - #### InstanceFilter

          public InstanceFilter(java.lang.String filter,
                        java.lang.String orderKeys,
                        int limit)

      Initializes properly the InstanceFilter attributes by pre-parsing the filter and orderKeys strings and setting the limit. A limit inferior than or equal to 0 is ignored.
      Parameters:
        `filter` -
        `orderKeys` -

    - #### InstanceFilter

          public InstanceFilter(java.lang.String filter)

  - ### Method Detail

    - #### convertFilterState

          public java.util.List<java.lang.Short> convertFilterState()

      Converts the status filter value as given by a filter ('active', 'suspended', ...) to an instance state as defined in the ProcessState class.
      Returns:
        one of the STATE_XX constant in ProcessState

    - #### getNameFilter

          public java.lang.String getNameFilter()

    - #### getNamespaceFilter

          public java.lang.String getNamespaceFilter()

    - #### getStatusFilter

          public java.util.List<java.lang.String> getStatusFilter()

    - #### getStartedDateFilter

          public java.util.List<java.lang.String> getStartedDateFilter()

    - #### getLastActiveDateFilter

          public java.util.List<java.lang.String> getLastActiveDateFilter()

    - #### getPropertyValuesFilter

          public java.util.Map<java.lang.String,java.lang.String> getPropertyValuesFilter()

    - #### getOrders

          public java.util.List<java.lang.String> getOrders()

    - #### getPidFilter

          public java.util.List<java.lang.String> getPidFilter()

    - #### arePidsNegative

          public boolean arePidsNegative()

    - #### getIidFilter

          public java.util.List<java.lang.String> getIidFilter()

    - #### main

          public static void main(java.lang.String[] args)

    - #### parseKey

          protected org.apache.ode.bpel.common.InstanceFilter.Criteria parseKey(java.lang.String keyVal)

      Description copied from class: `Filter`
      Parse the string representation of a key into an enumeration value.
      Specified by:
        `parseKey` in class `Filter<org.apache.ode.bpel.common.InstanceFilter.Criteria>`
      Parameters:
        `keyVal` - string representation
      Returns:
        enumeration value

    - #### getFilterKeys

          protected org.apache.ode.bpel.common.InstanceFilter.Criteria[] getFilterKeys()

      Description copied from class: `Filter`
      Get the list of known (recognized) filter keys.
      Specified by:
        `getFilterKeys` in class `Filter<org.apache.ode.bpel.common.InstanceFilter.Criteria>`
      Returns:
        recognized filter keys

    - #### process

          protected void process(org.apache.ode.bpel.common.InstanceFilter.Criteria key,
                     Filter.Restriction<java.lang.String> rest)

      Description copied from class: `Filter`
      Perform additional parsing/processing.
      Specified by:
        `process` in class `Filter<org.apache.ode.bpel.common.InstanceFilter.Criteria>`
      Parameters:
        `key` - filter key
        `rest` - restriction

    - #### getLimit

          public int getLimit()

      Returns:
        the limit

    - #### toString

          public java.lang.String toString()

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