org.apache.ode.dao.jpa

## Class CorrelatorDAOImpl

- java.lang.Object
- - org.apache.ode.dao.jpa.OpenJPADAO
  - - org.apache.ode.dao.jpa.CorrelatorDAOImpl

- All Implemented Interfaces:
    CorrelatorDAO

      @Entity
      public class CorrelatorDAOImpl
      extends OpenJPADAO
      implements CorrelatorDAO

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CorrelatorDAOImpl()`
    `CorrelatorDAOImpl(java.lang.String correlatorKey, ProcessDAOImpl process)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRoute(java.lang.String routeGroupId, ProcessInstanceDAO target, int index, CorrelationKeySet correlationKeySet, java.lang.String routePolicy)` Add a route from the given correlation key to the given process instance.
    `boolean` | `checkRoute(CorrelationKeySet correlationKeySet)` Check if corresponding key set is free to register (see ODE-804)
    `MessageExchangeDAO` | `dequeueMessage(CorrelationKeySet correlationKeySet)` Dequeue a message exchange matching a correlationKey constraint.
    `void` | `enqueueMessage(MessageExchangeDAO mex, CorrelationKeySet correlationKeySet)` Enqueue a message exchange to the queue with a set of correlation keys.
    `java.util.List<MessageRouteDAO>` | `findRoute(CorrelationKeySet correlationKeySet)`
    `java.util.List<MessageRouteDAO>` | `findRoute(CorrelationKeySet correlationKeySet, boolean isCorrleationKeySetPreInitialized)` Find a route matching the given correlation key set.
    `java.util.Collection<CorrelatorMessageDAO>` | `getAllMessages()`
    `java.util.Collection<MessageRouteDAO>` | `getAllRoutes()`
    `java.lang.String` | `getCorrelatorId()` Get the correlator identifier.
    `void` | `removeRoutes(java.lang.String routeGroupId, ProcessInstanceDAO target)` Remove all routes with the given route-group identifier.
    `void` | `setCorrelatorId(java.lang.String newId)`

    - ### Methods inherited from class org.apache.ode.dao.jpa.OpenJPADAO

      `batchUpdateByIds, getConn, getEM, getSingleResult`

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

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

- - ### Field Detail

    - #### DELETE_CORRELATORS_BY_PROCESS

          public static final java.lang.String DELETE_CORRELATORS_BY_PROCESS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CorrelatorDAOImpl

          public CorrelatorDAOImpl()

    - #### CorrelatorDAOImpl

          public CorrelatorDAOImpl(java.lang.String correlatorKey,
                                   ProcessDAOImpl process)

  - ### Method Detail

    - #### addRoute

          public void addRoute(java.lang.String routeGroupId,
                               ProcessInstanceDAO target,
                               int index,
                               CorrelationKeySet correlationKeySet,
                               java.lang.String routePolicy)

      Description copied from interface: `CorrelatorDAO`
      Add a route from the given correlation key to the given process instance.
      Specified by:
        `addRoute` in interface `CorrelatorDAO`
      Parameters:
        `routeGroupId` - identifier of the group of routes to which this route belongs
        `target` - target process instance
        `index` - relative order in which the route should be considered

    - #### dequeueMessage

          public MessageExchangeDAO dequeueMessage(CorrelationKeySet correlationKeySet)

      Description copied from interface: `CorrelatorDAO`
      Dequeue a message exchange matching a correlationKey constraint.
      Specified by:
        `dequeueMessage` in interface `CorrelatorDAO`
      Returns:
        opaque message-related data previously enqueued with the given correlation correlationKey

    - #### enqueueMessage

          public void enqueueMessage(MessageExchangeDAO mex,
                                     CorrelationKeySet correlationKeySet)

      Description copied from interface: `CorrelatorDAO`
      Enqueue a message exchange to the queue with a set of correlation keys.
      Specified by:
        `enqueueMessage` in interface `CorrelatorDAO`
      Parameters:
        `mex` - message exchange

    - #### getAllMessages

          public java.util.Collection<CorrelatorMessageDAO> getAllMessages()

      Specified by:
        `getAllMessages` in interface `CorrelatorDAO`
      Returns:
        all messages waiting on this correlator, use with care as it can potentially return a lot of values

    - #### findRoute

          public java.util.List<MessageRouteDAO> findRoute(CorrelationKeySet correlationKeySet)

      Specified by:
        `findRoute` in interface `CorrelatorDAO`
      Returns:
        route matching the given correlation key
      See Also:
        `CorrelatorDAO.findRoute(CorrelationKeySet correlationKeySet,boolean isCorrleationKeySetPreInitialized)`

    - #### getCorrelatorId

          public java.lang.String getCorrelatorId()

      Description copied from interface: `CorrelatorDAO`
      Get the correlator identifier.
      Specified by:
        `getCorrelatorId` in interface `CorrelatorDAO`
      Returns:
        correlator identifier

    - #### setCorrelatorId

          public void setCorrelatorId(java.lang.String newId)

      Specified by:
        `setCorrelatorId` in interface `CorrelatorDAO`

    - #### removeRoutes

          public void removeRoutes(java.lang.String routeGroupId,
                                   ProcessInstanceDAO target)

      Description copied from interface: `CorrelatorDAO`
      Remove all routes with the given route-group identifier.
      Specified by:
        `removeRoutes` in interface `CorrelatorDAO`

    - #### getAllRoutes

          public java.util.Collection<MessageRouteDAO> getAllRoutes()

      Specified by:
        `getAllRoutes` in interface `CorrelatorDAO`
      Returns:
        all routes registered on this correlator, use with care as it can potentially return a lot of values

    - #### checkRoute

          public boolean checkRoute(CorrelationKeySet correlationKeySet)

      Description copied from interface: `CorrelatorDAO`
      Check if corresponding key set is free to register (see ODE-804)
      Specified by:
        `checkRoute` in interface `CorrelatorDAO`
      Returns:
        true - available, false - not available

    - #### findRoute

          public java.util.List<MessageRouteDAO> findRoute(CorrelationKeySet correlationKeySet,
                                                           boolean isCorrleationKeySetPreInitialized)

      Description copied from interface: `CorrelatorDAO`
      Find a route matching the given correlation key set. If the correlationKeySet is known to be pre initialized then isCorrleationKeySetPreInitialized can be set to true or false otherwise. Depending on the value of isCorrleationKeySetPreInitialized, true - canonical value of the correlationKeySet might be used to find the route. false - canonical value of each of the subset of correlationKeySet might be used to find the route.
      Specified by:
        `findRoute` in interface `CorrelatorDAO`
      Parameters:
        `correlationKeySet` - correlation key
      Returns:
        route matching the given correlation key