Package org.copperengine.core.persistent
Interface DatabaseDialect
-
- All Known Implementing Classes:
AbstractSqlDialect
,DerbyDbDialect
,H2Dialect
,MySqlDialect
,OracleDialect
,OracleSimpleDialect
,PostgreSQLDialect
public interface DatabaseDialect
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.lang.String>
checkDbConsistency(java.sql.Connection con)
Checks the DB consistency, e.g.int
countAuditTrailInstances(org.copperengine.management.model.AuditTrailInstanceFilter filter, java.sql.Connection con)
int
countWorkflowInstances(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con)
BatchCommand
createBatchCommand4error(Workflow<?> w, java.lang.Throwable t, DBProcessingState dbProcessingState, Acknowledge callback)
BatchCommand
createBatchCommand4Finish(Workflow<?> w, Acknowledge callback)
BatchCommand
createBatchCommand4Notify(Response<?> response, Acknowledge callback)
BatchCommand
createBatchCommand4registerCallback(RegisterCall rc, ScottyDBStorageInterface dbStorageInterface, Acknowledge callback)
void
deleteBroken(java.lang.String workflowInstanceId, java.sql.Connection c)
void
deleteFiltered(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con)
int
deleteStaleResponse(java.sql.Connection con, int maxRows)
void
deleteWaiting(java.lang.String workflowInstanceId, java.sql.Connection c)
java.util.List<Workflow<?>>
dequeue(java.lang.String ppoolId, int max, java.sql.Connection con)
void
insert(java.util.List<Workflow<?>> wfs, java.sql.Connection con)
void
insert(Workflow<?> wf, java.sql.Connection con)
void
notify(java.util.List<Response<?>> responses, java.sql.Connection c)
java.util.List<Workflow<?>>
queryAllActive(java.lang.String className, java.sql.Connection con, int max)
Query workflows that were active at the moment in (ENQUEUE, RUNNING or WAITING) statejava.util.List<org.copperengine.management.model.AuditTrailInfo>
queryAuditTrailInstances(org.copperengine.management.model.AuditTrailInstanceFilter filter, java.sql.Connection con)
java.lang.String
queryAuditTrailMessage(long id, java.sql.Connection con)
java.lang.String
queryObjectState(java.lang.String id, java.sql.Connection con)
int
queryQueueSize(java.lang.String processorPoolId, int max, java.sql.Connection con)
java.util.List<Workflow<?>>
queryWorkflowInstances(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con)
Workflow<?>
read(java.lang.String workflowInstanceId, java.sql.Connection con)
java.util.Date
readDatabaseClock(java.sql.Connection con)
Read the current system time from the underlying database systemvoid
restart(java.lang.String workflowInstanceId, java.sql.Connection c)
void
restartAll(java.sql.Connection c)
void
restartFiltered(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con)
void
resumeBrokenBusinessProcesses(java.sql.Connection con)
void
setRemoveWhenFinished(boolean removeWhenFinished)
void
shutdown()
void
startup()
int
updateQueueState(int max, java.sql.Connection con)
-
-
-
Method Detail
-
resumeBrokenBusinessProcesses
void resumeBrokenBusinessProcesses(java.sql.Connection con) throws java.lang.Exception
- Throws:
java.lang.Exception
-
dequeue
java.util.List<Workflow<?>> dequeue(java.lang.String ppoolId, int max, java.sql.Connection con) throws java.lang.Exception
- Throws:
java.lang.Exception
-
updateQueueState
int updateQueueState(int max, java.sql.Connection con) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
deleteStaleResponse
int deleteStaleResponse(java.sql.Connection con, int maxRows) throws java.lang.Exception
- Throws:
java.lang.Exception
-
insert
void insert(java.util.List<Workflow<?>> wfs, java.sql.Connection con) throws DuplicateIdException, java.lang.Exception
- Throws:
DuplicateIdException
java.lang.Exception
-
insert
void insert(Workflow<?> wf, java.sql.Connection con) throws DuplicateIdException, java.lang.Exception
- Throws:
DuplicateIdException
java.lang.Exception
-
restart
void restart(java.lang.String workflowInstanceId, java.sql.Connection c) throws java.lang.Exception
- Throws:
java.lang.Exception
-
restartFiltered
void restartFiltered(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con) throws java.lang.Exception
- Throws:
java.lang.Exception
-
restartAll
void restartAll(java.sql.Connection c) throws java.lang.Exception
- Throws:
java.lang.Exception
-
deleteBroken
void deleteBroken(java.lang.String workflowInstanceId, java.sql.Connection c) throws java.lang.Exception
- Throws:
java.lang.Exception
-
deleteWaiting
void deleteWaiting(java.lang.String workflowInstanceId, java.sql.Connection c) throws java.lang.Exception
- Throws:
java.lang.Exception
-
deleteFiltered
void deleteFiltered(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con) throws java.lang.Exception
- Throws:
java.lang.Exception
-
notify
void notify(java.util.List<Response<?>> responses, java.sql.Connection c) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createBatchCommand4Finish
BatchCommand createBatchCommand4Finish(Workflow<?> w, Acknowledge callback)
-
createBatchCommand4Notify
BatchCommand createBatchCommand4Notify(Response<?> response, Acknowledge callback) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createBatchCommand4registerCallback
BatchCommand createBatchCommand4registerCallback(RegisterCall rc, ScottyDBStorageInterface dbStorageInterface, Acknowledge callback) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createBatchCommand4error
BatchCommand createBatchCommand4error(Workflow<?> w, java.lang.Throwable t, DBProcessingState dbProcessingState, Acknowledge callback)
-
setRemoveWhenFinished
void setRemoveWhenFinished(boolean removeWhenFinished)
- Parameters:
removeWhenFinished
- If true (default), finished workflow instances are removed from the database.
-
checkDbConsistency
java.util.List<java.lang.String> checkDbConsistency(java.sql.Connection con) throws java.lang.Exception
Checks the DB consistency, e.g. at system startup, by deserialising all workflow instances in the underlying database.- Parameters:
con
- database connection- Returns:
- list of ids of bad workflows which could not be deserialized
- Throws:
java.lang.Exception
- For any SQL error like losing connection or such.
-
startup
void startup()
-
shutdown
void shutdown()
-
read
Workflow<?> read(java.lang.String workflowInstanceId, java.sql.Connection con) throws java.lang.Exception
- Throws:
java.lang.Exception
-
queryAllActive
java.util.List<Workflow<?>> queryAllActive(java.lang.String className, java.sql.Connection con, int max) throws java.sql.SQLException
Query workflows that were active at the moment in (ENQUEUE, RUNNING or WAITING) state- Parameters:
className
- - optional, specify which className it want to return. May be null. (No filtering for class name done in this case) If specified, the className must fully match the class name, so no regexp or similar is allowed. className must be given as fully qualified name (i.e. with package names prepending). Example isorg.copperengine.examples.workflows.MyWorkflow
con
- - database connectionmax
- maximum number to be queried (Translates to LIMIT max or FETCH ,max or similar on SQL queries SELECT)- Returns:
- List of active workflows.
- Throws:
java.sql.SQLException
- If anything goes wrong regarding SQL.
-
readDatabaseClock
java.util.Date readDatabaseClock(java.sql.Connection con) throws java.sql.SQLException
Read the current system time from the underlying database system- Parameters:
con
- database connection- Returns:
- Current database clock time
- Throws:
java.sql.SQLException
- Any sql error happening in here.
-
queryQueueSize
int queryQueueSize(java.lang.String processorPoolId, int max, java.sql.Connection con) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
queryObjectState
java.lang.String queryObjectState(java.lang.String id, java.sql.Connection con) throws java.lang.Exception
- Throws:
java.lang.Exception
-
queryWorkflowInstances
java.util.List<Workflow<?>> queryWorkflowInstances(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
countWorkflowInstances
int countWorkflowInstances(org.copperengine.management.model.WorkflowInstanceFilter filter, java.sql.Connection con) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
queryAuditTrailInstances
java.util.List<org.copperengine.management.model.AuditTrailInfo> queryAuditTrailInstances(org.copperengine.management.model.AuditTrailInstanceFilter filter, java.sql.Connection con) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
queryAuditTrailMessage
java.lang.String queryAuditTrailMessage(long id, java.sql.Connection con) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
countAuditTrailInstances
int countAuditTrailInstances(org.copperengine.management.model.AuditTrailInstanceFilter filter, java.sql.Connection con) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-