Class CronServiceImpl

java.lang.Object
com.codebarrel.automation.api.schedule.CronServiceImpl
All Implemented Interfaces:
CronService

@Component public class CronServiceImpl extends Object implements CronService
  • Constructor Details

    • CronServiceImpl

      @Inject public CronServiceImpl(TimezoneProvider timezoneProvider)
  • Method Details

    • validate

      public ErrorCollection validate(String cronExpression)
      Description copied from interface: CronService
      Returns an error collection with all errors in the error messages.
      Specified by:
      validate in interface CronService
      Parameters:
      cronExpression - The cron expression to validate.
      Returns:
      an error collection with all errors in the error messages.
    • getNextExecution

      public Date getNextExecution(Date now, String cronExpression)
      Description copied from interface: CronService
      Calculates the next execution for the provided cron string using now as the starting date
      Specified by:
      getNextExecution in interface CronService
      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