Class JobManager
- java.lang.Object
-
- org.camunda.bpm.engine.impl.persistence.AbstractManager
-
- org.camunda.bpm.engine.impl.persistence.entity.JobManager
-
- All Implemented Interfaces:
Session
public class JobManager extends AbstractManager
- Author:
- Tom Baeyens, Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description static QueryOrderingProperty
JOB_DUEDATE_ORDERING_PROPERTY
static QueryOrderingProperty
JOB_PRIORITY_ORDERING_PROPERTY
static QueryOrderingProperty
JOB_TYPE_ORDERING_PROPERTY
-
Constructor Summary
Constructors Constructor Description JobManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
areInSameProcessInstance(JobEntity job1, JobEntity job2)
void
cancelTimers(ExecutionEntity execution)
protected ListQueryParameterObject
configureParameterizedQuery(java.lang.Object parameter)
protected void
configureQuery(JobQueryImpl query)
void
deleteJob(JobEntity job)
void
deleteJob(JobEntity job, boolean fireDeleteEvent)
java.util.List<ImmutablePair<java.lang.String,java.lang.String>>
findDeploymentIdMappingsByQueryCriteria(JobQueryImpl jobQuery)
JobEntity
findJobById(java.lang.String jobId)
long
findJobCountByQueryCriteria(JobQueryImpl jobQuery)
java.util.List<JobEntity>
findJobsByConfiguration(java.lang.String jobHandlerType, java.lang.String jobHandlerConfiguration, java.lang.String tenantId)
java.util.List<JobEntity>
findJobsByExecutionId(java.lang.String executionId)
java.util.List<Job>
findJobsByHandlerType(java.lang.String handlerType)
java.util.List<JobEntity>
findJobsByJobDefinitionId(java.lang.String jobDefinitionId)
java.util.List<JobEntity>
findJobsByProcessInstanceId(java.lang.String processInstanceId)
java.util.List<Job>
findJobsByQueryCriteria(JobQueryImpl jobQuery, Page page)
java.util.List<AcquirableJobEntity>
findNextJobsToExecute(Page page)
java.util.List<TimerEntity>
findTimersByExecutionId(java.lang.String executionId)
java.util.List<TimerEntity>
findUnlockedTimersByDuedate(java.util.Date duedate, Page page)
protected void
hintJobExecutor(JobEntity job)
void
insertAndHintJobExecutor(JobEntity jobEntity)
void
insertJob(JobEntity job)
protected boolean
isEnsureJobDueDateNotNull()
protected boolean
isJobDue(JobEntity job)
Sometimes we get a notification of a job that is not yet due, so we should not execute it immediatelyprotected boolean
isJobPriorityInJobExecutorPriorityRange(long jobPriority)
void
reschedule(JobEntity jobEntity, java.util.Date newDuedate)
void
schedule(TimerEntity timer)
void
send(MessageEntity message)
void
updateFailedJobRetriesByJobDefinitionId(java.lang.String jobDefinitionId, int retries)
void
updateJob(JobEntity job)
void
updateJobPriorityByDefinitionId(java.lang.String jobDefinitionId, long priority)
void
updateJobSuspensionStateById(java.lang.String jobId, SuspensionState suspensionState)
void
updateJobSuspensionStateByJobDefinitionId(java.lang.String jobDefinitionId, SuspensionState suspensionState)
void
updateJobSuspensionStateByProcessDefinitionId(java.lang.String processDefinitionId, SuspensionState suspensionState)
void
updateJobSuspensionStateByProcessDefinitionKey(java.lang.String processDefinitionKey, SuspensionState suspensionState)
void
updateJobSuspensionStateByProcessDefinitionKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String processDefinitionTenantId, SuspensionState suspensionState)
void
updateJobSuspensionStateByProcessInstanceId(java.lang.String processInstanceId, SuspensionState suspensionState)
void
updateStartTimerJobSuspensionStateByProcessDefinitionId(java.lang.String processDefinitionId, SuspensionState suspensionState)
void
updateStartTimerJobSuspensionStateByProcessDefinitionKey(java.lang.String processDefinitionKey, SuspensionState suspensionState)
void
updateStartTimerJobSuspensionStateByProcessDefinitionKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String processDefinitionTenantId, SuspensionState suspensionState)
-
Methods inherited from class org.camunda.bpm.engine.impl.persistence.AbstractManager
checkAuthorization, close, configureQuery, delete, deleteAuthorizations, deleteAuthorizationsForGroup, deleteAuthorizationsForUser, deleteDefaultAuthorizations, flush, getAttachmentManager, getAuthorizationManager, getBatchManager, getByteArrayManager, getCamundaFormDefinitionManager, getCaseDefinitionManager, getCaseExecutionManager, getCaseInstanceManager, getCommandContext, getCurrentAuthentication, getDbEntityManager, getDbSqlSession, getDecisionDefinitionManager, getDecisionRequirementsDefinitionManager, getDeploymentManager, getEventSubscriptionManager, getHistoricActivityInstanceManager, getHistoricBatchManager, getHistoricCaseActivityInstanceManager, getHistoricCaseInstanceManager, getHistoricDecisionInstanceManager, getHistoricDetailManager, getHistoricExternalTaskLogManager, getHistoricIdentityLinkManager, getHistoricIncidentManager, getHistoricJobLogManager, getHistoricProcessInstanceManager, getHistoricReportManager, getHistoricTaskInstanceManager, getHistoricVariableInstanceManager, getIdentityInfoManager, getIdentityLinkManager, getJobDefinitionManager, getJobManager, getProcessDefinitionManager, getProcessInstanceManager, getResourceAuthorizationProvider, getResourceManager, getSession, getTaskManager, getTaskReportManager, getTenantManager, getUserOperationLogManager, getVariableInstanceManager, insert, isAuthorizationEnabled, saveDefaultAuthorizations
-
-
-
-
Field Detail
-
JOB_PRIORITY_ORDERING_PROPERTY
public static QueryOrderingProperty JOB_PRIORITY_ORDERING_PROPERTY
-
JOB_TYPE_ORDERING_PROPERTY
public static QueryOrderingProperty JOB_TYPE_ORDERING_PROPERTY
-
JOB_DUEDATE_ORDERING_PROPERTY
public static QueryOrderingProperty JOB_DUEDATE_ORDERING_PROPERTY
-
-
Method Detail
-
updateJob
public void updateJob(JobEntity job)
-
insertJob
public void insertJob(JobEntity job)
-
deleteJob
public void deleteJob(JobEntity job)
-
deleteJob
public void deleteJob(JobEntity job, boolean fireDeleteEvent)
-
insertAndHintJobExecutor
public void insertAndHintJobExecutor(JobEntity jobEntity)
-
send
public void send(MessageEntity message)
-
schedule
public void schedule(TimerEntity timer)
-
reschedule
public void reschedule(JobEntity jobEntity, java.util.Date newDuedate)
-
hintJobExecutor
protected void hintJobExecutor(JobEntity job)
-
areInSameProcessInstance
protected boolean areInSameProcessInstance(JobEntity job1, JobEntity job2)
-
isJobPriorityInJobExecutorPriorityRange
protected boolean isJobPriorityInJobExecutorPriorityRange(long jobPriority)
-
cancelTimers
public void cancelTimers(ExecutionEntity execution)
-
findJobById
public JobEntity findJobById(java.lang.String jobId)
-
findNextJobsToExecute
public java.util.List<AcquirableJobEntity> findNextJobsToExecute(Page page)
-
findJobsByExecutionId
public java.util.List<JobEntity> findJobsByExecutionId(java.lang.String executionId)
-
findJobsByProcessInstanceId
public java.util.List<JobEntity> findJobsByProcessInstanceId(java.lang.String processInstanceId)
-
findJobsByJobDefinitionId
public java.util.List<JobEntity> findJobsByJobDefinitionId(java.lang.String jobDefinitionId)
-
findJobsByHandlerType
public java.util.List<Job> findJobsByHandlerType(java.lang.String handlerType)
-
findUnlockedTimersByDuedate
public java.util.List<TimerEntity> findUnlockedTimersByDuedate(java.util.Date duedate, Page page)
-
findTimersByExecutionId
public java.util.List<TimerEntity> findTimersByExecutionId(java.lang.String executionId)
-
findJobsByQueryCriteria
public java.util.List<Job> findJobsByQueryCriteria(JobQueryImpl jobQuery, Page page)
-
findDeploymentIdMappingsByQueryCriteria
public java.util.List<ImmutablePair<java.lang.String,java.lang.String>> findDeploymentIdMappingsByQueryCriteria(JobQueryImpl jobQuery)
-
findJobsByConfiguration
public java.util.List<JobEntity> findJobsByConfiguration(java.lang.String jobHandlerType, java.lang.String jobHandlerConfiguration, java.lang.String tenantId)
-
findJobCountByQueryCriteria
public long findJobCountByQueryCriteria(JobQueryImpl jobQuery)
-
updateJobSuspensionStateById
public void updateJobSuspensionStateById(java.lang.String jobId, SuspensionState suspensionState)
-
updateJobSuspensionStateByJobDefinitionId
public void updateJobSuspensionStateByJobDefinitionId(java.lang.String jobDefinitionId, SuspensionState suspensionState)
-
updateJobSuspensionStateByProcessInstanceId
public void updateJobSuspensionStateByProcessInstanceId(java.lang.String processInstanceId, SuspensionState suspensionState)
-
updateJobSuspensionStateByProcessDefinitionId
public void updateJobSuspensionStateByProcessDefinitionId(java.lang.String processDefinitionId, SuspensionState suspensionState)
-
updateStartTimerJobSuspensionStateByProcessDefinitionId
public void updateStartTimerJobSuspensionStateByProcessDefinitionId(java.lang.String processDefinitionId, SuspensionState suspensionState)
-
updateJobSuspensionStateByProcessDefinitionKey
public void updateJobSuspensionStateByProcessDefinitionKey(java.lang.String processDefinitionKey, SuspensionState suspensionState)
-
updateJobSuspensionStateByProcessDefinitionKeyAndTenantId
public void updateJobSuspensionStateByProcessDefinitionKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String processDefinitionTenantId, SuspensionState suspensionState)
-
updateStartTimerJobSuspensionStateByProcessDefinitionKey
public void updateStartTimerJobSuspensionStateByProcessDefinitionKey(java.lang.String processDefinitionKey, SuspensionState suspensionState)
-
updateStartTimerJobSuspensionStateByProcessDefinitionKeyAndTenantId
public void updateStartTimerJobSuspensionStateByProcessDefinitionKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String processDefinitionTenantId, SuspensionState suspensionState)
-
updateFailedJobRetriesByJobDefinitionId
public void updateFailedJobRetriesByJobDefinitionId(java.lang.String jobDefinitionId, int retries)
-
updateJobPriorityByDefinitionId
public void updateJobPriorityByDefinitionId(java.lang.String jobDefinitionId, long priority)
-
configureQuery
protected void configureQuery(JobQueryImpl query)
-
configureParameterizedQuery
protected ListQueryParameterObject configureParameterizedQuery(java.lang.Object parameter)
-
isEnsureJobDueDateNotNull
protected boolean isEnsureJobDueDateNotNull()
-
isJobDue
protected boolean isJobDue(JobEntity job)
Sometimes we get a notification of a job that is not yet due, so we should not execute it immediately
-
-