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
public class AddressHostMatcher extends InetHostMatcher
Compares ip address string and mask string by usingInetAddress
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/
[[examples=http_processors]]- !ipMatch ip: 192.1.0.0 mask: 255.255.0.0 pathRegex: /print/.+
-
-
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 Constructor Description AddressHostMatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<InetHostMatcher.AddressMask>
createAuthorizedIPs()
Get the full list of authorized IP addresses and the masks.boolean
equals(java.lang.Object obj)
int
hashCode()
void
setIp(java.lang.String ip)
Set the allowed ip address for this matcher.void
setMask(java.lang.String mask)
Set the Mask to apply to the ip address obtained from the URI that is being tested.java.lang.String
toString()
void
validate(java.util.List<java.lang.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
-
-
-
-
Method Detail
-
createAuthorizedIPs
protected final java.util.List<InetHostMatcher.AddressMask> createAuthorizedIPs() throws java.net.UnknownHostException
Description copied from class:InetHostMatcher
Get the full list of authorized IP addresses and the masks.- Specified by:
createAuthorizedIPs
in classInetHostMatcher
- Throws:
java.net.UnknownHostException
-
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.
-
toString
public java.lang.String toString()
- Specified by:
toString
in classHostMatcher
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classInetHostMatcher
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classInetHostMatcher
-
-