public class ScheduleUtil extends Object
Modifier and Type | Field and Description |
---|---|
static ScheduledJobKey |
BACKUP_JOB_KEY |
Constructor and Description |
---|
ScheduleUtil() |
Modifier and Type | Method and Description |
---|---|
static com.atlassian.scheduler.config.JobId |
generateUniqueJobId(com.atlassian.scheduler.SchedulerService schedulerService,
String idPrefix)
Instead of using
SchedulerService.scheduleJobWithGeneratedId(com.atlassian.scheduler.config.JobConfig) , you
can use SchedulerService.scheduleJob(com.atlassian.scheduler.config.JobId, com.atlassian.scheduler.config.JobConfig) with the result of this method. |
static int |
getJitterSecs(Map<String,Serializable> parameters) |
static int |
getRepeatCount(Map<String,Serializable> parameters) |
static long |
getUnscheduleJobAfterTimestampMillis(Map<String,Serializable> parameters) |
static boolean |
isBackupEnabled(ScheduledJobManager scheduledJobManager,
SettingsManager settingsManager)
Determines if the backup job is enabled.
|
static void |
pauseAndFlushSchedulerService(com.atlassian.scheduler.core.LifecycleAwareSchedulerService schedulerService)
If there's error, it will be wrapped in a
SchedulerServiceException . |
static void |
shutdownAndFlushSchedulerService(com.atlassian.scheduler.core.LifecycleAwareSchedulerService schedulerService)
If there's error, it will be wrapped in a
SchedulerServiceException . |
static com.atlassian.scheduler.config.JobConfig |
withCronSchedule(com.atlassian.scheduler.config.JobConfig jobConfig,
String cronExpression,
TimeZone timeZone)
Returns a new
JobConfig with the new cronExpression and
time zone if its schedule is of type CRON_EXPRESSION
and the time zone has changed. |
static Map<String,Serializable> |
withJitterSecs(int jitterSecs)
atlassian-scheduler doesn't support schedule jittering.
|
static Map<String,Serializable> |
withJitterSecs(Map<String,Serializable> parameters,
int jitterSecs)
atlassian-scheduler doesn't support schedule jittering.
|
static Map<String,Serializable> |
withoutJitterSecs(Map<String,Serializable> parameters) |
static com.atlassian.scheduler.config.JobConfig |
withTimeZone(com.atlassian.scheduler.config.JobConfig jobConfig,
TimeZone timeZone)
Returns a new
JobConfig with the specified time zone if its
schedule is of type CRON_EXPRESSION and the
time zone has changed. |
static Map<String,Serializable> |
withUnscheduleJobAfterTimestampMillis(long repeatInterval,
int repeatCount,
Date firstRunTime)
atlassian-scheduler interval jobs don't support repeat count.
|
static Map<String,Serializable> |
withUnscheduleJobAfterTimestampMillis(Map<String,Serializable> parameters,
long repeatInterval,
int repeatCount,
Date firstRunTime)
atlassian-scheduler doesn't support repeat count.
|
public static final ScheduledJobKey BACKUP_JOB_KEY
public static boolean isBackupEnabled(ScheduledJobManager scheduledJobManager, SettingsManager settingsManager)
public static com.atlassian.scheduler.config.JobId generateUniqueJobId(com.atlassian.scheduler.SchedulerService schedulerService, String idPrefix) throws com.atlassian.scheduler.SchedulerServiceException
SchedulerService.scheduleJobWithGeneratedId(com.atlassian.scheduler.config.JobConfig)
, you
can use SchedulerService.scheduleJob(com.atlassian.scheduler.config.JobId, com.atlassian.scheduler.config.JobConfig)
with the result of this method.com.atlassian.scheduler.SchedulerServiceException
public static void pauseAndFlushSchedulerService(com.atlassian.scheduler.core.LifecycleAwareSchedulerService schedulerService) throws com.atlassian.scheduler.SchedulerServiceException
SchedulerServiceException
.com.atlassian.scheduler.SchedulerServiceException
public static void shutdownAndFlushSchedulerService(com.atlassian.scheduler.core.LifecycleAwareSchedulerService schedulerService) throws com.atlassian.scheduler.SchedulerServiceException
SchedulerServiceException
.com.atlassian.scheduler.SchedulerServiceException
public static Map<String,Serializable> withJitterSecs(int jitterSecs)
JobConfig
parameters.public static Map<String,Serializable> withJitterSecs(Map<String,Serializable> parameters, int jitterSecs)
JobConfig
parameters.public static int getJitterSecs(Map<String,Serializable> parameters)
public static Map<String,Serializable> withoutJitterSecs(Map<String,Serializable> parameters)
public static Map<String,Serializable> withUnscheduleJobAfterTimestampMillis(long repeatInterval, int repeatCount, @Nullable Date firstRunTime)
public static Map<String,Serializable> withUnscheduleJobAfterTimestampMillis(Map<String,Serializable> parameters, long repeatInterval, int repeatCount, @Nullable Date firstRunTime)
public static long getUnscheduleJobAfterTimestampMillis(Map<String,Serializable> parameters)
public static int getRepeatCount(Map<String,Serializable> parameters)
public static com.atlassian.scheduler.config.JobConfig withTimeZone(com.atlassian.scheduler.config.JobConfig jobConfig, TimeZone timeZone)
JobConfig
with the specified time zone if its
schedule is of type CRON_EXPRESSION
and the
time zone has changed.public static com.atlassian.scheduler.config.JobConfig withCronSchedule(com.atlassian.scheduler.config.JobConfig jobConfig, @Nullable String cronExpression, TimeZone timeZone)
JobConfig
with the new cronExpression
and
time zone if its schedule is of type CRON_EXPRESSION
and the time zone has changed. If the new cronExpression
is
null
, only the time zone is changed if it has changed.Copyright © 2003–2016 Atlassian. All rights reserved.