Class HttpClientContext
- java.lang.Object
-
- org.apache.hc.core5.http.protocol.HttpCoreContext
-
- org.apache.hc.client5.http.protocol.HttpClientContext
-
- All Implemented Interfaces:
org.apache.hc.core5.http.protocol.HttpContext
- Direct Known Subclasses:
HttpCacheContext
public class HttpClientContext extends org.apache.hc.core5.http.protocol.HttpCoreContext
Adaptor class that provides convenience type safe setters and getters for commonHttpContext
attributes used in the course of HTTP request execution.- Since:
- 4.3
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AUTH_CACHE
Attribute name of aAuthCache
object that represents the auth scheme cache.static java.lang.String
AUTH_EXCHANGE_MAP
Attribute name of a map containing actualAuthExchange
s keyed by their respectiveHttpHost
.static java.lang.String
AUTHSCHEME_REGISTRY
Attribute name of aLookup
object that represents the actualAuthSchemeFactory
registry.static java.lang.String
COOKIE_ORIGIN
Attribute name of aCookieOrigin
object that represents the actual details of the origin server.static java.lang.String
COOKIE_SPEC
Attribute name of aCookieSpec
object that represents the actual cookie specification.static java.lang.String
COOKIE_STORE
Attribute name of aCookieStore
object that represents the actual cookie store.static java.lang.String
COOKIESPEC_REGISTRY
Attribute name of aLookup
object that represents the actualCookieSpecFactory
registry.static java.lang.String
CREDS_PROVIDER
Attribute name of aCredentialsProvider
object that represents the actual credentials provider.static java.lang.String
EXCHANGE_ID
Attribute name of aString
object that represents the ID of the current message exchange.static java.lang.String
HTTP_ROUTE
Attribute name of aRouteInfo
object that represents the actual connection route.static java.lang.String
REDIRECT_LOCATIONS
Attribute name of aRedirectLocations
object that represents a collection of all redirect locations received in the process of request execution.static java.lang.String
REQUEST_CONFIG
Attribute name of aRequestConfig
object that represents the actual request configuration.static java.lang.String
USER_TOKEN
Attribute name of aObject
object that represents the actual user identity such as userPrincipal
.
-
Constructor Summary
Constructors Constructor Description HttpClientContext()
HttpClientContext(org.apache.hc.core5.http.protocol.HttpContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HttpClientContext
adapt(org.apache.hc.core5.http.protocol.HttpContext context)
static HttpClientContext
create()
AuthCache
getAuthCache()
AuthExchange
getAuthExchange(org.apache.hc.core5.http.HttpHost host)
java.util.Map<org.apache.hc.core5.http.HttpHost,AuthExchange>
getAuthExchanges()
org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory>
getAuthSchemeRegistry()
CookieOrigin
getCookieOrigin()
CookieSpec
getCookieSpec()
org.apache.hc.core5.http.config.Lookup<CookieSpecFactory>
getCookieSpecRegistry()
CookieStore
getCookieStore()
CredentialsProvider
getCredentialsProvider()
java.lang.String
getExchangeId()
RouteInfo
getHttpRoute()
private <T> org.apache.hc.core5.http.config.Lookup<T>
getLookup(java.lang.String name)
RedirectLocations
getRedirectLocations()
RequestConfig
getRequestConfig()
java.lang.Object
getUserToken()
<T> T
getUserToken(java.lang.Class<T> clazz)
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
setCookieSpecRegistry(org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> lookup)
void
setCookieStore(CookieStore cookieStore)
void
setCredentialsProvider(CredentialsProvider credentialsProvider)
void
setExchangeId(java.lang.String id)
void
setRequestConfig(RequestConfig config)
void
setUserToken(java.lang.Object obj)
-
-
-
Field Detail
-
HTTP_ROUTE
public static final java.lang.String HTTP_ROUTE
Attribute name of aRouteInfo
object that represents the actual connection route.- See Also:
- Constant Field Values
-
REDIRECT_LOCATIONS
public static final java.lang.String REDIRECT_LOCATIONS
Attribute name of aRedirectLocations
object that represents a collection of all redirect locations received in the process of request execution.- See Also:
- Constant Field Values
-
COOKIESPEC_REGISTRY
public static final java.lang.String COOKIESPEC_REGISTRY
Attribute name of aLookup
object that represents the actualCookieSpecFactory
registry.- See Also:
- Constant Field Values
-
COOKIE_SPEC
public static final java.lang.String COOKIE_SPEC
Attribute name of aCookieSpec
object that represents the actual cookie specification.- See Also:
- Constant Field Values
-
COOKIE_ORIGIN
public static final java.lang.String COOKIE_ORIGIN
Attribute name of aCookieOrigin
object that represents the actual details of the origin server.- See Also:
- Constant Field Values
-
COOKIE_STORE
public static final java.lang.String COOKIE_STORE
Attribute name of aCookieStore
object that represents the actual cookie store.- See Also:
- Constant Field Values
-
CREDS_PROVIDER
public static final java.lang.String CREDS_PROVIDER
Attribute name of aCredentialsProvider
object that represents the actual credentials provider.- See Also:
- Constant Field Values
-
AUTH_CACHE
public static final java.lang.String AUTH_CACHE
Attribute name of aAuthCache
object that represents the auth scheme cache.- See Also:
- Constant Field Values
-
AUTH_EXCHANGE_MAP
public static final java.lang.String AUTH_EXCHANGE_MAP
Attribute name of a map containing actualAuthExchange
s keyed by their respectiveHttpHost
.- See Also:
- Constant Field Values
-
USER_TOKEN
public static final java.lang.String USER_TOKEN
Attribute name of aObject
object that represents the actual user identity such as userPrincipal
.- See Also:
- Constant Field Values
-
AUTHSCHEME_REGISTRY
public static final java.lang.String AUTHSCHEME_REGISTRY
Attribute name of aLookup
object that represents the actualAuthSchemeFactory
registry.- See Also:
- Constant Field Values
-
REQUEST_CONFIG
public static final java.lang.String REQUEST_CONFIG
Attribute name of aRequestConfig
object that represents the actual request configuration.- See Also:
- Constant Field Values
-
EXCHANGE_ID
public static final java.lang.String EXCHANGE_ID
Attribute name of aString
object that represents the ID of the current message exchange.- See Also:
- Constant Field Values
-
-
Method Detail
-
adapt
public static HttpClientContext adapt(org.apache.hc.core5.http.protocol.HttpContext context)
-
create
public static HttpClientContext create()
-
getHttpRoute
public RouteInfo getHttpRoute()
-
getRedirectLocations
public RedirectLocations getRedirectLocations()
-
getCookieStore
public CookieStore getCookieStore()
-
setCookieStore
public void setCookieStore(CookieStore cookieStore)
-
getCookieSpec
public CookieSpec getCookieSpec()
-
getCookieOrigin
public CookieOrigin getCookieOrigin()
-
getLookup
private <T> org.apache.hc.core5.http.config.Lookup<T> getLookup(java.lang.String name)
-
getCookieSpecRegistry
public org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> getCookieSpecRegistry()
-
setCookieSpecRegistry
public void setCookieSpecRegistry(org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> lookup)
-
getAuthSchemeRegistry
public org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> getAuthSchemeRegistry()
-
setAuthSchemeRegistry
public void setAuthSchemeRegistry(org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> lookup)
-
getCredentialsProvider
public CredentialsProvider getCredentialsProvider()
-
setCredentialsProvider
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
-
getAuthCache
public AuthCache getAuthCache()
-
setAuthCache
public void setAuthCache(AuthCache authCache)
-
getAuthExchanges
public java.util.Map<org.apache.hc.core5.http.HttpHost,AuthExchange> getAuthExchanges()
- Since:
- 5.0
-
getAuthExchange
public AuthExchange getAuthExchange(org.apache.hc.core5.http.HttpHost host)
- Since:
- 5.0
-
setAuthExchange
public void setAuthExchange(org.apache.hc.core5.http.HttpHost host, AuthExchange authExchange)
- Since:
- 5.0
-
resetAuthExchange
public void resetAuthExchange(org.apache.hc.core5.http.HttpHost host, AuthScheme authScheme)
- Since:
- 5.0
-
getUserToken
public <T> T getUserToken(java.lang.Class<T> clazz)
-
getUserToken
public java.lang.Object getUserToken()
-
setUserToken
public void setUserToken(java.lang.Object obj)
-
getRequestConfig
public RequestConfig getRequestConfig()
-
setRequestConfig
public void setRequestConfig(RequestConfig config)
-
getExchangeId
public java.lang.String getExchangeId()
- Since:
- 5.1
-
setExchangeId
public void setExchangeId(java.lang.String id)
- Since:
- 5.1
-
-