Example #1
0
  /**
   * Returns the list of resolvers which accept the name from the given source address.
   *
   * @param name
   * @param source
   * @return
   */
  private static Iterable<DnsResolver> resolversFor(final Record query, final InetAddress source) {
    return Iterables.filter(
        resolvers.values(),
        new Predicate<DnsResolver>() {

          @Override
          public boolean apply(final DnsResolver input) {
            try {
              return input.checkAccepts(query, source);
            } catch (final Exception ex) {
              return false;
            }
          }
        });
  }