public interface

ScheduledJobManager

com.atlassian.confluence.schedule.managers.ScheduledJobManager
Known Indirect Subclasses

Class Overview

Defines the services provided for manage scheduled jobs. Generally a ManagedScheduleJobException is 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).

Summary

Public Methods
void disable(ScheduledJobKey key)
Disables the specified job, and removes it from the scheduler.
void enable(ScheduledJobKey key)
Enables the specified job, and adds it from the scheduler.
String getCronExpression(ScheduledJobKey key)
Gets the currently configured cron expression, or the default value if none has been configured.
ScheduledJobStatus getScheduledJob(ScheduledJobKey key)
Gets the current status for a single scheduled job.
List<ScheduledJobStatus> getScheduledJobs()
Gets a list of all the jobs managed by the system, and their current status.
void runNow(ScheduledJobKey key)
Schedules the specified to run immediately.
Date updateSchedule(ScheduledJobKey key, String newCronSchedule)
Updates stored schedule and reschedules the specified job.

Public Methods

public void disable (ScheduledJobKey key)

Disables the specified job, and removes it from the scheduler. Requires canDisable() to be true.

Parameters
key the job key

public void enable (ScheduledJobKey key)

Enables the specified job, and adds it from the scheduler. Requires canDisable() to be true.

Parameters
key the job key

public String getCronExpression (ScheduledJobKey key)

Gets the currently configured cron expression, or the default value if none has been configured.

Parameters
key the job key
Returns
  • gets the currently configured cron schedule for the specified job. Null if not a cron job.

public ScheduledJobStatus getScheduledJob (ScheduledJobKey key)

Gets the current status for a single scheduled job.

Parameters
key the job key

public List<ScheduledJobStatus> getScheduledJobs ()

Gets a list of all the jobs managed by the system, and their current status.

Returns
  • the managed jobs.

public void runNow (ScheduledJobKey key)

Schedules the specified to run immediately. Requires canRunAdhoc() to be true.

Parameters
key the job key

public Date updateSchedule (ScheduledJobKey key, String newCronSchedule)

Updates stored schedule and reschedules the specified job. Only valid for ManagedScheduledCronJob jobs and requires isEditable() to be true.

Parameters
key the job key
newCronSchedule a valid cron expression
Returns
  • the next Date of execution