Class CronHelper
- java.lang.Object
-
- software.amazon.cloudformation.scheduler.CronHelper
-
public class CronHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description CronHelper()CronHelper(Clock clock)This .ctor provided for testing
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgenerateOneTimeCronExpression(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
-
-
-
Constructor Detail
-
CronHelper
public CronHelper()
-
CronHelper
public CronHelper(Clock clock)
This .ctor provided for testing- Parameters:
clock- current clock system usuallyClock.systemUTC()
-
-
Method Detail
-
generateOneTimeCronExpression
public 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
-
-