public class HttpClientContext
extends org.apache.hc.core5.http.protocol.HttpCoreContext
HttpContext. This class can be re-used for
 multiple consecutive logically related request executions that represent
 a single communication session. This context may not be used concurrently.
 IMPORTANT: This class is NOT thread-safe and MUST NOT be used concurrently by multiple message exchanges.
| Modifier and Type | Field and Description | 
|---|---|
| static String | AUTH_CACHEDeprecated. 
 Use getter methods | 
| static String | AUTH_EXCHANGE_MAPDeprecated. 
 Use getter methods | 
| static String | AUTHSCHEME_REGISTRYDeprecated. 
 Use getter methods | 
| static String | COOKIE_ORIGINDeprecated. 
 Use getter methods | 
| static String | COOKIE_SPECDeprecated. 
 Use getter methods | 
| static String | COOKIE_STOREDeprecated. 
 Use getter methods | 
| static String | COOKIESPEC_REGISTRYDeprecated. 
 Use getter methods | 
| static String | CREDS_PROVIDERDeprecated. 
 Use getter methods | 
| static String | EXCHANGE_IDDeprecated. 
 Use getter methods | 
| static String | HTTP_ROUTEDeprecated. 
 Use getter methods | 
| static String | REDIRECT_LOCATIONSDeprecated. 
 Use getter methods | 
| static String | REQUEST_CONFIGDeprecated. 
 Use getter methods | 
| static String | USER_TOKENDeprecated. 
 Use getter methods | 
| Constructor and Description | 
|---|
| HttpClientContext() | 
| HttpClientContext(org.apache.hc.core5.http.protocol.HttpContext context) | 
| Modifier and Type | Method and Description | 
|---|---|
| static HttpClientContext | adapt(org.apache.hc.core5.http.protocol.HttpContext context)Deprecated. 
 | 
| static HttpClientContext | cast(org.apache.hc.core5.http.protocol.HttpContext context)Casts the given generic  HttpContextasHttpClientContext. | 
| static HttpClientContext | castOrCreate(org.apache.hc.core5.http.protocol.HttpContext context)Casts the given generic  HttpContextasHttpClientContextor
 creates newHttpClientContextif the given context is null. | 
| static HttpClientContext | create() | 
| AuthCache | getAuthCache()Represents a  AuthCacheused in the context of the request execution. | 
| AuthExchange | getAuthExchange(org.apache.hc.core5.http.HttpHost host) | 
| Map<org.apache.hc.core5.http.HttpHost,AuthExchange> | getAuthExchanges()Represents a map of  AuthExchanges performed in the context of the request
 execution. | 
| org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> | getAuthSchemeRegistry()Represents a  AuthSchemeFactoryregistry used in the context of the request execution. | 
| CookieOrigin | getCookieOrigin()Represents a  CookieOriginproduced in the context of request execution. | 
| CookieSpec | getCookieSpec()Represents a  CookieSpecchosen in the context of request execution. | 
| org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> | getCookieSpecRegistry()Represents a  CookieSpecFactoryregistry used in the context of the request execution. | 
| CookieStore | getCookieStore()Represents a  CookieStoreused in the context of the request execution. | 
| CredentialsProvider | getCredentialsProvider()Represents a  CredentialsProviderregistry used in the context of the request execution. | 
| String | getExchangeId()Represents an identifier generated for the current message exchange executed
 in the given context. | 
| RouteInfo | getHttpRoute()Represents current route used to execute message exchanges. | 
| String | getNextNonce()Retrieves the stored  nextnoncevalue. | 
| RedirectLocations | getRedirectLocations()Represents a collection of all redirects executed in the context of request execution. | 
| RequestConfig | getRequestConfig()Represents an  usedin the context of the request execution. | 
| RequestConfig | getRequestConfigOrDefault()Returns  RequestConfigset in the context orRequestConfig.DEFAULTif not explicitly set in the context. | 
| Object | getUserToken()Represents an arbitrary user token that identifies the user in the context
 of the request execution. | 
| <T> T | getUserToken(Class<T> clazz)Deprecated. 
 Use  getUserToken() | 
| void | resetAuthExchange(org.apache.hc.core5.http.HttpHost host,
                 AuthScheme authScheme) | 
| void | setAuthCache(AuthCache authCache) | 
| void | setAuthExchange(org.apache.hc.core5.http.HttpHost host,
               AuthExchange authExchange) | 
