Interface TasksManagerImplApi

All Known Implementing Classes:
TasksManagerImpl

public interface TasksManagerImplApi
TasksManagerImplApi
  • Method Details

    • countTasks

      int countTasks()
      Returns:
    • deleteAllTaskResults

      int deleteAllTaskResults()
      Delete all TaskResults
      Returns:
      number of deleted TaskResults
    • deleteOldTaskResults

      int deleteOldTaskResults(int numDays)
      Delete all TaskResults older than specified number of days
      Parameters:
      numDays - Number of days to keep
      Returns:
      number of deleted TaskResults
    • deleteTaskResultById

      void deleteTaskResultById(int taskResultId)
      Delete TaskResult by its ID
      Parameters:
      taskResultId - ID of TaskResult to delete
    • deleteTaskResults

      int deleteTaskResults(int taskId)
      Delete all TaskResults for the particular Task
      Parameters:
      taskId - ID of Task to delete TaskResults
      Returns:
      number of deleted TaskResults
    • deleteTaskResults

      int deleteTaskResults(int taskId, int destinationId)
      Delete all TaskResults for the particular Task and Destination.
      Parameters:
      taskId - ID of Task to delete TaskResults
      destinationId - ID of Destination to delete TaskResults
      Returns:
      number of deleted TaskResults
    • getTask

      Task getTask(int serviceId, int facilityId)
      Retrieve task for given service and facility (by id).
      Parameters:
      serviceId -
      facilityId -
      Returns:
      Task
    • getTask

      Task getTask(Service service, Facility facility)
      Retrieve task for given service and facility.
      Parameters:
      service -
      facility -
      Returns:
      Task
    • getTaskById

      Task getTaskById(int id)
      Retrieve task with given id.
      Parameters:
      id -
      Returns:
      Task
    • getTaskResultById

      TaskResult getTaskResultById(int taskResultId)
      Get TaskResult by its ID
      Parameters:
      taskResultId -
      Returns:
      TaskResult
    • getTaskResults

      List<TaskResult> getTaskResults()
      List TaskResults
      Returns:
      all TaskResults
    • getTaskResultsByDestinations

      List<TaskResult> getTaskResultsByDestinations(List<String> destinationsNames)
      Returns list of tasks results for defined destinations (string representation).
      Parameters:
      destinationsNames -
      Returns:
      list of tasks results
      Throws:
      InternalErrorException
    • getTaskResultsByTask

      List<TaskResult> getTaskResultsByTask(int taskId)
      List TaskResults tied to a certain task
      Parameters:
      taskId -
      Returns:
    • getTaskResultsByTaskAndDestination

      List<TaskResult> getTaskResultsByTaskAndDestination(int taskId, int destinationId)
      List newest TaskResults tied to a certain task and destination
      Parameters:
      taskId -
      Returns:
    • getTaskResultsByTaskOnlyNewest

      List<TaskResult> getTaskResultsByTaskOnlyNewest(int taskId)
      List newest TaskResults tied to a certain task
      Parameters:
      taskId -
      Returns:
    • insertNewTaskResult

      int insertNewTaskResult(TaskResult taskResult)
      Store task result into DB.
      Parameters:
      taskResult -
      Returns:
      id of new task result
    • insertTask

      int insertTask(Task task)
      Insert new task into DB.
      Parameters:
      task -
      Returns:
      id of new task
    • isThereSuchTask

      boolean isThereSuchTask(Service service, Facility facility)
      Check if there is a task for given service and facility.
      Parameters:
      service -
      facility -
      Returns:
      boolean true if there is a task, false otherwise
    • listAllTasks

      List<Task> listAllTasks()
      Retrieve all tasks from DB.
      Returns:
      List of Task
    • listAllTasksForFacility

      List<Task> listAllTasksForFacility(int facilityId)
      Returns all tasks associated with selected facility.
      Parameters:
      facilityId -
      Returns:
      tasks for facility
    • listAllTasksForService

      List<Task> listAllTasksForService(int serviceId)
      Returns all tasks associated with given service
      Parameters:
      serviceId -
      Returns:
      tasks for service
    • listAllTasksInState

      List<Task> listAllTasksInState(Task.TaskStatus state)
      Retrieve all tass in given state.
      Parameters:
      state -
      Returns:
      List of Task
    • listAllTasksNotInState

      List<Task> listAllTasksNotInState(Task.TaskStatus state)
      Retrieve all tasks not in given state.
      Parameters:
      state -
      Returns:
      List of Task
    • removeTask

      void removeTask(int id)
      Remove task with given id.
      Parameters:
      id -
    • removeTask

      void removeTask(Service service, Facility facility)
      Remove task for given service and facility.
      Parameters:
      service -
      facility -
    • updateTask

      void updateTask(Task task)
      Update DB record of given task.
      Parameters:
      task -
    • retrieveRunIdForTask

      Task retrieveRunIdForTask(Task task)
      Retrieves a new run id for the task propagation.
      Parameters:
      task - task to schedule
      Returns:
      task with updated run id