private Attribute lookup(String query, DirContext ictx, String recordType) { try { Attributes dnsResult = ictx.getAttributes(query, new String[] { recordType }); return dnsResult.get(recordType); } catch (NamingException e) { if (e instanceof NameNotFoundException) { throw new DnsEntryNotFoundException("DNS entry not found for:" + query, e); } throw new DnsLookupException("DNS lookup failed for: " + query, e); } }
private Attribute lookup(String query, DirContext ictx, String recordType) { try { Attributes dnsResult = ictx.getAttributes(query, new String[] { recordType }); return dnsResult.get(recordType); } catch (NamingException e) { if (e instanceof NameNotFoundException) { throw new DnsEntryNotFoundException("DNS entry not found for:" + query, e); } throw new DnsLookupException("DNS lookup failed for: " + query, e); } }
private Attribute lookup(String query, DirContext ictx, String recordType) { try { Attributes dnsResult = ictx.getAttributes(query, new String[] { recordType }); return dnsResult.get(recordType); } catch (NamingException e) { if (e instanceof NameNotFoundException) { throw new DnsEntryNotFoundException("DNS entry not found for:" + query, e); } throw new DnsLookupException("DNS lookup failed for: " + query, e); } }