if (jbidGroup.equals(getRootGroup()))
{
return "";
}
Collection<org.picketlink.idm.api.Group> parents = new HashSet();
String gtnGroupName = getGtnGroupName(jbidGroup.getName());
try
{
parents = getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, false, false);
}
catch (Exception e)
{
//TODO:
log.info("Identity operation error: ", e);
}
if (parents.size() == 0 || parents.size() > 1)
{
if (parents.size() > 1)
{
log.info("PLIDM Group has more than one parent: " + jbidGroup.getName() + "; Will try to use parent path " +
"defined by type mappings or just place it under root /");
}
String id = orgService.getConfiguration().getParentId(jbidGroup.getGroupType());
if (id != null && orgService.getConfiguration().isForceMembershipOfMappedTypes())
{
if (id.endsWith("/*"))
{
id = id.substring(0, id.length() - 2);
}
return id + "/" + gtnGroupName;
}
// All groups not connected to the root should be just below the root
return "/" + gtnGroupName;
//TODO: make it configurable
// throw new IllegalStateException("Group present that is not connected to the root: " + jbidGroup.getName());
}
String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()));
return parentGroupId + "/" + gtnGroupName;
}