}
else
{
//TODO: if relationships are not refered with DNs and only names its not possible to map
//TODO: them to proper IdentityType and keep name uniqnes per type. Workaround needed
throw new NotYetImplementedException("LDAP limitation. If relationship targets are not refered with FQDNs " +
"and only names, it's not possible to map them to proper IdentityType and keep name uniqnes per type. " +
"Workaround needed");
}
//break;
}
}
}
else
{
objects.addAll(findRelatedIdentityObjects(ctx, identity, ldapIO, criteria, false));
}
}
// if not parent then all parent entries need to be found
else
{
if (typeConfig.getChildMembershipAttributeName() == null)
{
objects.addAll(findRelatedIdentityObjects(ctx, identity, ldapIO, criteria, true));
}
else
{
Attributes attrs = ldapContext.getAttributes(ldapIO.getDn());
Attribute member = attrs.get(typeConfig.getChildMembershipAttributeName());
if (member != null)
{
NamingEnumeration memberValues = member.getAll();
while (memberValues.hasMoreElements())
{
String memberRef = memberValues.nextElement().toString();
if (typeConfig.isChildMembershipAttributeDN())
{
//TODO: use direct LDAP query instead of other find method and add attributesFilter
if (criteria != null && criteria.getFilter() != null)
{
String name = Tools.stripDnToName(memberRef);
String regex = Tools.wildcardToRegex(criteria.getFilter());
if (Pattern.matches(regex, name))
{
objects.add(findIdentityObject(ctx, memberRef));
}
}
else
{
objects.add(findIdentityObject(ctx, memberRef));
}
}
else
{
//TODO: if relationships are not refered with DNs and only names its not possible to map
//TODO: them to proper IdentityType and keep name uniqnes per type. Workaround needed
throw new NotYetImplementedException("LDAP limitation. If relationship targets are not refered with FQDNs " +
"and only names, it's not possible to map them to proper IdentityType and keep name uniqnes per type. " +
"Workaround needed");
}
//break;
}