public class RunTimeCalculator extends Object
| Constructor and Description |
|---|
RunTimeCalculator(com.atlassian.scheduler.core.spi.SchedulerServiceConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
Date |
firstRunTime(com.atlassian.scheduler.config.JobId jobId,
com.atlassian.scheduler.config.JobConfig jobConfig)
Calculates the first run time for the given job configuration.
|
Date |
nextRunTime(com.atlassian.scheduler.config.Schedule schedule,
Date prevRunTime)
Calculates the next run time for the given schedule and previous run time.
|
public RunTimeCalculator(com.atlassian.scheduler.core.spi.SchedulerServiceConfiguration config)
@Nonnull public Date firstRunTime(com.atlassian.scheduler.config.JobId jobId, com.atlassian.scheduler.config.JobConfig jobConfig) throws com.atlassian.scheduler.SchedulerServiceException
jobId - the job ID for which to calculate the first run time (used only for error reporting)jobConfig - the new job's configurationcom.atlassian.scheduler.SchedulerServiceException - if the job will never run@Nullable public Date nextRunTime(com.atlassian.scheduler.config.Schedule schedule, @Nullable Date prevRunTime) throws com.atlassian.scheduler.cron.CronSyntaxException
schedule - the job's scheduleprevRunTime - the job's previous run time, or null if it has never run previouslynull if it will never run againcom.atlassian.scheduler.cron.CronSyntaxException - if the schedule uses a cron expression that is invalidCopyright © 2019 Atlassian. All rights reserved.