Class IpAddressMatcher
- java.lang.Object
-
- org.springframework.security.web.util.matcher.IpAddressMatcher
-
- All Implemented Interfaces:
RequestMatcher
public final class IpAddressMatcher extends java.lang.Object implements RequestMatcher
Matches a request based on IP Address or subnet mask matching against the remote address.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.
- Since:
- 3.0.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
RequestMatcher.MatchResult
-
-
Constructor Summary
Constructors Constructor Description IpAddressMatcher(java.lang.String ipAddress)
Takes a specific IP address or a range specified using the IP/Netmask (e.g.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(java.lang.String address)
boolean
matches(javax.servlet.http.HttpServletRequest request)
Decides whether the rule implemented by the strategy matches the supplied request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
matcher
-
-
-
-
Method Detail
-
matches
public boolean matches(javax.servlet.http.HttpServletRequest request)
Description copied from interface:RequestMatcher
Decides whether the rule implemented by the strategy matches the supplied request.- Specified by:
matches
in interfaceRequestMatcher
- Parameters:
request
- the request to check for a match- Returns:
- true if the request matches, false otherwise
-
matches
public boolean matches(java.lang.String address)
-
-