Class ProxyOptions.ProxyOptionsBuilder
java.lang.Object
fr.enedis.chutney.jira.infra.atlassian.httpclient.api.factory.ProxyOptions.ProxyOptionsBuilder
- Enclosing class:
ProxyOptions
Use this builder to create a ProxyOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()create()Create a builder with default options (use what is configured in standard system properties (protocol).proxyHost/(protocol).proxyPort)Obtain proxy configuration for standard system properties (e.g. http.proxyHost, http.proxyPort, http.proxyUser, etc.)withNonProxyHost(com.atlassian.httpclient.api.factory.Scheme scheme, List<String> nonProxyHosts) Add a list of non-proxy hosts for the given scheme.Use no proxy in the clientwithProxy(com.atlassian.httpclient.api.factory.Scheme scheme, org.apache.hc.core5.http.HttpHost proxyHost) Add a proxy host for the given scheme.withProxy(Map<com.atlassian.httpclient.api.factory.Scheme, org.apache.hc.core5.http.HttpHost> proxyHostMap, Map<com.atlassian.httpclient.api.factory.Scheme, List<String>> nonProxyHosts) Configure proxies as per given arguments.
-
Constructor Details
-
ProxyOptionsBuilder
public ProxyOptionsBuilder()
-
-
Method Details
-
create
Create a builder with default options (use what is configured in standard system properties (protocol).proxyHost/(protocol).proxyPort)- Returns:
- Builder with default options set.
-
build
- Returns:
- The proxy options from the builder settings
-
withNoProxy
Use no proxy in the client- Returns:
- Builder with 'no proxy' option set
-
withDefaultSystemProperties
Obtain proxy configuration for standard system properties (e.g. http.proxyHost, http.proxyPort, http.proxyUser, etc.)- Returns:
- Builder with 'system properties' option set.
-
withProxy
public ProxyOptions.ProxyOptionsBuilder withProxy(@Nonnull com.atlassian.httpclient.api.factory.Scheme scheme, @Nonnull org.apache.hc.core5.http.HttpHost proxyHost) Add a proxy host for the given scheme. This enables 'configured' proxy mode, and will not obtain settings from system properties any more.- Parameters:
scheme- the schemeproxyHost- the proxy host- Returns:
- Builder with appropriate settings
-
withNonProxyHost
public ProxyOptions.ProxyOptionsBuilder withNonProxyHost(@Nonnull com.atlassian.httpclient.api.factory.Scheme scheme, @Nonnull List<String> nonProxyHosts) Add a list of non-proxy hosts for the given scheme. This enables 'configured' proxy mode, and will not obtain settings from system properties any more.- Parameters:
scheme- The schemenonProxyHosts- The list of non-proxy hosts- Returns:
- Builder with appropriate settings
-
withProxy
public ProxyOptions.ProxyOptionsBuilder withProxy(Map<com.atlassian.httpclient.api.factory.Scheme, org.apache.hc.core5.http.HttpHost> proxyHostMap, Map<com.atlassian.httpclient.api.factory.Scheme, List<String>> nonProxyHosts) Configure proxies as per given arguments. This enables 'configured' proxy mode, and will not obtain settings from system properties any more.- Parameters:
proxyHostMap- Map of schemes to proxy hosts.nonProxyHosts- List of hosts that we shouldn't use the proxy for- Returns:
- Builder with appropriate settings
-