@ChannelHandler.Sharable public class RuleBasedIpFilter extends AbstractRemoteAddressFilter<InetSocketAddress>
Channel
s based on the
IpFilterRule
s passed to its constructor. If no rules are provided, all connections
will be accepted.
If you would like to explicitly take action on rejected Channel
s, you should override
AbstractRemoteAddressFilter.channelRejected(ChannelHandlerContext, SocketAddress)
.Constructor and Description |
---|
RuleBasedIpFilter(IpFilterRule... rules) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(io.netty.channel.ChannelHandlerContext ctx,
InetSocketAddress remoteAddress)
This method is called immediately after a
Channel gets registered. |
channelAccepted, channelActive, channelRegistered, channelRejected
channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public RuleBasedIpFilter(IpFilterRule... rules)
protected boolean accept(io.netty.channel.ChannelHandlerContext ctx, InetSocketAddress remoteAddress) throws Exception
AbstractRemoteAddressFilter
Channel
gets registered.accept
in class AbstractRemoteAddressFilter<InetSocketAddress>
Exception
Copyright © 2008–2019 The Netty Project. All rights reserved.