org.apache.mina.io.filter
Class BlacklistFilter

java.lang.Object
  extended by org.apache.mina.io.IoFilterAdapter
      extended by org.apache.mina.io.filter.BlacklistFilter
All Implemented Interfaces:
IoFilter

public class BlacklistFilter
extends IoFilterAdapter

A IoFilter which blocks connections from blacklisted remote address.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
Author:
The Apache Directory Project (dev@directory.apache.org)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.mina.io.IoFilter
IoFilter.NextFilter
 
Constructor Summary
BlacklistFilter()
           
 
Method Summary
 void block(InetAddress address)
          Blocks the specified endpoint.
 void dataRead(IoFilter.NextFilter nextFilter, IoSession session, ByteBuffer buf)
          Forwards event if and if only the remote address of session is not blacklisted.
 void sessionOpened(IoFilter.NextFilter nextFilter, IoSession session)
          Close connection immediately if the remote address of session is blacklisted.
 void unblock(InetAddress address)
          Unblocks the specified endpoint.
 
Methods inherited from class org.apache.mina.io.IoFilterAdapter
dataWritten, exceptionCaught, filterWrite, sessionClosed, sessionIdle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlacklistFilter

public BlacklistFilter()
Method Detail

block

public void block(InetAddress address)
Blocks the specified endpoint.


unblock

public void unblock(InetAddress address)
Unblocks the specified endpoint.


dataRead

public void dataRead(IoFilter.NextFilter nextFilter,
                     IoSession session,
                     ByteBuffer buf)
              throws Exception
Forwards event if and if only the remote address of session is not blacklisted.

Specified by:
dataRead in interface IoFilter
Overrides:
dataRead in class IoFilterAdapter
Throws:
Exception

sessionOpened

public void sessionOpened(IoFilter.NextFilter nextFilter,
                          IoSession session)
                   throws Exception
Close connection immediately if the remote address of session is blacklisted.

Specified by:
sessionOpened in interface IoFilter
Overrides:
sessionOpened in class IoFilterAdapter
Throws:
Exception


Copyright © 2004-2005 . All Rights Reserved.