public String getNativeAttributeName() { return attributeDefinition.getNativeAttributeName(); }
/** * Returns native attribute name. * <p/> * Native name of the attribute is a name as it is used on the resource or * as seen by the connector. It is used for diagnostics purposes and may be * used by the connector itself. As the attribute names in XSD have to * comply with XML element name limitations, this may be the only way how to * determine original attribute name. * <p/> * Returns null if native attribute name is not set or unknown. * <p/> * The name should be the same as the one used by the resource, if the * resource supports naming of attributes. E.g. in case of LDAP this * annotation should contain "cn", "givenName", etc. If the resource is not * that flexible, the native attribute names may be hardcoded (e.g. * "username", "homeDirectory") or may not be present at all. * * @return native attribute name */ @Override public String getNativeAttributeName() { return getDefinition() == null ? null : getDefinition() .getNativeAttributeName(); }
@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); } } }
assertTrue("Attribute "+OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME+" in not an identifier",idPrimaryDef.isPrimaryIdentifier(accountDefinition)); 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()); assertFalse("Attribute "+OpenDJController.RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME+" in in identifiers list and it should NOT be",identifiers.contains(idSecondaryDef)); 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());