Class HostnameMatcher
java.lang.Object
org.mapfish.print.processor.http.matcher.AbstractMatcher
org.mapfish.print.processor.http.matcher.HostMatcher
org.mapfish.print.processor.http.matcher.HostnameMatcher
- All Implemented Interfaces:
ConfigurationObject
,URIMatcher
Allows to check that a given URL matches a hostname literally (textual match).
Example 1: Accept any www.camptocamp.com url
- !hostnameMatch
host: www.camptocamp.com
Example 2: Accept any www.camptocamp.com url (port == -1 accepts any port)
- !hostnameMatch
host: www.camptocamp.com
port: -1
Example 3: Accept any www.camptocamp.com url on port 80 only
- !hostnameMatch
host: www.camptocamp.com
port: 80
Example 4: Accept www.camptocamp.com urls with paths that start with /print/.
If the regular expression give does not start with / then it will be added because all paths start with /
- !hostnameMatch
host: www.camptocamp.com
pathRegex: /print/.+
-
Field Summary
Fields inherited from class org.mapfish.print.processor.http.matcher.HostMatcher
pathRegex, port
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
void
setAllowSubDomains
(boolean allowSubDomains) Set if sub-domains are allowed.void
Set the host.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.void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.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
-
Constructor Details
-
HostnameMatcher
public HostnameMatcher()
-
-
Method Details
-
validate
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
-
tryOverrideValidation
Description copied from class:HostMatcher
If the subclass has its own checks or if it has a different validation method this method can return a valid value.- Specified by:
tryOverrideValidation
in classHostMatcher
- Parameters:
matchInfo
- the match information to validate.
-
toString
- Specified by:
toString
in classHostMatcher
-
setHost
Set the host.- Parameters:
host
- the host
-
setAllowSubDomains
public void setAllowSubDomains(boolean allowSubDomains) Set if sub-domains are allowed.- Parameters:
allowSubDomains
- true if allowed
-
equals
- Overrides:
equals
in classHostMatcher
-
hashCode
public int hashCode()- Overrides:
hashCode
in classHostMatcher
-