| void | setAuthSchemeRegistry(org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> lookup) | 
| void | setCookieOrigin(CookieOrigin cookieOrigin) | 
| void | setCookieSpec(CookieSpec cookieSpec) | 
| void | setCookieSpecRegistry(org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> lookup) | 
| void | setCookieStore(CookieStore cookieStore) | 
| void | setCredentialsProvider(CredentialsProvider credentialsProvider) | 
| void | setExchangeId(String exchangeId) | 
| void | setNextNonce(String nextNonce)Sets the  nextnoncevalue directly as an instance attribute. | 
| void | setRedirectLocations(RedirectLocations redirectLocations) | 
| void | setRequestConfig(RequestConfig requestConfig) | 
| void | setRoute(HttpRoute route) | 
| void | setUserToken(Object userToken) | 
getAttribute, getAttribute, getEndpointDetails, getProtocolVersion, getRequest, getResponse, getSSLSession, removeAttribute, setAttribute, setEndpointDetails, setProtocolVersion, setRequest, setResponse, setSSLSession, toString@Deprecated public static final String HTTP_ROUTE
@Deprecated public static final String REDIRECT_LOCATIONS
@Deprecated public static final String COOKIESPEC_REGISTRY
@Deprecated public static final String COOKIE_SPEC
@Deprecated public static final String COOKIE_ORIGIN
@Deprecated public static final String COOKIE_STORE
@Deprecated public static final String CREDS_PROVIDER
@Deprecated public static final String AUTH_CACHE
@Deprecated public static final String AUTH_EXCHANGE_MAP
@Deprecated public static final String USER_TOKEN
@Deprecated public static final String AUTHSCHEME_REGISTRY
@Deprecated public static final String REQUEST_CONFIG
@Deprecated public static final String EXCHANGE_ID
public HttpClientContext(org.apache.hc.core5.http.protocol.HttpContext context)
public HttpClientContext()
@Deprecated public static HttpClientContext adapt(org.apache.hc.core5.http.protocol.HttpContext context)
castOrCreate(HttpContext).public static HttpClientContext cast(org.apache.hc.core5.http.protocol.HttpContext context)
HttpContext as HttpClientContext.public static HttpClientContext castOrCreate(org.apache.hc.core5.http.protocol.HttpContext context)
HttpContext as HttpClientContext or
 creates new HttpClientContext if the given context is null.public static HttpClientContext create()
public RouteInfo getHttpRoute()
This context attribute is expected to be populated by the protocol handler.
@Internal public void setRoute(HttpRoute route)
public RedirectLocations getRedirectLocations()
This context attribute is expected to be populated by the protocol handler.
@Internal public void setRedirectLocations(RedirectLocations redirectLocations)
public CookieStore getCookieStore()
CookieStore used in the context of the request execution.
 This context attribute can be set by the caller.
public void setCookieStore(CookieStore cookieStore)
public CookieSpec getCookieSpec()
CookieSpec chosen in the context of request execution.
 This context attribute is expected to be populated by the protocol handler.
@Internal public void setCookieSpec(CookieSpec cookieSpec)
public CookieOrigin getCookieOrigin()
CookieOrigin produced in the context of request execution.
 This context attribute is expected to be populated by the protocol handler.
@Internal public void setCookieOrigin(CookieOrigin cookieOrigin)
public org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> getCookieSpecRegistry()
CookieSpecFactory registry used in the context of the request execution.
 This context attribute can be set by the caller.
public void setCookieSpecRegistry(org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> lookup)
public org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> getAuthSchemeRegistry()
AuthSchemeFactory registry used in the context of the request execution.
 This context attribute can be set by the caller.
public void setAuthSchemeRegistry(org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> lookup)
public CredentialsProvider getCredentialsProvider()
CredentialsProvider registry used in the context of the request execution.
 This context attribute can be set by the caller.
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
public AuthCache getAuthCache()
AuthCache used in the context of the request execution.
 This context attribute can be set by the caller.
public void setAuthCache(AuthCache authCache)
public Map<org.apache.hc.core5.http.HttpHost,AuthExchange> getAuthExchanges()
AuthExchanges performed in the context of the request
 execution.
 This context attribute is expected to be populated by the protocol handler.
public AuthExchange getAuthExchange(org.apache.hc.core5.http.HttpHost host)
public void setAuthExchange(org.apache.hc.core5.http.HttpHost host,
                            AuthExchange authExchange)
public void resetAuthExchange(org.apache.hc.core5.http.HttpHost host,
                              AuthScheme authScheme)
@Deprecated public <T> T getUserToken(Class<T> clazz)
getUserToken()public Object getUserToken()
This context attribute can be set by the caller.
public void setUserToken(Object userToken)
public RequestConfig getRequestConfig()
used in the context of the request execution.
 This context attribute can be set by the caller.
public final RequestConfig getRequestConfigOrDefault()
RequestConfig set in the context or RequestConfig.DEFAULT
 if not explicitly set in the context.public void setRequestConfig(RequestConfig requestConfig)
public String getExchangeId()
This context attribute is expected to be populated by the protocol handler.
public void setExchangeId(String exchangeId)
@Internal public String getNextNonce()
nextnonce value.nextnonce parameter value, or null if not set@Internal public void setNextNonce(String nextNonce)
nextnonce value directly as an instance attribute.nextNonce - the nonce value to setCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.