org.apache.ode.daohib.bpel
Class BpelDAOConnectionImpl

java.lang.Object
  extended by org.apache.ode.daohib.bpel.BpelDAOConnectionImpl
All Implemented Interfaces:
BpelDAOConnection, FilteredInstanceDeletable

public class BpelDAOConnectionImpl
extends java.lang.Object
implements BpelDAOConnection, FilteredInstanceDeletable

Hibernate-based BpelDAOConnection implementation.


Field Summary
protected  SessionManager _sm
           
 
Constructor Summary
BpelDAOConnectionImpl(SessionManager sm)
           
 
Method Summary
 java.util.List<BpelEvent> bpelEventQuery(InstanceFilter ifilter, BpelEventFilter efilter)
          Execute a query to retrieve the BPEL events matching the criteria.
 java.util.List<java.util.Date> bpelEventTimelineQuery(InstanceFilter ifilter, BpelEventFilter efilter)
          Execute a query for the timeline for BPEL events matching the criteria.
 void close()
           
 MessageExchangeDAO createMessageExchange(char dir)
          Create a message exchange.
 ProcessDAO createProcess(javax.xml.namespace.QName pid, javax.xml.namespace.QName type, java.lang.String guid, long version)
           
 ProcessDAO createTransientProcess(java.io.Serializable id)
           
 int deleteInstances(InstanceFilter criteria, java.util.Set<ProcessConf.CLEANUP_CATEGORY> categories)
          Deletes instance filter by the given instance filter and clean up categories.
 java.util.Collection<CorrelationSetDAO> getActiveCorrelationSets()
           
 java.util.Map<java.lang.Long,java.util.Collection<CorrelationSetDAO>> getCorrelationSets(java.util.Collection<ProcessInstanceDAO> instances)
           
 ProcessInstanceDAO getInstance(java.lang.Long instanceId)
          Retrieve a process instance from the database.
 MessageExchangeDAO getMessageExchange(java.lang.String mexid)
           
 int getNumInstances(javax.xml.namespace.QName processId)
           
 ProcessDAO getProcess(javax.xml.namespace.QName processId)
          Return the DAO for a bpel process.
 ProcessManagementDAO getProcessManagement()
          Returns an interface for process and instance management.
 ScopeDAO getScope(java.lang.Long siidl)
          Retrieve a scope instance from the database.
protected  org.hibernate.Session getSession()
           
 void insertBpelEvent(BpelEvent event, ProcessDAO process, ProcessInstanceDAO instance)
          Insert a BPEL event into the database.
 java.util.Collection<ProcessInstanceDAO> instanceQuery(InstanceFilter criteria)
          Query instances in the database meeting the requested criteria.
 java.util.Collection<ProcessInstanceDAO> instanceQuery(java.lang.String expression)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sm

protected SessionManager _sm
Constructor Detail

BpelDAOConnectionImpl

public BpelDAOConnectionImpl(SessionManager sm)
Method Detail

getSession

protected org.hibernate.Session getSession()

createMessageExchange

public MessageExchangeDAO createMessageExchange(char dir)
Description copied from interface: BpelDAOConnection
Create a message exchange.

Specified by:
createMessageExchange in interface BpelDAOConnection
Parameters:
dir - type of message exchange
Returns:

getMessageExchange

public MessageExchangeDAO getMessageExchange(java.lang.String mexid)
Specified by:
getMessageExchange in interface BpelDAOConnection

createProcess

public ProcessDAO createProcess(javax.xml.namespace.QName pid,
                                javax.xml.namespace.QName type,
                                java.lang.String guid,
                                long version)
Specified by:
createProcess in interface BpelDAOConnection

createTransientProcess

public ProcessDAO createTransientProcess(java.io.Serializable id)
Specified by:
createTransientProcess in interface BpelDAOConnection

getProcess

public ProcessDAO getProcess(javax.xml.namespace.QName processId)
Description copied from interface: BpelDAOConnection
Return the DAO for a bpel process.

