Class ProxyHelper
java.lang.Object
de.captaingoldfish.scim.sdk.client.http.ProxyHelper
author: Pascal Knueppel
created at: 09.12.2019 - 12:17
this helper can be used with the apache http-client to create an http client that will use a proxy.
created at: 09.12.2019 - 12:17
this helper can be used with the apache http-client to create an http client that will use a proxy.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classoverriding lombok builder class -
Constructor Summary
ConstructorsConstructorDescriptionProxyHelper(String systemProxyHost, int systemProxyPort, String systemProxyUsername, String systemProxyPassword) Creates a newProxyHelperinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()org.apache.http.client.config.RequestConfigwill give back a request-config with the proxy settings based on the configuration-popertiesorg.apache.http.client.CredentialsProviderthe host under which the proxy can be reachedoptional proxy password in case of proxy authenticationintthe port on the host under which the proxy can be reachedoptional proxy username in case of proxy authenticationbooleanvoidsetSystemProxyHost(String systemProxyHost) the host under which the proxy can be reachedvoidsetSystemProxyPassword(String systemProxyPassword) optional proxy password in case of proxy authenticationvoidsetSystemProxyPort(int systemProxyPort) the port on the host under which the proxy can be reachedvoidsetSystemProxyUsername(String systemProxyUsername) optional proxy username in case of proxy authentication
-
Constructor Details
-
ProxyHelper
public ProxyHelper(String systemProxyHost, int systemProxyPort, String systemProxyUsername, String systemProxyPassword) Creates a newProxyHelperinstance.- Parameters:
systemProxyHost- the host under which the proxy can be reachedsystemProxyPort- the port on the host under which the proxy can be reachedsystemProxyUsername- optional proxy username in case of proxy authenticationsystemProxyPassword- optional proxy password in case of proxy authentication
-
-
Method Details
-
isProxySet
public boolean isProxySet()- Returns:
- true if a proxy configuration is present, false else
-
getProxyCredentials
public org.apache.http.client.CredentialsProvider getProxyCredentials()- Returns:
- a basic credentials provider that will be used for proxy authentication.
-
getProxyConfig
public org.apache.http.client.config.RequestConfig getProxyConfig()will give back a request-config with the proxy settings based on the configuration-poperties- Returns:
- a new config with the configured proxy or the default-config
-
getProxyAddress
- Returns:
- the currently configured proxy settings as string in the form "localhost:8888"
-
builder
-
getSystemProxyHost
the host under which the proxy can be reached -
getSystemProxyPort
public int getSystemProxyPort()the port on the host under which the proxy can be reached -
getSystemProxyUsername
optional proxy username in case of proxy authentication -
getSystemProxyPassword
optional proxy password in case of proxy authentication -
setSystemProxyHost
the host under which the proxy can be reached -
setSystemProxyPort
public void setSystemProxyPort(int systemProxyPort) the port on the host under which the proxy can be reached -
setSystemProxyUsername
optional proxy username in case of proxy authentication -
setSystemProxyPassword
optional proxy password in case of proxy authentication
-