public class AddressHostMatcher extends InetHostMatcher
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]]InetHostMatcher.AddressMaskpathRegex, port| Constructor and Description |
|---|
AddressHostMatcher() |
| Modifier and Type | Method and 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.
|
clearAuthorizedIPs, tryOverrideValidationmatches, setPathRegex, setPortisReject, setRejectprotected final java.util.List<InetHostMatcher.AddressMask> createAuthorizedIPs() throws java.net.UnknownHostException
InetHostMatchercreateAuthorizedIPs in class InetHostMatcherjava.net.UnknownHostExceptionpublic final void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configurationpublic final void setIp(java.lang.String ip)
ip - the ip address.public final void setMask(java.lang.String mask)
mask - the mask ip address.public java.lang.String toString()
toString in class HostMatcherpublic int hashCode()
hashCode in class InetHostMatcherpublic boolean equals(java.lang.Object obj)
equals in class InetHostMatcher