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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations