org.apache.ode.dao.jpa
Class CorrelatorDAOImpl

java.lang.Object
  extended by org.apache.ode.dao.jpa.OpenJPADAO
      extended by org.apache.ode.dao.jpa.CorrelatorDAOImpl
All Implemented Interfaces:
CorrelatorDAO

public class CorrelatorDAOImpl
extends OpenJPADAO
implements CorrelatorDAO


Field Summary
static java.lang.String DELETE_CORRELATORS_BY_PROCESS
           
 
Constructor Summary
CorrelatorDAOImpl()
           
CorrelatorDAOImpl(java.lang.String correlatorKey, ProcessDAOImpl process)
           
 
Method Summary
 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.
 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)
          Find a route matching the given correlation key.
 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)
Description copied from interface: CorrelatorDAO
Find a route matching the given correlation key.

Specified by:
findRoute in interface CorrelatorDAO
Returns:
route matching the given correlation key

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