public String getIdentifier ( LDAPEntry entry , Collection < String > attributes ) { // Retrieve the first value of the highest priority identifier attribute for ( String identifierAttribute : attributes ) { LDAPAttribute identifier = entry . getAttribute ( identifierAttribute ) ; if ( identifier != null ) return identifier . getStringValue ( ) ; } // No identifier attribute is present on the entry return null ; }
Returns the identifier of the object represented by the given LDAP entry . Multiple attributes may be declared as containing the identifier of the object when present on an LDAP entry . If multiple such attributes are present on the same LDAP entry the value of the attribute with highest priority is used . If multiple copies of the same attribute are present on the same LDAPentry the first value of that attribute is used .