use of com.evolveum.midpoint.model.impl.sync.tasks.ResourceObjectClass in project midpoint by Evolveum.
the class ImportFromResourceLauncher method importSingleShadow.
public boolean importSingleShadow(String shadowOid, Task task, OperationResult parentResult) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
OperationResult result = parentResult.createSubresult(OP_IMPORT_SINGLE_SHADOW);
try {
ShadowType shadow = provisioningService.getObject(ShadowType.class, shadowOid, createReadOnlyCollection(), task, result).asObjectable();
ResourceObjectClass spec = syncTaskHelper.createObjectClassForShadow(shadow, task, result);
Synchronizer synchronizer = new Synchronizer(spec.getResource(), spec.getResourceObjectDefinitionRequired(), new NullSynchronizationObjectFilterImpl(), eventDispatcher, SchemaConstants.CHANNEL_IMPORT, false, true);
synchronizer.synchronize(shadow.asPrismObject(), null, task, result);
result.computeStatusIfUnknown();
return !result.isError();
} catch (ActivityRunException t) {
result.recordStatus(t.getOpResultStatus(), t.getMessage(), t);
// FIXME unwrap the exception
throw new SystemException(t);
} catch (Throwable t) {
result.recordFatalError(t);
throw t;
} finally {
// just for sure
result.computeStatusIfUnknown();
}
}
use of com.evolveum.midpoint.model.impl.sync.tasks.ResourceObjectClass in project midpoint by Evolveum.
the class ReconciliationResult method fromActivityRun.
static ReconciliationResult fromActivityRun(@NotNull ReconciliationActivityRun execution, @NotNull ActivityRunResult executionResult) {
ReconciliationResult result = new ReconciliationResult();
result.runResult = executionResult.createTaskRunResult();
ResourceObjectClass resourceObjectClass = findResourceObjectClass(execution);
if (resourceObjectClass != null) {
result.resource = resourceObjectClass.resource.asPrismObject();
result.resourceObjectDefinition = resourceObjectClass.getResourceObjectDefinition();
}
OperationCompletionActivityRun operationCompletionExecution = execution.getOperationCompletionExecution();
if (operationCompletionExecution != null) {
result.unOpsCount = operationCompletionExecution.getUnOpsCount();
}
ResourceObjectsReconciliationActivityRun resourceReconciliationExecution = execution.getResourceReconciliationExecution();
if (resourceReconciliationExecution != null) {
result.resourceReconCount = resourceReconciliationExecution.getResourceReconCount();
result.resourceReconErrors = resourceReconciliationExecution.getResourceReconErrors();
}
RemainingShadowsActivityRun remainingShadowsExecution = execution.getRemainingShadowsExecution();
if (remainingShadowsExecution != null) {
result.shadowReconCount = remainingShadowsExecution.getShadowReconCount();
}
return result;
}
Aggregations