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 |
event(IoFilter.NextFilter nextFilter,
IoSession session,
FilterEvent event)
Propagate an event up to the
IoHandler |
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 |
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, sessionClosed, 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)
address - The address to blockpublic void block(Subnet subnet)
subnet - The subnet to blockpublic void unblock(InetAddress address)
address - The address to unblockpublic void unblock(Subnet subnet)
subnet - The subnet to unblockpublic void event(IoFilter.NextFilter nextFilter, IoSession session, FilterEvent event) throws Exception
IoHandlerevent in interface IoFilterevent 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 to process this invocationevent - The event to propagateException - If an error occurred while processing the eventpublic void sessionCreated(IoFilter.NextFilter nextFilter, IoSession session)
IoHandler.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
IoHandler.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 eventException - If an error occurred while processing the eventpublic void sessionIdle(IoFilter.NextFilter nextFilter, IoSession session, IdleStatus status) throws Exception
IoHandler.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 typeException - If an error occurred while processing the eventpublic void messageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message)
IoHandler.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
IoHandler.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 messageException - If an error occurred while processing the eventCopyright © 2004–2024 Apache MINA Project. All rights reserved.