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(InetAddress address)
Blocks the specified endpoint.
|
void |
block(Subnet subnet)
Blocks the specified subnet.
|
void |
messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
Filters
IoHandler.messageReceived(IoSession,Object) event. |
void |
messageSent(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
Filters
IoHandler.messageSent(IoSession,Object) event. |
void |
sessionClosed(IoFilter.NextFilter nextFilter,
IoSession session)
Filters
IoHandler.sessionClosed(IoSession) event. |
void |
sessionCreated(IoFilter.NextFilter nextFilter,
IoSession session)
Filters
IoHandler.sessionCreated(IoSession) event. |
void |
sessionIdle(IoFilter.NextFilter nextFilter,
IoSession session,
IdleStatus status)
Filters
IoHandler.sessionIdle(IoSession,IdleStatus) event. |
void |
sessionOpened(IoFilter.NextFilter nextFilter,
IoSession session)
Filters
IoHandler.sessionOpened(IoSession) event. |
void |
setBlacklist(InetAddress[] addresses)
Sets the addresses to be blacklisted.
|
void |
setBlacklist(Iterable<InetAddress> addresses)
Sets the addresses to be blacklisted.
|
void |
setSubnetBlacklist(Iterable<Subnet> subnets)
Sets the subnets to be blacklisted.
|
void |
setSubnetBlacklist(Subnet[] subnets)
Sets the subnets to be blacklisted.
|
void |
unblock(InetAddress address)
Unblocks the specified endpoint.
|
void |
unblock(Subnet subnet)
Unblocks the specified subnet.
|
destroy, exceptionCaught, filterClose, filterWrite, init, inputClosed, onPostAdd, onPostRemove, onPreAdd, onPreRemove, toStringpublic void setBlacklist(InetAddress[] addresses)
addresses - an array of addresses to be blacklisted.public void setSubnetBlacklist(Subnet[] subnets)
subnets - an array of subnets to be blacklisted.public void setBlacklist(Iterable<InetAddress> addresses)
addresses - a collection of InetAddress objects representing the
addresses to be blacklisted.IllegalArgumentException - if the specified collections contains
non-InetAddress objects.public void setSubnetBlacklist(Iterable<Subnet> subnets)
subnets - an array of subnets to be blacklisted.public void block(InetAddress address)
public void block(Subnet subnet)
public void unblock(InetAddress address)
public void unblock(Subnet subnet)
public void sessionCreated(IoFilter.NextFilter nextFilter, IoSession session)
IoFilterAdapterIoHandler.sessionCreated(IoSession) event.sessionCreated in interface IoFiltersessionCreated in class IoFilterAdapternextFilter - the IoFilter.NextFilter for this filter. You can reuse this
object until this filter is removed from the chain.session - The IoSession which has received this eventpublic void sessionOpened(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
IoFilterAdapterIoHandler.sessionOpened(IoSession) event.sessionOpened in interface IoFiltersessionOpened in class IoFilterAdapternextFilter - the IoFilter.NextFilter for this filter. You can reuse this
object until this filter is removed from the chain.session - The IoSession which has received this eventExceptionpublic void sessionClosed(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
IoFilterAdapterIoHandler.sessionClosed(IoSession) event.sessionClosed in interface IoFiltersessionClosed in class IoFilterAdapternextFilter - the IoFilter.NextFilter for this filter. You can reuse this
object until this filter is removed from the chain.session - The IoSession which has received this eventExceptionpublic void sessionIdle(IoFilter.NextFilter nextFilter, IoSession session, IdleStatus status) throws Exception
IoFilterAdapterIoHandler.sessionIdle(IoSession,IdleStatus) event.sessionIdle in interface IoFiltersessionIdle in class IoFilterAdapternextFilter - the IoFilter.NextFilter for this filter. You can reuse this
object until this filter is removed from the chain.session - The IoSession which has received this eventstatus - The IdleStatus typeExceptionpublic void messageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message)
IoFilterAdapterIoHandler.messageReceived(IoSession,Object) event.messageReceived in interface IoFiltermessageReceived in class IoFilterAdapternextFilter - the IoFilter.NextFilter for this filter. You can reuse this
object until this filter is removed from the chain.session - The IoSession which has received this eventmessage - The received messagepublic void messageSent(IoFilter.NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception
IoFilterAdapterIoHandler.messageSent(IoSession,Object) event.messageSent in interface IoFiltermessageSent in class IoFilterAdapternextFilter - the IoFilter.NextFilter for this filter. You can reuse this
object until this filter is removed from the chain.session - The IoSession which has received this eventwriteRequest - The WriteRequest that contains the sent messageExceptionCopyright © 2004–2017 Apache MINA Project. All rights reserved.