code: protected NamingEnumeration<?> rawSearchOneLevel(Name searchbase,
  
     String filter, int limit, int timeout, String returnAttributes[])
  
     throws NamingException
  
     {
  
       SearchControls constraints = new SearchControls();
  
        constraints.setSearchScope(1);
  
        constraints.setCountLimit(limit);
  
        constraints.setTimeLimit(timeout);
  
        constraints.setReturningAttributes(returnAttributes);
        
        NamingEnumeration<?> results = ctx.search(searchbase, filter, constraints);
  
        return results;
  
     }
docs: --------------------------------------------------------