public String getIdentifier(Entry entry, Collection<String> attributes) 
            throws LdapInvalidAttributeValueException {

        // Retrieve the first value of the highest priority identifier attribute
        for (String identifierAttribute : attributes) {
            Attribute identifier = entry.get(identifierAttribute);
            if (identifier != null)
                return identifier.getString();
        }

        // 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.

@param entry
    The entry representing the Guacamole object whose unique identifier
    should be determined.

@param attributes
    A collection of all attributes which may be used to specify the
    unique identifier of the Guacamole object represented by an LDAP
    entry, in order of decreasing priority.

@return
    The identifier of the object represented by the given LDAP entry, or
    null if no attributes declared as containing the identifier of the
    object are present on the entry.

@throws LdapInvalidAttributeValueException
    If an error occurs retrieving the value of the identifier attribute.
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ObjectQueryService.java