org.jwall.rbl
Class RblServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.jwall.rbl.RblServer
All Implemented Interfaces:
Runnable

public class RblServer
extends Thread

This class implements a very simple DNS server for running a real-time blackhole list. The server only responds to A records. Support for AAAA record queries is planned.

Author:
Christian Bockermann <chris@jwall.org>

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static Inet4Address BLOCKED_VALUE
           
 org.slf4j.Logger log
           
static String[] PROPERTY_NAMES
          These properties can be overwritten using system properties (command line)
static String RBL_ADDRESS
           
static String RBL_ADMIN_PORT
           
static String RBL_DOMAIN
           
static String RBL_FILE
           
static String RBL_HOME
           
static String RBL_PERMISSIONS
           
static String RBL_PORT
           
static String VERSION
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RblServer(InetAddress addr, Integer port)
          This method creates a new RBL server listening at the specified address on the given port.
RblServer(Properties p)
          Create a new RblServer with the provided set of properties.
 
Method Summary
 void block(String address, Integer ttl)
           
 RBList getBlockList()
           
 String getDomain()
           
 RblSecurityManager getRblSecurityManager()
           
static void main(String[] args)
           This is the server's main entry point.
 void run()
           
 void setBlockList(RBList list)
          Sets the block list for this server.
 void setRblSecurityManager(RblSecurityManager manager)
           
 void shutdown()
          This method is called upon server shutdown, e.g. by the VM's ShutdownHook.
 void unblock(String address)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RBL_HOME

public static final String RBL_HOME
See Also:
Constant Field Values

RBL_PORT

public static final String RBL_PORT
See Also:
Constant Field Values

RBL_ADDRESS

public static final String RBL_ADDRESS
See Also:
Constant Field Values

RBL_ADMIN_PORT

public static final String RBL_ADMIN_PORT
See Also:
Constant Field Values

RBL_FILE

public static final String RBL_FILE
See Also:
Constant Field Values

RBL_DOMAIN

public static final String RBL_DOMAIN
See Also:
Constant Field Values

RBL_PERMISSIONS

public static final String RBL_PERMISSIONS
See Also:
Constant Field Values

PROPERTY_NAMES

public static final String[] PROPERTY_NAMES
These properties can be overwritten using system properties (command line)


BLOCKED_VALUE

public static Inet4Address BLOCKED_VALUE

VERSION

public static final String VERSION
See Also:
Constant Field Values

log

public org.slf4j.Logger log
Constructor Detail

RblServer

public RblServer(Properties p)
          throws Exception
Create a new RblServer with the provided set of properties.

Parameters:
p -
Throws:
Exception

RblServer

public RblServer(InetAddress addr,
                 Integer port)
          throws Exception
This method creates a new RBL server listening at the specified address on the given port.

Parameters:
addr -
port -
Throws:
Exception
Method Detail

setRblSecurityManager

public void setRblSecurityManager(RblSecurityManager manager)

getRblSecurityManager

public RblSecurityManager getRblSecurityManager()

setBlockList

public void setBlockList(RBList list)
Sets the block list for this server.

Parameters:
list -

getBlockList

public RBList getBlockList()

getDomain

public String getDomain()

block

public void block(String address,
                  Integer ttl)

unblock

public void unblock(String address)

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.run()

shutdown

public void shutdown()
This method is called upon server shutdown, e.g. by the VM's ShutdownHook. It will save the


main

public static void main(String[] args)
                 throws Exception

This is the server's main entry point. It will read the configuration from ${RBL_HOME}/etc/jwall-rbld.conf if that file exists or from a configuration file specified as first argument at the command line.

Parameters:
args -
Throws:
Exception


Copyright © 2014. All Rights Reserved.