Class TimerJobEntityManagerImpl
- java.lang.Object
-
- org.activiti.engine.impl.persistence.AbstractManager
-
- org.activiti.engine.impl.persistence.entity.AbstractEntityManager<TimerJobEntity>
-
- org.activiti.engine.impl.persistence.entity.TimerJobEntityManagerImpl
-
- All Implemented Interfaces:
EntityManager<TimerJobEntity>,TimerJobEntityManager
public class TimerJobEntityManagerImpl extends AbstractEntityManager<TimerJobEntity> implements TimerJobEntityManager
-
-
Field Summary
Fields Modifier and Type Field Description protected TimerJobDataManagerjobDataManager-
Fields inherited from class org.activiti.engine.impl.persistence.AbstractManager
processEngineConfiguration
-
-
Constructor Summary
Constructors Constructor Description TimerJobEntityManagerImpl(ProcessEngineConfigurationImpl processEngineConfiguration, TimerJobDataManager jobDataManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.DatecalculateNextTimer(JobEntity timerEntity, VariableScope variableScope)protected intcalculateRepeatValue(JobEntity timerEntity)TimerJobEntitycreateAndCalculateNextTimer(JobEntity timerEntity, VariableScope variableScope)Creates a newTimerJobEntity, typically when a timer is used in a repeating way.protected TimerJobEntitycreateTimer(JobEntity te)voiddelete(TimerJobEntity jobEntity)protected voiddeleteExceptionByteArrayRef(TimerJobEntity jobEntity)Deletes a the byte array used to store the exception information.protected booleandoInsert(TimerJobEntity jobEntity, boolean fireCreateEvent)longfindJobCountByQueryCriteria(TimerJobQueryImpl jobQuery)Same asTimerJobEntityManager.findJobsByQueryCriteria(TimerJobQueryImpl, Page), but only returns a count and not the instances itself.java.util.List<TimerJobEntity>findJobsByExecutionId(java.lang.String id)Returns allTimerJobEntityinstances related to onExecutionEntity.java.util.List<TimerJobEntity>findJobsByProcessInstanceId(java.lang.String id)Returns allTimerJobEntityinstances related to onExecutionEntity.java.util.List<Job>findJobsByQueryCriteria(TimerJobQueryImpl jobQuery, Page page)Executes aJobQueryImpland returns the matchingTimerJobEntityinstances.java.util.List<TimerJobEntity>findJobsByTypeAndProcessDefinitionId(java.lang.String jobHandlerType, java.lang.String processDefinitionId)Returns theTimerJobEntityfor a given process definition.java.util.List<TimerJobEntity>findJobsByTypeAndProcessDefinitionKeyAndTenantId(java.lang.String jobHandlerType, java.lang.String processDefinitionKey, java.lang.String tenantId)The same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and for a specific tenantId.java.util.List<TimerJobEntity>findJobsByTypeAndProcessDefinitionKeyNoTenantId(java.lang.String jobHandlerType, java.lang.String processDefinitionKey)The same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and specifically for the 'no tenant' mode.java.util.List<TimerJobEntity>findTimerJobsToExecute(Page page)Returns theTimerJobEntityinstances that are elegible to execute, meaning the due date of the timer has been passed.protected java.lang.StringgetBusinessCalendarName(java.lang.String calendarName, VariableScope variableScope)protected TimerJobDataManagergetDataManager()voidinsert(TimerJobEntity jobEntity)voidinsert(TimerJobEntity jobEntity, boolean fireCreateEvent)booleaninsertTimerJobEntity(TimerJobEntity timerJobEntity)Insert theTimerJobEntity, similar to#insert(TimerJobEntity), but returns a boolean in case the insert did not go through.protected booleanisValidTime(JobEntity timerEntity, java.util.Date newTimerDate, VariableScope variableScope)protected voidremoveExecutionLink(TimerJobEntity jobEntity)Removes the job's execution's reference to this job, if the job has an associated execution.voidsetJobDataManager(TimerJobDataManager jobDataManager)protected voidsetNewRepeat(JobEntity timerEntity, int newRepeatValue)voidupdateJobTenantIdForDeployment(java.lang.String deploymentId, java.lang.String newTenantId)Changes the tenantId for all jobs related to a givenDeploymentEntity.-
Methods inherited from class org.activiti.engine.impl.persistence.entity.AbstractEntityManager
create, delete, delete, findById, isExecutionRelatedEntityCountEnabled, isExecutionRelatedEntityCountEnabled, isExecutionRelatedEntityCountEnabledGlobally, update, update
-
Methods inherited from class org.activiti.engine.impl.persistence.AbstractManager
getAsyncExecutor, getAttachmentEntityManager, getByteArrayEntityManager, getClock, getCommandContext, getCommandExecutor, getCommentEntityManager, getDeadLetterJobEntityManager, getDeploymentEntityManager, getEventDispatcher, getEventSubscriptionEntityManager, getExecutionEntityManager, getHistoricActivityInstanceEntityManager, getHistoricDetailEntityManager, getHistoricIdentityLinkEntityManager, getHistoricProcessInstanceEntityManager, getHistoricTaskInstanceEntityManager, getHistoricVariableInstanceEntityManager, getHistoryManager, getIdentityLinkEntityManager, getJobEntityManager, getJobManager, getModelEntityManager, getProcessDefinitionEntityManager, getProcessDefinitionInfoEntityManager, getProcessEngineConfiguration, getResourceEntityManager, getSession, getSuspendedJobEntityManager, getTaskEntityManager, getTimerJobEntityManager, getVariableInstanceEntityManager
-
-
-
-
Field Detail
-
jobDataManager
protected TimerJobDataManager jobDataManager
-
-
Constructor Detail
-
TimerJobEntityManagerImpl
public TimerJobEntityManagerImpl(ProcessEngineConfigurationImpl processEngineConfiguration, TimerJobDataManager jobDataManager)
-
-
Method Detail
-
createAndCalculateNextTimer
public TimerJobEntity createAndCalculateNextTimer(JobEntity timerEntity, VariableScope variableScope)
Description copied from interface:TimerJobEntityManagerCreates a newTimerJobEntity, typically when a timer is used in a repeating way. The returnsTimerJobEntityis not yet inserted. Returns null if the timer has finished its repetitions.- Specified by:
createAndCalculateNextTimerin interfaceTimerJobEntityManager
-
findTimerJobsToExecute
public java.util.List<TimerJobEntity> findTimerJobsToExecute(Page page)
Description copied from interface:TimerJobEntityManagerReturns theTimerJobEntityinstances that are elegible to execute, meaning the due date of the timer has been passed.- Specified by:
findTimerJobsToExecutein interfaceTimerJobEntityManager
-
findJobsByTypeAndProcessDefinitionId
public java.util.List<TimerJobEntity> findJobsByTypeAndProcessDefinitionId(java.lang.String jobHandlerType, java.lang.String processDefinitionId)
Description copied from interface:TimerJobEntityManagerReturns theTimerJobEntityfor a given process definition. This is for example used when deleting a process definition: it finds theTimerJobEntityrepresenting the timer start events.- Specified by:
findJobsByTypeAndProcessDefinitionIdin interfaceTimerJobEntityManager
-
findJobsByTypeAndProcessDefinitionKeyNoTenantId
public java.util.List<TimerJobEntity> findJobsByTypeAndProcessDefinitionKeyNoTenantId(java.lang.String jobHandlerType, java.lang.String processDefinitionKey)
Description copied from interface:TimerJobEntityManagerThe same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and specifically for the 'no tenant' mode.- Specified by:
findJobsByTypeAndProcessDefinitionKeyNoTenantIdin interfaceTimerJobEntityManager
-
findJobsByTypeAndProcessDefinitionKeyAndTenantId
public java.util.List<TimerJobEntity> findJobsByTypeAndProcessDefinitionKeyAndTenantId(java.lang.String jobHandlerType, java.lang.String processDefinitionKey, java.lang.String tenantId)
Description copied from interface:TimerJobEntityManagerThe same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and for a specific tenantId.- Specified by:
findJobsByTypeAndProcessDefinitionKeyAndTenantIdin interfaceTimerJobEntityManager
-
findJobsByExecutionId
public java.util.List<TimerJobEntity> findJobsByExecutionId(java.lang.String id)
Description copied from interface:TimerJobEntityManagerReturns allTimerJobEntityinstances related to onExecutionEntity.- Specified by:
findJobsByExecutionIdin interfaceTimerJobEntityManager
-
findJobsByProcessInstanceId
public java.util.List<TimerJobEntity> findJobsByProcessInstanceId(java.lang.String id)
Description copied from interface:TimerJobEntityManagerReturns allTimerJobEntityinstances related to onExecutionEntity.- Specified by:
findJobsByProcessInstanceIdin interfaceTimerJobEntityManager
-
findJobsByQueryCriteria
public java.util.List<Job> findJobsByQueryCriteria(TimerJobQueryImpl jobQuery, Page page)
Description copied from interface:TimerJobEntityManagerExecutes aJobQueryImpland returns the matchingTimerJobEntityinstances.- Specified by:
findJobsByQueryCriteriain interfaceTimerJobEntityManager
-
findJobCountByQueryCriteria
public long findJobCountByQueryCriteria(TimerJobQueryImpl jobQuery)
Description copied from interface:TimerJobEntityManagerSame asTimerJobEntityManager.findJobsByQueryCriteria(TimerJobQueryImpl, Page), but only returns a count and not the instances itself.- Specified by:
findJobCountByQueryCriteriain interfaceTimerJobEntityManager
-
updateJobTenantIdForDeployment
public void updateJobTenantIdForDeployment(java.lang.String deploymentId, java.lang.String newTenantId)Description copied from interface:TimerJobEntityManagerChanges the tenantId for all jobs related to a givenDeploymentEntity.- Specified by:
updateJobTenantIdForDeploymentin interfaceTimerJobEntityManager
-
insertTimerJobEntity
public boolean insertTimerJobEntity(TimerJobEntity timerJobEntity)
Description copied from interface:TimerJobEntityManagerInsert theTimerJobEntity, similar to#insert(TimerJobEntity), but returns a boolean in case the insert did not go through. This could happen if the execution related to theTimerJobEntityhas been removed (for example due to a task complete for a timer boundary on that task).- Specified by:
insertTimerJobEntityin interfaceTimerJobEntityManager
-
insert
public void insert(TimerJobEntity jobEntity)
- Specified by:
insertin interfaceEntityManager<TimerJobEntity>- Overrides:
insertin classAbstractEntityManager<TimerJobEntity>
-
insert
public void insert(TimerJobEntity jobEntity, boolean fireCreateEvent)
- Specified by:
insertin interfaceEntityManager<TimerJobEntity>- Overrides:
insertin classAbstractEntityManager<TimerJobEntity>
-
doInsert
protected boolean doInsert(TimerJobEntity jobEntity, boolean fireCreateEvent)
-
delete
public void delete(TimerJobEntity jobEntity)
- Specified by:
deletein interfaceEntityManager<TimerJobEntity>- Overrides:
deletein classAbstractEntityManager<TimerJobEntity>
-
removeExecutionLink
protected void removeExecutionLink(TimerJobEntity jobEntity)
Removes the job's execution's reference to this job, if the job has an associated execution. Subclasses may override to provide custom implementations.
-
deleteExceptionByteArrayRef
protected void deleteExceptionByteArrayRef(TimerJobEntity jobEntity)
Deletes a the byte array used to store the exception information. Subclasses may override to provide custom implementations.
-
createTimer
protected TimerJobEntity createTimer(JobEntity te)
-
setNewRepeat
protected void setNewRepeat(JobEntity timerEntity, int newRepeatValue)
-
isValidTime
protected boolean isValidTime(JobEntity timerEntity, java.util.Date newTimerDate, VariableScope variableScope)
-
calculateNextTimer
protected java.util.Date calculateNextTimer(JobEntity timerEntity, VariableScope variableScope)
-
calculateRepeatValue
protected int calculateRepeatValue(JobEntity timerEntity)
-
getBusinessCalendarName
protected java.lang.String getBusinessCalendarName(java.lang.String calendarName, VariableScope variableScope)
-
getDataManager
protected TimerJobDataManager getDataManager()
- Specified by:
getDataManagerin classAbstractEntityManager<TimerJobEntity>
-
setJobDataManager
public void setJobDataManager(TimerJobDataManager jobDataManager)
-
-