CronJobSimpleExpressionBuilder

public class CronJobSimpleExpressionBuilder

Builder for simple cron expressions for jobs, which should be fired every repeatIntervalInDays days.

Constructors

CronJobSimpleExpressionBuilder

public CronJobSimpleExpressionBuilder(Time startTime)

Constructor.

Parameters:
  • startTime – the time at which job should become active, not null

Methods

build

public String build()

Builds cron expression with “0 M H D/D * ?” pattern for non-zero interval, or with “0 M H D * ?” pattern for zero interval.

Returns:the cron expression ready to use with CronSchedulableJob

withRepeatIntervalInDays

public CronJobSimpleExpressionBuilder withRepeatIntervalInDays(int repeatIntervalInDays)

Sets interval on which job should be fired.

Parameters:
  • repeatIntervalInDays – the interval(in days) between job fires, 0 means everyday
Returns:

the CronJobSimpleExpressionBuilder ready to build cron expressions