Package cz.metacentrum.perun.core.bl
Interface TasksManagerBl
- All Known Implementing Classes:
- TasksManagerBlImpl
public interface TasksManagerBl
TasksManagerBl
- 
Method SummaryModifier and TypeMethodDescriptionintGet number of tasks in DB.intDelete all TaskResultsintdeleteOldTaskResults(PerunSession sess, int numDays) Delete all TaskResults older than specified number of daysvoiddeleteTask(PerunSession sess, Task task) Delete Task and it's TaskResults.voiddeleteTaskResultById(PerunSession sess, int taskResultId) Delete TaskResults by its IDintdeleteTaskResults(PerunSession sess, int taskId) Delete all TaskResults for the particular TaskintdeleteTaskResults(PerunSession sess, int taskId, int destinationId) Delete all TaskResults for the particular Task and Destination.getAllFacilitiesStates(PerunSession session) Return propagation status of all facilities in PerungetAllFacilitiesStatesForVo(PerunSession session, Vo vo) Return propagation status of all facilities related to VO resourcesgetFacilityServicesState(PerunSession sess, Facility facility) Returns list of ServiceStates for given facility.getFacilityState(PerunSession session, Facility facility) Return propagation status of facilitygetResourcesState(PerunSession session, Vo vo) Returns list of ResourceStates for VO.getTask(PerunSession perunSession, Service service, Facility facility) Find propagation task for given service and facility.getTaskById(PerunSession perunSession, int id) Retrieve task given its id.getTaskResultById(PerunSession sess, int taskResultId) Retrieve all task results for given task (by task id)getTaskResults(PerunSession sess) Retrieve all task results from DB.getTaskResultsByDestinations(PerunSession session, List<String> destinationsNames) Returns task results for defined destinations (string representation).getTaskResultsByTask(PerunSession sess, int taskId) Retrieve all tasks results for given taskgetTaskResultsByTaskAndDestination(PerunSession sess, int taskId, int destinationId) List newest TaskResults tied to a certain task and destinationgetTaskResultsByTaskOnlyNewest(PerunSession sess, int taskId) List newest TaskResults tied to a certain taskintinsertNewTaskResult(PerunSession sess, TaskResult taskResult) Insert TaskResult into DB.intinsertTask(PerunSession sess, Task task) Insert Task into DB.booleanCheck if propagating tasks to engine is suspended.booleanCheck if propagating tasks to engine is suspended via the DB flag CAREFUL: even if not suspended though DB, can be disabled temporarily through synced fieldbooleanisThereSuchTask(PerunSession sess, Service service, Facility facility) Check if there is a task for given service and facility.listAllTasks(PerunSession perunSession) Retrieve all tasks from DB.listAllTasksForFacility(PerunSession session, int facilityId) Returns all tasks associated with selected facility.listAllTasksForService(PerunSession sess, int serviceId) Returns all tasks associated with given service.listAllTasksInState(PerunSession perunSession, Task.TaskStatus state) Retrieve all tasks in given state.listAllTasksNotInState(PerunSession sess, Task.TaskStatus state) Retrieve all tasks that are not in given state.voidremoveAllTasksForService(PerunSession sess, Service service) Removes all tasks associated with given service including the associated task resultsvoidremoveTask(PerunSession sess, int id) Remove task with given id.voidremoveTask(PerunSession sess, Service service, Facility facility) Remove task for given service and facility.retrieveRunIdForTask(PerunSession sess, Task task) Retrieves a new run id for the task propagation.voidsuspendTasksPropagation(PerunSession sess, boolean suspend, boolean persistently) Suspend propagating tasks to engine.voidupdateTask(PerunSession sess, Task task) Update DB record for given task.
- 
Method Details- 
countTasksint countTasks()Get number of tasks in DB.- Returns:
- int number of tasks
 
- 
deleteAllTaskResultsDelete all TaskResults- Returns:
- number of deleted TaskResults
 
- 
deleteOldTaskResultsDelete all TaskResults older than specified number of days- Parameters:
- numDays- Number of days to keep
- Returns:
- number of deleted TaskResults
 
- 
deleteTaskDelete Task and it's TaskResults. Use this method only before deleting whole Facility.- Parameters:
- sess- PerunSession
- task- Task to delete
- Throws:
- InternalErrorException
 
- 
deleteTaskResultByIdDelete TaskResults by its ID- Parameters:
- taskResultId- ID of TaskResult to delete
 
- 
deleteTaskResultsDelete all TaskResults for the particular Task- Parameters:
- taskId- ID of Task to delete TaskResults
- Returns:
- number of deleted TaskResults
 
- 
deleteTaskResultsDelete all TaskResults for the particular Task and Destination.- Parameters:
- taskId- ID of Task to delete TaskResults
- destinationId- ID of Destination to delete TaskResults
- Returns:
- number of deleted TaskResults
 
- 
getAllFacilitiesStatesReturn propagation status of all facilities in Perun- Parameters:
- session- PerunSession
- Returns:
- all facilities propagation statuses
- Throws:
- InternalErrorException
- FacilityNotExistsException
 
