@Override public Lookup forName(final String fqdn) { try { return cacheHolder.get().get( fqdn, new Callable<Lookup>() { @Override public Lookup call() { return delegate.forName(fqdn); } } ); } catch (ExecutionException e) { throw new DnsException(e); } catch (UncheckedExecutionException e) { throw new DnsException(e); } } }
errorHandler.handle(fqdn, e); log.error(e.getMessage(), e); fireIfFirstError(); return;
errorHandler.handle(fqdn, e); log.error(e.getMessage(), e); fireIfFirstError(); return;
@Override public Lookup forName(final String fqdn) { try { return cacheHolder.get().get( fqdn, new Callable<Lookup>() { @Override public Lookup call() { return delegate.forName(fqdn); } } ); } catch (ExecutionException e) { throw new DnsException(e); } catch (UncheckedExecutionException e) { throw new DnsException(e); } } }
@Override public Lookup forName(String fqdn) { try { return new Lookup(fqdn, Type.SRV, DClass.IN); } catch (TextParseException e) { throw new DnsException("unable to create lookup for name: " + fqdn, e); } } }
@Override public Lookup forName(String fqdn) { try { final Lookup lookup = new Lookup(fqdn, Type.SRV, DClass.IN); if (resolver != null) { lookup.setResolver(resolver); } return lookup; } catch (TextParseException e) { throw new DnsException("unable to create lookup for name: " + fqdn, e); } } }
@Override public List<LookupResult> resolve(final String fqdn) { Lookup lookup = lookupFactory.forName(fqdn); Record[] queryResult = lookup.run(); switch (lookup.getResult()) { case Lookup.SUCCESSFUL: return toLookupResults(queryResult); case Lookup.HOST_NOT_FOUND: // fallthrough case Lookup.TYPE_NOT_FOUND: LOG.warn("No results returned for query '{}'; result from XBill: {} - {}", fqdn, lookup.getResult(), lookup.getErrorString()); return ImmutableList.of(); default: throw new DnsException( String.format("Lookup of '%s' failed with code: %d - %s ", fqdn, lookup.getResult(), lookup.getErrorString())); } }
@Override public List<LookupResult> resolve(final String fqdn) { Lookup lookup = lookupFactory.forName(fqdn); Record[] queryResult = lookup.run(); switch (lookup.getResult()) { case Lookup.SUCCESSFUL: return toLookupResults(queryResult); case Lookup.HOST_NOT_FOUND: // fallthrough case Lookup.TYPE_NOT_FOUND: LOG.warn("No results returned for query '{}'; result from XBill: {} - {}", fqdn, lookup.getResult(), lookup.getErrorString()); return ImmutableList.of(); default: throw new DnsException( String.format("Lookup of '%s' failed with code: %d - %s ", fqdn, lookup.getResult(), lookup.getErrorString())); } }