Class DefaultCaseEngineScheduler
- java.lang.Object
-
- com.aquima.interactions.caseengine.scheduler.impl.DefaultCaseEngineScheduler
-
- All Implemented Interfaces:
CaseEngineScheduler
public class DefaultCaseEngineScheduler extends Object implements CaseEngineScheduler
This class provides a default implementation for the CaseEngineScheduler interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultCaseEngineScheduler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DcmScheduledJob
getJob(JobIdentifier jobIdentifier)
Get the job information.boolean
hasJob(JobIdentifier jobIdentifier)
Check if a job exists.void
reschedule(JobIdentifier jobIdentifier, Date newTriggerTime)
Reschedules an existing job at a new time.JobIdentifier
schedule(DcmScheduledJob dcmScheduledJob, Date triggerTime)
Schedules a job which will be executed when the triggerTime arrives.void
unschedule(JobIdentifier jobIdentifier)
Unschedules an existing job.void
unscheduleAllForTask(String tenantId, long caseId, long taskId)
Unschedules existing jobs for a task.void
updateJob(JobIdentifier jobIdentifier, DcmScheduledJob dcmScheduledJob)
Update the model of a job
-
-
-
Method Detail
-
schedule
public JobIdentifier schedule(DcmScheduledJob dcmScheduledJob, Date triggerTime)
Description copied from interface:CaseEngineScheduler
Schedules a job which will be executed when the triggerTime arrives.- Specified by:
schedule
in interfaceCaseEngineScheduler
- Parameters:
dcmScheduledJob
- the dcmScheduledJob model containing the necessary information to execute the job.triggerTime
- the time at which the job will be executed.- Returns:
- a unique identifier to be able to reschedule/unschedule the job.
-
unschedule
public void unschedule(JobIdentifier jobIdentifier)
Description copied from interface:CaseEngineScheduler
Unschedules an existing job.- Specified by:
unschedule
in interfaceCaseEngineScheduler
- Parameters:
jobIdentifier
- the unique identifier obtained by scheduling a job.
-
unscheduleAllForTask
public void unscheduleAllForTask(String tenantId, long caseId, long taskId)
Description copied from interface:CaseEngineScheduler
Unschedules existing jobs for a task.- Specified by:
unscheduleAllForTask
in interfaceCaseEngineScheduler
- Parameters:
tenantId
- The id of the tenantcaseId
- The id of the case that the task belongs totaskId
- The id of the task to unschedule jobs for
-
reschedule
public void reschedule(JobIdentifier jobIdentifier, Date newTriggerTime)
Description copied from interface:CaseEngineScheduler
Reschedules an existing job at a new time.- Specified by:
reschedule
in interfaceCaseEngineScheduler
- Parameters:
jobIdentifier
- the unique identifier obtained by scheduling a job.newTriggerTime
- the updated time at which the job will be executed.
-
hasJob
public boolean hasJob(JobIdentifier jobIdentifier)
Description copied from interface:CaseEngineScheduler
Check if a job exists.- Specified by:
hasJob
in interfaceCaseEngineScheduler
- Parameters:
jobIdentifier
- the unique identifier obtained by scheduling a job.- Returns:
- job exists
-
getJob
public DcmScheduledJob getJob(JobIdentifier jobIdentifier)
Description copied from interface:CaseEngineScheduler
Get the job information.- Specified by:
getJob
in interfaceCaseEngineScheduler
- Parameters:
jobIdentifier
- the unique identifier obtained by scheduling a job.- Returns:
- dcmScheduledJob the dcmScheduledJob model containing the necessary information to execute the job.
-
updateJob
public void updateJob(JobIdentifier jobIdentifier, DcmScheduledJob dcmScheduledJob)
Description copied from interface:CaseEngineScheduler
Update the model of a job- Specified by:
updateJob
in interfaceCaseEngineScheduler
- Parameters:
jobIdentifier
- the unique identifier obtained by scheduling a job.dcmScheduledJob
- with updated information
-
-