Class JobManager

  • All Implemented Interfaces:
    Session

    public class JobManager
    extends AbstractManager
    Author:
    Tom Baeyens, Daniel Meyer
    • Constructor Detail

      • JobManager

        public JobManager()
    • 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)
      • 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)
      • findJobById

        public JobEntity findJobById​(java.lang.String jobId)
      • 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