Class ScheduleSpec.Builder

java.lang.Object
io.temporal.client.schedules.ScheduleSpec.Builder
Enclosing class:
ScheduleSpec

public static final class ScheduleSpec.Builder extends Object
  • Method Details

    • setCalendars

      public ScheduleSpec.Builder setCalendars(List<ScheduleCalendarSpec> calendars)
      Set the calendar-based specification of times a schedule should run.
    • setIntervals

      public ScheduleSpec.Builder setIntervals(List<ScheduleIntervalSpec> intervals)
      Set the interval-based specification of times a schedule should run.
    • setCronExpressions

      public ScheduleSpec.Builder setCronExpressions(List<String> cronExpressions)
      Set the cron-based specification of times a schedule should run.

      This is provided for easy migration from legacy string-based cron scheduling. New uses should use ScheduleSpec.calendars instead. These expressions will be translated to calendar-based specifications on the server.

    • setSkip

      Set the calendar-based specification of times a schedule should not run.
    • setStartAt

      public ScheduleSpec.Builder setStartAt(Instant startAt)
      Set the start time of the schedule, before which any matching times will be skipped.
    • setEndAt

      public ScheduleSpec.Builder setEndAt(Instant endAt)
      Set the end time of the schedule, after which any matching times will be skipped.
    • setJitter

      public ScheduleSpec.Builder setJitter(Duration jitter)
      Set the jitter to apply to each action.

      An action's schedule time will be incremented by a random value between 0 and this value if present (but not past the next schedule).

    • setTimeZoneName

      public ScheduleSpec.Builder setTimeZoneName(String timeZoneName)
      Set the schedules time zone as a string, for example US/Central.
    • build

      public ScheduleSpec build()