Class MetaTasksManager<T extends ManagedTask>

java.lang.Object
io.openems.edge.common.taskmanager.MetaTasksManager<T>
Type Parameters:
T - the type of the actual ManagedTask

public class MetaTasksManager<T extends ManagedTask> extends Object
Manages a number of TasksManagers.

A useful application for MetaTasksManager is to provide a list of Tasks that need to be handled on an OpenEMS Cycle run.

  • Constructor Details

    • MetaTasksManager

      public MetaTasksManager()
  • Method Details

    • addTasksManager

      public void addTasksManager(String sourceId, TasksManager<T> tasksManager)
      Adds a TasksManager.
      Parameters:
      sourceId - a source identifier
      tasksManager - the TasksManager
    • removeTasksManager

      public void removeTasksManager(String sourceId, TasksManager<T> tasksManager)
      Removes a TasksManager.
      Parameters:
      sourceId - a source identifier
      tasksManager - the TasksManager
    • removeTasksManager

      public void removeTasksManager(String sourceId)
      Removes all TasksManagers with the given Source-ID.
      Parameters:
      sourceId - a source identifier
    • getOneTask

      public T getOneTask(Priority priority)
      Gets the next task with the given Priority sequentially.
      Parameters:
      priority - the Priority
      Returns:
      the next task; null if there are no tasks with the given Priority
    • getAllTasksBySourceId

      public com.google.common.collect.Multimap<String,T> getAllTasksBySourceId(Priority priority)
      Gets all Tasks with the given Priority by their Source-ID.
      Parameters:
      priority - the priority
      Returns:
      a list of tasks
    • getAllTasksBySourceId

      public com.google.common.collect.Multimap<String,T> getAllTasksBySourceId()
      Gets all Tasks with by their Source-ID.
      Returns:
      a list of tasks
    • hasTasks

      public boolean hasTasks()
      Does this TasksManager have any Tasks?.
      Returns:
      true if there are Tasks