Class OfflineTaskManager

java.lang.Object
offlineProcessing.OfflineTaskManager

public class OfflineTaskManager extends Object
Some global management of offline tasks / task groups.
Author:
dg50
  • Field Details

  • Constructor Details

    • OfflineTaskManager

      public OfflineTaskManager()
  • Method Details

    • getManager

      public static OfflineTaskManager getManager()
    • getAllOfflineTasks

      public ArrayList<OfflineTask> getAllOfflineTasks()
      Get a list of ALL offline tasks registered with all modules in all of PAMGUard.

      N.B. Many tasks won't be registered.

      Returns:
      list of all offline tasks
    • getOfflineTasks

      public ArrayList<OfflineTask> getOfflineTasks(PamDataBlock taskParentDataBlock)
      Get a list of all tasks in the system which have the given parent data block
      Parameters:
      taskParentDataBlock - parent data block for tasks
      Returns:
      list of available tasks.
    • getOfflineTasks

      public ArrayList<OfflineTask> getOfflineTasks(PamControlledUnit pamControlledUnit)
      Get a list of all tasks in the system which associate with the given PAMGuard module
      Parameters:
      pamControlledUnit - parent PAMGuard module
      Returns:
      list of available tasks.
    • addAvailableTasks

      public int addAvailableTasks(OfflineTaskGroup taskGroup, PamDataBlock taskParentDataBlock)
      Add all available tasks from the system which use the given datablock as primary input.
      Parameters:
      taskGroup - Task group to add tasks to
      taskParentDataBlock - parent data block
      Returns:
      number of tasks added
    • registerTask

      public void registerTask(OfflineTask offlineTask)
      Register a task in the global list. It's possible some tasks might get recreated, in which case when registered they will replace the previous one This will cause trouble if two separate tasks have the same name, but that should not be possible.
      Parameters:
      offlineTask -
    • findOfflineTask

      public OfflineTask findOfflineTask(OfflineTask offlineTask)
      find a task with the same module type, module name and task name. This should be enough to uniquely identify every task.
      Parameters:
      offlineTask -
      Returns:
      matching task or null.
    • findOfflineTask

      public OfflineTask findOfflineTask(String unitType, String unitName, String taskName)
      Find a registered task based on it's module type, module name and task name. This should be enough to uniquely identify every task.
      Parameters:
      unitType -
      unitName -
      taskName -
      Returns:
      matching task or null.
    • findOfflineTask

      public OfflineTask findOfflineTask(String taskLongName)
      Another way of finding offline tasks based on their long name. This is basically the three names unitType, unitName and taskName concatenated together. Get's used for some task management such as passing batch processing instructions.
      Parameters:
      taskLongName -
      Returns:
      matching task or null.
    • addCommandLineTask

      public void addCommandLineTask(String taskLongName)
      Add a task listed in the command line when PAMGuard was started.
      Parameters:
      taskLongName -
    • getCommandLineTasks

      public ArrayList<String> getCommandLineTasks()
      The list of tasks from the command line.
      Returns:
      the commandLineTasks
    • getBatchStatus

      public String getBatchStatus()
      Get the status of jobs to pass back to the batch process controller.
      Returns: