This class allows one to filter new Channels based on the
IpFilterRules passed to its constructor. If no rules are provided, all connections
will be accepted.
If you would like to explicitly take action on rejected Channels, you should override
AbstractRemoteAddressFilter#channelRejected(ChannelHandlerContext, SocketAddress).
Consider using IpSubnetFilter for better performance while not as
general purpose as this filter.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | RuleBasedIpFilter(IpFilterRule...
An array of rules)IpFilterRule containing all rules. Create new Instance of |
| public | RuleBasedIpFilter(boolean
If acceptIfNotFound, IpFilterRule... true then accept connection from IP Address if it
doesn't match any rule.An array of rules)IpFilterRule containing all rules.Create new Instance of |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | accept(ChannelHandlerContext ctx, InetSocketAddress remoteAddress)
Implements abstract io. io. gets registered.
|
| public boolean | isSharable()
Overrides default io. true if this handler is sharable and thus can be added
to more than one ChannelPipeline.
|
| acceptIfNotFound | back to summary |
|---|---|
| private final boolean acceptIfNotFound | |
| rules | back to summary |
|---|---|
| private final List<IpFilterRule> rules | |
| RuleBasedIpFilter | back to summary |
|---|---|
| public RuleBasedIpFilter(IpFilterRule... rules) Create new Instance of
| |
| RuleBasedIpFilter | back to summary |
|---|---|
| public RuleBasedIpFilter(boolean acceptIfNotFound, IpFilterRule... rules) Create new Instance of
| |
| accept | back to summary |
|---|---|
| protected boolean accept(ChannelHandlerContext ctx, InetSocketAddress remoteAddress) throws Exception Implements abstract io. Doc from io. This method is called immediately after a
| |
| isSharable | back to summary |
|---|---|
| public boolean isSharable() Overrides default io. Doc from io. Returns
| |