org.jwall.rbl.dns
Class QueryHandler

java.lang.Object
  extended by org.jwall.rbl.dns.QueryHandler

public class QueryHandler
extends Object

Author:
chris

Constructor Summary
QueryHandler(RblServer server)
           
 
Method Summary
static String getKeyForAddress(String address, String domain)
           To speed up lookups, RBLs are stored as Hashmaps.
protected  String preprocess(InetAddress source, String queryValue)
           This method checks for any actions, which may be contained in the query-value.
 Response process(InetAddress source, Query q)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryHandler

public QueryHandler(RblServer server)
Method Detail

process

public Response process(InetAddress source,
                        Query q)

preprocess

protected String preprocess(InetAddress source,
                            String queryValue)

This method checks for any actions, which may be contained in the query-value. The actions are processed and removed from the query-value, yielding the final block-entry key.

Parameters:
source - The source address from which this query has been sent
query - The query value of the DNS query
Returns:

getKeyForAddress

public static String getKeyForAddress(String address,
                                      String domain)

To speed up lookups, RBLs are stored as Hashmaps. Usually, queries contain an address value in the form

    1.0.16.172.rbl.localnet
 

This method will convert addresses like 172.16.0.1 into this reversed format and append the specified domain.

If the address already ends with the given domain, this method assumes the address value to already match the reversed format and will simply return it as is.

Parameters:
address -
domain -
Returns:


Copyright © 2014. All Rights Reserved.