public abstract class IpFilteringHandlerImpl extends Object implements ChannelUpstreamHandler, IpFilteringHandler
ChannelHandler.Sharable| Constructor and Description |
|---|
IpFilteringHandlerImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
accept(ChannelHandlerContext ctx,
ChannelEvent e,
InetSocketAddress inetSocketAddress)
Called when the channel is connected.
|
protected boolean |
continues(ChannelHandlerContext ctx,
ChannelEvent e)
Called in handleUpstream, if this channel was previously blocked,
to check if whatever the event, it should be passed to the next entry in the pipeline.
|
protected ChannelFuture |
handleAllowedChannel(ChannelHandlerContext ctx,
ChannelEvent e,
InetSocketAddress inetSocketAddress) |
protected ChannelFuture |
handleRefusedChannel(ChannelHandlerContext ctx,
ChannelEvent e,
InetSocketAddress inetSocketAddress)
Called when the channel has the CONNECTED status and the channel was refused by a previous call to accept().
|
void |
handleUpstream(ChannelHandlerContext ctx,
ChannelEvent e)
Handles the specified upstream event.
|
protected boolean |
isBlocked(ChannelHandlerContext ctx)
Internal method to test if the current channel is blocked.
|
void |
removeIpFilterListener()
Remove the filter listener.
|
void |
setIpFilterListener(IpFilterListener listener)
Sets the filter listener.
|
protected abstract boolean accept(ChannelHandlerContext ctx, ChannelEvent e, InetSocketAddress inetSocketAddress) throws Exception
inetSocketAddress - the remote InetSocketAddress from clientExceptionprotected ChannelFuture handleRefusedChannel(ChannelHandlerContext ctx, ChannelEvent e, InetSocketAddress inetSocketAddress) throws Exception
inetSocketAddress - the remote InetSocketAddress from clientExceptionprotected ChannelFuture handleAllowedChannel(ChannelHandlerContext ctx, ChannelEvent e, InetSocketAddress inetSocketAddress) throws Exception
Exceptionprotected boolean isBlocked(ChannelHandlerContext ctx)
protected boolean continues(ChannelHandlerContext ctx, ChannelEvent e) throws Exception
Exceptionpublic void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception
ChannelUpstreamHandlerhandleUpstream in interface ChannelUpstreamHandlerctx - the context object for this handlere - the upstream event to process or interceptExceptionpublic void setIpFilterListener(IpFilterListener listener)
IpFilteringHandlersetIpFilterListener in interface IpFilteringHandlerlistener - the new ip filter listenerpublic void removeIpFilterListener()
IpFilteringHandlerremoveIpFilterListener in interface IpFilteringHandlerCopyright © 2008-2015 The Netty Project. All Rights Reserved.