Interface ScheduledJobManager
-
- All Known Implementing Classes:
DefaultScheduledJobManager
@Transactional public interface ScheduledJobManagerDefines the services provided for manage scheduled jobs.Generally a
ManagedScheduledJobExceptionis thrown if the input is invalid (e.g. job does not exist) or if the type of request is not permitted (e.g. execute runNow when the job is not set to canRunAdhoc).- Since:
- 3.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddisable(com.atlassian.scheduler.config.JobId jobId)Disables the specified job, and removes it from the scheduler.voidenable(com.atlassian.scheduler.config.JobId jobId)Enables the specified job, and adds it to the scheduler.StringgetCronExpression(com.atlassian.scheduler.config.JobId jobId)Gets the currently configured cron expression, or the default value if none has been configured.LonggetRepeatInterval(com.atlassian.scheduler.config.JobId jobId)Gets the currently configured repeat interval, or the default value if none has been configured.ScheduledJobStatusgetScheduledJob(com.atlassian.scheduler.config.JobId jobId)List<ScheduledJobStatus>getScheduledJobs()Gets the list of managed job status.voidrunNow(com.atlassian.scheduler.config.JobId jobId)Schedules the specified to run immediately.DateupdateCronJobSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule)Updates stored schedule.DateupdateSimpleJobSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval)Updates stored schedule.
-
-
-
Method Detail
-
getScheduledJobs
@Transactional(readOnly=true) List<ScheduledJobStatus> getScheduledJobs()
Gets the list of managed job status.
-
getScheduledJob
@Transactional(readOnly=true) ScheduledJobStatus getScheduledJob(com.atlassian.scheduler.config.JobId jobId)
-
updateCronJobSchedule
Date updateCronJobSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule)
Updates stored schedule. If the job is being scheduled e.g. enabled, it will be rescheduled. If the job is not being scheduled e.g. disabled, it won't be rescheduled.Only valid for
ManagedScheduledCronJoband requiresAbstractManagedScheduledJob.isEditable()to be true.- Returns:
- Date of the next execution
-
updateSimpleJobSchedule
Date updateSimpleJobSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval)
Updates stored schedule. If the job is being scheduled e.g. enabled, it will be rescheduled. If the job is not being scheduled e.g. disabled, it won't be rescheduled.Only valid for
ManagedScheduledSimpleJoband requiresAbstractManagedScheduledJob.isEditable()to be true.- Returns:
- Date of the next execution
-
runNow
void runNow(com.atlassian.scheduler.config.JobId jobId)
Schedules the specified to run immediately.Requires
ManagedScheduledJob.canRunAdhoc()to be true.
-
disable
void disable(com.atlassian.scheduler.config.JobId jobId)
Disables the specified job, and removes it from the scheduler.Requires
ManagedScheduledJob.canDisable()to be true.
-
enable
void enable(com.atlassian.scheduler.config.JobId jobId)
Enables the specified job, and adds it to the scheduler.Requires
ManagedScheduledJob.canDisable()to be true.
-
getCronExpression
@Transactional(readOnly=true) String getCronExpression(com.atlassian.scheduler.config.JobId jobId)
Gets the currently configured cron expression, or the default value if none has been configured.- Returns:
nullif not a cron job.
-
getRepeatInterval
@Transactional(readOnly=true) Long getRepeatInterval(com.atlassian.scheduler.config.JobId jobId)
Gets the currently configured repeat interval, or the default value if none has been configured.- Returns:
nullif not a simple job
-
-