Interface TaskStore
- All Known Implementing Classes:
- TaskStoreImpl
public interface TaskStore
This interface describes basic Task storing functionality, where every Task is uniquely represented by both its ID,
 and the Facility and Service it contains.
 
Storage is meant to be in-memory pool.
- 
Method SummaryModifier 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
- 
Method Details- 
addTaskAdd Task to TaskStore.- Parameters:
- task- Task to be added
- Returns:
- Added Task
- Throws:
- TaskStoreException- When Task can't be added because of some kind of inconsistency
 
- 
clearvoid clear()Clear all Tasks from TaskStore.
- 
getAllTasksCollection<Task> getAllTasks()Get all Tasks present in a TaskStore.- Returns:
- All Tasks from TaskStore
 
- 
getSizeint getSize()Get current size of TaskStore (number of Tasks stored).- Returns:
- Number of Tasks stored in a TaskStore
 
- 
getTaskGet Task by its ID.- Parameters:
- id- ID of Task to get
- Returns:
- Task by its ID
 
- 
getTaskGet Task by its Facility and Service.- Parameters:
- facility- Facility to get Task for
- service- Service to get Task for
- Returns:
- Task by its Facility and Service
 
- 
getTasksWithStatusGet all Tasks which are in any of specified statuses.- Parameters:
- status- Array of expected TaskStatuses
- Returns:
- All Tasks which are in any of expected statuses.
- See Also:
 
- 
removeTaskRemove Task from TaskStore by its ID.- Parameters:
- id- ID of Task to be removed
- runId- run ID of Task to be removed
- Returns:
- Removed Task
- Throws:
- TaskStoreException- When Task can't be removed because of some kind of inconsistency
 
- 
removeTaskRemove Task from TaskStore- Parameters:
- task- Task to be removed
- Returns:
- Removed Task
- Throws:
- TaskStoreException- When Task can't be removed because of some kind of inconsistency
 
 
-