Package cz.metacentrum.perun.core.blImpl
Class TasksManagerBlImpl
java.lang.Object
cz.metacentrum.perun.core.blImpl.TasksManagerBlImpl
- All Implemented Interfaces:
- TasksManagerBl
TasksManagerBlImpl
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
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.voidsetPerunBl(PerunBlImpl perunBl) voidsetServicesManagerBl(ServicesManagerBl servicesManagerBl) voidsuspendTasksPropagation(PerunSession perunSession, boolean suspend, boolean persistently) Suspend propagating tasks to engine.voidupdateTask(PerunSession sess, Task task) Update DB record for given task.
- 
Field Details- 
perun
- 
tasksManagerImpl
 
- 
- 
Constructor Details- 
TasksManagerBlImpl
 
- 
- 
Method Details- 
countTaskspublic int countTasks()Description copied from interface:TasksManagerBlGet number of tasks in DB.- Specified by:
- countTasksin interface- TasksManagerBl
- Returns:
- int number of tasks
 
- 
deleteAllTaskResultsDescription copied from interface:TasksManagerBlDelete all TaskResults- Specified by:
- deleteAllTaskResultsin interface- TasksManagerBl
- Returns:
- number of deleted TaskResults
 
- 
deleteOldTaskResultsDescription copied from interface:TasksManagerBlDelete all TaskResults older than specified number of days- Specified by:
- deleteOldTaskResultsin interface- TasksManagerBl
- Parameters:
- numDays- Number of days to keep
- Returns:
- number of deleted TaskResults
 
- 
deleteTaskDescription copied from interface:TasksManagerBlDelete Task and it's TaskResults. Use this method only before deleting whole Facility.- Specified by:
- deleteTaskin interface- TasksManagerBl
- Parameters:
- sess- PerunSession
- task- Task to delete
 
- 
deleteTaskResultByIdDescription copied from interface:TasksManagerBlDelete TaskResults by its ID- Specified by:
- deleteTaskResultByIdin interface- TasksManagerBl
- Parameters:
- taskResultId- ID of TaskResult to delete
 
- 
deleteTaskResultsDescription copied from interface:TasksManagerBlDelete all TaskResults for the particular Task- Specified by:
- deleteTaskResultsin interface- TasksManagerBl
- Parameters:
- taskId- ID of Task to delete TaskResults
- Returns:
- number of deleted TaskResults
 
- 
deleteTaskResultsDescription copied from interface:TasksManagerBlDelete all TaskResults for the particular Task and Destination.- Specified by:
- deleteTaskResultsin interface- TasksManagerBl
- Parameters:
- taskId- ID of Task to delete TaskResults
- destinationId- ID of Destination to delete TaskResults
- Returns:
- number of deleted TaskResults
 
- 
getAllFacilitiesStatespublic List<FacilityState> getAllFacilitiesStates(PerunSession session) throws FacilityNotExistsException Description copied from interface:TasksManagerBlReturn propagation status of all facilities in Perun- Specified by:
- getAllFacilitiesStatesin interface- TasksManagerBl
- Parameters:
- session- PerunSession
- Returns:
- all facilities propagation statuses
- Throws:
- FacilityNotExistsException
 
- 
getAllFacilitiesStatesForVopublic List<FacilityState> getAllFacilitiesStatesForVo(PerunSession session, Vo vo) throws VoNotExistsException, FacilityNotExistsException Description copied from interface:TasksManagerBlReturn propagation status of all facilities related to VO resources- Specified by:
- getAllFacilitiesStatesForVoin interface- TasksManagerBl
- Parameters:
- session- PerunSession
- Returns:
- all facilities propagation statuses
- Throws:
- VoNotExistsException
- FacilityNotExistsException
 
- 
getFacilityServicesStateDescription copied from interface:TasksManagerBlReturns 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. - Specified by:
- getFacilityServicesStatein interface- TasksManagerBl
- Parameters:
- sess-
- facility-
- Returns:
- list of ServiceStates
 
