public void handle(RecordProcessor processor) throws NamingException {
    try {
      for (NamingEnumeration<SearchResult> searchResult : searchResults) {
        while (searchResult.hasMore()) {
          if (!processor.process(searchResult.next())) {
            return;
          }
        }
      }
    } finally {
      for (NamingEnumeration<SearchResult> searchResult : searchResults) {
        try {
          searchResult.close();
        } catch (NamingException ex) {
          LOG.warn("Failed to close LDAP search result", ex);
        }
      }
    }
  }
Allows for custom processing of the search results.
@param processor {@link RecordProcessor} implementation
@throws NamingException
service/src/java/org/apache/hive/service/auth/ldap/SearchResultHandler.java