}
}
if (entityId == null)
{
DistinguishedName name = new DistinguishedName(dn);
LdapRdn rdn = name.getLdapRdn(name.size() - 1);
if (rdn.getKey().equals(searchConfiguration.getLdapIdAttribute()))
{
entityId = rdn.getValue();
}
else
{
// TODO: throw exception???
return null;