protected void storeDNSRecord(final CrawlURI curi, final String dnsName, final CrawlHost targetHost, final Record[] rrecordSet) { // Get TTL and IP info from the first A record (there may be // multiple, e.g. www.washington.edu) then update the CrawlServer ARecord arecord = getFirstARecord(rrecordSet); if (arecord == null) { throw new NullPointerException("Got null arecord for " + dnsName); } targetHost.setIP(arecord.getAddress(), arecord.getTTL()); try { recordDNS(curi, rrecordSet); curi.setFetchStatus(S_DNS_SUCCESS); curi.setDNSServerIPLabel(ResolverConfig.getCurrentConfig().server()); } catch (IOException e) { logger.log(Level.SEVERE, "Failed store of DNS Record for " + curi.toString(), e); setUnresolvable(curi, targetHost); } }
/** * Creates a SimpleResolver that will query the specified host * @exception UnknownHostException Failure occurred while finding the host */ public SimpleResolver(String hostname) throws UnknownHostException { if (hostname == null) { hostname = ResolverConfig.getCurrentConfig().server(); if (hostname == null) hostname = defaultResolver; } InetAddress addr; if (hostname.equals("0")) addr = InetAddress.getLocalHost(); else addr = InetAddress.getByName(hostname); address = new InetSocketAddress(addr, DEFAULT_PORT); }
/** * Creates a SimpleResolver that will query the specified host * @exception UnknownHostException Failure occurred while finding the host */ public SimpleResolver(String hostname) throws UnknownHostException { if (hostname == null) { hostname = ResolverConfig.getCurrentConfig().server(); if (hostname == null) hostname = defaultResolver; } InetAddress addr; if (hostname.equals("0")) addr = InetAddress.getLocalHost(); else addr = InetAddress.getByName(hostname); address = new InetSocketAddress(addr, DEFAULT_PORT); }
/** * Creates a SimpleResolver that will query the specified host * @exception UnknownHostException Failure occurred while finding the host */ public SimpleResolver(String hostname) throws UnknownHostException { if (hostname == null) { hostname = ResolverConfig.getCurrentConfig().server(); if (hostname == null) hostname = defaultResolver; } InetAddress addr; if (hostname.equals("0")) addr = InetAddress.getLocalHost(); else addr = InetAddress.getByName(hostname); address = new InetSocketAddress(addr, DEFAULT_PORT); }
/** * Creates a SimpleResolver that will query the specified host * @exception UnknownHostException Failure occurred while finding the host */ public SimpleResolver(String hostname) throws UnknownHostException { if (hostname == null) { hostname = ResolverConfig.getCurrentConfig().server(); if (hostname == null) hostname = defaultResolver; } InetAddress addr; if (hostname.equals("0")) addr = InetAddress.getLocalHost(); else addr = InetAddress.getByName(hostname); address = new InetSocketAddress(addr, DEFAULT_PORT); }
protected void storeDNSRecord(final CrawlURI curi, final String dnsName, final CrawlHost targetHost, final Record[] rrecordSet) { // Get TTL and IP info from the first A record (there may be // multiple, e.g. www.washington.edu) then update the CrawlServer ARecord arecord = getFirstARecord(rrecordSet); if (arecord == null) { throw new NullPointerException("Got null arecord for " + dnsName); } targetHost.setIP(arecord.getAddress(), arecord.getTTL()); try { recordDNS(curi, rrecordSet); curi.setFetchStatus(S_DNS_SUCCESS); curi.setDNSServerIPLabel(ResolverConfig.getCurrentConfig().server()); } catch (IOException e) { logger.log(Level.SEVERE, "Failed store of DNS Record for " + curi.toString(), e); setUnresolvable(curi, targetHost); } }