Class ProxyHelper
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.client.http.ProxyHelper
-
public class ProxyHelper extends Object
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.- See Also:
ScimHttpClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProxyHelper.ProxyHelperBuilderoverriding lombok builder class
-
Constructor Summary
Constructors Constructor Description ProxyHelper(String systemProxyHost, int systemProxyPort, String systemProxyUsername, String systemProxyPassword)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProxyHelper.ProxyHelperBuilderbuilder()StringgetProxyAddress()org.apache.http.client.config.RequestConfiggetProxyConfig()will give back a request-config with the proxy settings based on the configuration-popertiesorg.apache.http.client.CredentialsProvidergetProxyCredentials()StringgetSystemProxyHost()the host under which the proxy can be reachedStringgetSystemProxyPassword()optional proxy password in case of proxy authenticationintgetSystemProxyPort()the port on the host under which the proxy can be reachedStringgetSystemProxyUsername()optional proxy username in case of proxy authenticationbooleanisProxySet()voidsetSystemProxyHost(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
-
-
-
Method Detail
-
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
public String getProxyAddress()
- Returns:
- the currently configured proxy settings as string in the form "localhost:8888"
-
builder
public static ProxyHelper.ProxyHelperBuilder builder()
-
getSystemProxyHost
public String 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
public String getSystemProxyUsername()
optional proxy username in case of proxy authentication
-
getSystemProxyPassword
public String getSystemProxyPassword()
optional proxy password in case of proxy authentication
-
setSystemProxyHost
public void setSystemProxyHost(String systemProxyHost)
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
public void setSystemProxyUsername(String systemProxyUsername)
optional proxy username in case of proxy authentication
-
setSystemProxyPassword
public void setSystemProxyPassword(String systemProxyPassword)
optional proxy password in case of proxy authentication
-
-