public final class IpAddressMatcher extends java.lang.Object implements RequestMatcher
Both IPv6 and IPv4 addresses are supported, but a matcher which is configured with an IPv4 address will never match a request which returns an IPv6 address, and vice-versa.
RequestMatcher.MatchResult
Constructor and Description |
---|
IpAddressMatcher(java.lang.String ipAddress)
Takes a specific IP address or a range specified using the IP/Netmask (e.g.
|
Modifier and Type | Method and Description |
---|---|
boolean |
matches(javax.servlet.http.HttpServletRequest request)
Decides whether the rule implemented by the strategy matches the supplied request.
|
boolean |
matches(java.lang.String address) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
matcher
public IpAddressMatcher(java.lang.String ipAddress)
ipAddress
- the address or range of addresses from which the request must
come.public boolean matches(javax.servlet.http.HttpServletRequest request)
RequestMatcher
matches
in interface RequestMatcher
request
- the request to check for a matchpublic boolean matches(java.lang.String address)