use of com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType in project midpoint by Evolveum.
the class ProjectionsLoadOperation method createNewProjectionContext.
private LensProjectionContext createNewProjectionContext(PrismObject<ShadowType> shadowObject, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
ShadowType shadow = shadowObject.asObjectable();
String resourceOid = java.util.Objects.requireNonNull(ShadowUtil.getResourceOid(shadow), () -> "The " + shadow + " has null resource reference OID");
String intent = ShadowUtil.getIntent(shadow);
ShadowKindType kind = ShadowUtil.getKind(shadow);
ResourceType resource = LensUtil.getResourceReadOnly(context, resourceOid, beans.provisioningService, task, result);
String accountIntent = LensUtil.refineProjectionIntent(kind, intent, resource);
ResourceShadowDiscriminator rsd = new ResourceShadowDiscriminator(resourceOid, kind, accountIntent, shadow.getTag(), false);
LensProjectionContext existingProjectionContext = context.findProjectionContext(rsd);
if (existingProjectionContext != null) {
throw new SchemaException("Attempt to add " + shadowObject + " to a focus that already contains projection of type '" + accountIntent + "' on " + resource);
}
LensProjectionContext newProjectionContext = context.createProjectionContext(rsd);
newProjectionContext.setResource(resource);
newProjectionContext.setOid(shadowObject.getOid());
return newProjectionContext;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType in project midpoint by Evolveum.
the class ProjectionsLoadOperation method createResourceShadowDiscriminator.
@NotNull
private ResourceShadowDiscriminator createResourceShadowDiscriminator(@NotNull ShadowType shadow, @NotNull String resourceOid, @NotNull OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
String intent = ShadowUtil.getIntent(shadow);
ShadowKindType kind = ShadowUtil.getKind(shadow);
ResourceType resource = LensUtil.getResourceReadOnly(context, resourceOid, beans.provisioningService, task, result);
intent = LensUtil.refineProjectionIntent(kind, intent, resource);
return new ResourceShadowDiscriminator(resourceOid, kind, intent, shadow.getTag(), ShadowUtil.isGone(shadow));
}
Aggregations