public class BlacklistFilter extends IoFilterAdapter
IoFilter
which blocks connections from blacklisted remote
address.IoFilter.NextFilter
Constructor and Description |
---|
BlacklistFilter() |
Modifier and Type | Method and Description |
---|---|
void |
block(java.net.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(java.net.InetAddress address)
Unblocks the specified endpoint.
|
dataWritten, exceptionCaught, filterWrite, sessionClosed, sessionIdle
public void block(java.net.InetAddress address)
public void unblock(java.net.InetAddress address)
public void dataRead(IoFilter.NextFilter nextFilter, IoSession session, ByteBuffer buf) throws java.lang.Exception
dataRead
in interface IoFilter
dataRead
in class IoFilterAdapter
java.lang.Exception
public void sessionOpened(IoFilter.NextFilter nextFilter, IoSession session) throws java.lang.Exception
sessionOpened
in interface IoFilter
sessionOpened
in class IoFilterAdapter
java.lang.Exception