Class JobSchedule

    • Method Detail

      • atFixedRate

        public static JobSchedule.FixedRateSchedule atFixedRate​(int hour,
                                                                int minute)
        Indicates the job is to run at fixed rate, at given hour and minute, each day.
        Parameters:
        hour - the hour (0 to 23) at which the job must run
        minute - the minute (0 to 59) at which the job must run
        Returns:
        a job schedule
        Throws:
        IllegalArgumentException - if hour and minute values are out of range
      • withFixedDelay

        public static JobSchedule.FixedDelaySchedule withFixedDelay​(long initialDelay,
                                                                    long delay,
                                                                    TimeUnit unit)
        Indicates the job is to run periodically with a given delay between the termination of one execution and the commencement of the next.

        Note a cluster job cannot use a fixed delay schedule.

        Parameters:
        initialDelay - the initial delay before running the job, 0 or a negative number if the job must run immediately
        delay - the delay between the termination of one execution and the commencement of the next
        unit - the unit of time for the two delay values
        Returns:
        a job schedule
        Throws:
        NullPointerException - if unit is null
        IllegalArgumentException - if delay is not a positive number
      • disabled

        public static JobSchedule disabled()
        Indicates the job is disabled and shall not run. This method is convenient to suspend executions of jobs.
        Returns:
        a job schedule
      • getType

        public abstract JobSchedule.Type getType()
        Returns the type of scheduling.
        Returns:
        the type of scheduling.
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public abstract boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • getDescription

        public abstract String getDescription​(List<Locale> locales)
        Returns a description of the schedule, for end-user understanding, typically inserted in audit events.
        Parameters:
        locales - the locales to use, in decreasing order starting with the preferred locale
        Returns:
        a description of the schedule