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 default io. Channel of the ChannelHandlerContext is now active
|
| public void | channelRegistered(ChannelHandlerContext ctx)
Overrides default io. Channel of the ChannelHandlerContext was registered with its EventLoop
|
| protected Future | channelRejected(ChannelHandlerContext ctx, T remoteAddress)
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 default io. Doc from io. The
| |
| channelRegistered | back to summary |
|---|---|
| public void channelRegistered(ChannelHandlerContext ctx) throws Exception Overrides default io. Doc from io. The
| |
| channelRejected | back to summary |
|---|---|
| protected Future This method is called if
| |
| handleNewChannel | back to summary |
|---|---|
| private boolean handleNewChannel(ChannelHandlerContext ctx, boolean register) throws Exception | |