Specified by:
getProcess in interface BpelDAOConnection
Parameters:
processId - name (identifier) of the process
Returns:
DAO

close

public void close()
Specified by:
close in interface BpelDAOConnection

getInstance

public ProcessInstanceDAO getInstance(java.lang.Long instanceId)
Description copied from interface: BpelDAOConnection
Retrieve a process instance from the database.

Specified by:
getInstance in interface BpelDAOConnection
Parameters:
instanceId - instance identifier
Returns:
process instance
See Also:
ProcessDAO.getInstance(java.lang.Long)

getNumInstances

public int getNumInstances(javax.xml.namespace.QName processId)
Specified by:
getNumInstances in interface BpelDAOConnection

getScope

public ScopeDAO getScope(java.lang.Long siidl)
Description copied from interface: BpelDAOConnection
Retrieve a scope instance from the database.

Specified by:
getScope in interface BpelDAOConnection
Parameters:
siidl - scope instance identifier
Returns:
scope instance

instanceQuery

public java.util.Collection<ProcessInstanceDAO> instanceQuery(InstanceFilter criteria)
Description copied from interface: BpelDAOConnection
Query instances in the database meeting the requested criteria.

Specified by:
instanceQuery in interface BpelDAOConnection
Returns:
Collection

deleteInstances

public int deleteInstances(InstanceFilter criteria,
                           java.util.Set<ProcessConf.CLEANUP_CATEGORY> categories)
Description copied from interface: FilteredInstanceDeletable
Deletes instance filter by the given instance filter and clean up categories.

Specified by:
deleteInstances in interface FilteredInstanceDeletable
Parameters:
criteria - instance filter
categories - clean up categories
Returns:
returns the number of instances that are deleted

insertBpelEvent

public void insertBpelEvent(BpelEvent event,
                            ProcessDAO process,
                            ProcessInstanceDAO instance)
Description copied from interface: BpelDAOConnection
Insert a BPEL event into the database.

Specified by:
insertBpelEvent in interface BpelDAOConnection
Parameters:
event - a BPEL event
process - associated process (optional)
instance - associated instance (optional)

bpelEventTimelineQuery

public java.util.List<java.util.Date> bpelEventTimelineQuery(InstanceFilter ifilter,
                                                             BpelEventFilter efilter)
Description copied from interface: BpelDAOConnection
Execute a query for the timeline for BPEL events matching the criteria.

Specified by:
bpelEventTimelineQuery in interface BpelDAOConnection
Parameters:
ifilter - instance filter (optional)
efilter - event filter (optional)
Returns:
List of event timestamps of events matching the criteria

bpelEventQuery

public java.util.List<BpelEvent> bpelEventQuery(InstanceFilter ifilter,
                                                BpelEventFilter efilter)
Description copied from interface: BpelDAOConnection
Execute a query to retrieve the BPEL events matching the criteria.

Specified by:
bpelEventQuery in interface BpelDAOConnection
Parameters:
ifilter - instance filter
efilter - event filter
Returns:

instanceQuery

public java.util.Collection<ProcessInstanceDAO> instanceQuery(java.lang.String expression)
Specified by:
instanceQuery in interface BpelDAOConnection
See Also:
BpelDAOConnection.instanceQuery(String)

getCorrelationSets

public java.util.Map<java.lang.Long,java.util.Collection<CorrelationSetDAO>> getCorrelationSets(java.util.Collection<ProcessInstanceDAO> instances)
Specified by:
getCorrelationSets in interface BpelDAOConnection

getActiveCorrelationSets

public java.util.Collection<CorrelationSetDAO> getActiveCorrelationSets()
Specified by:
getActiveCorrelationSets in interface BpelDAOConnection

getProcessManagement

public ProcessManagementDAO getProcessManagement()
Description copied from interface: BpelDAOConnection
Returns an interface for process and instance management.

Specified by:
getProcessManagement in interface BpelDAOConnection
Returns:
a ProcessManagement DAO