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
      • 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
      • 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
      • 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