NamingEnumeration results = ctx.search(searchBase, searchFilter, args, ctls);
NamingEnumeration results = ctx.search(searchBase, searchFilter, args, searchControls);
    public LdapUserInfo searchForUser(String username) {        DirContext ctx = initialDirContextFactory.newInitialDirContext();        SearchControls ctls = new SearchControls();        ctls.setTimeLimit( searchTimeLimit );        ctls.setSearchScope( searchScope );        if (logger.isDebugEnabled()) {            logger.debug("Searching for user '" + username + "', in context " + ctx +                    ", with user search " + this.toString());        }        try {            String[] args = new String[] { LdapUtils.escapeNameForFilter(username) };            NamingEnumeration results = ctx.search(searchBase, searchFilter, args, ctls);            if (!results.hasMore()) {                throw new UsernameNotFoundException("User " + username + " not found in directory.");            }            SearchResult searchResult = (SearchResult)results.next();            if (results.hasMore()) {               throw new BadCredentialsException("Expected a single user but search returned multiple results");            }            StringBuffer userDn = new StringBuffer(searchResult.getName());            if (searchBase.length() > 0) {                userDn.append(",");                userDn.append(searchBase);            }            userDn.append(",");            userDn.append(ctx.getNameInNamespace());            return new LdapUserInfo(userDn.toString(), searchResult.getAttributes());        } catch(NamingException ne) {            throw new LdapDataAccessException("User Couldn't be found due to exception", ne);        } finally {            LdapUtils.closeContext(ctx);        }    }