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
public abstract class HostMatcher extends AbstractMatcher
Used to validate the access to a map service host.
-
-
Constructor Summary
Constructors Constructor Description HostMatcher()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
matches(MatchInfo matchInfo)
Check if the uri is matching.void
setPathRegex(java.lang.String pathRegex)
The regular expression used to verify the path of the uri as is expected.void
setPort(int port)
abstract java.lang.String
toString()
protected abstract java.util.Optional<java.lang.Boolean>
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
-
-
-
-
Method Detail
-
matches
public final boolean matches(MatchInfo matchInfo) throws java.net.UnknownHostException, java.net.SocketException, java.net.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:
java.net.UnknownHostException
java.net.SocketException
java.net.MalformedURLException
-
tryOverrideValidation
protected abstract java.util.Optional<java.lang.Boolean> tryOverrideValidation(MatchInfo matchInfo) throws java.net.UnknownHostException, java.net.SocketException, java.net.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:
java.net.UnknownHostException
java.net.SocketException
java.net.MalformedURLException
-
setPort
public final void setPort(int port)
-
setPathRegex
public final void setPathRegex(java.lang.String pathRegex)
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
public abstract java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-