public String retrieveSingle(String attribute, String searchFilter, boolean failOnMultipleResults) {
        try {
            return retrieveSingle(attribute, searchFilter, failOnMultipleResults, baseDN);
        }
        catch (Exception e) {
            if (alternateBaseDN != null) {
                return retrieveSingle(attribute, searchFilter, failOnMultipleResults, alternateBaseDN);
            }
            else {
                throw e;
            }
        }
    }
Generic routine for retrieving a single element from the LDAP server.  It's meant to be very
flexible so that just about any query for a single results can make use of it without having
to reimplement their own calls to LDAP.
<p>
The passed in filter string needs to be pre-prepared! In other words, nothing will be changed
in the string before it is used as a string.

@param attribute             LDAP attribute to be pulled from each result and placed in the return results.
                             Typically pulled from this manager. Null means the absolute DN is returned.
@param searchFilter          Filter to use to perform the search.  Typically pulled from this manager.
@param failOnMultipleResults It true, an {@link IllegalStateException} will be thrown, if the
                             search result is not unique. If false, just the first result will be returned.
@return A single string.
xmppserver/src/main/java/org/jivesoftware/openfire/ldap/LdapManager.java