com.esf.net.dnsproxy.service
Interface IDnsProxyService


public interface IDnsProxyService

Defines DNS-proxy service. DNS proxy takes DNS queries from a local client device, forwards the request to a public DNS server, and returns the resolved address to the client.

Author:
ilya.binshtok

Field Summary
static java.lang.String SERVICE_NAME
          service name of this interface for the bundle activator (com.esf.networking.dnsproxy.service.IDnsProxyService)
 
Method Summary
 boolean configFileDoesExist()
          checks for the existence of DNS proxy configuration file
 void configure(java.lang.String authoritative, int authoritativePort, int authoritativeTout, java.lang.String recursive, int recursivePort, int recursiveTout, java.lang.String listen, int listenPort, java.util.ArrayList securityFeatures, java.util.ArrayList internalNetworks)
           
 java.lang.String getAuthoritative()
          gets the currently defined authoritative DNS server
 int getAuthoritativePort()
          gets the currently defined authoritative DNS server port number
 int getAuthoritativeTimeout()
          gets the authoritative DNS server timeout
 java.util.ArrayList getInternalNetworks()
          gets the current list of networks on which dnsproxy will perform DNS queries
 java.lang.String getListen()
          gets the IP address on which dnsproxy is configured to listen on
 int getListenPort()
          gets the port number on which dnsproxy listens
 java.lang.String getRecursive()
          gets the currently defined DNS server IP address
 int getRecursivePort()
          gets the current recursive DNS server port number
 int getRecursiveTimeout()
          gets the recursive DNS server timeout
 java.util.ArrayList getSecurityFeatures()
          gets the list of currently defined dnsproxy security features
 void setAuthoritative(java.lang.String authoritative)
          sets the authoritative DNS server
 void setAuthoritativePort(int authoritativePort)
          sets the authoritative DNS server port number
 void setAuthoritativeTimeout(int authoritativeTimeout)
          sets the authoritative DNS server timeout
 void setInternalNetwork(java.lang.String internalNetwork)
          Sets 'internal network' entry in appropriate configuration file
 void setListen(java.lang.String listen)
          sets the IP address on which dnsproxy is configured to listen
 void setListenPort(int listenPort)
          sets the port number on which dnsproxy listens
 void setRecursive(java.lang.String recursive)
          sets the recursive DNS server
 void setRecursivePort(int recursivePort)
          sets the recursive DNS server port number
 void setRecursiveTimeout(int recursiveTimeout)
          sets the recursive DNS server timeout
 void setSecurityFeature(DnsProxySecurityFeature securityFeature)
          Sets 'security feature' in appropriate configuration file
 void start()
          Starts the DNS proxy service on the given interface
 void stop()
          Stops the DNS proxy service on the given interface
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
service name of this interface for the bundle activator (com.esf.networking.dnsproxy.service.IDnsProxyService)

Method Detail

configure

void configure(java.lang.String authoritative,
               int authoritativePort,
               int authoritativeTout,
               java.lang.String recursive,
               int recursivePort,
               int recursiveTout,
               java.lang.String listen,
               int listenPort,
               java.util.ArrayList securityFeatures,
               java.util.ArrayList internalNetworks)
               throws java.lang.Exception
Parameters:
authoritative - authoritative IP address to use for DNS
authoritativePort - IP port of authoritative DNS server
authoritativeTout - timeout to wait for DNS responses from authoritative server
recursive - recursive IP address to use for DNS
recursivePort - IP port of recursive DNS server
recursiveTout - timeout to wait for DNS responses from recursive server
listen - IP address on which dnsproxy is to listen
listenPort - port number of listen IP
securityFeatures - list of DNS security features
internalNetworks - internal networks on which to listen for DNS
Throws:
java.lang.Exception

setSecurityFeature

void setSecurityFeature(DnsProxySecurityFeature securityFeature)
                        throws java.lang.Exception
Sets 'security feature' in appropriate configuration file

Parameters:
securityFeature - as DnsProxySecurityFeature
Throws:
java.lang.Exception

setInternalNetwork

void setInternalNetwork(java.lang.String internalNetwork)
                        throws java.lang.Exception
Sets 'internal network' entry in appropriate configuration file

Parameters:
internalNetwork - IP network on which to listen for DNS
Throws:
java.lang.Exception

configFileDoesExist

boolean configFileDoesExist()
                            throws java.lang.Exception
checks for the existence of DNS proxy configuration file

Returns:
true if configuration file exists; false otherwise
Throws:
java.lang.Exception

