Package org.mapfish.print.http
Class HttpProxy
- java.lang.Object
-
- org.mapfish.print.http.HttpCredential
-
- org.mapfish.print.http.HttpProxy
-
- All Implemented Interfaces:
ConfigurationObject
public final class HttpProxy extends HttpCredential
This configuration object configures the proxies to be used by the system. This is configured as one of the root elements of the config.yamlExample - Proxy all requests except localhost and www.camptocamp.org:
proxies: - !proxy scheme: http host: proxy.host.com port: 8888 username: username password: xyzpassword matchers: - !localMatch reject: true - !dnsMatch host: www.camptocamp.org reject: true - !acceptAll {}
-
-
Constructor Summary
Constructors Constructor Description HttpProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.HttpHost
getHttpHost()
void
setHost(java.lang.String host)
The host of the proxy.void
setMatchers(java.util.List<? extends URIMatcher> matchers)
Matchers are used to choose which requests this proxy applies to.void
setPassword(java.lang.String password)
The password for authenticating with the proxy.void
setPort(int port)
The host of the proxy.void
setScheme(java.lang.String scheme)
The scheme (http, https) of the proxy.void
setUsername(java.lang.String username)
The username for authenticating with the proxy.void
validate(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
validate that the configuration was correct.-
Methods inherited from class org.mapfish.print.http.HttpCredential
getUsername, matches, toCredentials
-
-
-
-
Method Detail
-
getHttpHost
public org.apache.http.HttpHost getHttpHost()
-
setScheme
public void setScheme(java.lang.String scheme)
The scheme (http, https) of the proxy.This is optional, default is http if no username and https if there is a password
- Parameters:
scheme
- the scheme of the proxy
-
setMatchers
public void setMatchers(java.util.List<? extends URIMatcher> matchers)
Matchers are used to choose which requests this proxy applies to.- Overrides:
setMatchers
in classHttpCredential
- Parameters:
matchers
- the matchers to use to determine which requests the applies can be used for- See Also:
URIMatcher
,RestrictUrisProcessor
-
setHost
public void setHost(java.lang.String host)
The host of the proxy. Can be a hostname or ip address.This is required.
- Parameters:
host
- the host of the proxy
-
setUsername
public void setUsername(java.lang.String username)
The username for authenticating with the proxy.This is optional
- Overrides:
setUsername
in classHttpCredential
- Parameters:
username
- the username for authenticating with the proxy
-
setPassword
public void setPassword(java.lang.String password)
The password for authenticating with the proxy.This is optional
- Overrides:
setPassword
in classHttpCredential
- Parameters:
password
- the password for authenticating with the proxy
-
setPort
public void setPort(int port)
The host of the proxy. Can be a hostname or ip address.This is optional. The default value is 80.
- Parameters:
port
- the port of the proxy
-
validate
public void validate(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Specified by:
validate
in interfaceConfigurationObject
- Overrides:
validate
in classHttpCredential
- Parameters:
validationErrors
- a list to add any detected errors to.configuration
- the containing configuration
-
-