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 namelong
getMaxAttempts()
Returns the max attempts allowed for the runnable to execute per scheduled executionlong
getMaxRunTimeMillis()
Returns the max time in millis allowed for the schedule runnable to run before it times outjava.util.List<Param>
getParams()
Returns a list of user-provided, single-value parameters keyed by namelong
getRetryDelayMillis()
Returns the delay in millis between which runnable execution should be retried on failjava.lang.String
getRunnableClassName()
Returns the fully qualified name of an implementation ofRunnable
whoseRunnable.run()
method will be called when the schedule is invoked.Schedule
getSchedule()
Returns theSchedule
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 executionvoid
setMaxRunTimeMillis(long maxRunTimeMillis)
Sets the max time in millis allowed for the schedule runnable to run before it times outvoid
setRetryDelayMillis(long retryDelayMillis)
Sets the delay in millis between which runnable execution should be retried on failvoid
setRunnableClassName(java.lang.String runnableClassName)
Sets the fully qualified name of an implementation ofRunnable
whoseRunnable.run()
method will be called when the schedule is invoked.void
setSchedule(Schedule schedule)
Sets theSchedule
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 theSchedule
which describes when the job is to be run. -
setSchedule
Sets theSchedule
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 ofRunnable
whoseRunnable.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 ()
- If JSONObject constructor is available, then framework creates a JSON object out of
Param
andListParam
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.
GridTask
-
setRunnableClassName
void setRunnableClassName(java.lang.String runnableClassName)Sets the fully qualified name of an implementation ofRunnable
whoseRunnable.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 ()
- If JSONObject constructor is available, then framework creates a JSON object out of
Param
andListParam
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.
GridTask
- Parameters:
runnableClassName
- fully qualified name of an implementation ofRunnable
-
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
-