Channels
based on their IP address.
You should inherit from this class if you would like to implement your own IP-based filter. Basically you have to
implement accept(ChannelHandlerContext, SocketAddress) to decided whether you want to accept or reject
a connection from the remote address.
Furthermore overriding channelRejected(ChannelHandlerContext, SocketAddress) gives you the
flexibility to respond to rejected (denied) connections. If you do not want to send a response, just have it return
null. Take a look at RuleBasedIpFilter for details.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract boolean | Returns: Return true if connections from this IP address and port should be accepted. False otherwise.This method is called immediately after a |
| protected void | channelAccepted(ChannelHandlerContext ctx, T remoteAddress)
This method is called if |
| public void | channelActive(ChannelHandlerContext ctx)
Overrides io. Implements io. ChannelHandlerContext#fireChannelActive() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
|
| public void | channelRegistered(ChannelHandlerContext ctx)
Overrides io. Implements io. ChannelHandlerContext#fireChannelRegistered() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
|
| protected ChannelFuture | Returns: AChannelFuture if you perform I/O operations, so that
the Channel can be closed once it completes. Null otherwise.This method is called if |
| private boolean |
| AbstractRemoteAddressFilter | back to summary |
|---|---|
| public AbstractRemoteAddressFilter() | |
| accept | back to summary |
|---|---|
| protected abstract boolean accept(ChannelHandlerContext ctx, T remoteAddress) throws Exception This method is called immediately after a
| |
| channelAccepted | back to summary |
|---|---|
| protected void channelAccepted(ChannelHandlerContext ctx, T remoteAddress) This method is called if
| |
| channelActive | back to summary |
|---|---|
| public void channelActive(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelRegistered | back to summary |
|---|---|
| public void channelRegistered(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelRejected | back to summary |
|---|---|
| protected ChannelFuture channelRejected(ChannelHandlerContext ctx, T remoteAddress) This method is called if
| |
| handleNewChannel | back to summary |
|---|---|
| private boolean handleNewChannel(ChannelHandlerContext ctx) throws Exception | |