Code example for SearchControls

0
                    " deref=" + deref +
                    " filter=" + searchFilter
                      ); 
        } 
        SearchControls searchcontrols = null;
        searchcontrols = new SearchControls(scope, countlim, timelim, attrs, retobj, deref);
        return dirContext.search(searchBase, searchFilter, searchcontrols);
    } 
 
    /*************************************************************************** 
     * Filter the data in the ldap directory 
     * 
     * @param filter 
     *            filter this value from the base 
     **************************************************************************/ 
    public static NamingEnumeration<SearchResult> compare(DirContext dirContext, String filter, String entrydn) throws NamingException {
        if (dirContext == null) {
            throw new NamingException(CONTEXT_IS_NULL);
        } 
        SearchControls searchcontrols = new SearchControls(0, 1, 0, new String[0], false, false);