Class CronSchedule

    • Method Detail

      • of

        public static CronSchedule of​(String expression)
        Creates cron expression object with defined expression string
        Parameters:
        expression - of cron
        Returns:
        object
        Throws:
        IllegalArgumentException - wrapping a ParseException if the expression is invalid
      • of

        public static CronSchedule of​(String expression,
                                      ZoneId zoneId)
        Creates cron expression object with defined expression string and time-zone ID
        Parameters:
        expression - of cron
        zoneId - id of zone
        Returns:
        object
        Throws:
        IllegalArgumentException - wrapping a ParseException if the expression is invalid
      • dailyAtHourAndMinute

        public static CronSchedule dailyAtHourAndMinute​(int hour,
                                                        int minute)
        Creates cron expression which schedule task execution every day at the given time
        Parameters:
        hour - of schedule
        minute - of schedule
        Returns:
        object
        Throws:
        IllegalArgumentException - wrapping a ParseException if the expression is invalid
      • dailyAtHourAndMinute

        public static CronSchedule dailyAtHourAndMinute​(int hour,
                                                        int minute,
                                                        ZoneId zoneId)
        Creates cron expression which schedule task execution every day at the given time in specified time-zone ID
        Parameters:
        hour - of schedule
        minute - of schedule
        zoneId - id of zone
        Returns:
        object
        Throws:
        IllegalArgumentException - wrapping a ParseException if the expression is invalid
      • weeklyOnDayAndHourAndMinute

        public static CronSchedule weeklyOnDayAndHourAndMinute​(int hour,
                                                               int minute,
                                                               Integer... daysOfWeek)
        Creates cron expression which schedule task execution every given days of the week at the given time. Use Calendar object constants to define day.
        Parameters:
        hour - of schedule
        minute - of schedule
        daysOfWeek - - Calendar object constants
        Returns:
        object
      • weeklyOnDayAndHourAndMinute

        public static CronSchedule weeklyOnDayAndHourAndMinute​(int hour,
                                                               int minute,
                                                               ZoneId zoneId,
                                                               Integer... daysOfWeek)
        Creates cron expression which schedule task execution every given days of the week at the given time in specified time-zone ID. Use Calendar object constants to define day.
        Parameters:
        hour - of schedule
        minute - of schedule
        zoneId - id of zone
        daysOfWeek - - Calendar object constants
        Returns:
        object
      • monthlyOnDayAndHourAndMinute

        public static CronSchedule monthlyOnDayAndHourAndMinute​(int dayOfMonth,
                                                                int hour,
                                                                int minute)
        Creates cron expression which schedule task execution every given day of the month at the given time
        Parameters:
        hour - of schedule
        minute - of schedule
        dayOfMonth - of schedule
        Returns:
        object
      • monthlyOnDayAndHourAndMinute

        public static CronSchedule monthlyOnDayAndHourAndMinute​(int dayOfMonth,
                                                                int hour,
                                                                int minute,
                                                                ZoneId zoneId)
        Creates cron expression which schedule task execution every given day of the month at the given time in specified time-zone ID.
        Parameters:
        hour - of schedule
        minute - of schedule
        dayOfMonth - of schedule
        zoneId - id of zone
        Returns:
        object
      • getZoneId

        public ZoneId getZoneId()