use of com.evolveum.midpoint.util.exception.SchemaException in project midpoint by Evolveum.
the class PageTaskEdit method refreshTaskModels.
public void refreshTaskModels() {
TaskDto oldTaskDto = taskDtoModel.getObject();
if (oldTaskDto == null) {
LOGGER.warn("Null or empty taskModel");
return;
}
TaskManager taskManager = getTaskManager();
OperationResult result = new OperationResult("refresh");
Task operationTask = taskManager.createTaskInstance("refresh");
try {
LOGGER.debug("Refreshing task {}", oldTaskDto);
TaskType taskType = loadTaskType(oldTaskDto.getOid(), operationTask, result);
TaskDto newTaskDto = prepareTaskDto(taskType, operationTask, result);
final ObjectWrapper<TaskType> newWrapper = loadObjectWrapper(taskType.asPrismObject(), operationTask, result);
previousTaskDto = currentTaskDto;
currentTaskDto = newTaskDto;
taskDtoModel.setObject(newTaskDto);
objectWrapperModel.setObject(newWrapper);
} catch (ObjectNotFoundException | SchemaException | ExpressionEvaluationException | RuntimeException | Error e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't refresh task {}", e, oldTaskDto);
}
}
use of com.evolveum.midpoint.util.exception.SchemaException in project midpoint by Evolveum.
the class PageTasks method deleteTaskConfirmedPerformed.
private void deleteTaskConfirmedPerformed(AjaxRequestTarget target, TaskDto task) {
List<TaskDto> taskDtoList = new ArrayList<>();
if (task != null) {
taskDtoList.add(task);
} else {
taskDtoList.addAll(WebComponentUtil.getSelectedData(getTaskTable()));
}
if (!isSomeTaskSelected(taskDtoList, target)) {
return;
}
OperationResult result = new OperationResult(OPERATION_DELETE_TASKS);
try {
getTaskService().suspendAndDeleteTasks(TaskDto.getOids(taskDtoList), WAIT_FOR_TASK_STOP, true, result);
result.computeStatus();
if (result.isSuccess()) {
result.recordStatus(OperationResultStatus.SUCCESS, "The task(s) have been successfully deleted.");
}
} catch (ObjectNotFoundException | SchemaException | SecurityViolationException | RuntimeException e) {
result.recordFatalError("Couldn't delete the task(s)", e);
}
showResult(result);
TaskDtoProvider provider = (TaskDtoProvider) getTaskTable().getDataTable().getDataProvider();
provider.clearCache();
//refresh feedback and table
refreshTables(target);
}
use of com.evolveum.midpoint.util.exception.SchemaException 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.SchemaException 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.SchemaException 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);
}
Aggregations