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.boolean
int
hashCode()
final void
Set the allowed ip address for this matcher.final void
Set the Mask to apply to the ip address obtained from the URI that is being tested.toString()
final void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.Methods inherited from class org.mapfish.print.processor.http.matcher.InetHostMatcher
clearAuthorizedIPs, tryOverrideValidation
Methods inherited from class org.mapfish.print.processor.http.matcher.HostMatcher
matches, setPathRegex, setPort
Methods inherited from class org.mapfish.print.processor.http.matcher.AbstractMatcher
isReject, setReject
-
Constructor Details
-
AddressHostMatcher
public AddressHostMatcher()
-
-
Method Details
-
createAuthorizedIPs
Description copied from class:InetHostMatcher
Get the full list of authorized IP addresses and the masks.- Specified by:
createAuthorizedIPs
in classInetHostMatcher
- Throws:
UnknownHostException
-
validate
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
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:
toString
in classHostMatcher
-
hashCode
public int hashCode()- Overrides:
hashCode
in classInetHostMatcher
-
equals
- Overrides:
equals
in classInetHostMatcher
-