Package org.mapfish.print.http
Class HttpProxy
java.lang.Object
org.mapfish.print.http.HttpCredential
org.mapfish.print.http.HttpProxy
- All Implemented Interfaces:
ConfigurationObject
This configuration object configures the proxies to be used by the system. This is configured as
one of the root elements of the config.yaml
Example - 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 -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.HttpHost
void
The host of the proxy.void
setMatchers
(List<? extends URIMatcher> matchers) Matchers are used to choose which requests this proxy applies to.void
setPassword
(String password) The password for authenticating with the proxy.void
setPort
(int port) The host of the proxy.void
The scheme (http, https) of the proxy.void
setUsername
(String username) The username for authenticating with the proxy.void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.Methods inherited from class org.mapfish.print.http.HttpCredential
getUsername, matches, toCredentials
-
Constructor Details
-
HttpProxy
public HttpProxy()
-
-
Method Details
-
getHttpHost
public org.apache.http.HttpHost getHttpHost() -
setScheme
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
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:
-
setHost
The host of the proxy. Can be a hostname or ip address.This is required.
- Parameters:
host
- the host of the proxy
-
setUsername
The username for authenticating with the proxy.This is optional
- Overrides:
setUsername
in classHttpCredential
- Parameters:
username
- the username for authenticating with the proxy
-
setPassword
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
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
-