Class HostMatcher
java.lang.Object
org.mapfish.print.processor.http.matcher.AbstractMatcher
org.mapfish.print.processor.http.matcher.HostMatcher
- All Implemented Interfaces:
ConfigurationObject
,URIMatcher
- Direct Known Subclasses:
DnsHostMatcher
,HostnameMatcher
,InetHostMatcher
Used to validate the access to a map service host.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
final boolean
Check if the uri is matching.final void
setPathRegex
(String pathRegex) The regular expression used to verify the path of the uri as is expected.final void
setPort
(int port) Port of this host matcher.abstract String
toString()
tryOverrideValidation
(MatchInfo matchInfo) If the subclass has its own checks or if it has a different validation method this method can return a valid value.Methods inherited from class org.mapfish.print.processor.http.matcher.AbstractMatcher
isReject, setReject
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.mapfish.print.config.ConfigurationObject
validate
-
Field Details
-
port
protected int portThe request port. -1 is the unset/default number -
pathRegex
A regex that will be ran against the host name. If there is a match then the matcher accepts the uri.
-
-
Constructor Details
-
HostMatcher
public HostMatcher()
-
-
Method Details
-
matches
public final boolean matches(MatchInfo matchInfo) throws UnknownHostException, SocketException, MalformedURLException Description copied from interface:URIMatcher
Check if the uri is matching.- Parameters:
matchInfo
- the matching information to check- Returns:
- true if the uri is matching or false otherwise
- Throws:
UnknownHostException
SocketException
MalformedURLException
-
tryOverrideValidation
protected abstract Optional<Boolean> tryOverrideValidation(MatchInfo matchInfo) throws UnknownHostException, SocketException, MalformedURLException If the subclass has its own checks or if it has a different validation method this method can return a valid value.- Parameters:
matchInfo
- the match information to validate.- Throws:
UnknownHostException
SocketException
MalformedURLException
-
setPort
public final void setPort(int port) Port of this host matcher. -
setPathRegex
The regular expression used to verify the path of the uri as is expected. All paths start with /.The regular expression used are the ones supported by java: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
- Parameters:
pathRegex
- the regular expression.
-
toString
-
hashCode
public int hashCode() -
equals
-