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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd Task to TaskStore.voidclear()Clear all Tasks from TaskStore.Get all Tasks present in a TaskStore.intgetSize()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:TaskStoreAdd Task to TaskStore.- Specified by:
addTaskin 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:TaskStoreClear all Tasks from TaskStore. -
getAllTasks
Description copied from interface:TaskStoreGet all Tasks present in a TaskStore.- Specified by:
getAllTasksin interfaceTaskStore- Returns:
- All Tasks from TaskStore
-
getSize
public int getSize()Description copied from interface:TaskStoreGet current size of TaskStore (number of Tasks stored). -
getTask
Description copied from interface:TaskStoreGet Task by its ID. -
getTask
Description copied from interface:TaskStoreGet Task by its Facility and Service. -
getTasksWithStatus
Description copied from interface:TaskStoreGet all Tasks which are in any of specified statuses.- Specified by:
getTasksWithStatusin interfaceTaskStore- Parameters:
status- Array of expected TaskStatuses- Returns:
- All Tasks which are in any of expected statuses.
- See Also:
-
removeTask
Description copied from interface:TaskStoreRemove Task from TaskStore by its ID.- Specified by:
removeTaskin 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:TaskStoreRemove Task from TaskStore- Specified by:
removeTaskin interfaceTaskStore- Parameters:
task- Task to be removed- Returns:
- Removed Task
- Throws:
TaskStoreException- When Task can't be removed because of some kind of inconsistency
-