public class DnsHostMatcher extends HostMatcher
Example 1: Accept any www.camptocamp.com url
- !dnsMatch
host : www.camptocamp.com
Example 2: Accept any www.camptocamp.com url (port == -1 accepts any port)
- !dnsMatch
host : www.camptocamp.com
port : -1
Example 3: Accept any www.camptocamp.com url on port 80 only
- !dnsMatch
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 /
- !dnsMatch
host : www.camptocamp.com
pathRegex : /print/.+
[[examples=http_processors]]pathRegex, port| Constructor and Description |
|---|
DnsHostMatcher() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
void |
setHost(java.lang.String host)
Set the host.
|
java.lang.String |
toString() |
java.util.Optional<java.lang.Boolean> |
tryOverrideValidation(MatchInfo matchInfo)
Check the given URI to see if it matches.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
matches, setPathRegex, setPortisReject, setRejectpublic final java.util.Optional<java.lang.Boolean> tryOverrideValidation(MatchInfo matchInfo) throws java.net.SocketException, java.net.UnknownHostException, java.net.MalformedURLException
tryOverrideValidation in class HostMatchermatchInfo - the matchInfo to validate.java.net.SocketExceptionjava.net.UnknownHostExceptionjava.net.MalformedURLExceptionpublic 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 setHost(java.lang.String host)
throws java.net.UnknownHostException
host - the hostjava.net.UnknownHostExceptionpublic java.lang.String toString()
toString in class HostMatcherpublic int hashCode()
hashCode in class HostMatcherpublic boolean equals(java.lang.Object obj)
equals in class HostMatcher