public AssignmentHolderType assignment(AssignmentType value) { getAssignment().add(value); return this; }
public List<ObjectReferenceType> createArchetypeRefList() { PrismForJAXBUtil.createReference(asPrismContainerValue(), F_ARCHETYPE_REF); return getArchetypeRef(); }
public List<ObjectReferenceType> createDelegatedRefList() { PrismForJAXBUtil.createReference(asPrismContainerValue(), F_DELEGATED_REF); return getDelegatedRef(); }
public List<AssignmentType> createAssignmentList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_ASSIGNMENT); return getAssignment(); }
static <T extends ObjectType> void copyAssignmentHolderInformationFromJAXB(AssignmentHolderType jaxb, RObject<T> repo, RepositoryContext repositoryContext, IdGeneratorResult generatorResult) throws DtoTranslationException { copyObjectInformationFromJAXB(jaxb, repo, repositoryContext, generatorResult); repo.getRoleMembershipRef().addAll( RUtil.safeListReferenceToSet(jaxb.getRoleMembershipRef(), repo, RReferenceOwner.ROLE_MEMBER, repositoryContext.relationRegistry)); repo.getDelegatedRef().addAll( RUtil.safeListReferenceToSet(jaxb.getDelegatedRef(), repo, RReferenceOwner.DELEGATED, repositoryContext.relationRegistry)); repo.getArchetypeRef().addAll( RUtil.safeListReferenceToSet(jaxb.getArchetypeRef(), repo, RReferenceOwner.ARCHETYPE, repositoryContext.relationRegistry)); for (AssignmentType assignment : jaxb.getAssignment()) { RAssignment rAssignment = new RAssignment(repo, RAssignmentOwner.FOCUS); RAssignment.fromJaxb(assignment, rAssignment, jaxb, repositoryContext, generatorResult); repo.getAssignments().add(rAssignment); } }
LifecycleStateModelType targetStateModel = ModelUtils.determineLifecycleModel(targetType.asPrismObject(), systemConfiguration); boolean isTargetValid = LensUtil.isFocusValid(targetType, now, activationComputer, targetStateModel); if (!isTargetValid) { targetType.asPrismObject(), for (AssignmentType roleAssignment : targetType.getAssignment()) { evaluateAssignment(segment, relativeMode, isValid, ctx, targetType, relation, roleAssignment); Authorization authorization = createAuthorization(authorizationType, targetType.toString()); if (!ctx.evalAssignment.getAuthorizations().contains(authorization)) { ctx.evalAssignment.addAuthorization(authorization);
public AssignmentHolderType archetypeRef(ObjectReferenceType value) { getArchetypeRef().add(value); return this; }
public <AH extends AssignmentHolderType> void applyObjectState(LensContext<AH> context, List<EvaluatedPolicyRule> rulesToRecord) throws SchemaException { // compute policySituation and triggeredPolicyRules and compare it with the expected state // note that we use the new state for the comparison, because if values match we do not need to do anything LensFocusContext<AH> focusContext = context.getFocusContext(); if (focusContext.isDelete()) { return; } AH objectNew = focusContext.getObjectNew().asObjectable(); ComputationResult cr = compute(rulesToRecord, objectNew.getPolicySituation(), objectNew.getTriggeredPolicyRule()); if (cr.situationsNeedUpdate) { focusContext.addToPendingObjectPolicyStateModifications(prismContext.deltaFor(ObjectType.class) .item(ObjectType.F_POLICY_SITUATION) .oldRealValues(cr.oldPolicySituations) .replaceRealValues(cr.newPolicySituations) .asItemDelta()); } if (cr.rulesNeedUpdate) { focusContext.addToPendingObjectPolicyStateModifications(prismContext.deltaFor(ObjectType.class) .item(ObjectType.F_TRIGGERED_POLICY_RULE) .oldRealValues(cr.oldTriggeredRules) .replaceRealValues(cr.newTriggeredRules) .asItemDelta()); } }
public List<ObjectReferenceType> createRoleMembershipRefList() { PrismForJAXBUtil.createReference(asPrismContainerValue(), F_ROLE_MEMBERSHIP_REF); return getRoleMembershipRef(); }
Integer focusIteration = focusCurrent.asObjectable().getIteration(); if (focusIteration != null) { iteration = focusIteration; iterationToken = focusCurrent.asObjectable().getIterationToken(); PolyStringType objectName = previewObjectNew.asObjectable().getName(); if (objectName == null || objectName.getOrig().isEmpty()) { throw new NoFocusNameSchemaException("No name in new object "+objectName+" as produced by template "+objectTemplate+
private void collectMembership(AssignmentHolderType targetType, QName relation, EvaluationContext ctx) { PrismReferenceValue refVal = prismContext.itemFactory().createReferenceValue(); refVal.setObject(targetType.asPrismObject()); refVal.setTargetType(ObjectTypes.getObjectType(targetType.getClass()).getTypeQName()); refVal.setRelation(relation); refVal.setTargetName(targetType.getName().toPolyString()); collectMembershipRefVal(refVal, targetType.getClass(), relation, targetType, ctx); }
public static <F extends AssignmentHolderType> void recordRoleEvaluationSkip(F target, boolean fullEvaluation) { long count = recordCountInternal(InternalCounters.ROLE_EVALUATION_SKIP_COUNT); if (isTrace(InternalCounters.ROLE_EVALUATION_SKIP_COUNT)) { traceOperation("roleEvaluationSkip", () -> target.toString() , count, true); } }
public AssignmentHolderType trigger(TriggerType value) { getTrigger().add(value); return this; }
public void check(PrismObject<AH> objectNew, OperationResult result) throws SchemaException { if (objectNew == null) { // This must be delete LOGGER.trace("No new object. Therefore it satisfies constraints"); satisfiesConstraints = true; return; } // Hardcode to name ... for now PolyStringType name = objectNew.asObjectable().getName(); if (Cache.isOk(name)) { satisfiesConstraints = true; } else { satisfiesConstraints = checkPropertyUniqueness(objectNew, ObjectType.F_NAME, context, result); if (satisfiesConstraints) { Cache.setOk(name); } } }
public AssignmentHolderType policySituation(String value) { getPolicySituation().add(value); return this; }
public AssignmentHolderType delegatedRef(ObjectReferenceType value) { getDelegatedRef().add(value); return this; }
public AssignmentHolderType roleMembershipRef(ObjectReferenceType value) { getRoleMembershipRef().add(value); return this; }
public AssignmentHolderType triggeredPolicyRule(EvaluatedPolicyRuleType value) { getTriggeredPolicyRule().add(value); return this; }
private void collectTenantRef(AssignmentHolderType targetType, AssignmentEvaluator<AH>.EvaluationContext ctx) { if (targetType instanceof OrgType) { if (BooleanUtils.isTrue(((OrgType)targetType).isTenant()) && ctx.evalAssignment.getTenantOid() == null) { if (ctx.assignmentPath.hasOnlyOrgs()) { ctx.evalAssignment.setTenantOid(targetType.getOid()); } } } }