Class AddressHostMatcher
java.lang.Object
org.mapfish.print.processor.http.matcher.AbstractMatcher
org.mapfish.print.processor.http.matcher.HostMatcher
org.mapfish.print.processor.http.matcher.InetHostMatcher
org.mapfish.print.processor.http.matcher.AddressHostMatcher
- All Implemented Interfaces:
ConfigurationObject,URIMatcher
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]]-
Nested Class Summary
Nested classes/interfaces inherited from class org.mapfish.print.processor.http.matcher.InetHostMatcher
InetHostMatcher.AddressMask -
Field Summary
Fields inherited from class org.mapfish.print.processor.http.matcher.HostMatcher
pathRegex, port -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final List<InetHostMatcher.AddressMask> Get the full list of authorized IP addresses and the masks.booleaninthashCode()final voidSet the allowed ip address for this matcher.final voidSet the Mask to apply to the ip address obtained from the URI that is being tested.toString()final voidvalidate(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.Methods inherited from class org.mapfish.print.processor.http.matcher.InetHostMatcher
clearAuthorizedIPs, tryOverrideValidationMethods inherited from class org.mapfish.print.processor.http.matcher.HostMatcher
matches, setPathRegex, setPortMethods inherited from class org.mapfish.print.processor.http.matcher.AbstractMatcher
isReject, setReject
-
Constructor Details
-
AddressHostMatcher
public AddressHostMatcher()
-
-
Method Details
-
createAuthorizedIPs
Description copied from class:InetHostMatcherGet the full list of authorized IP addresses and the masks.- Specified by:
createAuthorizedIPsin classInetHostMatcher- Throws:
UnknownHostException
-
validate
Description copied from interface:ConfigurationObjectvalidate that the configuration was correct.- Parameters:
validationErrors- a list to add any detected errors to.configuration- the containing configuration
-
setIp
Set the allowed ip address for this matcher.- Parameters:
ip- the ip address.
-
setMask
Set the Mask to apply to the ip address obtained from the URI that is being tested.- Parameters:
mask- the mask ip address.
-
toString
- Specified by:
toStringin classHostMatcher
-
hashCode
public int hashCode()- Overrides:
hashCodein classInetHostMatcher
-
equals
- Overrides:
equalsin classInetHostMatcher
-