Class ScheduledTaskSpec


  • public class ScheduledTaskSpec
    extends JsonObject
    Specification of one instance of a ScheduledTask. The specification contains information to identify the task and to rebuild the ScheduledTask if needed. See the discussion at TaskScheduler for the cases when this is done.
    • 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 instance
        task - the task
        scheduleParams - 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 instance
        name - the task name (for logging)
        className - the class name of the ScheduledTask
        taskData - 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
      • setName

        public void setName​(String name)
        Sets the task name. This is used for logging. See ScheduledTask.getName().
        Parameters:
        name - the task name
      • getClassName

        public String getClassName()
        Returns the class name of the ScheduledTask.
        Returns:
        the class name
      • setClassName

        public void setClassName​(String className)
        Sets the class name of the ScheduledTask.
        Parameters:
        className - the class name
      • setTaskData

        public void setTaskData​(String taskData)
        Sets the task data. This may be used for rebuilding the ScheduledTask. It can be null. See ScheduledTask.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