Search in sources :

Example 1 with AssignedFocusMappingEvaluationRequest

use of com.evolveum.midpoint.model.impl.lens.projector.mappings.AssignedFocusMappingEvaluationRequest in project midpoint by Evolveum.

the class PayloadEvaluation method collectFocusMappings.

private void collectFocusMappings() throws SchemaException {
    MappingsType mappingsBean = segment.assignment.getFocusMappings();
    if (mappingsBean != null) {
        LOGGER.trace("Request evaluation of focus mappings '{}' in {} ({} mappings)", mappingsBean.getDescription(), segment.source, mappingsBean.getMapping().size());
        @NotNull AssignmentPathVariables assignmentPathVariables = LensUtil.computeAssignmentPathVariables(ctx.assignmentPath);
        for (MappingType mappingBean : mappingsBean.getMapping()) {
            PlusMinusZero relativityMode = segment.getRelativeAssignmentRelativityMode();
            /* TODO */
            if (relativityMode != null) {
                AssignedFocusMappingEvaluationRequest request = new AssignedFocusMappingEvaluationRequest(mappingBean, segment.source, ctx.evalAssignment, relativityMode, assignmentPathVariables, segment.sourceDescription);
                ctx.evalAssignment.addFocusMappingEvaluationRequest(request);
            } else {
            // This can occur because overall condition state can be "true,false->false", making relative
            // condition state to be false->false.
            }
        }
    }
}
Also used : AssignedFocusMappingEvaluationRequest(com.evolveum.midpoint.model.impl.lens.projector.mappings.AssignedFocusMappingEvaluationRequest) PlusMinusZero(com.evolveum.midpoint.prism.delta.PlusMinusZero) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with AssignedFocusMappingEvaluationRequest

use of com.evolveum.midpoint.model.impl.lens.projector.mappings.AssignedFocusMappingEvaluationRequest in project midpoint by Evolveum.

the class EvaluatedAssignmentImpl method debugDump.

@Override
public String debugDump(int indent) {
    StringBuilder sb = new StringBuilder();
    DebugUtil.debugDumpLabelLn(sb, "EvaluatedAssignment", indent);
    DebugUtil.debugDumpWithLabelLn(sb, "assignment old", String.valueOf(assignmentIdi.getItemOld()), indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "assignment delta", String.valueOf(assignmentIdi.getDelta()), indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "assignment new", String.valueOf(assignmentIdi.getItemNew()), indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "evaluatedOld", evaluatedOld, indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "target", String.valueOf(target), indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "valid", valid, indent + 1);
    if (forceRecon) {
        sb.append("\n");
        DebugUtil.debugDumpWithLabel(sb, "forceRecon", true, indent + 1);
    }
    sb.append("\n");
    if (constructionTriple.isEmpty()) {
        DebugUtil.debugDumpWithLabel(sb, "Constructions", "(empty)", indent + 1);
    } else {
        DebugUtil.debugDumpWithLabel(sb, "Constructions", constructionTriple, indent + 1);
    }
    if (!personaConstructionTriple.isEmpty()) {
        sb.append("\n");
        DebugUtil.debugDumpWithLabel(sb, "Persona constructions", personaConstructionTriple, indent + 1);
    }
    if (!roles.isEmpty()) {
        sb.append("\n");
        DebugUtil.debugDumpWithLabel(sb, "Roles", roles, indent + 1);
    }
    dumpRefList(indent, sb, "Orgs", orgRefVals);
    dumpRefList(indent, sb, "Membership", membershipRefVals);
    dumpRefList(indent, sb, "Delegation", delegationRefVals);
    if (!authorizations.isEmpty()) {
        sb.append("\n");
        DebugUtil.debugDumpLabel(sb, "Authorizations", indent + 1);
        for (Authorization autz : authorizations) {
            sb.append("\n");
            DebugUtil.indentDebugDump(sb, indent + 2);
            sb.append(autz.toString());
        }
    }
    if (!focusMappingEvaluationRequests.isEmpty()) {
        sb.append("\n");
        DebugUtil.debugDumpLabel(sb, "Focus mappings evaluation requests", indent + 1);
        for (AssignedFocusMappingEvaluationRequest request : focusMappingEvaluationRequests) {
            sb.append("\n");
            DebugUtil.indentDebugDump(sb, indent + 2);
            sb.append(request.shortDump());
        }
    }
    if (!focusMappings.isEmpty()) {
        sb.append("\n");
        DebugUtil.debugDumpLabel(sb, "Focus mappings", indent + 1);
        for (PrismValueDeltaSetTripleProducer<?, ?> mapping : focusMappings) {
            sb.append("\n");
            DebugUtil.indentDebugDump(sb, indent + 2);
            sb.append(mapping.toString());
        }
    }
    if (target != null) {
        sb.append("\n");
        DebugUtil.debugDumpWithLabel(sb, "Target", target.toString(), indent + 1);
    }
    sb.append("\n");
    DebugUtil.debugDumpWithLabelLn(sb, "focusPolicyRules " + ruleCountInfo(focusPolicyRules), focusPolicyRules, indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "thisTargetPolicyRules " + ruleCountInfo(thisTargetPolicyRules), thisTargetPolicyRules, indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "otherTargetsPolicyRules " + ruleCountInfo(otherTargetsPolicyRules), otherTargetsPolicyRules, indent + 1);
    DebugUtil.debugDumpWithLabelLn(sb, "origin", origin.toString(), indent + 1);
    return sb.toString();
}
Also used : Authorization(com.evolveum.midpoint.security.api.Authorization) AssignedFocusMappingEvaluationRequest(com.evolveum.midpoint.model.impl.lens.projector.mappings.AssignedFocusMappingEvaluationRequest)

Aggregations

AssignedFocusMappingEvaluationRequest (com.evolveum.midpoint.model.impl.lens.projector.mappings.AssignedFocusMappingEvaluationRequest)2 PlusMinusZero (com.evolveum.midpoint.prism.delta.PlusMinusZero)1 Authorization (com.evolveum.midpoint.security.api.Authorization)1 NotNull (org.jetbrains.annotations.NotNull)1