private QName getAssociationAttribute() { ResourceObjectAssociationDirectionType direction = resourceObjectAssociationType.getDirection(); if (ResourceObjectAssociationDirectionType.OBJECT_TO_SUBJECT.equals(direction)) { return resourceObjectAssociationType.getAssociationAttribute(); } return resourceObjectAssociationType.getValueAttribute(); }
private <S extends ShadowType,T> void postProcessEntitlementSubjectToEntitlement(ResourceType resourceType, PrismObject<S> resourceObject, RefinedObjectClassDefinition objectClassDefinition, RefinedAssociationDefinition assocDefType, RefinedObjectClassDefinition entitlementDef, ResourceAttributeContainer attributesContainer, PrismContainer<ShadowAssociationType> associationContainer, OperationResult parentResult) throws SchemaException { QName assocAttrName = assocDefType.getResourceObjectAssociationType().getAssociationAttribute(); QName valueAttrName = assocDefType.getResourceObjectAssociationType().getValueAttribute(); postProcessEntitlementSubjectToEntitlement(resourceType, resourceObject, objectClassDefinition, assocDefType, entitlementDef, attributesContainer, associationContainer, assocAttrName, valueAttrName, parentResult); }
public static boolean shouldStoreAtributeInShadow(RefinedObjectClassDefinition objectClassDefinition, QName attributeName, CachingStategyType cachingStrategy) throws ConfigurationException { if (cachingStrategy == null || cachingStrategy == CachingStategyType.NONE) { if (objectClassDefinition.isPrimaryIdentifier(attributeName) || objectClassDefinition.isSecondaryIdentifier(attributeName)) { return true; } for (RefinedAssociationDefinition associationDef: objectClassDefinition.getAssociationDefinitions()) { if (associationDef.getResourceObjectAssociationType().getDirection() == ResourceObjectAssociationDirectionType.OBJECT_TO_SUBJECT) { QName valueAttributeName = associationDef.getResourceObjectAssociationType().getValueAttribute(); if (QNameUtil.match(attributeName, valueAttributeName)) { return true; } } } return false; } else if (cachingStrategy == CachingStategyType.PASSIVE) { RefinedAttributeDefinition<Object> attrDef = objectClassDefinition.findAttributeDefinition(attributeName); return attrDef != null; } else { throw new ConfigurationException("Unknown caching strategy "+cachingStrategy); } }
continue; QName valueAttributeName = associationDefinition.getResourceObjectAssociationType().getValueAttribute(); if (!ShadowUtil.matchesAttribute(subjectItemPath, valueAttributeName)) { continue;
private void checkSchemaHandlingAssociation(ResourceValidationContext ctx, ObjectClassComplexTypeDefinition ocdef, ItemPath path, ResourceObjectTypeDefinitionType objectType, ResourceObjectAssociationType associationDef) { checkSchemaHandlingItem(ctx, path, objectType, associationDef); checkItemRef(ctx, path, objectType, associationDef, C_NO_ASSOCIATION_NAME); checkNotEmpty(ctx, path, objectType, associationDef, associationDef.getKind(), ResourceObjectAssociationType.F_KIND, C_MISSING_ASSOCIATION_TARGET_KIND); checkNotEmpty(ctx, path, objectType, associationDef, associationDef.getIntent(), ResourceObjectAssociationType.F_INTENT, C_MISSING_ASSOCIATION_TARGET_INTENT); checkNotEmpty(ctx, path, objectType, associationDef, associationDef.getDirection(), ResourceObjectAssociationType.F_DIRECTION, C_MISSING_ASSOCIATION_DIRECTION); checkNotEmpty(ctx, path, objectType, associationDef, associationDef.getAssociationAttribute(), ResourceObjectAssociationType.F_ASSOCIATION_ATTRIBUTE, C_MISSING_ASSOCIATION_ASSOCIATION_ATTRIBUTE); checkNotEmpty(ctx, path, objectType, associationDef, associationDef.getValueAttribute(), ResourceObjectAssociationType.F_VALUE_ATTRIBUTE, C_MISSING_ASSOCIATION_VALUE_ATTRIBUTE); // TODO checking matching rule for associations? QName ref = itemRefToName(associationDef.getRef()); if (ocdef != null) { if (ref != null) { if (ocdef.findAttributeDefinition(ref, ResourceTypeUtil.isCaseIgnoreAttributeNames(ctx.resourceObject.asObjectable())) != null) { ctx.validationResult.add(Issue.Severity.ERROR, CAT_SCHEMA_HANDLING, C_COLLIDING_ASSOCIATION_NAME, getString(CLASS_DOT + C_COLLIDING_ASSOCIATION_NAME, getName(objectType), prettyPrintUsingStandardPrefix(ref)), ctx.resourceRef, path.append(ResourceItemDefinitionType.F_REF)); } } } for (String intent : associationDef.getIntent()) { checkAssociationTargetIntent(ctx, path, objectType, associationDef, ref, intent); } }
QName valueAttrName = assocDefType.getResourceObjectAssociationType().getValueAttribute(); if (valueAttrName == null) { throw new SchemaException("No value attribute defined in entitlement association '"+associationName+"' in "+resourceType);
QName valueAttrName = assocDefType.getResourceObjectAssociationType().getValueAttribute(); if (valueAttrName == null) { throw new SchemaException("No value attribute defined in entitlement association '"+associationName+"' in "+ctx.getResource());
QName valueAttrName = assocDefType.getResourceObjectAssociationType().getValueAttribute(); if (valueAttrName == null) { throw new SchemaException("No value attribute defined in entitlement association in "+resource);
QName valueAttrName = assocDefType.getResourceObjectAssociationType().getValueAttribute(); if (valueAttrName == null) { throw new SchemaException("No value attribute defined in entitlement association '"+associationName+"' in "+subjectCtx.getResource());
for (RefinedAssociationDefinition associationDef: objectClassDefinition.getAssociationDefinitions()) { if (associationDef.getResourceObjectAssociationType().getDirection() == ResourceObjectAssociationDirectionType.OBJECT_TO_SUBJECT) { QName valueAttributeName = associationDef.getResourceObjectAssociationType().getValueAttribute(); if (repoAttributesContainer.findAttribute(valueAttributeName) == null) { ResourceAttribute<Object> valueAttribute = attributesContainer.findAttribute(valueAttributeName);