public abstract class HttpBuilderBase<T extends HttpBuilderBase<?>>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpBuilderBase.DefaultHostRoutePlanner
Implementation that uses the (optional) default configured
HttpHost if the request doesn't explicitly
specify the host as part of the request query. |
protected static class |
HttpBuilderBase.JFrogAuthScheme |
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.impl.client.HttpClientBuilder |
builder |
static int |
CONNECTION_POOL_TIME_TO_LIVE
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
WARNING CONFUSING HTTPCLIENT DOC *
we tested this and the *longer* the timeout is the better it will reuse connections *
and not the opposite as we would expect from reading their convoluted doc *
see RTFACT-13074 *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
protected java.lang.String |
noProxyHosts |
protected org.apache.http.HttpHost |
proxyHost |
| Modifier and Type | Method and Description |
|---|---|
T |
addInterceptorFirst(org.apache.http.HttpRequestInterceptor interceptor) |
T |
addInterceptorLast(org.apache.http.HttpRequestInterceptor httpRequestInterceptor) |
T |
addInterceptorLast(org.apache.http.HttpResponseInterceptor interceptor) |
T |
authentication(java.lang.String username,
java.lang.String password)
Configures preemptive authentication on this client.
|
T |
authentication(java.lang.String username,
java.lang.String password,
boolean allowAnyHost)
Configures preemptive authentication on this client.
|
org.apache.http.impl.client.CloseableHttpClient |
build() |
protected org.apache.http.conn.routing.HttpRoutePlanner |
buildRoutePlanner(java.lang.String noProxyHostsList) |
protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager |
configConnectionManager() |
T |
connectionPoolTTL(int seconds)
How long to keep connections alive for reuse purposes before ditching them
|
T |
connectionTimeout(int connectionTimeout) |
static org.apache.http.conn.ConnectionKeepAliveStrategy |
createConnectionKeepAliveStrategy()
Produces a
ConnectionKeepAliveStrategy |
org.apache.http.HttpHost |
getProxyHost() |
T |
host(java.lang.String host) |
T |
host(java.lang.String host,
int port) |
T |
host(java.lang.String host,
int port,
java.lang.String scheme) |
T |
hostFromUrl(java.lang.String urlStr)
Sets the host the client works with by default.
|
boolean |
isCookieSupportEnabled() |
T |
maxConnectionsPerRoute(int maxConnectionsPerHost) |
T |
maxTotalConnections(int maxTotalConnections) |
T |
noProxyHosts(java.lang.String noProxyHosts) |
T |
proxy(ProxyConfig proxy) |
T |
redirectStrategy(org.apache.http.client.RedirectStrategy redirectStrategy) |
T |
socketTimeout(int soTimeout) |
T |
sslContext(javax.net.ssl.SSLContext sslContext) |
T |
sslContextBuilder(org.apache.http.ssl.SSLContextBuilder sslContextBuilder) |
T |
trustSelfSignCert(boolean trustSelfSignCert) |
T |
userAgent(java.lang.String userAgent)
Sets the User-Agent value
|
protected org.apache.http.impl.client.HttpClientBuilder builder
protected org.apache.http.HttpHost proxyHost
protected java.lang.String noProxyHosts
public static final int CONNECTION_POOL_TIME_TO_LIVE
public org.apache.http.impl.client.CloseableHttpClient build()
protected org.apache.http.conn.routing.HttpRoutePlanner buildRoutePlanner(java.lang.String noProxyHostsList)
public T redirectStrategy(org.apache.http.client.RedirectStrategy redirectStrategy)
public T noProxyHosts(java.lang.String noProxyHosts)
public T userAgent(java.lang.String userAgent)
public T host(java.lang.String host)
public T host(java.lang.String host, int port)
public T host(java.lang.String host, int port, java.lang.String scheme)
public T hostFromUrl(java.lang.String urlStr)
URL formatted string.
This will extract the schema, host and port to use by default.java.lang.IllegalArgumentException - if the given URL is invalidpublic T maxConnectionsPerRoute(int maxConnectionsPerHost)
public T maxTotalConnections(int maxTotalConnections)
public T connectionTimeout(int connectionTimeout)
public T socketTimeout(int soTimeout)
public T addInterceptorLast(org.apache.http.HttpRequestInterceptor httpRequestInterceptor)
public T connectionPoolTTL(int seconds)
seconds - Time to live in secondspublic T trustSelfSignCert(boolean trustSelfSignCert)
trustSelfSignCert - Trust self signed certificates on SSL handshakeTpublic T sslContextBuilder(org.apache.http.ssl.SSLContextBuilder sslContextBuilder)
sslContextBuilder - SSLContext builderTpublic T sslContext(javax.net.ssl.SSLContext sslContext)
sslContext - SSLContextTpublic T authentication(java.lang.String username, java.lang.String password)
Tpublic T authentication(java.lang.String username, java.lang.String password, boolean allowAnyHost)
Tpublic T addInterceptorFirst(org.apache.http.HttpRequestInterceptor interceptor)
public T addInterceptorLast(org.apache.http.HttpResponseInterceptor interceptor)
public T proxy(ProxyConfig proxy)
public org.apache.http.HttpHost getProxyHost()
public boolean isCookieSupportEnabled()
public static org.apache.http.conn.ConnectionKeepAliveStrategy createConnectionKeepAliveStrategy()
ConnectionKeepAliveStrategyprotected org.apache.http.impl.conn.PoolingHttpClientConnectionManager configConnectionManager()