use of com.evolveum.midpoint.schema.result.OperationResultStatus in project midpoint by Evolveum.
the class ManualConnectorInstance method queryOperationStatus.
@Override
public OperationResultStatus queryOperationStatus(String asyncronousOperationReference, OperationResult parentResult) throws ObjectNotFoundException, SchemaException {
OperationResult result = parentResult.createMinorSubresult(OPERATION_QUERY_CASE);
PrismObject<CaseType> acase;
try {
acase = repositoryService.getObject(CaseType.class, asyncronousOperationReference, null, result);
} catch (ObjectNotFoundException | SchemaException e) {
result.recordFatalError(e);
throw e;
}
CaseType caseType = acase.asObjectable();
String state = caseType.getState();
if (QNameUtil.matchWithUri(SchemaConstants.CASE_STATE_OPEN_QNAME, state)) {
result.recordSuccess();
return OperationResultStatus.IN_PROGRESS;
} else if (QNameUtil.matchWithUri(SchemaConstants.CASE_STATE_CLOSED_QNAME, state)) {
String outcome = caseType.getOutcome();
OperationResultStatus status = translateOutcome(outcome);
result.recordSuccess();
return status;
} else {
SchemaException e = new SchemaException("Unknown case state " + state);
result.recordFatalError(e);
throw e;
}
}
use of com.evolveum.midpoint.schema.result.OperationResultStatus in project midpoint by Evolveum.
the class OrgClosureManager method compareOrgClosureTables.
private void compareOrgClosureTables(List existingEntries, List recomputedEntries, boolean rebuild, OperationResult result) {
Set<List> existing = convertEntries(existingEntries);
Set<List> recomputed = convertEntries(recomputedEntries);
if (!existing.equals(recomputed)) {
String addendum;
OperationResultStatus status;
if (rebuild) {
status = OperationResultStatus.HANDLED_ERROR;
addendum = " The table has been recomputed and now it is OK.";
} else {
status = OperationResultStatus.FATAL_ERROR;
addendum = " Please recompute the table as soon as possible.";
}
String m = "Closure table is not consistent with the repository. Expected size: " + recomputed.size() + " actual size: " + existing.size() + "." + addendum;
result.recordStatus(status, m);
LOGGER.info(m);
} else {
String m = "Closure table is OK (" + existing.size() + " entries)";
result.recordStatus(OperationResultStatus.SUCCESS, m);
LOGGER.info(m);
}
}
use of com.evolveum.midpoint.schema.result.OperationResultStatus in project midpoint by Evolveum.
the class ResourceController method getStatusFromResultType.
private static OperationResultStatus getStatusFromResultType(ConnectorTestOperation operation, List<OperationResult> results) {
OperationResultStatus status = OperationResultStatus.UNKNOWN;
OperationResult resultFound = null;
for (OperationResult result : results) {
try {
if (operation.getOperation().equals(result.getOperation())) {
resultFound = result;
break;
}
} catch (IllegalArgumentException ex) {
//result.recordFatalError("Result operation name " + result.getOperation() + " returned from test connection is not type of " + ConnectorTestOperation.class + ".", ex);
}
}
if (resultFound == null) {
return status;
}
switch(resultFound.getStatus()) {
case UNKNOWN:
status = OperationResultStatus.UNKNOWN;
break;
case SUCCESS:
status = OperationResultStatus.SUCCESS;
break;
case WARNING:
status = OperationResultStatus.WARNING;
break;
case FATAL_ERROR:
status = OperationResultStatus.FATAL_ERROR;
break;
case PARTIAL_ERROR:
status = OperationResultStatus.PARTIAL_ERROR;
break;
case HANDLED_ERROR:
status = OperationResultStatus.HANDLED_ERROR;
break;
case IN_PROGRESS:
status = OperationResultStatus.IN_PROGRESS;
break;
default:
status = OperationResultStatus.UNKNOWN;
}
return status;
}
use of com.evolveum.midpoint.schema.result.OperationResultStatus in project midpoint by Evolveum.
the class ResourceState method updateOverallStatus.
private OperationResultStatus updateOverallStatus() {
OperationResultStatus overall = OperationResultStatus.UNKNOWN;
overall = getOverallBasedOnPartialStatus(overall, getConConnection());
overall = getOverallBasedOnPartialStatus(overall, getConfValidation());
overall = getOverallBasedOnPartialStatus(overall, getConInitialization());
overall = getOverallBasedOnPartialStatus(overall, getConSanity());
overall = getOverallBasedOnPartialStatus(overall, getConSchema());
overall = getOverallBasedOnPartialStatus(overall, getExtra());
return overall;
}
use of com.evolveum.midpoint.schema.result.OperationResultStatus in project midpoint by Evolveum.
the class WebComponentUtil method createErrorIcon.
public static String createErrorIcon(OperationResult result) {
OperationResultStatus status = result.getStatus();
OperationResultStatusPresentationProperties icon = OperationResultStatusPresentationProperties.parseOperationalResultStatus(status);
return icon.getIcon() + " fa-lg";
}
Aggregations