Interface CronService

All Known Implementing Classes:
CronServiceImpl

public interface CronService
Helper to deal with cron expressions.
  • Method Summary

    Modifier and Type
    Method
    Description
    getNextExecution(Date now, String cronExpression)
    Calculates the next execution for the provided cron string using now as the starting date
    validate(String cronExpression)
    Returns an error collection with all errors in the error messages.
  • Method Details

    • validate

      ErrorCollection validate(String cronExpression)
      Returns an error collection with all errors in the error messages.
      Parameters:
      cronExpression - The cron expression to validate.
      Returns:
      an error collection with all errors in the error messages.
    • getNextExecution

      Date getNextExecution(Date now, String cronExpression)
      Calculates the next execution for the provided cron string using now as the starting date
      Parameters:
      now - the date from which to calculate the next execution
      cronExpression - The cron expression to use to calculate the next execution time
      Returns:
      the next execution time