- 
getFacilityStatepublic FacilityState getFacilityState(PerunSession session, Facility facility) throws FacilityNotExistsException Description copied from interface:TasksManagerBlReturn propagation status of facility- Specified by:
- getFacilityStatein interface- TasksManagerBl
- Parameters:
- session-
- facility-
- Returns:
- propagation status of facility
- Throws:
- FacilityNotExistsException
 
- 
getPerunBl
- 
getResourcesStatepublic List<ResourceState> getResourcesState(PerunSession session, Vo vo) throws VoNotExistsException Description copied from interface:TasksManagerBlReturns list of ResourceStates for VO.- Specified by:
- getResourcesStatein interface- TasksManagerBl
- Parameters:
- session- PerunSession
- vo- VirtualOrganization
- Returns:
- list of ResourceStates
- Throws:
- VoNotExistsException
 
- 
getServicesManagerBl
- 
getTaskDescription copied from interface:TasksManagerBlFind propagation task for given service and facility.- Specified by:
- getTaskin interface- TasksManagerBl
- Parameters:
- perunSession-
- service-
- facility-
- Returns:
- Task
 
- 
getTaskByIdDescription copied from interface:TasksManagerBlRetrieve task given its id.- Specified by:
- getTaskByIdin interface- TasksManagerBl
- Parameters:
- perunSession-
- id-
- Returns:
- Task
 
- 
getTaskResultByIdDescription copied from interface:TasksManagerBlRetrieve all task results for given task (by task id)- Specified by:
- getTaskResultByIdin interface- TasksManagerBl
- Parameters:
- sess-
- taskResultId-
- Returns:
- TaskResult
 
- 
getTaskResultsDescription copied from interface:TasksManagerBlRetrieve all task results from DB.- Specified by:
- getTaskResultsin interface- TasksManagerBl
- Parameters:
- sess-
- Returns:
- List of TaskResult
 
- 
getTaskResultsByDestinationspublic List<TaskResult> getTaskResultsByDestinations(PerunSession session, List<String> destinationsNames) Description copied from interface:TasksManagerBlReturns task results for defined destinations (string representation).- Specified by:
- getTaskResultsByDestinationsin interface- TasksManagerBl
- Parameters:
- session-
- destinationsNames-
- Returns:
- list of tasks results
 
- 
getTaskResultsByTaskDescription copied from interface:TasksManagerBlRetrieve all tasks results for given task- Specified by:
- getTaskResultsByTaskin interface- TasksManagerBl
- Parameters:
- sess-
- taskId-
- Returns:
- List of TaskResult
 
- 
getTaskResultsByTaskAndDestinationpublic List<TaskResult> getTaskResultsByTaskAndDestination(PerunSession sess, int taskId, int destinationId) Description copied from interface:TasksManagerBlList newest TaskResults tied to a certain task and destination- Specified by:
- getTaskResultsByTaskAndDestinationin interface- TasksManagerBl
- Parameters:
- taskId-
- Returns:
- List of TaskResult
 
- 
getTaskResultsByTaskOnlyNewestDescription copied from interface:TasksManagerBlList newest TaskResults tied to a certain task- Specified by:
- getTaskResultsByTaskOnlyNewestin interface- TasksManagerBl
- Parameters:
- taskId-
- Returns:
- List of TaskResult
 
- 
getTasksManagerImpl
- 
insertNewTaskResultDescription copied from interface:TasksManagerBlInsert TaskResult into DB.- Specified by:
- insertNewTaskResultin interface- TasksManagerBl
- Parameters:
- sess-
- taskResult-
- Returns:
- int id of the new task result
 
- 
insertTaskDescription copied from interface:TasksManagerBlInsert Task into DB.- Specified by:
- insertTaskin interface- TasksManagerBl
- Parameters:
- sess-
- task-
- Returns:
- int id of the inserted task
 
