org.nhindirect.dns
Class DNSServer

java.lang.Object
  extended by org.nhindirect.dns.DNSServer
All Implemented Interfaces:
DNSServerMBean

public class DNSServer
extends Object
implements DNSServerMBean

The DNS server creates the UDP and TCP responders and manages their life cycles. DNS queries are delegated the responders which use the DNSStore to lookup entries.

To run a server, an instance of a server is created followed by calling the start() method.

Since:
1.0
Author:
Greg Meyer

Constructor Summary
DNSServer(DNSStore store, DNSServerSettings settings)
          Create a new DNSServer
 
Method Summary
 String getDNSStoreImplName()
          Gets the fully qualified class name of the DNS store.
 CompositeData getServerSettings()
          Gets the DNS server settings.
 void start()
          Starts the DNS server by initializing and launching the TCP and UDP listeners.
 void startServer()
          Initializes the DNS server socket listeners are begins accepting requests.
 void stop()
          Stops the server and shuts down the TCP and UPD listeners.
 void stopServer()
          Shutdown the DNS server socket listeners and stops accepting requests.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNSServer

@Inject
public DNSServer(DNSStore store,
                        DNSServerSettings settings)
Create a new DNSServer

Parameters:
store - The storage medium of the DNS records.
settings - DNS server specific settings such as UDP/TCP ports, IP bindings, and thread tuning parameters.
Method Detail

start

public void start()
           throws DNSException
Starts the DNS server by initializing and launching the TCP and UDP listeners.

Throws:
DNSException - Thrown if the internal listeners could not be started.

stop

public void stop()
          throws DNSException
Stops the server and shuts down the TCP and UPD listeners.

Throws:
DNSException - Thrown if the internal listeners could not be stopped.

getServerSettings

public CompositeData getServerSettings()
Gets the DNS server settings.

Specified by:
getServerSettings in interface DNSServerMBean
Returns:
The DNS server settings.

startServer

public void startServer()
Initializes the DNS server socket listeners are begins accepting requests.

Specified by:
startServer in interface DNSServerMBean

stopServer

public void stopServer()
Shutdown the DNS server socket listeners and stops accepting requests.

Specified by:
stopServer in interface DNSServerMBean

getDNSStoreImplName

public String getDNSStoreImplName()
Gets the fully qualified class name of the DNS store.

Specified by:
getDNSStoreImplName in interface DNSServerMBean
Returns:
The fully qualified class name of the DNS store.


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