private QName getAssociationAttribute() { ResourceObjectAssociationDirectionType direction = resourceObjectAssociationType.getDirection(); if (ResourceObjectAssociationDirectionType.OBJECT_TO_SUBJECT.equals(direction)) { return resourceObjectAssociationType.getAssociationAttribute(); } return resourceObjectAssociationType.getValueAttribute(); }
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); } }
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); } }
throw new SchemaException("No definition for entitlement intent(s) '"+assocDefType.getIntents()+"' in "+resourceType); ResourceObjectAssociationDirectionType direction = assocDefType.getResourceObjectAssociationType().getDirection(); if (direction == ResourceObjectAssociationDirectionType.SUBJECT_TO_OBJECT) { postProcessEntitlementSubjectToEntitlement(resourceType, resourceObject, objectClassDefinition, assocDefType, entitlementDef, attributesContainer, associationContainer, parentResult);
ResourceObjectAssociationDirectionType direction = assocDefType.getResourceObjectAssociationType().getDirection(); if (direction != ResourceObjectAssociationDirectionType.SUBJECT_TO_OBJECT) {
ResourceObjectAssociationDirectionType direction = assocDefType.getResourceObjectAssociationType().getDirection(); if (direction != ResourceObjectAssociationDirectionType.OBJECT_TO_SUBJECT) {
if (assocDefType.getResourceObjectAssociationType().getDirection() != ResourceObjectAssociationDirectionType.OBJECT_TO_SUBJECT) {
if (associationDef.getResourceObjectAssociationType().getDirection() == ResourceObjectAssociationDirectionType.OBJECT_TO_SUBJECT) { QName valueAttributeName = associationDef.getResourceObjectAssociationType().getValueAttribute(); if (repoAttributesContainer.findAttribute(valueAttributeName) == null) {