com.atlassian.httpclient.api.factory
Class ProxyOptions.ProxyOptionsBuilder

java.lang.Object
  extended by com.atlassian.httpclient.api.factory.ProxyOptions.ProxyOptionsBuilder
Enclosing class:
ProxyOptions

public static class ProxyOptions.ProxyOptionsBuilder
extends Object

Use this builder to create a ProxyOptions


Constructor Summary
ProxyOptions.ProxyOptionsBuilder()
           
 
Method Summary
 ProxyOptions build()
           
static ProxyOptions.ProxyOptionsBuilder create()
          Create a builder with default options (use what is configured in standard system properties (protocol).proxyHost/(protocol).proxyPort)
 ProxyOptions.ProxyOptionsBuilder withDefaultSystemProperties()
          Obtain proxy configuration for standard system properties (e.g.
 ProxyOptions.ProxyOptionsBuilder withNonProxyHost(Scheme scheme, List<String> nonProxyHosts)
          Add a list of non-proxy hosts for the given scheme.
 ProxyOptions.ProxyOptionsBuilder withNoProxy()
          Use no proxy in the client
 ProxyOptions.ProxyOptionsBuilder withProxy(Map<Scheme,Host> proxyHostMap, Map<Scheme,List<String>> nonProxyHosts)
          Configure proxies as per given arguments.
 ProxyOptions.ProxyOptionsBuilder withProxy(Scheme scheme, Host proxyHost)
          Add a proxy host for the given scheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyOptions.ProxyOptionsBuilder

public ProxyOptions.ProxyOptionsBuilder()
Method Detail

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
                                                  Scheme scheme,
                                                  @Nonnull
                                                  Host 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
                                                         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<Scheme,Host> proxyHostMap,
                                                  Map<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


Copyright © 2012–2015 Atlassian. All rights reserved.