MotechSchedulerService¶
- public interface MotechSchedulerService¶
ingroup scheduler Motech Scheduler Service Interface provides methods to schedule reschedule and unschedule a job Set a global policy that determines trigger fire behaviour for misfired triggers. For details see quartz documentations for misfire policy do_nothing -> @see CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING fire_once_now -> @see CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW ignore -> @see CronTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY fire_now -> @see SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW ignore -> @see SimpleTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY reschedule_next_with_existing_count -> @see SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT reschedule_next_with_remaining_count -> @see SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT reschedule_now_with_existing_count -> @see SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT reschedule_now_with_remaining_count -> @see SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT Scheduler can use couchdb for its job store. To enable set the following properties org.quartz.jobStore.class = org.motechproject.quartz.CouchDbStore org.quartz.jobStore.dbNameGenerator = org.motechproject.scheduler.service.impl.MultiTenantQuartzDatabaseName # provides database names for the jobstore, used in a multi-tenant environment to have separate databases for each tenant; leave blank to use a single database org.quartz.jobStore.properties = # a couchdb.properties file understood by ektorp to specify the database environment
Author: Igor (iopushnyev@2paths.com) Date: 16/02/11
Methods¶
getScheduledJobDetailedInfo¶
- JobDetailedInfo getScheduledJobDetailedInfo(JobBasicInfo jobBasicInfo)¶
getScheduledJobTimings¶
getScheduledJobTimingsWithPrefix¶
getScheduledJobsBasicInfo¶
- List<JobBasicInfo> getScheduledJobsBasicInfo()¶
rescheduleJob¶
- void rescheduleJob(String subject, String externalId, String cronExpression)¶
Reschedules a job with the given job ID to be fired according to the given Cron Expression Previous version of the configured Motech Scheduled Even that will be created when the job is fired remains us it was
Parameters: - subject –
- externalId –
- cronExpression –
safeScheduleJob¶
- void safeScheduleJob(CronSchedulableJob cronSchedulableJob)¶
Same as scheduleJob, except that it would update existing job if one exists instead of creating a new one
Parameters: - cronSchedulableJob –
safeScheduleRepeatingJob¶
- void safeScheduleRepeatingJob(RepeatingSchedulableJob repeatingSchedulableJob)¶
Same as safeScheduleRepeatingJob with intervening = true
Parameters: - repeatingSchedulableJob –
safeScheduleRunOnceJob¶
- void safeScheduleRunOnceJob(RunOnceSchedulableJob schedulableJob)¶
Same as scheduleRunOnceJob, except that it would update existing job if one exists instead of creating a new one
Parameters: - schedulableJob –
safeUnscheduleJob¶
safeUnscheduleRepeatingJob¶
safeUnscheduleRunOnceJob¶
scheduleDayOfWeekJob¶
- void scheduleDayOfWeekJob(DayOfWeekSchedulableJob dayOfWeekSchedulableJob)¶
Same as safeScheduleDayOfWeekJob with intervening = true
Parameters: - dayOfWeekSchedulableJob –
scheduleJob¶
- void scheduleJob(CronSchedulableJob cronSchedulableJob)¶
Schedules the given schedulable job. The Job ID by which the job will be referencing in the future should be provided in an Instance of MotechEvent in SchedulableJob (see MotechEvent.jobId) If a job with the same job ID as the given exists, this job will be unscheduled and the given schedulable job will be scheduled
Parameters: - cronSchedulableJob –
scheduleRepeatingJob¶
- void scheduleRepeatingJob(RepeatingSchedulableJob repeatingSchedulableJob)¶
Schedules the given schedulable job. The Job ID by which the job will be referencing in the future should be provided in an Instance of MotechEvent in SchedulableJob (see MotechEvent.jobId) If a job with the same job ID as the given exists, this job will be unscheduled and the given schedulable job will be scheduled
Parameters: - repeatingSchedulableJob –
scheduleRunOnceJob¶
- void scheduleRunOnceJob(RunOnceSchedulableJob schedulableJob)¶
unscheduleJob¶
unscheduleRunOnceJob¶
updateScheduledJob¶
- void updateScheduledJob(MotechEvent motechEvent)¶
Updates MotechEvent data of the job defined by jobIb in the given instance of that class
Parameters: - motechEvent –