Class DefaultScheduledJobManager
- java.lang.Object
- 
- com.atlassian.confluence.schedule.managers.DefaultScheduledJobManager
 
- 
- All Implemented Interfaces:
- ScheduledJobNodeManager,- ScheduledJobManager
 
 public class DefaultScheduledJobManager extends Object implements ScheduledJobManager, ScheduledJobNodeManager Implementation of the ScheduledJobManager, co-ordinates access to the scheduler, persisted configuration (in Bandana), transient status (in caches), and static data (in the job registry).
- 
- 
Constructor SummaryConstructors Constructor Description DefaultScheduledJobManager(ScheduledJobDao jobDAO, com.atlassian.scheduler.SchedulerService schedulerService, ManagedScheduledJobRegistry jobRegistry, AuditService auditService, ScheduledJobStatusManager statusManager, com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager, com.atlassian.event.api.EventPublisher eventPublisher)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable(com.atlassian.scheduler.config.JobId jobId)Disables the specified job, and removes it from the scheduler.voiddisableJob(com.atlassian.scheduler.config.JobId jobId)Disable job on this node only.voidenable(com.atlassian.scheduler.config.JobId jobId)Enables the specified job, and adds it to the scheduler.voidenableJob(com.atlassian.scheduler.config.JobId jobId)Enable job on this node only.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.static com.atlassian.scheduler.config.JobIdjobIdToScheduledJobKeyWithoutRunNowSuffix(com.atlassian.scheduler.config.JobId jobId)See the implementation ofrunNow(com.atlassian.scheduler.config.JobId).voidrunNow(com.atlassian.scheduler.config.JobId jobId)Schedules the specified to run immediately.static com.atlassian.scheduler.config.JobIdscheduledJobKeyToJobIdWithRunNowSuffix(com.atlassian.scheduler.config.JobId jobId)See the implementation ofrunNow(com.atlassian.scheduler.config.JobId).DateupdateCronJobSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule)Updates stored schedule.DateupdateCronSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule)voidupdateDisabledJobExecutionStatus(com.atlassian.scheduler.config.JobId jobId, ScheduledJobStatus jobStatus)voidupdateEnabledJobExecutionStatus(com.atlassian.scheduler.config.JobId jobId, ScheduledJobStatus jobStatus)DateupdateSimpleJobSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval)Updates stored schedule.DateupdateSimpleSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval)
 
- 
- 
- 
Constructor Detail- 
DefaultScheduledJobManagerpublic DefaultScheduledJobManager(ScheduledJobDao jobDAO, com.atlassian.scheduler.SchedulerService schedulerService, ManagedScheduledJobRegistry jobRegistry, AuditService auditService, ScheduledJobStatusManager statusManager, com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager, com.atlassian.event.api.EventPublisher eventPublisher) 
 
- 
 - 
Method Detail- 
getScheduledJobspublic List<ScheduledJobStatus> getScheduledJobs() Description copied from interface:ScheduledJobManagerGets the list of managed job status.- Specified by:
- getScheduledJobsin interface- ScheduledJobManager
 
 - 
getScheduledJobpublic ScheduledJobStatus getScheduledJob(com.atlassian.scheduler.config.JobId jobId) - Specified by:
- getScheduledJobin interface- ScheduledJobManager
 
 - 
updateCronJobSchedulepublic Date updateCronJobSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule) Description copied from interface:ScheduledJobManagerUpdates 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.- Specified by:
- updateCronJobSchedulein interface- ScheduledJobManager
- Returns:
- Date of the next execution
 
 - 
updateCronSchedulepublic Date updateCronSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule) - Specified by:
- updateCronSchedulein interface- ScheduledJobNodeManager
 
 - 
updateSimpleJobSchedulepublic Date updateSimpleJobSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval) Description copied from interface:ScheduledJobManagerUpdates 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.- Specified by:
- updateSimpleJobSchedulein interface- ScheduledJobManager
- Returns:
- Date of the next execution
 
 - 
updateSimpleSchedulepublic Date updateSimpleSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval) - Specified by:
- updateSimpleSchedulein interface- ScheduledJobNodeManager
 
 - 
runNowpublic void runNow(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerSchedules the specified to run immediately.Requires ManagedScheduledJob.canRunAdhoc()to be true.- Specified by:
- runNowin interface- ScheduledJobManager
 
 - 
disablepublic void disable(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerDisables the specified job, and removes it from the scheduler.Requires ManagedScheduledJob.canDisable()to be true.- Specified by:
- disablein interface- ScheduledJobManager
 
 - 
disableJobpublic void disableJob(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobNodeManagerDisable job on this node only.- Specified by:
- disableJobin interface- ScheduledJobNodeManager
- Parameters:
- jobId- the job ID.
 
 - 
enablepublic void enable(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerEnables the specified job, and adds it to the scheduler.Requires ManagedScheduledJob.canDisable()to be true.- Specified by:
- enablein interface- ScheduledJobManager
 
 - 
enableJobpublic void enableJob(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobNodeManagerEnable job on this node only.- Specified by:
- enableJobin interface- ScheduledJobNodeManager
- Parameters:
- jobId- the job ID.
 
 - 
updateEnabledJobExecutionStatuspublic void updateEnabledJobExecutionStatus(com.atlassian.scheduler.config.JobId jobId, ScheduledJobStatus jobStatus)
 - 
updateDisabledJobExecutionStatuspublic void updateDisabledJobExecutionStatus(com.atlassian.scheduler.config.JobId jobId, ScheduledJobStatus jobStatus)
 - 
getCronExpressionpublic String getCronExpression(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerGets the currently configured cron expression, or the default value if none has been configured.- Specified by:
- getCronExpressionin interface- ScheduledJobManager
- Returns:
- nullif not a cron job.
 
 - 
getRepeatIntervalpublic Long getRepeatInterval(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerGets the currently configured repeat interval, or the default value if none has been configured.- Specified by:
- getRepeatIntervalin interface- ScheduledJobManager
- Returns:
- nullif not a simple job
 
 - 
scheduledJobKeyToJobIdWithRunNowSuffixpublic static com.atlassian.scheduler.config.JobId scheduledJobKeyToJobIdWithRunNowSuffix(com.atlassian.scheduler.config.JobId jobId) See the implementation ofrunNow(com.atlassian.scheduler.config.JobId).
 - 
jobIdToScheduledJobKeyWithoutRunNowSuffixpublic static com.atlassian.scheduler.config.JobId jobIdToScheduledJobKeyWithoutRunNowSuffix(com.atlassian.scheduler.config.JobId jobId) See the implementation ofrunNow(com.atlassian.scheduler.config.JobId).
 
- 
 
-