public LdapName getGroupsBaseDN(String groupname) {
        try {
            findGroupRDN(groupname, baseDN);
            return baseDN;
        }
        catch (Exception e) {
            try {
                if (alternateBaseDN != null) {
                    findGroupRDN(groupname, alternateBaseDN);
                    return alternateBaseDN;
                }
            }
            catch (Exception ex) {
                Log.debug("An exception occurred while trying to find the base dn for group: {}", groupname, ex);
            }
        }
        return null;
    }
Returns the BaseDN for the given groupname.

@param groupname groupname to return its base DN.
@return the BaseDN for the given groupname. If no baseDN is found,
        this method will return {@code null}.
xmppserver/src/main/java/org/jivesoftware/openfire/ldap/LdapManager.java