Interface TaskStore

All Known Implementing Classes:
TaskStoreImpl

public interface TaskStore
This interface describes basic Task storing functionality, where every Task is uniquely represented by both its ID, and the Facility and Service it contains.

Storage is meant to be in-memory pool.

  • Method Details

    • addTask

      Task addTask(Task task) throws TaskStoreException
      Add Task to TaskStore.
      Parameters:
      task - Task to be added
      Returns:
      Added Task
      Throws:
      TaskStoreException - When Task can't be added because of some kind of inconsistency
    • clear

      void clear()
      Clear all Tasks from TaskStore.
    • getAllTasks

      Collection<Task> getAllTasks()
      Get all Tasks present in a TaskStore.
      Returns:
      All Tasks from TaskStore
    • getSize

      int getSize()
      Get current size of TaskStore (number of Tasks stored).
      Returns:
      Number of Tasks stored in a TaskStore
    • getTask

      Task getTask(int id)
      Get Task by its ID.
      Parameters:
      id - ID of Task to get
      Returns:
      Task by its ID
    • getTask

      Task getTask(Facility facility, Service service)
      Get Task by its Facility and Service.
      Parameters:
      facility - Facility to get Task for
      service - Service to get Task for
      Returns:
      Task by its Facility and Service
    • getTasksWithStatus

      List<Task> getTasksWithStatus(Task.TaskStatus... status)
      Get all Tasks which are in any of specified statuses.
      Parameters:
      status - Array of expected TaskStatuses
      Returns:
      All Tasks which are in any of expected statuses.
      See Also:
    • removeTask

      Task removeTask(int id, int runId) throws TaskStoreException
      Remove Task from TaskStore by its ID.
      Parameters:
      id - ID of Task to be removed
      runId - run ID of Task to be removed
      Returns:
      Removed Task
      Throws:
      TaskStoreException - When Task can't be removed because of some kind of inconsistency
    • removeTask

      Task removeTask(Task task) throws TaskStoreException
      Remove Task from TaskStore
      Parameters:
      task - Task to be removed
      Returns:
      Removed Task
      Throws:
      TaskStoreException - When Task can't be removed because of some kind of inconsistency