- 
getAllFacilitiesStatesForVoList<FacilityState> getAllFacilitiesStatesForVo(PerunSession session, Vo vo) throws VoNotExistsException, FacilityNotExistsException Return propagation status of all facilities related to VO resources- Parameters:
- session- PerunSession
- Returns:
- all facilities propagation statuses
- Throws:
- InternalErrorException
- FacilityNotExistsException
- VoNotExistsException
 
- 
getFacilityServicesStateReturns list of ServiceStates for given facility. It lists states for all services, which are currently assigned to the facility or has any Task related to this facility.So results are returned even when there was no previous propagation of such service or service is no longer assigned. - Parameters:
- sess-
- facility-
- Returns:
- list of ServiceStates
- Throws:
- InternalErrorException
 
- 
getFacilityStateFacilityState getFacilityState(PerunSession session, Facility facility) throws FacilityNotExistsException Return propagation status of facility- Parameters:
- session-
- facility-
- Returns:
- propagation status of facility
- Throws:
- FacilityNotExistsException
- InternalErrorException
 
- 
getResourcesStateReturns list of ResourceStates for VO.- Parameters:
- session- PerunSession
- vo- VirtualOrganization
- Returns:
- list of ResourceStates
- Throws:
- VoNotExistsException
- InternalErrorException
 
- 
getTaskFind propagation task for given service and facility.- Parameters:
- perunSession-
- service-
- facility-
- Returns:
- Task
 
- 
getTaskByIdRetrieve task given its id.- Parameters:
- perunSession-
- id-
- Returns:
- Task
 
- 
getTaskResultByIdRetrieve all task results for given task (by task id)- Parameters:
- sess-
- taskResultId-
- Returns:
- TaskResult
 
- 
getTaskResultsRetrieve all task results from DB.- Parameters:
- sess-
- Returns:
- List of TaskResult
 
- 
getTaskResultsByDestinationsReturns task results for defined destinations (string representation).- Parameters:
- session-
- destinationsNames-
- Returns:
- list of tasks results
 
- 
getTaskResultsByTaskRetrieve all tasks results for given task- Parameters:
- sess-
- taskId-
- Returns:
- List of TaskResult
 
- 
getTaskResultsByTaskAndDestinationList<TaskResult> getTaskResultsByTaskAndDestination(PerunSession sess, int taskId, int destinationId) List newest TaskResults tied to a certain task and destination- Parameters:
- taskId-
- Returns:
- List of TaskResult
 
- 
getTaskResultsByTaskOnlyNewestList newest TaskResults tied to a certain task- Parameters:
- taskId-
- Returns:
- List of TaskResult
 
- 
insertNewTaskResultInsert TaskResult into DB.- Parameters:
- sess-
- taskResult-
- Returns:
- int id of the new task result
 
- 
insertTaskInsert Task into DB.- Parameters:
- sess-
- task-
- Returns:
- int id of the inserted task
 
- 
isSuspendedTasksPropagationboolean isSuspendedTasksPropagation()Check if propagating tasks to engine is suspended.- Returns:
- True if suspended, false if propagating
 
- 
isSuspendedTasksPropagationPersistentlyboolean isSuspendedTasksPropagationPersistently()Check if propagating tasks to engine is suspended via the DB flag CAREFUL: even if not suspended though DB, can be disabled temporarily through synced field- Returns:
- True if suspended in DB, false otherwise
 
- 
isThereSuchTaskCheck if there is a task for given service and facility.- Parameters:
- sess-
- service-
- facility-
- Returns:
- boolean true if there is a task, false otherwise
 
- 
listAllTasksRetrieve all tasks from DB.- Parameters:
- perunSession-
- Returns:
- List of Task
 
- 
listAllTasksForFacilityReturns all tasks associated with selected facility.- Parameters:
- session-
- facilityId-
- Returns:
- all tasks for facility
 
- 
listAllTasksForServiceReturns all tasks associated with given service.- Parameters:
- serviceId-
- Returns:
- tasks for service
 
- 
listAllTasksInStateRetrieve all tasks in given state.- Parameters:
- perunSession-
- state-
- Returns:
- List of Task
 
- 
listAllTasksNotInStateRetrieve all tasks that are not in given state.- Parameters:
- sess-
- state-
- Returns:
- List of Task
 
- 
removeAllTasksForServiceRemoves all tasks associated with given service including the associated task results- Parameters:
- service-
 
- 
removeTaskRemove task with given id.- Parameters:
- sess-
- id-
 
- 
removeTaskRemove task for given service and facility.- Parameters:
- sess-
- service-
- facility-
 
- 
suspendTasksPropagationSuspend propagating tasks to engine.- Parameters:
- sess-
- suspend- True for suspending propagation, false for resuming propagation
- persistently- True for the change to persist even after Perun restart
 
- 
updateTaskUpdate DB record for given task.- Parameters:
- sess-
- task-
 
- 
retrieveRunIdForTaskRetrieves a new run id for the task propagation.- Parameters:
- sess- session
- task- task to schedule
- Returns:
- task with updated run id
 
 
-