Class CronExpressionValidator


  • public class CronExpressionValidator
    extends Object
    Validates a cron expression, and returns the future executions.
    • Constructor Detail

      • CronExpressionValidator

        public CronExpressionValidator​(com.atlassian.scheduler.core.spi.SchedulerServiceConfiguration schedulerConfig)
    • Method Detail

      • getFutureSchedules

        public List<Date> getFutureSchedules​(String cronExpressionValue,
                                             int limit)
                                      throws com.atlassian.scheduler.cron.CronSyntaxException
        Finds the next execution occurrences of a cron expression from now.
        Parameters:
        cronExpressionValue - the expression to evaluation
        limit - the maximum number of dates to return
        Returns:
        a list of update "limit" dates for the next executions
        Throws:
        com.atlassian.scheduler.cron.CronSyntaxException - if the cron expression is invalid
      • getFutureSchedules

        public List<Date> getFutureSchedules​(String cronExpressionValue,
                                             int limit,
                                             Date fromDate)
                                      throws com.atlassian.scheduler.cron.CronSyntaxException
        Finds the next execution occurrences of a cron expression from now.
        Parameters:
        cronExpressionValue - the expression to evaluation
        limit - the maximum number of dates to return
        fromDate - the date to start from, or now if null
        Returns:
        a list of update "limit" dates for the next executions
        Throws:
        com.atlassian.scheduler.cron.CronSyntaxException - if the cron expression is invalid