Class TaskStoreImpl
java.lang.Object
cz.metacentrum.perun.taskslib.service.impl.TaskStoreImpl
- All Implemented Interfaces:
TaskStore
Implementation of TaskStore as in-memory pool.
- Author:
- David Šarman, Pavel Zlámal invalid input: '<'zlamal@cesnet.cz>
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd Task to TaskStore.void
clear()
Clear all Tasks from TaskStore.Get all Tasks present in a TaskStore.int
getSize()
Get current size of TaskStore (number of Tasks stored).getTask
(int id) Get Task by its ID.Get Task by its Facility and Service.getTasksWithStatus
(Task.TaskStatus... status) Get all Tasks which are in any of specified statuses.removeTask
(int id, int runId) Remove Task from TaskStore by its ID.removeTask
(Task task) Remove Task from TaskStore
-
Constructor Details
-
TaskStoreImpl
public TaskStoreImpl()
-
-
Method Details
-
addTask
Description copied from interface:TaskStore
Add Task to TaskStore.- Specified by:
addTask
in interfaceTaskStore
- Parameters:
task
- Task to be added- Returns:
- Added Task
- Throws:
TaskStoreException
- When Task can't be added because of some kind of inconsistency
-
clear
public void clear()Description copied from interface:TaskStore
Clear all Tasks from TaskStore. -
getAllTasks
Description copied from interface:TaskStore
Get all Tasks present in a TaskStore.- Specified by:
getAllTasks
in interfaceTaskStore
- Returns:
- All Tasks from TaskStore
-
getSize
public int getSize()Description copied from interface:TaskStore
Get current size of TaskStore (number of Tasks stored). -
getTask
Description copied from interface:TaskStore
Get Task by its ID. -
getTask
Description copied from interface:TaskStore
Get Task by its Facility and Service. -
getTasksWithStatus
Description copied from interface:TaskStore
Get all Tasks which are in any of specified statuses.- Specified by:
getTasksWithStatus
in interfaceTaskStore
- Parameters:
status
- Array of expected TaskStatuses- Returns:
- All Tasks which are in any of expected statuses.
- See Also:
-
removeTask
Description copied from interface:TaskStore
Remove Task from TaskStore by its ID.- Specified by:
removeTask
in interfaceTaskStore
- Parameters:
id
- ID of Task to be removedrunId
- run ID of Task to be removed- Returns:
- Removed Task
- Throws:
TaskStoreException
- When Task can't be removed because of some kind of inconsistency
-
removeTask
Description copied from interface:TaskStore
Remove Task from TaskStore- Specified by:
removeTask
in interfaceTaskStore
- Parameters:
task
- Task to be removed- Returns:
- Removed Task
- Throws:
TaskStoreException
- When Task can't be removed because of some kind of inconsistency
-