Class CronHelper

java.lang.Object
software.amazon.cloudformation.scheduler.CronHelper

public class CronHelper
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    CronHelper()  
    CronHelper​(java.time.Clock clock)
    This .ctor provided for testing
  • Method Summary

    Modifier and Type Method Description
    java.lang.String generateOneTimeCronExpression​(int minutesFromNow)
    Schedule a re-invocation of the executing handler no less than 1 minute from now /** Creates a cron(..) expression for a single instance at Now+minutesFromNow NOTE: CloudWatchEvents only support a 1minute granularity for re-invoke Anything less should be handled inside the original handler request Expression is of form cron(minutes, hours, day-of-month, month, day-of-year, year) where day-of-year is not necessary when the day-of-month and month-of-year fields are supplied

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CronHelper

      public CronHelper()
    • CronHelper

      public CronHelper​(java.time.Clock clock)
      This .ctor provided for testing
      Parameters:
      clock - current clock system usually Clock.systemUTC()
  • Method Details

    • generateOneTimeCronExpression

      public java.lang.String generateOneTimeCronExpression​(int minutesFromNow)
      Schedule a re-invocation of the executing handler no less than 1 minute from now /** Creates a cron(..) expression for a single instance at Now+minutesFromNow NOTE: CloudWatchEvents only support a 1minute granularity for re-invoke Anything less should be handled inside the original handler request Expression is of form cron(minutes, hours, day-of-month, month, day-of-year, year) where day-of-year is not necessary when the day-of-month and month-of-year fields are supplied
      Parameters:
      minutesFromNow - The number of minutes from now for building the cron expression
      Returns:
      A cron expression for use with CloudWatchEvents putRule(..) API