getAuthoritative

java.lang.String getAuthoritative()
                                  throws java.lang.Exception
gets the currently defined authoritative DNS server

Returns:
IP address of the current authoritative DNS server as String
Throws:
java.lang.Exception

setAuthoritative

void setAuthoritative(java.lang.String authoritative)
                      throws java.lang.Exception
sets the authoritative DNS server

Parameters:
authoritative - IP address of the new authoritative DNS server to use as String
Throws:
java.lang.Exception

getAuthoritativePort

int getAuthoritativePort()
                         throws java.lang.Exception
gets the currently defined authoritative DNS server port number

Returns:
the port number of the authoritative DNS server
Throws:
java.lang.Exception

setAuthoritativePort

void setAuthoritativePort(int authoritativePort)
                          throws java.lang.Exception
sets the authoritative DNS server port number

Parameters:
authoritativePort - the port number of the authoritative DNS server
Throws:
java.lang.Exception

getAuthoritativeTimeout

int getAuthoritativeTimeout()
                            throws java.lang.Exception
gets the authoritative DNS server timeout

Returns:
the authoritative DNS server timeout
Throws:
java.lang.Exception

setAuthoritativeTimeout

void setAuthoritativeTimeout(int authoritativeTimeout)
                             throws java.lang.Exception
sets the authoritative DNS server timeout

Parameters:
authoritativeTimeout - the authoritative DNS server timeout
Throws:
java.lang.Exception

getListen

java.lang.String getListen()
                           throws java.lang.Exception
gets the IP address on which dnsproxy is configured to listen on

Returns:
IP address on which dnsproxy is set to listen on, as String
Throws:
java.lang.Exception

setListen

void setListen(java.lang.String listen)
               throws java.lang.Exception
sets the IP address on which dnsproxy is configured to listen

Parameters:
listen - IP address on which dnsproxy is set to listen, as String
Throws:
java.lang.Exception

getListenPort

int getListenPort()
                  throws java.lang.Exception
gets the port number on which dnsproxy listens

Returns:
the port number on which dnsproxy listens
Throws:
java.lang.Exception

setListenPort

void setListenPort(int listenPort)
                   throws java.lang.Exception
sets the port number on which dnsproxy listens

Parameters:
listenPort - the port number on which dnsproxy listens
Throws:
java.lang.Exception

setRecursive

void setRecursive(java.lang.String recursive)
                  throws java.lang.Exception
sets the recursive DNS server

Parameters:
recursive - recursive DNS server IP address, as String
Throws:
java.lang.Exception

getRecursive

java.lang.String getRecursive()
                              throws java.lang.Exception
gets the currently defined DNS server IP address

Returns:
DNS server IP address as String
Throws:
java.lang.Exception

getRecursivePort

int getRecursivePort()
                     throws java.lang.Exception
gets the current recursive DNS server port number

Returns:
DNS server port number
Throws:
java.lang.Exception

setRecursivePort

void setRecursivePort(int recursivePort)
                      throws java.lang.Exception
sets the recursive DNS server port number

Parameters:
recursivePort - the current recursive DNS server port number
Throws:
java.lang.Exception

getRecursiveTimeout

int getRecursiveTimeout()
                        throws java.lang.Exception
gets the recursive DNS server timeout

Returns:
the recursive DNS server timeout
Throws:
java.lang.Exception

setRecursiveTimeout

void setRecursiveTimeout(int recursiveTimeout)
                         throws java.lang.Exception
sets the recursive DNS server timeout

Parameters:
recursiveTimeout - the recursive DNS server timeout
Throws:
java.lang.Exception

getSecurityFeatures

java.util.ArrayList getSecurityFeatures()
                                        throws java.lang.Exception
gets the list of currently defined dnsproxy security features

Returns:
ArrayList of String variables representing the currently defined security features
Throws:
java.lang.Exception

getInternalNetworks

java.util.ArrayList getInternalNetworks()
                                        throws java.lang.Exception
gets the current list of networks on which dnsproxy will perform DNS queries

Returns:
an ArrayList of String variables representing the networks on which dnsproxy will perform queries for
Throws:
java.lang.Exception

start

void start()
           throws java.lang.Exception
Starts the DNS proxy service on the given interface

Throws:
java.lang.Exception - if the service fails to start

stop

void stop()
          throws java.lang.Exception
Stops the DNS proxy service on the given interface

Throws:
java.lang.Exception - if the service fails to stop