CronJobExpressionBuilder

public class CronJobExpressionBuilder

Builder for creating cron expressions for jobs, which should be triggered every repeatIntervalInMinutes for repeatWindowInHours hours or stop at 23:startTime.getMinute().

Constructors

CronJobExpressionBuilder

public CronJobExpressionBuilder(Time startTime, Integer repeatWindowInHours, Integer repeatIntervalInMinutes)

Constructor.

Parameters:
  • startTime – the time at which job should become active, not null
  • repeatWindowInHours – the period(in hours) in which job should be active
  • repeatIntervalInMinutes – the interval between job fires

Methods

build

public String build()

Builds cron expression with “0 M/M H-H + + ?” pattern.

Returns:the cron expression ready to be used with CronSchedulableJob