com.atlassian.confluence.schedule.managers
Interface ScheduledJobManager

All Known Implementing Classes:
DefaultScheduledJobManager

public interface ScheduledJobManager

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).

Since:
3.5

Method Summary
 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.
 java.lang.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.
 java.util.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.
 java.util.Date updateSchedule(ScheduledJobKey key, java.lang.String newCronSchedule)
          Updates stored schedule and reschedules the specified job.
 

Method Detail

getScheduledJobs

java.util.List<ScheduledJobStatus> getScheduledJobs()
Gets a list of all the jobs managed by the system, and their current status.

Returns:
the managed jobs.

getScheduledJob

ScheduledJobStatus getScheduledJob(ScheduledJobKey key)
Gets the current status for a single scheduled job.

Parameters:
key - the job key
Returns:

updateSchedule

java.util.Date updateSchedule(ScheduledJobKey key,
                              java.lang.String newCronSchedule)
Updates stored schedule and reschedules the specified job. Only valid for ManagedScheduledCronJob jobs and requires ManagedScheduledJob.isEditable() to be true.

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

runNow

void runNow(ScheduledJobKey key)
Schedules the specified to run immediately. Requires ManagedScheduledJob.canRunAdhoc() to be true.

Parameters:
key - the job key

disable

void disable(ScheduledJobKey key)
Disables the specified job, and removes it from the scheduler. Requires ManagedScheduledJob.canDisable() to be true.

Parameters:
key - the job key

enable

void enable(ScheduledJobKey key)
Enables the specified job, and adds it from the scheduler. Requires ManagedScheduledJob.canDisable() to be true.

Parameters:
key - the job key

getCronExpression

java.lang.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.


Copyright © 2003-2011 Atlassian. All Rights Reserved.