Package com.evolveum.midpoint.model.api
Interface TaskService
public interface TaskService
Interface of the Model subsystem that provides task-specific operations.
- 
Method SummaryModifier and TypeMethodDescriptionbooleandeactivateServiceThreads(long timeToWait, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Deactivates service threads (temporarily).voiddeleteActivityStateAndWorkers(String rootTaskOid, boolean deleteWorkers, long subtasksWaitTime, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) getRunningTasksThreadsDump(@NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult parentResult) booleanReturns true if the service threads are running.getTaskByIdentifier(String identifier, Collection<SelectorOptions<GetOperationOptions>> options, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Returns information about task, given its identifier.getTaskThreadsDump(@NotNull String taskOid, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult parentResult) getThreadsDump(@NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult parentResult) voidreactivateServiceThreads(com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Re-activates the service threads after they have been deactivated.voidreconcileWorkers(String oid, com.evolveum.midpoint.task.api.Task opTask, OperationResult result) recordRunningTasksThreadsDump(String cause, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult parentResult) voidresumeTask(String taskOid, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) voidresumeTasks(Collection<String> taskOids, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Resume suspended tasks.voidresumeTaskTree(String coordinatorOid, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) voidscheduleTaskNow(String taskOid, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) voidscheduleTasksNow(Collection<String> taskOids, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Schedules a RUNNABLE/CLOSED tasks to be run immediately.voidstartSchedulers(Collection<String> nodeIdentifiers, com.evolveum.midpoint.task.api.Task operationTask, OperationResult result) Starts the scheduler on a given nodes.voidstopSchedulers(Collection<String> nodeIdentifiers, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Stops the schedulers on a given nodes.booleanstopSchedulersAndTasks(Collection<String> nodeIdentifiers, long waitTime, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Stops a set of schedulers (on their nodes) and tasks that are executing on these nodes.voidsuspendAndDeleteTask(String taskOid, long waitForStop, boolean alsoSubtasks, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) voidsuspendAndDeleteTasks(Collection<String> taskOids, long waitForStop, boolean alsoSubtasks, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Suspends tasks and deletes them.booleansuspendTask(String taskOid, long waitForStop, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) booleansuspendTasks(Collection<String> taskOids, long waitForStop, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Suspends a set of tasks.booleansuspendTaskTree(String taskOid, long waitForStop, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) voidsynchronizeTasks(com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) Synchronizes information in midPoint repository and task scheduling database.
- 
Method Details- 
suspendTasksboolean suspendTasks(Collection<String> taskOids, long waitForStop, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException Suspends a set of tasks. Sets their execution status to SUSPENDED. Stops their execution (unless doNotStop is set).- Parameters:
- taskOids- a collection of OIDs of tasks that have to be suspended
- waitForStop- how long (in milliseconds) to wait for stopping the execution of tasks;- TaskManager.WAIT_INDEFINITELYmeans wait indefinitely,- TaskManager.DO_NOT_WAITmeans stop the tasks, but do not wait for finishing their execution,- TaskManager.DO_NOT_STOPmeans do not try to stop the task execution. Tasks will only be put into SUSPENDED state, and their executions (if any) will be left as they are. Use this option only when you know what you're doing.
- operationTask- Task in which the operation is executed. NOT the task that be being operated on.
- Returns:
- true if all the tasks were stopped, false if some tasks continue to run or if stopping was not requested (DO_NOT_STOP option)
- Throws:
- SecurityViolationException
- ObjectNotFoundException
- SchemaException
- ExpressionEvaluationException
- CommunicationException
- ConfigurationException
 
- 
suspendTaskboolean suspendTask(String taskOid, long waitForStop, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException 
- 
suspendTaskTreeboolean suspendTaskTree(String taskOid, long waitForStop, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException 
- 
suspendAndDeleteTasksvoid suspendAndDeleteTasks(Collection<String> taskOids, long waitForStop, boolean alsoSubtasks, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException Suspends tasks and deletes them.- Parameters:
- taskOids- Collection of task OIDs to be suspended and deleted.
- waitForStop- How long (in milliseconds) to wait for task stop before proceeding with deletion.- TaskManager.WAIT_INDEFINITELYmeans wait indefinitely,- TaskManager.DO_NOT_WAITmeans stop the tasks, but do not wait for finishing their execution,- TaskManager.DO_NOT_STOPmeans do not try to stop the task execution. Tasks will only be put into SUSPENDED state, and their executions (if any) will be left as they are. Use this option only when you know what you're doing.
- alsoSubtasks- Should also subtasks be deleted?
- Throws:
- SecurityViolationException
- ObjectNotFoundException
- SchemaException
- ExpressionEvaluationException
- CommunicationException
- ConfigurationException
 
- 
suspendAndDeleteTaskvoid suspendAndDeleteTask(String taskOid, long waitForStop, boolean alsoSubtasks, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException 
- 
resumeTasksvoid resumeTasks(Collection<String> taskOids, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException Resume suspended tasks.- Parameters:
- taskOids- a collection of OIDs of tasks that have to be resumed
- Throws:
- SecurityViolationException
- ObjectNotFoundException
- SchemaException
- ExpressionEvaluationException
- CommunicationException
- ConfigurationException
 
- 
resumeTaskvoid resumeTask(String taskOid, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException 
- 
resumeTaskTreevoid resumeTaskTree(String coordinatorOid, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException 
- 
scheduleTasksNowvoid scheduleTasksNow(Collection<String> taskOids, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException Schedules a RUNNABLE/CLOSED tasks to be run immediately. (If a task will really start immediately, depends e.g. on whether a scheduler is started, whether there are available threads, and so on.)- Parameters:
- taskOids- a collection of OIDs of tasks that have to be scheduled
- Throws:
- SecurityViolationException
- ObjectNotFoundException
- SchemaException
- ExpressionEvaluationException
- CommunicationException
- ConfigurationException
 
- 
scheduleTaskNowvoid scheduleTaskNow(String taskOid, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException 
- 
getTaskByIdentifierPrismObject<TaskType> getTaskByIdentifier(String identifier, Collection<SelectorOptions<GetOperationOptions>> options, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException, CommunicationException Returns information about task, given its identifier.
- 
deactivateServiceThreadsboolean deactivateServiceThreads(long timeToWait, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException Deactivates service threads (temporarily). This will suspend all background activity such as scanning threads, heartbeats and similar mechanisms. Note: The threads are normally activated after task manager implementation starts. This methods should not be used in a normal case. WARNING: this feature is intended for development-time diagnostics and should not be used on production environments. Suspending the threads may affect correct behavior of the system (such as timeouts on heartbeats). Use this feature only if you really know what you are doing. timeToWait is only for orientation = it may be so that the implementation would wait 2 or 3 times this value (if it waits separately for several threads completion)
- 
reactivateServiceThreadsvoid reactivateServiceThreads(com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException Re-activates the service threads after they have been deactivated.
- 
getServiceThreadsActivationStateboolean getServiceThreadsActivationState()Returns true if the service threads are running. This method returns true in a normal case. It returns false is the threads were temporarily suspended.- Returns:
- true if the service threads are running.
 
- 
stopSchedulersvoid stopSchedulers(Collection<String> nodeIdentifiers, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException Stops the schedulers on a given nodes. This means that at that nodes no tasks will be started.- Parameters:
- nodeIdentifiers- Nodes on which the schedulers should be stopped.
- Throws:
- SecurityViolationException
- ObjectNotFoundException
- SchemaException
- ExpressionEvaluationException
- CommunicationException
- ConfigurationException
 
- 
stopSchedulersAndTasksboolean stopSchedulersAndTasks(Collection<String> nodeIdentifiers, long waitTime, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException Stops a set of schedulers (on their nodes) and tasks that are executing on these nodes.- Parameters:
- nodeIdentifiers- collection of node identifiers
- waitTime- how long to wait for task shutdown, in milliseconds;- TaskManager.WAIT_INDEFINITELYmeans wait indefinitely,- TaskManager.DO_NOT_WAITmeans stop the tasks, but do not wait for finishing their execution.
- Throws:
- SecurityViolationException
- ObjectNotFoundException
- SchemaException
- ExpressionEvaluationException
- CommunicationException
- ConfigurationException
 
- 
startSchedulersvoid startSchedulers(Collection<String> nodeIdentifiers, com.evolveum.midpoint.task.api.Task operationTask, OperationResult result) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException Starts the scheduler on a given nodes. A prerequisite is that nodes are running and their TaskManagers are not in an error state.- Parameters:
- nodeIdentifiers- Nodes on which the scheduler should be started.
- Throws:
- SecurityViolationException
- ObjectNotFoundException
- SchemaException
- ExpressionEvaluationException
- CommunicationException
- ConfigurationException
 
- 
synchronizeTasksvoid synchronizeTasks(com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException Synchronizes information in midPoint repository and task scheduling database. Not needed to use during normal operation (only when problems occur).
- 
reconcileWorkersvoid reconcileWorkers(String oid, com.evolveum.midpoint.task.api.Task opTask, OperationResult result) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException 
- 
deleteActivityStateAndWorkersvoid deleteActivityStateAndWorkers(String rootTaskOid, boolean deleteWorkers, long subtasksWaitTime, com.evolveum.midpoint.task.api.Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException 
- 
getThreadsDumpString getThreadsDump(@NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException 
- 
getRunningTasksThreadsDumpString getRunningTasksThreadsDump(@NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException 
- 
recordRunningTasksThreadsDumpString recordRunningTasksThreadsDump(String cause, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException 
- 
getTaskThreadsDumpString getTaskThreadsDump(@NotNull @NotNull String taskOid, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException 
 
-