public String getFrameworkAttributeName() { return attributeDefinition.getFrameworkAttributeName(); }
public String convertAttributeNameToConnId(ResourceAttributeDefinition<?> attrDef) throws SchemaException { if (attrDef.getFrameworkAttributeName() != null) { return attrDef.getFrameworkAttributeName(); } QName attrQName = attrDef.getName(); if (specialAttributeMapMp.containsKey(attrQName)) { return specialAttributeMapMp.get(attrQName); } if (!attrQName.getNamespaceURI().equals(resourceSchemaNamespace)) { throw new SchemaException("No mapping from QName " + attrQName + " to an ICF attribute in resource schema namespace: " + resourceSchemaNamespace); } return attrQName.getLocalPart(); }
public QName convertAttributeNameToQName(String icfAttrName, ResourceAttributeDefinition attrDef) { if (specialAttributeMapIcf.containsKey(icfAttrName)) { if (icfAttrName.equals(attrDef.getFrameworkAttributeName())) { return attrDef.getName(); } // fallback, compatibility return specialAttributeMapIcf.get(icfAttrName); } return attrDef.getName(); }
public QName convertAttributeNameToQName(String icfAttrName, ObjectClassComplexTypeDefinition ocDef) { if (specialAttributeMapIcf.containsKey(icfAttrName)) { for (ResourceAttributeDefinition attributeDefinition: ocDef.getAttributeDefinitions()) { if (icfAttrName.equals(attributeDefinition.getFrameworkAttributeName())) { return attributeDefinition.getName(); } } // fallback, compatibility return specialAttributeMapIcf.get(icfAttrName); } QName attrXsdName = new QName(resourceSchemaNamespace, QNameUtil.escapeElementName(icfAttrName), MidPointConstants.PREFIX_NS_RI); return attrXsdName; }
private String getNameValue(ResourceObjectIdentification resourceObjectIdentification) throws SchemaException { Collection<? extends ResourceAttribute<?>> secondaryIdentifiers = resourceObjectIdentification.getSecondaryIdentifiers(); if (secondaryIdentifiers == null) { return null; } if (secondaryIdentifiers.size() == 1) { return (String) secondaryIdentifiers.iterator().next().getRealValue(); } else if (secondaryIdentifiers.size() > 1) { for (ResourceAttribute<?> secondaryIdentifier : secondaryIdentifiers) { ResourceAttributeDefinition<?> definition = secondaryIdentifier.getDefinition(); if (definition != null) { if (Name.NAME.equals(definition.getFrameworkAttributeName())) { return (String) secondaryIdentifier.getRealValue(); } } } throw new SchemaException("More than one secondary indentifier in "+resourceObjectIdentification+", cannot detemine ConnId __NAME__"); } return null; }
@Override public void addExtraPropertyAnnotations(PrismPropertyDefinition definition, Element appinfo, SchemaToDomProcessor schemaToDomProcessor) { super.addExtraPropertyAnnotations(definition, appinfo, schemaToDomProcessor); if (definition instanceof ResourceAttributeDefinition) { ResourceAttributeDefinition rad = (ResourceAttributeDefinition)definition; if (rad.getNativeAttributeName() != null) { schemaToDomProcessor.addAnnotation(MidPointConstants.RA_NATIVE_ATTRIBUTE_NAME, rad.getNativeAttributeName(), appinfo); } if (rad.getFrameworkAttributeName() != null) { schemaToDomProcessor.addAnnotation(MidPointConstants.RA_FRAMEWORK_ATTRIBUTE_NAME, rad.getFrameworkAttributeName(), appinfo); } if (rad.getReturnedByDefault() != null) { schemaToDomProcessor.addAnnotation(MidPointConstants.RA_RETURNED_BY_DEFAULT_NAME, rad.getReturnedByDefault().toString(), appinfo); } } }
String frameworkAttributeName = attrDef.getFrameworkAttributeName(); if (Name.NAME.equals(frameworkAttributeName)) { nameValue = ((ResourceAttribute<String>) attr).getValue().getValue();
assertTrue("Attribute "+OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME+" in not in identifiers list",identifiers.contains(idPrimaryDef)); assertEquals("Attribute "+OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME+" has wrong native name", OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME, idPrimaryDef.getNativeAttributeName()); assertEquals("Attribute "+OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME+" has wrong framework name", Uid.NAME, idPrimaryDef.getFrameworkAttributeName()); assertTrue("Attribute "+OpenDJController.RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME+" in not in secomdary identifiers list",accountDefinition.getSecondaryIdentifiers().contains(idSecondaryDef)); assertEquals("Attribute "+OpenDJController.RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME+" has wrong native name", OpenDJController.RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME, idSecondaryDef.getNativeAttributeName()); assertEquals("Attribute "+OpenDJController.RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME+" has wrong framework name", Name.NAME, idSecondaryDef.getFrameworkAttributeName());
assertTrue("No UID read", idPrimaryDef.canRead()); assertTrue("UID definition not in identifiers", accountDef.getPrimaryIdentifiers().contains(idPrimaryDef)); assertEquals("Wrong "+OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME+" frameworkAttributeName", ProvisioningTestUtil.CONNID_UID_NAME, idPrimaryDef.getFrameworkAttributeName()); assertEquals("Wrong primary identifier matching rule", PrismConstants.UUID_MATCHING_RULE_NAME, idPrimaryDef.getMatchingRuleQName()); assertTrue("No NAME read", idSecondaryDef.canRead()); assertTrue("NAME definition not in secondary identifiers", accountDef.getSecondaryIdentifiers().contains(idSecondaryDef)); assertEquals("Wrong "+OpenDJController.RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME+" frameworkAttributeName", ProvisioningTestUtil.CONNID_NAME_NAME, idSecondaryDef.getFrameworkAttributeName()); assertEquals("Wrong secondary identifier matching rule", PrismConstants.DISTINGUISHED_NAME_MATCHING_RULE_NAME, idSecondaryDef.getMatchingRuleQName()); assertTrue("No UID read", posixIdPrimaryDef.canRead()); assertTrue("UID definition not in identifiers", accountDef.getPrimaryIdentifiers().contains(posixIdPrimaryDef)); assertEquals("Wrong "+OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME+" frameworkAttributeName", ProvisioningTestUtil.CONNID_UID_NAME, posixIdPrimaryDef.getFrameworkAttributeName()); assertTrue("No NAME read", posixIdSecondaryDef.canRead()); assertTrue("NAME definition not in secondary identifiers", accountDef.getSecondaryIdentifiers().contains(posixIdSecondaryDef)); assertEquals("Wrong "+OpenDJController.RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME+" frameworkAttributeName", ProvisioningTestUtil.CONNID_NAME_NAME, posixIdSecondaryDef.getFrameworkAttributeName());