Top Description Fields Constructors Methods
org.apache.hc.client5.http.protocol

public Class HttpClientContext

extends HttpCoreContext
Class Inheritance
Imports
java.util.HashMap, .Map, org.apache.hc.client5.http.HttpRoute, .RouteInfo, org.apache.hc.client5.http.auth.AuthCache, .AuthExchange, .AuthScheme, .AuthSchemeFactory, .CredentialsProvider, org.apache.hc.client5.http.config.RequestConfig, org.apache.hc.client5.http.cookie.CookieOrigin, .CookieSpec, .CookieSpecFactory, .CookieStore, org.apache.hc.core5.http.HttpHost, org.apache.hc.core5.http.config.Lookup, org.apache.hc.core5.http.protocol.BasicHttpContext, .HttpContext, .HttpCoreContext, org.apache.hc.core5.util.Args

Adaptor class that provides convenience type safe setters and getters for common HttpContext attributes used in the course of HTTP request execution.
Since
4.3

Field Summary

Modifier and TypeField and Description
public static final String
AUTH_CACHE

Attribute name of a AuthCache object that represents the auth scheme cache.

public static final String
AUTH_EXCHANGE_MAP

Attribute name of a map containing actual AuthExchanges keyed by their respective org.apache.hc.core5.http.HttpHost.

public static final String
AUTHSCHEME_REGISTRY

Attribute name of a org.apache.hc.core5.http.config.Lookup object that represents the actual AuthSchemeFactory registry.

public static final String
COOKIESPEC_REGISTRY

Attribute name of a org.apache.hc.core5.http.config.Lookup object that represents the actual CookieSpecFactory registry.

public static final String
CREDS_PROVIDER

Attribute name of a CredentialsProvider object that represents the actual credentials provider.

public static final String
EXCHANGE_ID

Attribute name of a java.lang.String object that represents the ID of the current message exchange.

public static final String
HTTP_ROUTE

Attribute name of a RouteInfo object that represents the actual connection route.

public static final String
REDIRECT_LOCATIONS

Attribute name of a RedirectLocations object that represents a collection of all redirect locations received in the process of request execution.

public static final String
REQUEST_CONFIG

Attribute name of a org.apache.hc.client5.http.config.RequestConfig object that represents the actual request configuration.

public static final String
USER_TOKEN

Attribute name of a java.lang.Object object that represents the actual user identity such as user java.security.Principal.

Inherited from org.apache.hc.core5.http.protocol.HttpCoreContext:
CONNECTION_ENDPOINTHTTP_REQUESTHTTP_RESPONSESSL_SESSION

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public static HttpClientContext
public static HttpClientContext
public AuthCache
public AuthExchange
public Map<HttpHost, AuthExchange>
public Lookup<AuthSchemeFactory>
public CookieOrigin
public CookieSpec
public Lookup<CookieSpecFactory>
public CookieStore
public CredentialsProvider
public String
public RouteInfo
private <T> Lookup<T>
getLookup(final String name)

public RedirectLocations
public RequestConfig
public <T> T
getUserToken(final Class<T> clazz)

public Object
public void
resetAuthExchange(final HttpHost host, final AuthScheme authScheme)

public void
setAuthCache(final AuthCache authCache)

public void
setAuthExchange(final HttpHost host, final AuthExchange authExchange)

public void
public void
public void
setCookieStore(final CookieStore cookieStore)

public void
setCredentialsProvider(final CredentialsProvider credentialsProvider)

public void
public void
public void
setUserToken(final Object obj)

Inherited from org.apache.hc.core5.http.protocol.HttpCoreContext:
getAttributegetAttributegetEndpointDetailsgetProtocolVersiongetRequestgetResponsegetSSLSessionremoveAttributesetAttributesetProtocolVersiontoString

Field Detail

AUTH_CACHEback to summary
public static final String AUTH_CACHE

Attribute name of a AuthCache object that represents the auth scheme cache.

AUTH_EXCHANGE_MAPback to summary
public static final String AUTH_EXCHANGE_MAP

Attribute name of a map containing actual AuthExchanges keyed by their respective org.apache.hc.core5.http.HttpHost.

AUTHSCHEME_REGISTRYback to summary
public static final String AUTHSCHEME_REGISTRY

