public final class IpSubnetFilterRule extends Object implements IpFilterRule, Comparable<IpSubnetFilterRule>
RuleBasedIpFilter
that group IP addresses into subnets.
Supports both, IPv4 and IPv6.Constructor and Description |
---|
IpSubnetFilterRule(InetAddress ipAddress,
int cidrPrefix,
IpFilterRuleType ruleType) |
IpSubnetFilterRule(String ipAddress,
int cidrPrefix,
IpFilterRuleType ruleType) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IpSubnetFilterRule ipSubnetFilterRule) |
boolean |
matches(InetSocketAddress remoteAddress) |
IpFilterRuleType |
ruleType() |
public IpSubnetFilterRule(String ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
public IpSubnetFilterRule(InetAddress ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
public boolean matches(InetSocketAddress remoteAddress)
matches
in interface IpFilterRule
public IpFilterRuleType ruleType()
ruleType
in interface IpFilterRule
IpFilterRuleType.ACCEPT
if all
IpFilterRule.matches(InetSocketAddress)
for which IpFilterRule.matches(InetSocketAddress)
returns true should the accepted. If you want to exclude all of those IP addresses then
IpFilterRuleType.REJECT
should be returned.public int compareTo(IpSubnetFilterRule ipSubnetFilterRule)
compareTo
in interface Comparable<IpSubnetFilterRule>
Copyright © 2008–2023 The Netty Project. All rights reserved.