Class AddressHostMatcher

  • All Implemented Interfaces:
    ConfigurationObject, URIMatcher

    public class AddressHostMatcher
    extends InetHostMatcher
    Compares ip address string and mask string by using InetAddress comparison.

    Example 1: accept any uri whose host matches the ip of www.camptocamp.com

    
         - !ipMatch
           ip: www.camptocamp.com
     

    Example 2: accept any uri whose host ip starts with 192.1

    
         - !ipMatch
           ip: 192.1.0.0
           mask: 255.255.0.0
     

    Example 3: accept any uri whose host ip starts with 192.1 and restricts to port 80

    
         - !ipMatch
           ip: 192.1.0.0
           mask: 255.255.0.0
           port: 80
     

    Example 4: accept any uri whose host ip starts with 192.1 and and allows any port (-1 is any port)

    
         - !ipMatch
           ip: 192.1.0.0
           mask: 255.255.0.0
           port: -1
     

    Example 5: accept any uri whose host ip starts with 192.1 and restricts to paths that start with /print/

    
         - !ipMatch
           ip: 192.1.0.0
           mask: 255.255.0.0
           pathRegex: /print/.+
     
    [[examples=http_processors]]
    • Constructor Detail

      • AddressHostMatcher

        public AddressHostMatcher()
    • Method Detail

      • validate

        public final void validate​(java.util.List<java.lang.Throwable> validationErrors,
                                   Configuration configuration)
        Description copied from interface: ConfigurationObject
        validate that the configuration was correct.
        Parameters:
        validationErrors - a list to add any detected errors to.
        configuration - the containing configuration
      • setIp

        public final void setIp​(java.lang.String ip)
        Set the allowed ip address for this matcher.
        Parameters:
        ip - the ip address.
      • setMask

        public final void setMask​(java.lang.String mask)
        Set the Mask to apply to the ip address obtained from the URI that is being tested.
        Parameters:
        mask - the mask ip address.