Class IpSubnetFilterRule

  • All Implemented Interfaces:
    java.lang.Comparable<IpSubnet>, IpFilterRule, IpSet

    public class IpSubnetFilterRule
    extends IpSubnet
    implements IpFilterRule
    Ip V4 and Ip V6 filter rule.

    Note that mix of IPV4 and IPV6 is allowed but it is not recommended. So it is preferable to not mix IPV4 addresses with IPV6 rules, even if it should work.
    • Field Detail

      • isAllowRule

        private boolean isAllowRule
        Is this IpV4Subnet an ALLOW or DENY rule
    • Constructor Detail

      • IpSubnetFilterRule

        public IpSubnetFilterRule​(boolean allow)
        Constructor for a ALLOW or DENY ALL
        Parameters:
        allow - True for ALLOW, False for DENY
      • IpSubnetFilterRule

        public IpSubnetFilterRule​(boolean allow,
                                  java.net.InetAddress inetAddress,
                                  int cidrNetMask)
                           throws java.net.UnknownHostException
        Parameters:
        allow - True for ALLOW, False for DENY
        Throws:
        java.net.UnknownHostException
      • IpSubnetFilterRule

        public IpSubnetFilterRule​(boolean allow,
                                  java.net.InetAddress inetAddress,
                                  java.lang.String netMask)
                           throws java.net.UnknownHostException
        Parameters:
        allow - True for ALLOW, False for DENY
        Throws:
        java.net.UnknownHostException
      • IpSubnetFilterRule

        public IpSubnetFilterRule​(boolean allow,
                                  java.lang.String netAddress)
                           throws java.net.UnknownHostException
        Parameters:
        allow - True for ALLOW, False for DENY
        Throws:
        java.net.UnknownHostException
    • Method Detail

      • isAllowRule

        public boolean isAllowRule()
        Specified by:
        isAllowRule in interface IpFilterRule
        Returns:
        True if this Rule is an ALLOW rule
      • isDenyRule

        public boolean isDenyRule()
        Specified by:
        isDenyRule in interface IpFilterRule
        Returns:
        True if this Rule is a DENY rule