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 clientException
protected ChannelFuture handleRefusedChannel(ChannelHandlerContext ctx, ChannelEvent e, InetSocketAddress inetSocketAddress) throws Exception
inetSocketAddress
- the remote InetSocketAddress
from clientException
protected ChannelFuture handleAllowedChannel(ChannelHandlerContext ctx, ChannelEvent e, InetSocketAddress inetSocketAddress) throws Exception
Exception
protected boolean isBlocked(ChannelHandlerContext ctx)
protected boolean continues(ChannelHandlerContext ctx, ChannelEvent e) throws Exception
Exception
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception
ChannelUpstreamHandler
handleUpstream
in interface ChannelUpstreamHandler
ctx
- the context object for this handlere
- the upstream event to process or interceptException
public void setIpFilterListener(IpFilterListener listener)
IpFilteringHandler
setIpFilterListener
in interface IpFilteringHandler
listener
- the new ip filter listenerpublic void removeIpFilterListener()
IpFilteringHandler
removeIpFilterListener
in interface IpFilteringHandler
Copyright © 2008-2013 The Netty Project. All Rights Reserved.