Class ProxyOptions.ProxyOptionsBuilder

java.lang.Object
fr.enedis.chutney.jira.infra.atlassian.httpclient.api.factory.ProxyOptions.ProxyOptionsBuilder
Enclosing class:
ProxyOptions

public static class ProxyOptions.ProxyOptionsBuilder extends Object
Use this builder to create a ProxyOptions
  • Constructor Details

    • ProxyOptionsBuilder

      public ProxyOptionsBuilder()
  • Method Details

    • create

      public static ProxyOptions.ProxyOptionsBuilder 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

      public ProxyOptions build()
      Returns:
      The proxy options from the builder settings
    • withNoProxy

      public ProxyOptions.ProxyOptionsBuilder withNoProxy()
      Use no proxy in the client
      Returns:
      Builder with 'no proxy' option set
    • withDefaultSystemProperties

      public ProxyOptions.ProxyOptionsBuilder 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 scheme
      proxyHost - 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 scheme
      nonProxyHosts - 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