rabbit.filter
Class AccessFilter

java.lang.Object
  extended by rabbit.filter.AccessFilter
All Implemented Interfaces:
IPAccessFilter

public class AccessFilter
extends Object
implements IPAccessFilter

This is a class that filters access based on ip adress.

Author:
Robert Olofsson

Constructor Summary
AccessFilter()
           
 
Method Summary
 boolean doIPFiltering(SocketChannel s)
          Filter based on a socket.
 List<IPAccess> getAllowList()
          Get the list of allowed ips
 List<IPAccess> getDenyList()
          Get the list of denied ips
 void loadAccess(Logger logger, Reader r)
          Loads in the accessess allowed from the given Reader
 void saveAccess(Logger logger, Reader r)
          Saves the accesslist from the given Reader.
 void setup(Logger logger, SProperties properties)
          Setup this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessFilter

public AccessFilter()
Method Detail

doIPFiltering

public boolean doIPFiltering(SocketChannel s)
Filter based on a socket.

Specified by:
doIPFiltering in interface IPAccessFilter
Parameters:
s - the SocketChannel to check.
Returns:
true if the Socket should be allowed, false otherwise.

setup

public void setup(Logger logger,
                  SProperties properties)
Setup this class.

Specified by:
setup in interface IPAccessFilter
Parameters:
properties - the Properties to get the settings from.
logger - the Logger to use in case of errors/warnings.

loadAccess

public void loadAccess(Logger logger,
                       Reader r)
                throws IOException
Loads in the accessess allowed from the given Reader

Specified by:
loadAccess in interface IPAccessFilter
Parameters:
r - the Reader were data is available
Throws:
IOException

saveAccess

public void saveAccess(Logger logger,
                       Reader r)
                throws IOException
Saves the accesslist from the given Reader.

Specified by:
saveAccess in interface IPAccessFilter
Parameters:
r - the Reader with the users.
Throws:
IOException

getAllowList

public List<IPAccess> getAllowList()
Get the list of allowed ips

Specified by:
getAllowList in interface IPAccessFilter

getDenyList

public List<IPAccess> getDenyList()
Get the list of denied ips

Specified by:
getDenyList in interface IPAccessFilter