com.atlassian.confluence.schedule.managers
Class DefaultScheduledJobManager

java.lang.Object
  extended by com.atlassian.confluence.schedule.managers.DefaultScheduledJobManager
All Implemented Interfaces:
ScheduledJobManager

public class DefaultScheduledJobManager
extends java.lang.Object
implements ScheduledJobManager

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 Summary
DefaultScheduledJobManager(ScheduledJobDao jobDAO, org.quartz.Scheduler scheduler, ManagedScheduledJobRegistry jobRegistry, AuditService auditService, ScheduleJobStatusManager statusManager)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultScheduledJobManager

public DefaultScheduledJobManager(ScheduledJobDao jobDAO,
                                  org.quartz.Scheduler scheduler,
                                  ManagedScheduledJobRegistry jobRegistry,
                                  AuditService auditService,
                                  ScheduleJobStatusManager statusManager)
Method Detail

getScheduledJobs

public java.util.List<ScheduledJobStatus> getScheduledJobs()
Description copied from interface: ScheduledJobManager
Gets a list of all the jobs managed by the system, and their current status.

Specified by:
getScheduledJobs in interface ScheduledJobManager
Returns:
the managed jobs.

getScheduledJob

public ScheduledJobStatus getScheduledJob(ScheduledJobKey key)
Description copied from interface: ScheduledJobManager
Gets the current status for a single scheduled job.

Specified by:
getScheduledJob in interface ScheduledJobManager
Parameters:
key - the job key
Returns:

updateSchedule

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

Specified by:
updateSchedule in interface ScheduledJobManager
Parameters:
key - the job key
newCronSchedule - a valid cron expression
Returns:
the next Date of execution

runNow

public void runNow(ScheduledJobKey key)
Description copied from interface: ScheduledJobManager
Schedules the specified to run immediately. Requires ManagedScheduledJob.canRunAdhoc() to be true.

Specified by:
runNow in interface ScheduledJobManager
Parameters:
key - the job key

disable

public void disable(ScheduledJobKey key)
Description copied from interface: ScheduledJobManager
Disables the specified job, and removes it from the scheduler. Requires ManagedScheduledJob.canDisable() to be true.

Specified by:
disable in interface ScheduledJobManager
Parameters:
key - the job key

enable

public void enable(ScheduledJobKey key)
Description copied from interface: ScheduledJobManager
Enables the specified job, and adds it from the scheduler. Requires ManagedScheduledJob.canDisable() to be true.

Specified by:
enable in interface ScheduledJobManager
Parameters:
key - the job key

getCronExpression

public java.lang.String getCronExpression(ScheduledJobKey key)
Description copied from interface: ScheduledJobManager
Gets the currently configured cron expression, or the default value if none has been configured.

Specified by:
getCronExpression in interface ScheduledJobManager
Parameters:
key - the job key
Returns:
gets the currently configured cron schedule for the specified job. Null if not a cron job.


Copyright © 2003-2014 Atlassian. All Rights Reserved.