public class DefaultScheduledJobManager extends Object implements ScheduledJobManager
Constructor and Description |
---|
DefaultScheduledJobManager(ScheduledJobDao jobDAO,
org.quartz.Scheduler scheduler,
com.atlassian.scheduler.SchedulerService schedulerService,
ManagedScheduledJobRegistry jobRegistry,
AuditService auditService,
ScheduleJobStatusManager statusManager,
com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
void |
disable(ScheduledJobKey key)
Disables the specified job, and removes it from the scheduler.
|
void |
disableJob(ScheduledJobKey key) |
void |
enable(ScheduledJobKey key)
Enables the specified job, and adds it to the scheduler.
|
void |
enableJob(ScheduledJobKey key) |
String |
getCronExpression(ScheduledJobKey key)
Gets the currently configured cron expression, or the default value if none has been configured.
|
Long |
getRepeatInterval(ScheduledJobKey key)
Gets the currently configured repeat interval, 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 the list of managed job status.
|
static ScheduledJobKey |
jobIdToScheduledJobKeyWithoutRunNowSuffix(com.atlassian.scheduler.config.JobId jobId)
See the implementation of
runNow(com.atlassian.confluence.schedule.ScheduledJobKey) . |
void |
runNow(ScheduledJobKey key)
Schedules the specified to run immediately.
|
static com.atlassian.scheduler.config.JobId |
scheduledJobKeyToJobIdWithRunNowSuffix(ScheduledJobKey scheduledJobKey)
See the implementation of
runNow(com.atlassian.confluence.schedule.ScheduledJobKey) . |
Date |
updateCronJobSchedule(ScheduledJobKey key,
String newCronSchedule)
Updates stored schedule.
|
Date |
updateCronSchedule(ScheduledJobKey key,
String newCronSchedule) |
void |
updateDisabledJobExecutionStatus(ScheduledJobKey key,
ScheduledJobStatus jobStatus) |
void |
updateEnabledJobExecutionStatus(ScheduledJobKey key,
ScheduledJobStatus jobStatus) |
Date |
updateSimpleJobSchedule(ScheduledJobKey key,
long repeatInterval)
Updates stored schedule.
|
Date |
updateSimpleSchedule(ScheduledJobKey key,
long repeatInterval) |
public DefaultScheduledJobManager(ScheduledJobDao jobDAO, org.quartz.Scheduler scheduler, com.atlassian.scheduler.SchedulerService schedulerService, ManagedScheduledJobRegistry jobRegistry, AuditService auditService, ScheduleJobStatusManager statusManager, com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager, com.atlassian.event.api.EventPublisher eventPublisher)
public List<ScheduledJobStatus> getScheduledJobs()
ScheduledJobManager
getScheduledJobs
in interface ScheduledJobManager
public ScheduledJobStatus getScheduledJob(ScheduledJobKey key)
ScheduledJobManager
getScheduledJob
in interface ScheduledJobManager
public Date updateCronJobSchedule(ScheduledJobKey key, String newCronSchedule)
ScheduledJobManager
ManagedScheduledCronJob
and requires
AbstractManagedScheduledJob.isEditable()
to be true.updateCronJobSchedule
in interface ScheduledJobManager
public Date updateCronSchedule(ScheduledJobKey key, String newCronSchedule)
public Date updateSimpleJobSchedule(ScheduledJobKey key, long repeatInterval)
ScheduledJobManager
ManagedScheduledSimpleJob
and requires
AbstractManagedScheduledJob.isEditable()
to be true.updateSimpleJobSchedule
in interface ScheduledJobManager
public Date updateSimpleSchedule(ScheduledJobKey key, long repeatInterval)
public void runNow(ScheduledJobKey key)
ScheduledJobManager
Requires ManagedScheduledJob.canRunAdhoc()
to be true.
runNow
in interface ScheduledJobManager
public void disable(ScheduledJobKey key)
ScheduledJobManager
Requires ManagedScheduledJob.canDisable()
to be true.
disable
in interface ScheduledJobManager
public void disableJob(ScheduledJobKey key)
public void enable(ScheduledJobKey key)
ScheduledJobManager
Requires ManagedScheduledJob.canDisable()
to be true.
enable
in interface ScheduledJobManager
public void enableJob(ScheduledJobKey key)
public void updateEnabledJobExecutionStatus(ScheduledJobKey key, ScheduledJobStatus jobStatus)
public void updateDisabledJobExecutionStatus(ScheduledJobKey key, ScheduledJobStatus jobStatus)
public String getCronExpression(ScheduledJobKey key)
ScheduledJobManager
getCronExpression
in interface ScheduledJobManager
null
if not a cron job.public Long getRepeatInterval(ScheduledJobKey key)
ScheduledJobManager
getRepeatInterval
in interface ScheduledJobManager
null
if not a simple jobpublic static com.atlassian.scheduler.config.JobId scheduledJobKeyToJobIdWithRunNowSuffix(ScheduledJobKey scheduledJobKey)
runNow(com.atlassian.confluence.schedule.ScheduledJobKey)
.public static ScheduledJobKey jobIdToScheduledJobKeyWithoutRunNowSuffix(com.atlassian.scheduler.config.JobId jobId)
runNow(com.atlassian.confluence.schedule.ScheduledJobKey)
.Copyright © 2003–2017 Atlassian. All rights reserved.