Interface ScheduleEntry


public interface ScheduleEntry
Captures all metadata related to a Scheduled job.
  • Method Summary

    Modifier and Type Method Description
    java.util.Calendar getDisableUntil()
    If not null, indicates the schedule is disabled until that date/time.
    java.lang.String getGroupName()
    Returns the "group" in which the schedule lives; groups of schedules can be run/disabled/etc together.
    java.util.List<ListParam> getListParams()
    Returns a list of user-provided, multi-value parameters keyed by name
    long getMaxAttempts()
    Returns the max attempts allowed for the runnable to execute per scheduled execution
    long getMaxRunTimeMillis()
    Returns the max time in millis allowed for the schedule runnable to run before it times out
    java.util.List<Param> getParams()
    Returns a list of user-provided, single-value parameters keyed by name
    long getRetryDelayMillis()
    Returns the delay in millis between which runnable execution should be retried on fail
    java.lang.String getRunnableClassName()
    Returns the fully qualified name of an implementation of Runnable whose Runnable.run() method will be called when the schedule is invoked.
    Schedule getSchedule()
    Returns the Schedule which describes when the job is to be run.
    java.lang.String getScheduleName()
    Returns the name of this schedule, which is unique within its group.
    void setDisableUntil​(java.util.Calendar disableUntil)
    If not null, indicates the schedule is disabled until that date/time.
    void setGroupName​(java.lang.String groupName)
    Sets the "group" in which the schedule lives; groups of schedules can be run/disabled/etc together Schedules are uniquely identified by GroupName + ScheduleName.
    void setMaxAttempts​(long maxAttempts)
    Sets the max attempts allowed for the runnable to execute per scheduled execution
    void setMaxRunTimeMillis​(long maxRunTimeMillis)
    Sets the max time in millis allowed for the schedule runnable to run before it times out
    void setRetryDelayMillis​(long retryDelayMillis)
    Sets the delay in millis between which runnable execution should be retried on fail
    void setRunnableClassName​(java.lang.String runnableClassName)
    Sets the fully qualified name of an implementation of Runnable whose Runnable.run() method will be called when the schedule is invoked.
    void setSchedule​(Schedule schedule)
    Sets the Schedule which describes when the job is to be run.
    void setScheduleName​(java.lang.String scheduleName)
    Sets the name of this schedule, which is unique within its group.
  • Method Details

    • getGroupName

      java.lang.String getGroupName()
      Returns the "group" in which the schedule lives; groups of schedules can be run/disabled/etc together. Schedules are uniquely identified by GroupName + ScheduleName.
    • setGroupName

      void setGroupName​(java.lang.String groupName)
      Sets the "group" in which the schedule lives; groups of schedules can be run/disabled/etc together Schedules are uniquely identified by GroupName + ScheduleName.
      Parameters:
      groupName - group name
    • getScheduleName

      java.lang.String getScheduleName()
      Returns the name of this schedule, which is unique within its group.
    • setScheduleName

      void setScheduleName​(java.lang.String scheduleName)
      Sets the name of this schedule, which is unique within its group.
      Parameters:
      scheduleName - schedule name
    • getSchedule

      Schedule getSchedule()
      Returns the Schedule which describes when the job is to be run.
    • setSchedule

      void setSchedule​(Schedule schedule)
      Sets the Schedule which describes when the job is to be run.
      Parameters:
      schedule - Schedule which describes when the job is to be run.
    • getRunnableClassName

      java.lang.String getRunnableClassName()
      Returns the fully qualified name of an implementation of Runnable whose Runnable.run() method will be called when the schedule is invoked.

      When the schedule is invoked, schedule check for the availability of constructors on the RunnableClass in the following order

      • RunnableClass (JSONObj obj)
      • RunnableClass (String[] args)
      • RunnableClass ()
      Based on the available constructor, instantiate the RunnableClass with correct parameters and calls the run method
      • If JSONObject constructor is available, then framework creates a JSON object out of Param and ListParam and instantiates the RunnableClass with the JSONObject.
      • If String array constructor is available, then framework creates a String Array from the Parameters and instantiates the RunnableClass passing in the String Array.
      • Otherwise the framework tries to instantiate the RunnableClass Object with the default constructor.

      If Runnable class is implementing TaskAwareScheduledRunnable then when runnable executes, it gives an access to the underlying GridTask

    • setRunnableClassName

      void setRunnableClassName​(java.lang.String runnableClassName)
      Sets the fully qualified name of an implementation of Runnable whose Runnable.run() method will be called when the schedule is invoked.

      When the schedule is invoked, schedule check for the availability of constructors on the RunnableClass in the following order

      • RunnableClass (JSONObj obj)
      • RunnableClass (String[] args)
      • RunnableClass ()
      Based on the availabile constructor, instantiate the RunnableClass with correct parameters and calls the run method
      • If JSONObject constructor is available, then framework creates a JSON object out of Param and ListParam and instantiates the RunnableClass with the JSONObject.
      • If String array constructor is available, then framework creates a String Array from the Parameters and instantiates the RunnableClass passing in the String Array.
      • Otherwise the framework tries to instantiate the RunnableClass Object with the default constructor.

      If Runnable class is implementing TaskAwareScheduledRunnable then when runnable executes, it gives an access to the underlying GridTask

      Parameters:
      runnableClassName - fully qualified name of an implementation of Runnable
    • getParams

      java.util.List<Param> getParams()
      Returns a list of user-provided, single-value parameters keyed by name
    • getListParams

      java.util.List<ListParam> getListParams()
      Returns a list of user-provided, multi-value parameters keyed by name
    • getDisableUntil

      java.util.Calendar getDisableUntil()
      If not null, indicates the schedule is disabled until that date/time.
    • setDisableUntil

      void setDisableUntil​(java.util.Calendar disableUntil)
      If not null, indicates the schedule is disabled until that date/time.
      Parameters:
      disableUntil - indicates the schedule is disabled until that date/time.
    • getMaxRunTimeMillis

      long getMaxRunTimeMillis()
      Returns the max time in millis allowed for the schedule runnable to run before it times out
    • setMaxRunTimeMillis

      void setMaxRunTimeMillis​(long maxRunTimeMillis)
      Sets the max time in millis allowed for the schedule runnable to run before it times out
      Parameters:
      maxRunTimeMillis - max time in millis allowed for the schedule runnable to run before it times out
    • getMaxAttempts

      long getMaxAttempts()
      Returns the max attempts allowed for the runnable to execute per scheduled execution
    • setMaxAttempts

      void setMaxAttempts​(long maxAttempts)
      Sets the max attempts allowed for the runnable to execute per scheduled execution
      Parameters:
      maxAttempts - max attempts allowed for the runnable to execute per scheduled execution
    • getRetryDelayMillis

      long getRetryDelayMillis()
      Returns the delay in millis between which runnable execution should be retried on fail
    • setRetryDelayMillis

      void setRetryDelayMillis​(long retryDelayMillis)
      Sets the delay in millis between which runnable execution should be retried on fail
      Parameters:
      retryDelayMillis - delay in millis between which runnable execution should be retried on fail