Class MetaTasksManager<T extends ManagedTask>
java.lang.Object
io.openems.edge.common.taskmanager.MetaTasksManager<T>
- Type Parameters:
T
- the type of the actualManagedTask
Manages a number of
TasksManager
s.
A useful application for MetaTasksManager is to provide a list of Tasks that need to be handled on an OpenEMS Cycle run.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTasksManager
(String sourceId, TasksManager<T> tasksManager) Adds a TasksManager.Gets all Tasks with by their Source-ID.getAllTasksBySourceId
(Priority priority) Gets all Tasks with the given Priority by their Source-ID.getOneTask
(Priority priority) Gets the next task with the given Priority sequentially.boolean
hasTasks()
Does thisTasksManager
have any Tasks?.void
removeTasksManager
(String sourceId) Removes all TasksManagers with the given Source-ID.void
removeTasksManager
(String sourceId, TasksManager<T> tasksManager) Removes a TasksManager.
-
Constructor Details
-
MetaTasksManager
public MetaTasksManager()
-
-
Method Details
-
addTasksManager
Adds a TasksManager.- Parameters:
sourceId
- a source identifiertasksManager
- the TasksManager
-
removeTasksManager
Removes a TasksManager.- Parameters:
sourceId
- a source identifiertasksManager
- the TasksManager
-
removeTasksManager
Removes all TasksManagers with the given Source-ID.- Parameters:
sourceId
- a source identifier
-
getOneTask
Gets the next task with the given Priority sequentially.- Parameters:
priority
- thePriority
- Returns:
- the next task; null if there are no tasks with the given Priority
-
getAllTasksBySourceId
Gets all Tasks with the given Priority by their Source-ID.- Parameters:
priority
- the priority- Returns:
- a list of tasks
-
getAllTasksBySourceId
Gets all Tasks with by their Source-ID.- Returns:
- a list of tasks
-
hasTasks
public boolean hasTasks()Does thisTasksManager
have any Tasks?.- Returns:
- true if there are Tasks
-