Class IpRangeFilter

  • All Implemented Interfaces:
    UriFilter

    public class IpRangeFilter
    extends java.lang.Object
    implements UriFilter
    Filters an URI by inspecting it's IP address is in a given range. The range as must be defined in CIDR notation. e.g. 192.0.2.1/24,
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] matchTo  
      (package private) int numOfBits  
    • Constructor Summary

      Constructors 
      Constructor Description
      IpRangeFilter​(java.lang.String matchTo)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.net.URI uri)
      accept
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • matchTo

        private byte[] matchTo
      • numOfBits

        int numOfBits
    • Constructor Detail

      • IpRangeFilter

        public IpRangeFilter​(java.lang.String matchTo)
        Constructor
        Parameters:
        matchTo - the match subnet in CIDR notation.
    • Method Detail

      • accept

        public boolean accept​(java.net.URI uri)
        accept
        Specified by:
        accept in interface UriFilter
        Parameters:
        uri - the URI to test.
        Returns:
        true if it matches the criteria else false.
        See Also:
        UriFilter.accept(java.net.URI)