Class MetaTasksManager<T extends ManagedTask>

  • Type Parameters:
    T -

    public class MetaTasksManager<T extends ManagedTask>
    extends java.lang.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 Detail

      • MetaTasksManager

        public MetaTasksManager()
    • Method Detail

      • addTasksManager

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

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

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

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

        public com.google.common.collect.Multimap<java.lang.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<java.lang.String,​T> getAllTasksBySourceId()
        Gets all Tasks with by their Source-ID.
        Parameters:
        priority - the priority
        Returns:
        a list of tasks
      • hasTasks

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