- 
isSuspendedTasksPropagationpublic boolean isSuspendedTasksPropagation()Description copied from interface:TasksManagerBlCheck if propagating tasks to engine is suspended.- Specified by:
- isSuspendedTasksPropagationin interface- TasksManagerBl
- Returns:
- True if suspended, false if propagating
 
- 
isSuspendedTasksPropagationPersistentlypublic boolean isSuspendedTasksPropagationPersistently()Description copied from interface:TasksManagerBlCheck 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- Specified by:
- isSuspendedTasksPropagationPersistentlyin interface- TasksManagerBl
- Returns:
- True if suspended in DB, false otherwise
 
- 
isThereSuchTaskDescription copied from interface:TasksManagerBlCheck if there is a task for given service and facility.- Specified by:
- isThereSuchTaskin interface- TasksManagerBl
- Parameters:
- sess-
- service-
- facility-
- Returns:
- boolean true if there is a task, false otherwise
 
- 
listAllTasksDescription copied from interface:TasksManagerBlRetrieve all tasks from DB.- Specified by:
- listAllTasksin interface- TasksManagerBl
- Parameters:
- perunSession-
- Returns:
- List of Task
 
- 
listAllTasksForFacilityDescription copied from interface:TasksManagerBlReturns all tasks associated with selected facility.- Specified by:
- listAllTasksForFacilityin interface- TasksManagerBl
- Parameters:
- session-
- facilityId-
- Returns:
- all tasks for facility
 
- 
listAllTasksForServiceDescription copied from interface:TasksManagerBlReturns all tasks associated with given service.- Specified by:
- listAllTasksForServicein interface- TasksManagerBl
- Parameters:
- serviceId-
- Returns:
- tasks for service
 
- 
listAllTasksInStateDescription copied from interface:TasksManagerBlRetrieve all tasks in given state.- Specified by:
- listAllTasksInStatein interface- TasksManagerBl
- Parameters:
- perunSession-
- state-
- Returns:
- List of Task
 
- 
listAllTasksNotInStateDescription copied from interface:TasksManagerBlRetrieve all tasks that are not in given state.- Specified by:
- listAllTasksNotInStatein interface- TasksManagerBl
- Parameters:
- sess-
- state-
- Returns:
- List of Task
 
- 
removeAllTasksForServiceDescription copied from interface:TasksManagerBlRemoves all tasks associated with given service including the associated task results- Specified by:
- removeAllTasksForServicein interface- TasksManagerBl
- Parameters:
- service-
 
- 
removeTaskDescription copied from interface:TasksManagerBlRemove task with given id.- Specified by:
- removeTaskin interface- TasksManagerBl
- Parameters:
- sess-
- id-
 
- 
removeTaskDescription copied from interface:TasksManagerBlRemove task for given service and facility.- Specified by:
- removeTaskin interface- TasksManagerBl
- Parameters:
- sess-
- service-
- facility-
 
- 
setPerunBl
- 
setServicesManagerBl
- 
suspendTasksPropagationpublic void suspendTasksPropagation(PerunSession perunSession, boolean suspend, boolean persistently) Description copied from interface:TasksManagerBlSuspend propagating tasks to engine.- Specified by:
- suspendTasksPropagationin interface- TasksManagerBl
- Parameters:
- perunSession-
- suspend- True for suspending propagation, false for resuming propagation
- persistently- True for the change to persist even after Perun restart
 
- 
updateTaskDescription copied from interface:TasksManagerBlUpdate DB record for given task.- Specified by:
- updateTaskin interface- TasksManagerBl
- Parameters:
- sess-
- task-
 
- 
retrieveRunIdForTaskDescription copied from interface:TasksManagerBlRetrieves a new run id for the task propagation.- Specified by:
- retrieveRunIdForTaskin interface- TasksManagerBl
- Parameters:
- sess- session
- task- task to schedule
- Returns:
- task with updated run id
 
 
-