Class TaskManager

java.lang.Object
io.goobi.viewer.api.rest.model.tasks.TaskManager

public class TaskManager extends Object
Manages (possibly timeconsuming) tasks within the viewer which can be triggered and monitored via the TasksResource. The tasks are not executed sequentially or queued in any way, except through the limit of the internal thread pool (5 parallel tasks)
Author:
florian
  • Constructor Details

    • TaskManager

      public TaskManager(Duration jobLiveTime)
      Create new JobManager.
      Parameters:
      jobLiveTime - The guaranteed live time of jobs in the jobManager
  • Method Details

    • addTask

      public Long addTask(Task job)
    • getTask

      public Task getTask(long jobId)
    • removeTask

      public Task removeTask(long jobId)
    • triggerTaskInThread

      public Future triggerTaskInThread(long jobId, javax.servlet.http.HttpServletRequest request)
    • getTasks

      public List<Task> getTasks(TaskType type)
    • getTasks

      public List<Task> getTasks()
    • createTask

      public static BiConsumer<javax.servlet.http.HttpServletRequest,Task> createTask(TaskType type)
      Parameters:
      type -
      Returns:
      BiConsumer<HttpServletRequest, Task>