org.nhindirect.dns
Class DNSResponder

java.lang.Object
  extended by org.nhindirect.dns.DNSResponder
Direct Known Subclasses:
DNSResponderTCP, DNSResponderUDP

public abstract class DNSResponder
extends Object

Abstract DNSResponder for DNS requests. It implements common methods for calling the DNS store and handling error conditions. Protocol specific (UDP, TCP, etc) messaging handling is implemented in concrete implementations.

Since:
1.0
Author:
Greg Meyer

Constructor Summary
DNSResponder(DNSServerSettings settings, DNSStore store)
          Creates a DNS responder using the provided settings and DNS store.
 
Method Summary
 org.xbill.DNS.Message processRequest(byte[] rawMessage)
          Processes a DNS request and returns a DNS response.
 org.xbill.DNS.Message processRequest(org.xbill.DNS.Message request)
          Processes a DNS request and returns a DNS response.
abstract  void start()
          Starts the responder.
abstract  void stop()
          Stops the responder.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNSResponder

public DNSResponder(DNSServerSettings settings,
                    DNSStore store)
             throws DNSException
Creates a DNS responder using the provided settings and DNS store. The responder will not handle requests until start() is called.

Parameters:
settings - The DNS server settings.
store - The DNS store that holds the DNS record information.
Throws:
DNSException
Method Detail

start

public abstract void start()
                    throws DNSException
Starts the responder. Concrete implementation bind their protocol specific handlers and start accepting DNS requests.

Throws:
DNSException

stop

public abstract void stop()
                   throws DNSException
Stops the responder. The responder will not londer accept DNS requests after stop has been called.

Throws:
DNSException

processRequest

public org.xbill.DNS.Message processRequest(byte[] rawMessage)
                                     throws DNSException
Processes a DNS request and returns a DNS response. The request is in raw DNS wire protocol format.

Parameters:
rawMessage - The raw DNS wire protocol format of the request.
Returns:
A response to the DNS request.
Throws:
DNSException

processRequest

public org.xbill.DNS.Message processRequest(org.xbill.DNS.Message request)
Processes a DNS request and returns a DNS response.

Parameters:
request - The DNS request message.
Returns:
A response to the DNS request.


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