Class CronSchedule
java.lang.Object
org.sterl.spring.persistent_tasks.api.CronSchedule
- All Implemented Interfaces:
Serializable,Schedule
A schedule based on a cron expression. Always uses UTC timezone.
Examples:
- "0 0 2 * * *" - Every day at 2:00 AM UTC
- "0 0 * * * *" - Every hour on the hour
- "0 */15 * * * *" - Every 15 minutes
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a human-readable description of this schedule.next(OffsetDateTime from) Calculates the next execution time from the given time.
-
Constructor Details
-
CronSchedule
Creates a new cron schedule.- Parameters:
expression- the cron expression (6 fields: second minute hour day month weekday)- Throws:
IllegalArgumentException- if the cron expression is invalid
-
-
Method Details
-
next
Description copied from interface:ScheduleCalculates the next execution time from the given time. -
description
Description copied from interface:ScheduleReturns a human-readable description of this schedule.- Specified by:
descriptionin interfaceSchedule- Returns:
- description of the schedule
-