Interface TaskOptionManager

All Known Implementing Classes:
DatabaseTaskOptions, MemoryTaskOptions

public interface TaskOptionManager
This interface defines the methods that classes with TaskOptionManager functionalities have to implement.
Since:
1.0
  • Method Details

    • setScheduler

      void setScheduler(Scheduler scheduler)
      Sets the scheduler that uses this task option manager.
      Parameters:
      scheduler - this task option manager's scheduler
      Since:
      1.0
    • getScheduler

      Scheduler getScheduler()
      Retrieves the scheduler of this task option manager.
      Returns:
      this task option manager's scheduler; or null if the scheduler hasn't been set
      Since:
      1.0
    • addTaskOption

      boolean addTaskOption(TaskOption taskOption) throws TaskOptionManagerException
      Adds a new task option to a task.

      The provided task option needs to have the appropriate task ID set, otherwise the addition will fail.

      Parameters:
      taskOption - the task option to add
      Returns:
      true when the task option was successfully added; or false otherwise
      Throws:
      TaskOptionManagerException - when an error occurred during the task option addition
      Since:
      1.0
    • updateTaskOption

      boolean updateTaskOption(TaskOption taskOption) throws TaskOptionManagerException
      Update an existing task option.

      The provided task option needs to have the appropriate task ID set, otherwise the update will fail.

      Parameters:
      taskOption - the updated task option
      Returns:
      true if the task option was successfully updated; or false otherwise
      Throws:
      TaskManagerException - when an error occurred during the task option update
      TaskOptionManagerException
      Since:
      1.0
    • getTaskOption

      TaskOption getTaskOption(int taskId, String name) throws TaskOptionManagerException
      Retrieves a named task options for a particular task.
      Parameters:
      taskId - the unique ID of the task to retrieve the task option for
      name - the name of the task option
      Returns:
      the retrieved task option instance; or null when the task option couldn't be found
      Throws:
      TaskOptionManagerException - when an error occurred during the task option retrieval
      Since:
      1.0
    • getTaskOptions

      Collection<TaskOption> getTaskOptions(int taskId) throws TaskOptionManagerException
      Retrieves all the task options for a particular task.
      Parameters:
      taskId - the unique ID of the task to retrieve the task options for
      Returns:
      the retrieved task options collection
      Throws:
      TaskOptionManagerException - when an error occurred during the task option retrieval
      Since:
      1.0
    • removeTaskOption

      boolean removeTaskOption(TaskOption taskOption) throws TaskOptionManagerException
      Remove a particular task option.

      The provided task option needs to have the appropriate task ID set, otherwise the removal will fail.

      Parameters:
      taskOption - the task option to remove
      Returns:
      true when the task option was successfully removed; or false otherwise
      Throws:
      TaskOptionManagerException - when an error occurred during the task option removal
      Since:
      1.0
    • removeTaskOption

      boolean removeTaskOption(int taskId, String name) throws TaskOptionManagerException
      Remove a particular task option.
      Parameters:
      taskId - the unique ID of the task to retrieve the task option for
      name - the name of the task option
      Returns:
      true when the task option was successfully removed; or false otherwise
      Throws:
      TaskOptionManagerException - when an error occurred during the task option removal
      Since:
      1.0