Search in sources :

Example 11 with SecurityViolationException

use of com.evolveum.midpoint.util.exception.SecurityViolationException in project midpoint by Evolveum.

the class PageTasks method stopSchedulersAndTasksPerformed.

private void stopSchedulersAndTasksPerformed(AjaxRequestTarget target, List<String> identifiers) {
    OperationResult result = new OperationResult(OPERATION_STOP_SCHEDULERS_AND_TASKS);
    try {
        boolean suspended = getTaskService().stopSchedulersAndTasks(identifiers, WAIT_FOR_TASK_STOP, result);
        result.computeStatus();
        if (result.isSuccess()) {
            if (suspended) {
                result.recordStatus(OperationResultStatus.SUCCESS, "Selected node scheduler(s) have been " + "successfully stopped, including tasks that were running on them.");
            } else {
                result.recordWarning("Selected node scheduler(s) have been successfully paused; however, " + "some of the tasks they were executing are still running on them. Please check " + "their completion using task list.");
            }
        }
    } catch (SecurityViolationException | ObjectNotFoundException | SchemaException | RuntimeException e) {
        result.recordFatalError("Couldn't stop schedulers due", e);
    }
    showResult(result);
    //refresh feedback and table
    refreshTables(target);
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) SecurityViolationException(com.evolveum.midpoint.util.exception.SecurityViolationException) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Example 12 with SecurityViolationException

use of com.evolveum.midpoint.util.exception.SecurityViolationException in project midpoint by Evolveum.

the class PageTasks method reactivateServiceThreadsPerformed.

private void reactivateServiceThreadsPerformed(AjaxRequestTarget target) {
    OperationResult result = new OperationResult(OPERATION_REACTIVATE_SERVICE_THREADS);
    try {
        getTaskService().reactivateServiceThreads(result);
        result.computeStatus();
        if (result.isSuccess()) {
            result.recordStatus(OperationResultStatus.SUCCESS, "Service threads on local node have been successfully reactivated.");
        }
    } catch (RuntimeException | SchemaException | SecurityViolationException e) {
        result.recordFatalError("Couldn't reactivate service threads on local node", e);
    }
    showResult(result);
    //refresh feedback and table
    refreshTables(target);
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) SecurityViolationException(com.evolveum.midpoint.util.exception.SecurityViolationException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Example 13 with SecurityViolationException

use of com.evolveum.midpoint.util.exception.SecurityViolationException in project midpoint by Evolveum.

the class PageTasks method scheduleTasksPerformed.

private void scheduleTasksPerformed(AjaxRequestTarget target, List<String> oids) {
    OperationResult result = new OperationResult(OPERATION_SCHEDULE_TASKS);
    try {
        getTaskService().scheduleTasksNow(oids, result);
        result.computeStatus();
        if (result.isSuccess()) {
            result.recordStatus(OperationResultStatus.SUCCESS, "The task(s) have been successfully scheduled.");
        }
    } catch (ObjectNotFoundException | SchemaException | SecurityViolationException | RuntimeException e) {
        result.recordFatalError("Couldn't schedule the task(s)", e);
    }
    showResult(result);
    //refresh feedback and table
    refreshTables(target);
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) SecurityViolationException(com.evolveum.midpoint.util.exception.SecurityViolationException) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Example 14 with SecurityViolationException

use of com.evolveum.midpoint.util.exception.SecurityViolationException in project midpoint by Evolveum.

the class PageTasks method stopSchedulersPerformed.

private void stopSchedulersPerformed(AjaxRequestTarget target, List<String> identifiers) {
    OperationResult result = new OperationResult(OPERATION_STOP_SCHEDULERS);
    try {
        getTaskService().stopSchedulers(identifiers, result);
        result.computeStatus();
        if (result.isSuccess()) {
            result.recordStatus(OperationResultStatus.SUCCESS, "Selected node scheduler(s) have been successfully stopped.");
        }
    } catch (SecurityViolationException | ObjectNotFoundException | SchemaException | RuntimeException e) {
        result.recordFatalError("Couldn't stop the scheduler(s)", e);
    }
    showResult(result);
    //refresh feedback and table
    refreshTables(target);
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) SecurityViolationException(com.evolveum.midpoint.util.exception.SecurityViolationException) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Example 15 with SecurityViolationException

use of com.evolveum.midpoint.util.exception.SecurityViolationException in project midpoint by Evolveum.

the class PageTasks method synchronizeTasksPerformed.

private void synchronizeTasksPerformed(AjaxRequestTarget target) {
    OperationResult result = new OperationResult(OPERATION_SYNCHRONIZE_TASKS);
    try {
        getTaskService().synchronizeTasks(result);
        result.computeStatus();
        if (result.isSuccess()) {
            // brutal hack - the subresult's message contains statistics
            result.recordStatus(OperationResultStatus.SUCCESS, result.getLastSubresult().getMessage());
        }
    } catch (RuntimeException | SchemaException | SecurityViolationException e) {
        result.recordFatalError("Couldn't synchronize tasks", e);
    }
    showResult(result);
    //refresh feedback and table
    refreshTables(target);
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) SecurityViolationException(com.evolveum.midpoint.util.exception.SecurityViolationException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Aggregations

SecurityViolationException (com.evolveum.midpoint.util.exception.SecurityViolationException)131 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)109 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)93 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)84 CommunicationException (com.evolveum.midpoint.util.exception.CommunicationException)66 ConfigurationException (com.evolveum.midpoint.util.exception.ConfigurationException)64 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)57 Task (com.evolveum.midpoint.task.api.Task)53 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)35 SystemException (com.evolveum.midpoint.util.exception.SystemException)29 PrismObject (com.evolveum.midpoint.prism.PrismObject)24 PolicyViolationException (com.evolveum.midpoint.util.exception.PolicyViolationException)24 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)19 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)17 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)17 ArrayList (java.util.ArrayList)17 GenericFrameworkException (com.evolveum.midpoint.provisioning.ucf.api.GenericFrameworkException)15 QName (javax.xml.namespace.QName)13 Test (org.testng.annotations.Test)12 ResultHandler (com.evolveum.midpoint.schema.ResultHandler)11