org.apache.hc.client5.http.cache

## Class HttpCacheContext

- java.lang.Object
- - org.apache.hc.core5.http.protocol.HttpCoreContext
  - - org.apache.hc.client5.http.protocol.HttpClientContext
    - - org.apache.hc.client5.http.cache.HttpCacheContext

- All Implemented Interfaces:
    HttpContext

      public class HttpCacheContext
      extends HttpClientContext

  Adaptor class that provides convenience type safe setters and getters for caching `HttpContext` attributes.
  Since:
    4.3

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CACHE_RESPONSE_STATUS` This is the name under which the `CacheResponseStatus` of a request (for example, whether it resulted in a cache hit) will be recorded if an `HttpContext` is provided during execution.

    - ### Fields inherited from class org.apache.hc.client5.http.protocol.HttpClientContext

      `AUTH_CACHE, AUTH_EXCHANGE_MAP, AUTHSCHEME_REGISTRY, COOKIE_ORIGIN, COOKIE_SPEC, COOKIE_STORE, COOKIESPEC_REGISTRY, CREDS_PROVIDER, EXCHANGE_ID, HTTP_ROUTE, REDIRECT_LOCATIONS, REQUEST_CONFIG, USER_TOKEN`

    - ### Fields inherited from class org.apache.hc.core5.http.protocol.HttpCoreContext

      `CONNECTION_ENDPOINT, HTTP_REQUEST, HTTP_RESPONSE, SSL_SESSION`

    - ### Fields inherited from interface org.apache.hc.core5.http.protocol.HttpContext

      `RESERVED_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpCacheContext()`
    `HttpCacheContext(HttpContext context)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static HttpCacheContext` | `adapt(HttpContext context)`
    `static HttpCacheContext` | `create()`
    `CacheResponseStatus` | `getCacheResponseStatus()`

    - ### Methods inherited from class org.apache.hc.client5.http.protocol.HttpClientContext

      `getAuthCache, getAuthExchange, getAuthExchanges, getAuthSchemeRegistry, getCookieOrigin, getCookieSpec, getCookieSpecRegistry, getCookieStore, getCredentialsProvider, getExchangeId, getHttpRoute, getRedirectLocations, getRequestConfig, getUserToken, getUserToken, resetAuthExchange, setAuthCache, setAuthExchange, setAuthSchemeRegistry, setCookieSpecRegistry, setCookieStore, setCredentialsProvider, setExchangeId, setRequestConfig, setUserToken`

    - ### Methods inherited from class org.apache.hc.core5.http.protocol.HttpCoreContext

      `getAttribute, getAttribute, getEndpointDetails, getProtocolVersion, getRequest, getResponse, getSSLSession, removeAttribute, setAttribute, setProtocolVersion, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### CACHE_RESPONSE_STATUS

          public static final String CACHE_RESPONSE_STATUS

      This is the name under which the `CacheResponseStatus` of a request (for example, whether it resulted in a cache hit) will be recorded if an `HttpContext` is provided during execution.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HttpCacheContext

          public HttpCacheContext(HttpContext context)

    - #### HttpCacheContext

          public HttpCacheContext()

  - ### Method Detail

    - #### adapt

          public static HttpCacheContext adapt(HttpContext context)

    - #### create

          public static HttpCacheContext create()

    - #### getCacheResponseStatus

          public CacheResponseStatus getCacheResponseStatus()

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.