rabbit.filter
Class BlockFilter

java.lang.Object
  extended by rabbit.filter.BlockFilter
All Implemented Interfaces:
HttpFilter

public class BlockFilter
extends Object
implements HttpFilter

This is a class that blocks access to certain part of the www. You can either specify a deny filter, using blockURLmatching or you can specify an accept filter, using allowURLmatching. If you specify an accept filter, then no other urls will be accepted.


Constructor Summary
BlockFilter()
          Create a new Blockfilter
 
Method Summary
 HttpHeader doHttpInFiltering(SocketChannel socket, HttpHeader header, Connection con)
          test if a socket/header combination is valid or return a new HttpHeader.
 HttpHeader doHttpOutFiltering(SocketChannel socket, HttpHeader header, Connection con)
          test if a socket/header combination is valid or return a new HttpHeader.
 void setup(SProperties properties)
          Setup this class with the given properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockFilter

public BlockFilter()
Create a new Blockfilter

Method Detail

doHttpInFiltering

public HttpHeader doHttpInFiltering(SocketChannel socket,
                                    HttpHeader header,
                                    Connection con)
test if a socket/header combination is valid or return a new HttpHeader.

Specified by:
doHttpInFiltering in interface HttpFilter
Parameters:
socket - the SocketChannel that made the request.
header - the actual request made.
con - the Connection handling the request.
Returns:
if the url of the request is matched, then a 403 is returned, otherwise null is returned.

doHttpOutFiltering

public HttpHeader doHttpOutFiltering(SocketChannel socket,
                                     HttpHeader header,
                                     Connection con)
test if a socket/header combination is valid or return a new HttpHeader.

Specified by:
doHttpOutFiltering in interface HttpFilter
Parameters:
socket - the SocketChannel that made the request.
header - the actual request made.
con - the Connection handling the request.
Returns:
This method always returns null.

setup

public void setup(SProperties properties)
Setup this class with the given properties.

Specified by:
setup in interface HttpFilter
Parameters:
properties - the new configuration of this class.