public SearchRequest getSearchRequest(LDAPConfiguration config, Dn baseDn,
            ExprNode filter) throws GuacamoleException {
        
        SearchRequest searchRequest = new SearchRequestImpl();
        searchRequest.setBase(baseDn);
        searchRequest.setDerefAliases(config.getDereferenceAliases());
        searchRequest.setScope(SearchScope.SUBTREE);
        searchRequest.setFilter(filter);
        searchRequest.setSizeLimit(config.getMaxResults());
        searchRequest.setTimeLimit(config.getOperationTimeout());
        searchRequest.setTypesOnly(false);
        
        if (config.getFollowReferrals())
            searchRequest.followReferrals();
        
        return searchRequest;
    }
Generate a SearchRequest object using the given Base DN and filter
and retrieving other properties from the LDAP configuration service.

@param config
    The configuration of the LDAP server being queried.

@param baseDn
    The LDAP Base DN at which to search the search.

@param filter
    A string representation of a LDAP filter to use for the search.

@return
    The properly-configured SearchRequest object.

@throws GuacamoleException
    If an error occurs retrieving any of the configuration values.
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java