code: protected NamingEnumeration<?> rawSearchBaseEntry(Name searchbase,
  
     String filter, int limit, int timeout, String returnAttributes[])
  
     throws NamingException
  
     {
  
        NamingEnumeration<?> result = null;
  
        if (returnAttributes != null && returnAttributes.length == 0)
  
           returnAttributes = (new String[] {
  
              "objectClass" });
  
        SearchControls constraints = new SearchControls();
  
        constraints.setSearchScope(0);
  
        constraints.setCountLimit(limit);
  
        constraints.setTimeLimit(timeout);
  
        constraints.setReturningAttributes(returnAttributes);
  
        result = ctx.search(searchbase, filter, constraints);
  
        return result;
  
     }
docs: --------------------------------------------