Code example for SearchControls

0
     **************************************************************************/ 
    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);
        return dirContext.search(entrydn, filter, searchcontrols);
    } 
 
    /*************************************************************************** 
     * ModDN the data in the ldap directory for the given search base 
     * 
     **************************************************************************/ 
    public static void moddnOp(DirContext dirContext, String ddn, String newdn) throws NamingException {
        log.debug("ddn and newDn= " + ddn + "@@@@" + newdn);
        if (dirContext == null) {
            throw new NamingException(CONTEXT_IS_NULL);
        } 
        dirContext.rename(ddn, newdn);
    } 
Contextual code suggestions in your IDE  Get Codota for Java