Set<Attribute> convertFromResourceObjectToConnIdAttributes(ResourceAttributeContainer attributesPrism, ObjectClassComplexTypeDefinition ocDef) throws SchemaException { Collection<ResourceAttribute<?>> resourceAttributes = attributesPrism.getAttributes(); return convertFromResourceObjectToConnIdAttributes(resourceAttributes, ocDef); }
public static Collection<ResourceAttribute<?>> getAttributes(PrismObject<? extends ShadowType> shadow) { return getAttributesContainer(shadow).getAttributes(); }
public static void validateAttributeSchema(PrismObject<ShadowType> shadow, ObjectClassComplexTypeDefinition objectClassDefinition) throws SchemaException { ResourceAttributeContainer attributesContainer = getAttributesContainer(shadow); for (ResourceAttribute<?> attribute: attributesContainer.getAttributes()) { validateAttribute(attribute, objectClassDefinition); } }
@Override protected void checkConsistence(PrismObject<ShadowType> object, String elementDesc, String contextDesc) { super.checkConsistence(object, elementDesc, contextDesc); ResourceAttributeContainer attributesContainer = ShadowUtil.getAttributesContainer(object); if (attributesContainer != null) { ResourceType resource = getResource(); if (resource != null) { String resourceNamespace = ResourceTypeUtil.getResourceNamespace(resource); for(ResourceAttribute<?> attribute: attributesContainer.getAttributes()) { QName attrName = attribute.getElementName(); if (SchemaConstants.NS_ICF_SCHEMA.equals(attrName.getNamespaceURI())) { continue; } if (resourceNamespace.equals(attrName.getNamespaceURI())) { continue; } String desc = elementDesc+" in "+this + (contextDesc == null ? "" : " in " +contextDesc); throw new IllegalStateException("Invalid namespace for attribute "+attrName+" in "+desc); } } } }
public boolean matches(PrismObject<ShadowType> shadowToMatch, MatchingRuleRegistry matchingRuleRegistry, RelationRegistry relationRegistry) throws SchemaException { if (objectFilter != null) { ObjectTypeUtil.normalizeFilter(objectFilter, relationRegistry); // we suppose references in shadowToMatch are normalized (on return from repo) return ObjectQuery.match(shadowToMatch, objectFilter, matchingRuleRegistry); } else { // Deprecated method ResourceAttributeContainer attributesContainer = ShadowUtil.getAttributesContainer(shadowToMatch); if (attributesContainer == null) { return false; } Collection<ResourceAttribute<?>> attributesToMatch = attributesContainer.getAttributes(); for (ResourceAttribute<?> identifier: identifiers) { if (!matches(identifier, attributesToMatch, matchingRuleRegistry)) { return false; } } return true; } }
outstandingInRepo = new ArrayList<>(); for (ResourceAttribute<?> attribute : attributes.getAttributes()) { QName attributeName = attribute.getElementName(); boolean isIdentifier = QNameUtil.matchAny(attributeName, identifiers);
protected void assertSyncOldShadow(PrismObject<? extends ShadowType> oldShadow, String repoName, Integer expectedNumberOfAttributes) { assertNotNull("Old shadow missing", oldShadow); assertNotNull("Old shadow does not have an OID", oldShadow.getOid()); PrismAsserts.assertClass("old shadow", ShadowType.class, oldShadow); ShadowType oldShadowType = oldShadow.asObjectable(); ResourceAttributeContainer attributesContainer = ShadowUtil .getAttributesContainer(oldShadowType); assertNotNull("No attributes container in old shadow", attributesContainer); Collection<ResourceAttribute<?>> attributes = attributesContainer.getAttributes(); assertFalse("Attributes container is empty", attributes.isEmpty()); if (expectedNumberOfAttributes != null) { assertEquals("Unexpected number of attributes", (int)expectedNumberOfAttributes, attributes.size()); } ResourceAttribute<?> icfsNameAttribute = attributesContainer.findAttribute(SchemaConstants.ICFS_NAME); assertNotNull("No ICF name attribute in old shadow", icfsNameAttribute); assertEquals("Wrong value of ICF name attribute in old shadow", repoName, icfsNameAttribute.getRealValue()); }
for (ResourceAttribute<?> attribute: attributeContainer.getAttributes()) { QName attrName = attribute.getElementName(); RefinedAttributeDefinition attrDef = objectClassDefinition.findAttributeDefinition(attrName);
return AsynchronousOperationReturnValue.wrap(attributesContainer.getAttributes(), result);
ResourceAttributeContainer attributesContainer = ShadowUtil.getAttributesContainer(accountToAdd); if (attributesContainer != null) { for (ResourceAttribute<?> attribute: attributesContainer.getAttributes()) { RefinedAttributeDefinition rAttrDef = rAccountDef.findAttributeDefinition(attribute.getElementName()); if (!rAttrDef.isTolerant()) {
ResourceAttributeContainer attributeCont = ShadowUtil.getAttributesContainer(shadow); for (ResourceAttribute<?> attribute: attributeCont.getAttributes()) { RefinedAttributeDefinition attrDef = ctx.getObjectClassDefinition().findAttributeDefinition(attribute.getElementName());
.getAttributesContainer(currentShadow); assertNotNull("No attributes container in current shadow", attributesContainer); Collection<ResourceAttribute<?>> attributes = attributesContainer.getAttributes(); assertFalse("Attributes container is empty", attributes.isEmpty()); assertAttribute(currentShadow,
.getAttributesContainer(currentShadow); assertNotNull("No attributes container in current shadow", attributesContainer); Collection<ResourceAttribute<?>> attributes = attributesContainer.getAttributes(); assertFalse("Attributes container is empty", attributes.isEmpty()); assertAttribute(currentShadow,
Collection<ResourceAttribute<?>> entitlementIdentifiersFromAssociation = identifiersContainer.getAttributes();
.getAttributesContainer(currentShadow); assertNotNull("No attributes container in current shadow", attributesContainer); Collection<ResourceAttribute<?>> attributes = attributesContainer.getAttributes(); assertFalse("Attributes container is empty", attributes.isEmpty()); assertAttribute(currentShadow,
.getAttributesContainer(associationCVal, ShadowAssociationType.F_IDENTIFIERS); Collection<ResourceAttribute<?>> entitlementIdentifiers = identifierContainer .getAttributes(); if (entitlementIdentifiers == null || entitlementIdentifiers.isEmpty()) { throw new IllegalStateException(
.getAttributesContainer(currentShadowType); assertNotNull("No attributes container in current shadow", attributesContainer); Collection<ResourceAttribute<?>> attributes = attributesContainer.getAttributes(); assertFalse("Attributes container is empty", attributes.isEmpty()); assertEquals("Unexpected number of attributes", 2, attributes.size());
.getAttributesContainer(currentShadowType); assertNotNull("No attributes container in current shadow", attributesContainer); Collection<ResourceAttribute<?>> attributes = attributesContainer.getAttributes(); assertFalse("Attributes container is empty", attributes.isEmpty()); assertEquals("Unexpected number of attributes", 3, attributes.size());