use of com.evolveum.midpoint.util.exception.SecurityViolationException in project midpoint by Evolveum.
the class PageTasks method startSchedulersPerformed.
private void startSchedulersPerformed(AjaxRequestTarget target, List<String> identifiers) {
OperationResult result = new OperationResult(OPERATION_START_SCHEDULERS);
try {
getTaskService().startSchedulers(identifiers, result);
result.computeStatus();
if (result.isSuccess()) {
result.recordStatus(OperationResultStatus.SUCCESS, "Selected node scheduler(s) have been successfully started.");
}
} catch (SecurityViolationException | ObjectNotFoundException | SchemaException | RuntimeException e) {
result.recordFatalError("Couldn't start 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 synchronizeWorkflowRequestsPerformed.
private void synchronizeWorkflowRequestsPerformed(AjaxRequestTarget target) {
OperationResult result = new OperationResult(OPERATION_SYNCHRONIZE_WORKFLOW_REQUESTS);
try {
getTaskService().synchronizeWorkflowRequests(result);
result.computeStatusIfUnknown();
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);
}
use of com.evolveum.midpoint.util.exception.SecurityViolationException in project midpoint by Evolveum.
the class PageTasks method suspendTasksPerformed.
private void suspendTasksPerformed(AjaxRequestTarget target, List<String> oidList) {
OperationResult result = new OperationResult(OPERATION_SUSPEND_TASKS);
try {
boolean suspended = getTaskService().suspendTasks(oidList, WAIT_FOR_TASK_STOP, result);
result.computeStatus();
if (result.isSuccess()) {
if (suspended) {
result.recordStatus(OperationResultStatus.SUCCESS, "The task(s) have been successfully suspended.");
} else {
result.recordWarning("Task(s) suspension has been successfully requested; please check for its completion using task list.");
}
}
} catch (ObjectNotFoundException | SchemaException | SecurityViolationException | RuntimeException e) {
result.recordFatalError("Couldn't suspend 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 deactivateServiceThreadsPerformed.
//endregion
//region Diagnostics actions
private void deactivateServiceThreadsPerformed(AjaxRequestTarget target) {
OperationResult result = new OperationResult(OPERATION_DEACTIVATE_SERVICE_THREADS);
try {
boolean stopped = getTaskService().deactivateServiceThreads(WAIT_FOR_TASK_STOP, result);
result.computeStatus();
if (result.isSuccess()) {
if (stopped) {
result.recordStatus(OperationResultStatus.SUCCESS, "Service threads on local node have been successfully deactivated.");
} else {
result.recordWarning("Deactivation of service threads on local node have been successfully requested; however, some of the tasks are still running. Please check their completion using task list.");
}
}
} catch (RuntimeException | SchemaException | SecurityViolationException e) {
result.recordFatalError("Couldn't deactivate service threads on this 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 ResourceContentPanel method updateResourceObjectStatusPerformed.
protected void updateResourceObjectStatusPerformed(ShadowType selected, AjaxRequestTarget target, boolean enabled) {
List<ShadowType> selectedShadow = getSelectedShadowsList(selected);
OperationResult result = new OperationResult(OPERATION_UPDATE_STATUS);
Task task = pageBase.createSimpleTask(OPERATION_UPDATE_STATUS);
if (selectedShadow == null || selectedShadow.isEmpty()) {
result.recordWarning("Nothing selected to update status");
getPageBase().showResult(result);
target.add(getPageBase().getFeedbackPanel());
return;
}
ModelExecuteOptions opts = createModelOptions();
for (ShadowType shadow : selectedShadow) {
ActivationStatusType status = enabled ? ActivationStatusType.ENABLED : ActivationStatusType.DISABLED;
try {
ObjectDelta<ShadowType> deleteDelta = ObjectDelta.createModificationReplaceProperty(ShadowType.class, shadow.getOid(), SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, getPageBase().getPrismContext(), status);
getPageBase().getModelService().executeChanges(WebComponentUtil.createDeltaCollection(deleteDelta), opts, task, result);
} catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException | ExpressionEvaluationException | CommunicationException | ConfigurationException | PolicyViolationException | SecurityViolationException e) {
// TODO Auto-generated catch block
result.recordPartialError("Could not update status (to " + status + ") for " + shadow, e);
LOGGER.error("Could not update status (to {}) for {}, using option {}", status, shadow, opts, e);
continue;
}
}
result.computeStatusIfUnknown();
getPageBase().showResult(result);
getTable().refreshTable(null, target);
target.add(getPageBase().getFeedbackPanel());
}
Aggregations