Class CachingHttpClientBuilder
java.lang.Object
org.apache.hc.client5.http.impl.classic.HttpClientBuilder
org.apache.hc.client5.http.impl.cache.CachingHttpClientBuilder
Builder for
CloseableHttpClient
instances capable of client-side caching.- Since:
- 4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CacheConfigprivate Fileprivate booleanprivate ResourceFactoryprivate SchedulingStrategyprivate HttpCacheStorage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Function<org.apache.hc.core5.http.protocol.HttpContext, HttpClientContext> static CachingHttpClientBuildercreate()protected voidcustomizeExecChain(org.apache.hc.core5.http.config.NamedElementChain<ExecChainHandler> execChainDefinition) Request exec chain customization and extension.final CachingHttpClientBuildersetCacheConfig(CacheConfig cacheConfig) final CachingHttpClientBuildersetCacheDir(File cacheDir) final CachingHttpClientBuildersetDeleteCache(boolean deleteCache) final CachingHttpClientBuildersetHttpCacheInvalidator(HttpCacheInvalidator cacheInvalidator) Deprecated.Do not use.final CachingHttpClientBuildersetHttpCacheStorage(HttpCacheStorage storage) final CachingHttpClientBuildersetResourceFactory(ResourceFactory resourceFactory) final CachingHttpClientBuildersetSchedulingStrategy(SchedulingStrategy schedulingStrategy) Methods inherited from class HttpClientBuilder
addCloseable, addExecInterceptorAfter, addExecInterceptorBefore, addExecInterceptorFirst, addExecInterceptorLast, addRequestInterceptorFirst, addRequestInterceptorLast, addResponseInterceptorFirst, addResponseInterceptorLast, build, disableAuthCaching, disableAutomaticRetries, disableConnectionState, disableContentCompression, disableCookieManagement, disableDefaultUserAgent, disableRedirectHandling, evictExpiredConnections, evictIdleConnections, getConnManager, replaceExecInterceptor, setBackoffManager, setConnectionBackoffStrategy, setConnectionManager, setConnectionManagerShared, setConnectionReuseStrategy, setContentDecoderRegistry, setDefaultAuthSchemeRegistry, setDefaultCookieSpecRegistry, setDefaultCookieStore, setDefaultCredentialsProvider, setDefaultHeaders, setDefaultRequestConfig, setKeepAliveStrategy, setProxy, setProxyAuthenticationStrategy, setProxySelector, setRedirectStrategy, setRequestExecutor, setRetryStrategy, setRoutePlanner, setSchemePortResolver, setTargetAuthenticationStrategy, setUserAgent, setUserTokenHandler, useSystemProperties
-
Field Details
-
resourceFactory
-
storage
-
cacheDir
-
schedulingStrategy
-
cacheConfig
-
deleteCache
private boolean deleteCache
-
-
Constructor Details
-
CachingHttpClientBuilder
protected CachingHttpClientBuilder()
-
-
Method Details
-
create
-
setResourceFactory
-
setHttpCacheStorage
-
setCacheDir
-
setSchedulingStrategy
-
setCacheConfig
-
setHttpCacheInvalidator
@Deprecated public final CachingHttpClientBuilder setHttpCacheInvalidator(HttpCacheInvalidator cacheInvalidator) Deprecated.Do not use. -
setDeleteCache
-
customizeExecChain
protected void customizeExecChain(org.apache.hc.core5.http.config.NamedElementChain<ExecChainHandler> execChainDefinition) Description copied from class:HttpClientBuilderRequest exec chain customization and extension.For internal use.
- Overrides:
customizeExecChainin classHttpClientBuilder
-
contextAdaptor
protected Function<org.apache.hc.core5.http.protocol.HttpContext, HttpClientContext> contextAdaptor()- Overrides:
contextAdaptorin classHttpClientBuilder
-