Interface TasksManagerImplApi
- All Known Implementing Classes:
TasksManagerImpl
public interface TasksManagerImplApi
TasksManagerImplApi
-
Method Summary
Modifier and TypeMethodDescriptionint
int
Delete all TaskResultsint
deleteOldTaskResults
(int numDays) Delete all TaskResults older than specified number of daysvoid
deleteTaskResultById
(int taskResultId) Delete TaskResult by its IDint
deleteTaskResults
(int taskId) Delete all TaskResults for the particular Taskint
deleteTaskResults
(int taskId, int destinationId) Delete all TaskResults for the particular Task and Destination.getTask
(int serviceId, int facilityId) Retrieve task for given service and facility (by id).Retrieve task for given service and facility.getTaskById
(int id) Retrieve task with given id.getTaskResultById
(int taskResultId) Get TaskResult by its IDList TaskResultsgetTaskResultsByDestinations
(List<String> destinationsNames) Returns list of tasks results for defined destinations (string representation).getTaskResultsByTask
(int taskId) List TaskResults tied to a certain taskgetTaskResultsByTaskAndDestination
(int taskId, int destinationId) List newest TaskResults tied to a certain task and destinationgetTaskResultsByTaskOnlyNewest
(int taskId) List newest TaskResults tied to a certain taskint
insertNewTaskResult
(TaskResult taskResult) Store task result into DB.int
insertTask
(Task task) Insert new task into DB.boolean
isThereSuchTask
(Service service, Facility facility) Check if there is a task for given service and facility.Retrieve all tasks from DB.listAllTasksForFacility
(int facilityId) Returns all tasks associated with selected facility.listAllTasksForService
(int serviceId) Returns all tasks associated with given serviceRetrieve all tass in given state.Retrieve all tasks not in given state.void
removeTask
(int id) Remove task with given id.void
removeTask
(Service service, Facility facility) Remove task for given service and facility.retrieveRunIdForTask
(Task task) Retrieves a new run id for the task propagation.void
updateTask
(Task task) Update DB record of given task.
-
Method Details
-
countTasks
int countTasks()- Returns:
-
deleteAllTaskResults
int deleteAllTaskResults()Delete all TaskResults- Returns:
- number of deleted TaskResults
-
deleteOldTaskResults
int deleteOldTaskResults(int numDays) Delete all TaskResults older than specified number of days- Parameters:
numDays
- Number of days to keep- Returns:
- number of deleted TaskResults
-
deleteTaskResultById
void deleteTaskResultById(int taskResultId) Delete TaskResult by its ID- Parameters:
taskResultId
- ID of TaskResult to delete
-
deleteTaskResults
int deleteTaskResults(int taskId) Delete all TaskResults for the particular Task- Parameters:
taskId
- ID of Task to delete TaskResults- Returns:
- number of deleted TaskResults
-
deleteTaskResults
int deleteTaskResults(int taskId, int destinationId) Delete all TaskResults for the particular Task and Destination.- Parameters:
taskId
- ID of Task to delete TaskResultsdestinationId
- ID of Destination to delete TaskResults- Returns:
- number of deleted TaskResults
-
getTask
Retrieve task for given service and facility (by id).- Parameters:
serviceId
-facilityId
-- Returns:
- Task
-
getTask
Retrieve task for given service and facility.- Parameters:
service
-facility
-- Returns:
- Task
-
getTaskById
Retrieve task with given id.- Parameters:
id
-- Returns:
- Task
-
getTaskResultById
Get TaskResult by its ID- Parameters:
taskResultId
-- Returns:
- TaskResult
-
getTaskResults
List<TaskResult> getTaskResults()List TaskResults- Returns:
- all TaskResults
-
getTaskResultsByDestinations
Returns list of tasks results for defined destinations (string representation).- Parameters:
destinationsNames
-- Returns:
- list of tasks results
- Throws:
InternalErrorException
-
getTaskResultsByTask
List TaskResults tied to a certain task- Parameters:
taskId
-- Returns:
-
getTaskResultsByTaskAndDestination
List newest TaskResults tied to a certain task and destination- Parameters:
taskId
-- Returns:
-
getTaskResultsByTaskOnlyNewest
List newest TaskResults tied to a certain task- Parameters:
taskId
-- Returns:
-
insertNewTaskResult
Store task result into DB.- Parameters:
taskResult
-- Returns:
- id of new task result
-
insertTask
Insert new task into DB.- Parameters:
task
-- Returns:
- id of new task
-
isThereSuchTask
Check if there is a task for given service and facility.- Parameters:
service
-facility
-- Returns:
- boolean true if there is a task, false otherwise
-
listAllTasks
Retrieve all tasks from DB.- Returns:
- List of Task
-
listAllTasksForFacility
Returns all tasks associated with selected facility.- Parameters:
facilityId
-- Returns:
- tasks for facility
-
listAllTasksForService
Returns all tasks associated with given service- Parameters:
serviceId
-- Returns:
- tasks for service
-
listAllTasksInState
Retrieve all tass in given state.- Parameters:
state
-- Returns:
- List of Task
-
listAllTasksNotInState
Retrieve all tasks not in given state.- Parameters:
state
-- Returns:
- List of Task
-
removeTask
void removeTask(int id) Remove task with given id.- Parameters:
id
-
-
removeTask
Remove task for given service and facility.- Parameters:
service
-facility
-
-
updateTask
Update DB record of given task.- Parameters:
task
-
-
retrieveRunIdForTask
Retrieves a new run id for the task propagation.- Parameters:
task
- task to schedule- Returns:
- task with updated run id
-