Search in sources :

Example 41 with ShadowKindType

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;
}
Also used : ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) LensProjectionContext(com.evolveum.midpoint.model.impl.lens.LensProjectionContext) ShadowKindType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ResourceShadowDiscriminator(com.evolveum.midpoint.schema.ResourceShadowDiscriminator)

Example 42 with ShadowKindType

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));
}
Also used : ShadowKindType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ResourceShadowDiscriminator(com.evolveum.midpoint.schema.ResourceShadowDiscriminator) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ShadowKindType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType)33 QName (javax.xml.namespace.QName)15 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)13 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)13 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)12 PrismObject (com.evolveum.midpoint.prism.PrismObject)8 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)8 ArrayList (java.util.ArrayList)7 ShadowAssociationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowAssociationType)6 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)5 List (java.util.List)5 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 RefinedResourceSchema (com.evolveum.midpoint.common.refinery.RefinedResourceSchema)4 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)4 ResourceObjectTypeDefinition (com.evolveum.midpoint.schema.processor.ResourceObjectTypeDefinition)4 NotNull (org.jetbrains.annotations.NotNull)4 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)3 ResourceShadowDiscriminator (com.evolveum.midpoint.schema.ResourceShadowDiscriminator)3 ResourceAttributeContainer (com.evolveum.midpoint.schema.processor.ResourceAttributeContainer)3 ResourceSchema (com.evolveum.midpoint.schema.processor.ResourceSchema)3