com.atlassian.httpclient.apache.httpcomponents
Class ProvidedHttpClientProxyConfig

java.lang.Object
  extended by com.atlassian.httpclient.apache.httpcomponents.ProvidedHttpClientProxyConfig
All Implemented Interfaces:
HttpClientProxyConfig

public class ProvidedHttpClientProxyConfig
extends java.lang.Object
implements HttpClientProxyConfig

HttpClientProxyConfig implementation that uses proxy configuration from construction, and not from system properties.

Since:
v6.3

Constructor Summary
ProvidedHttpClientProxyConfig(java.util.Map<Scheme,Host> proxyHostMap, java.util.Map<Scheme,java.util.List<java.lang.String>> nonProxyHosts)
           
 
Method Summary
 void applyProxyCredentials(org.apache.http.impl.nio.client.AbstractHttpAsyncClient client, org.apache.http.nio.conn.scheme.AsyncSchemeRegistry schemeRegistry)
          Configure the given client with credentials to access the configured proxy.
 java.util.List<java.lang.String> getNonProxyHosts(org.apache.http.nio.conn.scheme.AsyncScheme scheme)
          Get the list of hosts that don't need to use the proxy for the given HTTP scheme.
 com.atlassian.fugue.Option<org.apache.http.HttpHost> getProxy(org.apache.http.nio.conn.scheme.AsyncScheme scheme)
          Get the proxy to use for the given HTTP scheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProvidedHttpClientProxyConfig

public ProvidedHttpClientProxyConfig(@Nonnull
                                     java.util.Map<Scheme,Host> proxyHostMap,
                                     @Nonnull
                                     java.util.Map<Scheme,java.util.List<java.lang.String>> nonProxyHosts)
Method Detail

getProxy

public com.atlassian.fugue.Option<org.apache.http.HttpHost> getProxy(@Nonnull
                                                                     org.apache.http.nio.conn.scheme.AsyncScheme scheme)
Description copied from interface: HttpClientProxyConfig
Get the proxy to use for the given HTTP scheme.

Specified by:
getProxy in interface HttpClientProxyConfig
Parameters:
scheme - The scheme to provide the proxy for
Returns:
Some HttpHost representing the proxy, or None if no proxy is configured for the scheme

getNonProxyHosts

public java.util.List<java.lang.String> getNonProxyHosts(@Nonnull
                                                         org.apache.http.nio.conn.scheme.AsyncScheme scheme)
Description copied from interface: HttpClientProxyConfig
Get the list of hosts that don't need to use the proxy for the given HTTP scheme.

Specified by:
getNonProxyHosts in interface HttpClientProxyConfig
Parameters:
scheme - The scheme.
Returns:
List of non-proxy host strings that represent hosts that don't require a proxy.

applyProxyCredentials

public void applyProxyCredentials(@Nonnull
                                  org.apache.http.impl.nio.client.AbstractHttpAsyncClient client,
                                  @Nonnull
                                  org.apache.http.nio.conn.scheme.AsyncSchemeRegistry schemeRegistry)
Description copied from interface: HttpClientProxyConfig
Configure the given client with credentials to access the configured proxy.

Specified by:
applyProxyCredentials in interface HttpClientProxyConfig
Parameters:
client - The client to configure
schemeRegistry - the registry of schemes


Copyright © 2012-2014 Atlassian. All Rights Reserved.