use of com.evolveum.midpoint.model.impl.sync.tasks.Synchronizer 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();
}
}
Aggregations