org.apache.ode.daohib.bpel
Class ProcessDaoImpl

java.lang.Object
  extended by org.apache.ode.daohib.bpel.HibernateDao
      extended by org.apache.ode.daohib.bpel.ProcessDaoImpl
All Implemented Interfaces:
DeferredProcessInstanceCleanable, ProcessDAO

public class ProcessDaoImpl
extends HibernateDao
implements ProcessDAO, DeferredProcessInstanceCleanable

Hibernate-based ProcessDAO implementation.


Field Summary
 
Fields inherited from class org.apache.ode.daohib.bpel.HibernateDao
_hobj, _sm
 
Constructor Summary
ProcessDaoImpl(SessionManager sm, HProcess process)
           
 
Method Summary
 CorrelatorDAO addCorrelator(java.lang.String corrid)
           
 ProcessInstanceDAO createInstance(CorrelatorDAO correlator)
          Create a new process instance object.
 int deleteInstances(java.util.Collection<HProcessInstance> instances, java.util.Set<ProcessConf.CLEANUP_CATEGORY> categories)
           
 int deleteInstances(int transactionSize)
          Deletes instances and data for this process, the number of rows gets deletes is limited by the transaction size.
 void deleteProcessAndRoutes()
          Deletes only the process and routes without instances.
 java.util.Collection<ProcessInstanceDAO> findInstance(CorrelationKey ckeyValue)
          Locates a process instance based on a correlation key.
 java.util.Collection<ProcessInstanceDAO> getActiveInstances()
           
 CorrelatorDAO getCorrelator(java.lang.String corrId)
          Get a message correlator instance.
 java.lang.String getGuid()
           
 ProcessInstanceDAO getInstance(java.lang.Long iid)
          Get a process instance (by identifier).
 int getNumInstances()
           
 javax.xml.namespace.QName getProcessId()
          Get the unique process identifier.
 javax.xml.namespace.QName getType()
          Get the BPEL process name.
 long getVersion()
          Get the process version
 void instanceCompleted(ProcessInstanceDAO instance)
          Callback indicating that a process instance has completed its duties.
 void removeRoutes(java.lang.String routeId, ProcessInstanceDAO target)
          Remove the routes with the given Id for all the correlators in the process.
 
Methods inherited from class org.apache.ode.daohib.bpel.HibernateDao
deleteByIds, equals, getDHandle, getHibernateObj, getId, getSession, hashCode, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ode.bpel.dao.DeferredProcessInstanceCleanable
getId
 

Constructor Detail

ProcessDaoImpl

public ProcessDaoImpl(SessionManager sm,
                      HProcess process)
Method Detail

getProcessId

public javax.xml.namespace.QName getProcessId()
Description copied from interface: ProcessDAO
Get the unique process identifier.

Specified by:
getProcessId in interface ProcessDAO
Returns:
process identifier

getInstance

public ProcessInstanceDAO getInstance(java.lang.Long iid)
Description copied from interface: ProcessDAO
Get a process instance (by identifier).

Specified by:
getInstance in interface ProcessDAO
Parameters:
iid - unique instance identifier.
Returns:
DAO corresponding to the process instance

getCorrelator

public CorrelatorDAO getCorrelator(java.lang.String corrId)
Description copied from interface: ProcessDAO
Get a message correlator instance.

Specified by:
getCorrelator in interface ProcessDAO
Parameters:
corrId - correlator identifier
Returns:
correlator corresponding to the given identifier

removeRoutes

public void removeRoutes(java.lang.String routeId,
                         ProcessInstanceDAO target)
Description copied from interface: ProcessDAO
Remove the routes with the given Id for all the correlators in the process.

Specified by:
removeRoutes in interface ProcessDAO

createInstance

public ProcessInstanceDAO createInstance(CorrelatorDAO correlator)
Description copied from interface: ProcessDAO
Create a new process instance object.

Specified by:
createInstance in interface ProcessDAO
Parameters:
correlator - instantiating CorrelatorDAO
Returns:
newly generated instance DAO

findInstance

public java.util.Collection<ProcessInstanceDAO> findInstance(CorrelationKey ckeyValue)
Description copied from interface: ProcessDAO
Locates a process instance based on a correlation key.

Specified by:
findInstance in interface ProcessDAO
Parameters:
ckeyValue - correlation key
Returns:
collection of ProcessInstanceDAO that match correlation key, ordered by date
See Also:
ProcessDAO.findInstance(CorrelationKey)

instanceCompleted

public void instanceCompleted(ProcessInstanceDAO instance)
Description copied from interface: ProcessDAO
Callback indicating that a process instance has completed its duties.

Specified by:
instanceCompleted in interface ProcessDAO
Parameters:
instance - the completed ProcessInstanceDAO
See Also:
ProcessDAO.instanceCompleted(ProcessInstanceDAO)

deleteProcessAndRoutes

public void deleteProcessAndRoutes()
Description copied from interface: ProcessDAO
Deletes only the process and routes without instances. This also deletes any static data to the process: correlators.

Specified by:
deleteProcessAndRoutes in interface ProcessDAO

deleteInstances

public int deleteInstances(int transactionSize)
Description copied from interface: DeferredProcessInstanceCleanable
Deletes instances and data for this process, the number of rows gets deletes is limited by the transaction size.

Specified by:
deleteInstances in interface DeferredProcessInstanceCleanable
Parameters:
transactionSize - the number of rows to delete
Returns:
the number of rows actually deleted

deleteInstances

public int deleteInstances(java.util.Collection<HProcessInstance> instances,
                           java.util.Set<ProcessConf.CLEANUP_CATEGORY> categories)

getType

public javax.xml.namespace.QName getType()
Description copied from interface: ProcessDAO
Get the BPEL process name.

Specified by:
getType in interface ProcessDAO
Returns:
qualified BPEL process name.

getVersion

public long getVersion()
Description copied from interface: ProcessDAO
Get the process version

Specified by:
getVersion in interface ProcessDAO
Returns:
version

addCorrelator

public CorrelatorDAO addCorrelator(java.lang.String corrid)
Specified by:
addCorrelator in interface ProcessDAO

getActiveInstances

public java.util.Collection<ProcessInstanceDAO> getActiveInstances()
Specified by:
getActiveInstances in interface ProcessDAO
Returns:
all instances that haven't completed, use with care as there could be a lot of them

getNumInstances

public int getNumInstances()
Specified by:
getNumInstances in interface ProcessDAO

getGuid

public java.lang.String getGuid()
Specified by:
getGuid in interface ProcessDAO