public final class IpSubnetFilterRule extends java.lang.Object implements IpFilterRule
RuleBasedIpFilter
that group IP addresses into subnets.
Supports both, IPv4 and IPv6.Modifier and Type | Class and Description |
---|---|
private static class |
IpSubnetFilterRule.Ip4SubnetFilterRule |
private static class |
IpSubnetFilterRule.Ip6SubnetFilterRule |
Modifier and Type | Field and Description |
---|---|
private IpFilterRule |
filterRule |
Constructor and Description |
---|
IpSubnetFilterRule(java.net.InetAddress ipAddress,
int cidrPrefix,
IpFilterRuleType ruleType) |
IpSubnetFilterRule(java.lang.String ipAddress,
int cidrPrefix,
IpFilterRuleType ruleType) |
Modifier and Type | Method and Description |
---|---|
boolean |
matches(java.net.InetSocketAddress remoteAddress) |
IpFilterRuleType |
ruleType() |
private static IpFilterRule |
selectFilterRule(java.net.InetAddress ipAddress,
int cidrPrefix,
IpFilterRuleType ruleType) |
private final IpFilterRule filterRule
public IpSubnetFilterRule(java.lang.String ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
public IpSubnetFilterRule(java.net.InetAddress ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
private static IpFilterRule selectFilterRule(java.net.InetAddress ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
public boolean matches(java.net.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.