Attribute name of a org.apache.hc.core5.http.config.Lookup object that represents the actual AuthSchemeFactory registry.

COOKIESPEC_REGISTRYback to summary
public static final String COOKIESPEC_REGISTRY

Attribute name of a org.apache.hc.core5.http.config.Lookup object that represents the actual CookieSpecFactory registry.

CREDS_PROVIDERback to summary
public static final String CREDS_PROVIDER

Attribute name of a CredentialsProvider object that represents the actual credentials provider.

EXCHANGE_IDback to summary
public static final String EXCHANGE_ID

Attribute name of a java.lang.String object that represents the ID of the current message exchange.

HTTP_ROUTEback to summary
public static final String HTTP_ROUTE

Attribute name of a RouteInfo object that represents the actual connection route.

REDIRECT_LOCATIONSback to summary
public static final String REDIRECT_LOCATIONS

Attribute name of a RedirectLocations object that represents a collection of all redirect locations received in the process of request execution.

REQUEST_CONFIGback to summary
public static final String REQUEST_CONFIG

Attribute name of a org.apache.hc.client5.http.config.RequestConfig object that represents the actual request configuration.

USER_TOKENback to summary
public static final String USER_TOKEN

Attribute name of a java.lang.Object object that represents the actual user identity such as user java.security.Principal.

Constructor Detail

HttpClientContextback to summary
public HttpClientContext(final HttpContext context)
HttpClientContextback to summary
public HttpClientContext()

Method Detail

adaptback to summary
public static HttpClientContext adapt(final HttpContext context)

Hides org.apache.hc.core5.http.protocol.HttpCoreContext.adapt.

createback to summary
public static HttpClientContext create()

Hides org.apache.hc.core5.http.protocol.HttpCoreContext.create.

getAuthCacheback to summary
public AuthCache getAuthCache()
getAuthExchangeback to summary
public AuthExchange getAuthExchange(final HttpHost host)
Since
5.0
getAuthExchangesback to summary
public Map<HttpHost, AuthExchange> getAuthExchanges()
Annotations
@SuppressWarnings:unchecked
Since
5.0
getAuthSchemeRegistryback to summary
public Lookup<AuthSchemeFactory> getAuthSchemeRegistry()
getCookieOriginback to summary
public CookieOrigin getCookieOrigin()
getCookieSpecback to summary
public CookieSpec getCookieSpec()
getCookieSpecRegistryback to summary
public Lookup<CookieSpecFactory> getCookieSpecRegistry()
getCookieStoreback to summary
public CookieStore getCookieStore()
getCredentialsProviderback to summary
public CredentialsProvider getCredentialsProvider()
getExchangeIdback to summary
public String getExchangeId()
Since
5.1
getHttpRouteback to summary
public RouteInfo getHttpRoute()
getLookupback to summary
private <T> Lookup<T> getLookup(final String name)
Annotations
@SuppressWarnings:unchecked
getRedirectLocationsback to summary
public RedirectLocations getRedirectLocations()
getRequestConfigback to summary
public RequestConfig getRequestConfig()
getUserTokenback to summary
public <T> T getUserToken(final Class<T> clazz)
getUserTokenback to summary
public Object getUserToken()
resetAuthExchangeback to summary
public void resetAuthExchange(final HttpHost host, final AuthScheme authScheme)
Since
5.0
setAuthCacheback to summary
public void setAuthCache(final AuthCache authCache)
setAuthExchangeback to summary
public void setAuthExchange(final HttpHost host, final AuthExchange authExchange)
Since
5.0
setAuthSchemeRegistryback to summary
public void setAuthSchemeRegistry(final Lookup<AuthSchemeFactory> lookup)
setCookieSpecRegistryback to summary
public void setCookieSpecRegistry(final Lookup<CookieSpecFactory> lookup)
setCookieStoreback to summary
public void setCookieStore(final CookieStore cookieStore)
setCredentialsProviderback to summary
public void setCredentialsProvider(final CredentialsProvider credentialsProvider)
setExchangeIdback to summary
public void setExchangeId(final String id)
Since
5.1
setRequestConfigback to summary
public void setRequestConfig(final RequestConfig config)
setUserTokenback to summary
public void setUserToken(final Object obj)