org.nhindirect.dns
Class ProxyDNSStore

java.lang.Object
  extended by org.nhindirect.dns.ProxyDNSStore
All Implemented Interfaces:
DNSStore

public class ProxyDNSStore
extends Object
implements DNSStore

Proxy DNS store that delegates all requests to another set of DNS servers. The store defaults to using port 53 and the machine's configured DNS servers.

Since:
1.0
Author:
Greg Meyer

Constructor Summary
ProxyDNSStore()
          Creates a default proxy store.
ProxyDNSStore(Collection<String> servers)
          Creates a proxy using the the provided servers for delegating requests.
ProxyDNSStore(Collection<String> servers, int port)
          Creates a proxy using the provided servers and port for delegating requests.
ProxyDNSStore(int port)
          Creates a proxy store delegating requests to the provided port.
 
Method Summary
 org.xbill.DNS.Message get(org.xbill.DNS.Message dnsMsg)
          Processes a lookup request for DNS records.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyDNSStore

public ProxyDNSStore()
Creates a default proxy store.


ProxyDNSStore

public ProxyDNSStore(int port)
Creates a proxy store delegating requests to the provided port.

Parameters:
port - The IP port to use when calling the proxy DNS server.

ProxyDNSStore

public ProxyDNSStore(Collection<String> servers)
Creates a proxy using the the provided servers for delegating requests.

Parameters:
servers - A collections of IP4 addresses (as strings) that the proxy will delegate request to.

ProxyDNSStore

public ProxyDNSStore(Collection<String> servers,
                     int port)
Creates a proxy using the provided servers and port for delegating requests.

Parameters:
servers - A collections of IP4 addresses (as strings) that the proxy will delegate request to.
port - The IP port to use when calling the proxy DNS server.
Method Detail

get

public org.xbill.DNS.Message get(org.xbill.DNS.Message dnsMsg)
                          throws DNSException
Processes a lookup request for DNS records.

Specified by:
get in interface DNSStore
Parameters:
dnsMsg - The DSN request message.
Returns:
The DNS response message. Returns null for lookup requests if a matching record cannot be found.
Throws:
DNSException - Thrown is the request fails due to sever failure such as illegal request parameters or a failure accessing the physical record medium.


Copyright © 2010-2015 The Direct Project. All Rights Reserved.