Package eu.woolplatform.utils.schedule
Class ScheduledTaskSpec
- java.lang.Object
-
- eu.woolplatform.utils.json.JsonObject
-
- eu.woolplatform.utils.schedule.ScheduledTaskSpec
-
public class ScheduledTaskSpec extends JsonObject
Specification of one instance of aScheduledTask. The specification contains information to identify the task and to rebuild theScheduledTaskif needed. See the discussion atTaskSchedulerfor the cases when this is done.
-
-
Constructor Summary
Constructors Constructor Description ScheduledTaskSpec()This default constructor is used for JSON serialization.ScheduledTaskSpec(String id, ScheduledTask task, ScheduleParams scheduleParams)Constructs a new task specification.ScheduledTaskSpec(String id, String name, String className, String taskData, ScheduleParams scheduleParams)Constructs a new task specification.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClassName()Returns the class name of theScheduledTask.StringgetId()Returns the ID of the task instance.StringgetName()Returns the task name.ScheduleParamsgetScheduleParams()Returns the schedule parameters of the task instance.StringgetTaskData()Returns the task data.voidsetClassName(String className)Sets the class name of theScheduledTask.voidsetId(String id)Sets the ID of the task instance.voidsetName(String name)Sets the task name.voidsetScheduleParams(ScheduleParams scheduleParams)Sets the schedule parameters of the task instance.voidsetTaskData(String taskData)Sets the task data.
-
-
-
Constructor Detail
-
ScheduledTaskSpec
public ScheduledTaskSpec()
This default constructor is used for JSON serialization.
-
ScheduledTaskSpec
public ScheduledTaskSpec(String id, ScheduledTask task, ScheduleParams scheduleParams)
Constructs a new task specification.- Parameters:
id- the ID of the task instancetask- the taskscheduleParams- the schedule parameters
-
ScheduledTaskSpec
public ScheduledTaskSpec(String id, String name, String className, String taskData, ScheduleParams scheduleParams)
Constructs a new task specification.- Parameters:
id- the ID of the task instancename- the task name (for logging)className- the class name of theScheduledTasktaskData- the task data (can be null)scheduleParams- the schedule parameters
-
-
Method Detail
-
getId
public String getId()
Returns the ID of the task instance.- Returns:
- the ID of the task instance
-
setId
public void setId(String id)
Sets the ID of the task instance.- Parameters:
id- the ID of the task instance
-
getName
public String getName()
Returns the task name. This is used for logging. SeeScheduledTask.getName().- Returns:
- the task name
-
setName
public void setName(String name)
Sets the task name. This is used for logging. SeeScheduledTask.getName().- Parameters:
name- the task name
-
getClassName
public String getClassName()
Returns the class name of theScheduledTask.- Returns:
- the class name
-
setClassName
public void setClassName(String className)
Sets the class name of theScheduledTask.- Parameters:
className- the class name
-
getTaskData
public String getTaskData()
Returns the task data. This may be used for rebuilding theScheduledTask. It can be null. SeeScheduledTask.getTaskData().- Returns:
- the task data (can be null)
-
setTaskData
public void setTaskData(String taskData)
Sets the task data. This may be used for rebuilding theScheduledTask. It can be null. SeeScheduledTask.getTaskData().- Parameters:
taskData- the task data (can be null)
-
getScheduleParams
public ScheduleParams getScheduleParams()
Returns the schedule parameters of the task instance.- Returns:
- the schedule parameters of the task instance
-
setScheduleParams
public void setScheduleParams(ScheduleParams scheduleParams)
Sets the schedule parameters of the task instance.- Parameters:
scheduleParams- the schedule parameters of the task instance
-
-