use of com.evolveum.midpoint.schema.GetOperationOptions in project midpoint by Evolveum.
the class GetHelper method processNoFetchGet.
@NotNull
private PrismObject<ShadowType> processNoFetchGet(ProvisioningContext ctx, PrismObject<ShadowType> repositoryShadow, Collection<SelectorOptions<GetOperationOptions>> options, XMLGregorianCalendar now, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, ExpressionEvaluationException {
LOGGER.trace("Processing noFetch get for {}", repositoryShadow);
GetOperationOptions rootOptions = SelectorOptions.findRootOptions(options);
if (!isRaw(rootOptions)) {
// Even with noFetch we still want to delete expired pending operations. And even delete
// the shadow if needed.
repositoryShadow = refreshHelper.refreshShadowQuick(ctx, repositoryShadow, now, task, parentResult);
}
if (repositoryShadow == null) {
ObjectNotFoundException e = new ObjectNotFoundException("Resource object not found");
parentResult.recordFatalError(e);
throw e;
}
// TODO do we really want to do this in raw mode (MID-7419)?
// must be done before futurizeShadow
shadowCaretaker.updateShadowState(ctx, repositoryShadow);
PrismObject<ShadowType> resultShadow = commonHelper.futurizeShadow(ctx, repositoryShadow, null, options, now);
shadowCaretaker.applyAttributesDefinition(ctx, resultShadow);
return resultShadow;
}
use of com.evolveum.midpoint.schema.GetOperationOptions in project midpoint by Evolveum.
the class QShadowMapping method toSchemaObject.
@Override
public ShadowType toSchemaObject(Tuple row, QShadow entityPath, Collection<SelectorOptions<GetOperationOptions>> options) throws SchemaException {
ShadowType shadowType = super.toSchemaObject(row, entityPath, options);
// FIXME: we store it because provisioning now sends it to repo, but it should be transient
shadowType.asPrismObject().removeContainer(ShadowType.F_ASSOCIATION);
GetOperationOptions rootOptions = SelectorOptions.findRootOptions(options);
if (GetOperationOptions.isRaw(rootOptions)) {
// If raw=true, we populate attributes with types cached in repository
Jsonb rowAttributes = row.get(entityPath.attributes);
applyShadowAttributesDefinitions(shadowType, rowAttributes);
}
List<SelectorOptions<GetOperationOptions>> retrieveOptions = SelectorOptions.filterRetrieveOptions(options);
if (retrieveOptions.isEmpty()) {
return shadowType;
}
if (loadIndexOnly(retrieveOptions)) {
addIndexOnlyAttributes(shadowType, row, entityPath, retrieveOptions);
}
return shadowType;
}
Aggregations