Class HttpClientConfig.BuilderBase.HttpClientConfigImpl
- All Implemented Interfaces:
Prototype.Api, HttpClientConfig, HttpConfigBase
- Direct Known Subclasses:
GrpcClientConfig.BuilderBase.GrpcClientConfigImpl, Http1ClientConfig.BuilderBase.Http1ClientConfigImpl, Http2ClientConfig.BuilderBase.Http2ClientConfigImpl, JsonRpcClientConfig.BuilderBase.JsonRpcClientConfigImpl, WebClientConfig.BuilderBase.WebClientConfigImpl, WsClientConfig.BuilderBase.WsClientConfigImpl
- Enclosing class:
HttpClientConfig.BuilderBase<BUILDER extends HttpClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends HttpClientConfig>
-
Nested Class Summary
Nested classes/interfaces inherited from interface HttpClientConfig
HttpClientConfig.Builder, HttpClientConfig.BuilderBase<BUILDER, PROTOTYPE>Modifier and TypeInterfaceDescriptionstatic classFluent API builder forHttpClientConfig.static classHttpClientConfig.BuilderBase<BUILDER extends HttpClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends HttpClientConfig>Fluent API builder base forHttpClientConfig.Nested classes/interfaces inherited from interface HttpConfigBase
HttpConfigBase.Builder, HttpConfigBase.BuilderBase<BUILDER, PROTOTYPE>Modifier and TypeInterfaceDescriptionstatic classFluent API builder forHttpConfigBase.static classHttpConfigBase.BuilderBase<BUILDER extends HttpConfigBase.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends HttpConfigBase>Fluent API builder base forHttpConfigBase. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpClientConfigImpl(HttpClientConfig.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionaltSvc()Client policy for accepting and using HTTPAlt-Svcresponse advertisements.Base address used by the client in all requests.Base fragment used by the client in all requests (unless overwritten on per-request basis).Base query used by the client in all requests.baseUri()Base uri used by the client in all requests.intMaximum number of reusable physical connections each HTTP protocol retains for a single connection target.Socket lifecycle callbacks.Configure the listener specificContentEncodingContext.WebClient cookie manager.Default headers to be used in every request from configuration.DNS address lookup preferences to be used by this client.DNS resolver to be used by this client.booleanexecutor()Client executor service.booleanWhether headers sensitive to cross-origin redirects should be filtered before the redirected request is sent.booleanWhether redirects that preserve request method and entity may be followed across origins.inthashCode()headers()Default headers to be used in every request.intIf the entity is expected to be smaller that this number of bytes, it would be buffered in memory to optimize performance.Configure the listener specificMediaContext.Media supports (manually added).Configure media type parsing mode for HTTPContent-Typeheader.Socket 100-Continue read timeout.Request header names to strip on cross-origin redirects.booleanCan be set totrueto force the use of relative URIs in all requests, regardless of the presence or absence of proxies or no-proxy lists.booleanWhether Expect-100-Continue header is sent to verify server availability before sending an entity.services()WebClient services.booleanWhether to use protocol-specific JVM-wide connection caches shared by compatible WebClient instances.sni()Client-side TLS SNI configuration.Socket options for connections opened by this client.toString()intBuffer size used when writing data to the underlying socket on a client TCP connection.Methods inherited from class HttpConfigBase.BuilderBase.HttpConfigBaseImpl
connectTimeout, followRedirects, keepAlive, maxRedirects, properties, proxy, readTimeout, tlsModifier and TypeMethodDescriptionConnect timeout.booleanWhether to follow redirects.booleanDetermines if connection keep alive is enabled (NOT socket keep alive, but HTTP connection keep alive, to re-use the same connection for multiple requests).intMax number of followed redirects.Properties configured for this client.proxy()Proxy configuration to be used for requests.Read timeout.tls()TLS configuration for any TLS request from this client.Methods inherited from interface HttpClientConfig
defaultRequestHeadersModifier and TypeMethodDescriptiondefault ClientRequestHeadersDefault headers as a headers object.
-
Constructor Details
-
HttpClientConfigImpl
Create an instance providing a builder.- Parameters:
builder- extending builder base of this prototype
-
-
Method Details
-
baseUri
Description copied from interface:HttpClientConfigBase uri used by the client in all requests.- Specified by:
baseUriin interfaceHttpClientConfig- Returns:
- base uri of the client requests
-
baseAddress
Description copied from interface:HttpClientConfigBase address used by the client in all requests. This may be either an Inet address or a UNIX domain socket address.A UNIX domain socket address overrides only the physical transport. The request URI resolved against
HttpClientConfig.baseUri()or an absolute request URI still provides the logical HTTP authority used for theHostheader, HTTP/2:authority, SNI, and endpoint identification.- Specified by:
baseAddressin interfaceHttpClientConfig- Returns:
- base address of the client requests
-
sni
Description copied from interface:HttpClientConfigClient-side TLS SNI configuration.If this is not configured, WebClient preserves the configured
tls()SSL parameters and uses the JDK TLS defaults for SNI. If this is configured without an explicitmode, the resolved request URI host is used.- Specified by:
sniin interfaceHttpClientConfig- Returns:
- SNI configuration
-
altSvc
Description copied from interface:HttpClientConfigClient policy for accepting and using HTTPAlt-Svcresponse advertisements.Alternative service handling is disabled when this configuration is absent. Configure an empty
ClientAltSvcConfigto opt in with its defaults.- Specified by:
altSvcin interfaceHttpClientConfig- Returns:
- alternative service policy, or empty if alternative service handling is disabled
-
baseQuery
Description copied from interface:HttpClientConfigBase query used by the client in all requests.- Specified by:
baseQueryin interfaceHttpClientConfig- Returns:
- base query of the client requests
-
baseFragment
Description copied from interface:HttpClientConfigBase fragment used by the client in all requests (unless overwritten on per-request basis).- Specified by:
baseFragmentin interfaceHttpClientConfig- Returns:
- fragment to use
-
socketOptions
Description copied from interface:HttpClientConfigSocket options for connections opened by this client. If there is a value explicitly configured on this type and on the socket options, the one configured on this type's builder will win:- Specified by:
socketOptionsin interfaceHttpClientConfig- Returns:
- socket options
-
dnsResolver
Description copied from interface:HttpClientConfigDNS resolver to be used by this client.- Specified by:
dnsResolverin interfaceHttpClientConfig- Returns:
- dns resolver
-
dnsAddressLookup
Description copied from interface:HttpClientConfigDNS address lookup preferences to be used by this client. Default value is determined by capabilities of the system.- Specified by:
dnsAddressLookupin interfaceHttpClientConfig- Returns:
- dns address lookup strategy
-
defaultHeadersMap
Description copied from interface:HttpClientConfigDefault headers to be used in every request from configuration.- Specified by:
defaultHeadersMapin interfaceHttpClientConfig- Returns:
- default headers
-
headers
Description copied from interface:HttpClientConfigDefault headers to be used in every request.- Specified by:
headersin interfaceHttpClientConfig- Returns:
- default headers
-
filterRedirectHeaders
public boolean filterRedirectHeaders()Description copied from interface:HttpClientConfigWhether headers sensitive to cross-origin redirects should be filtered before the redirected request is sent.When enabled, header names from
HttpClientConfig.redirectSensitiveHeaders()are stripped on cross-origin redirects.- Specified by:
filterRedirectHeadersin interfaceHttpClientConfig- Returns:
- whether redirect header filtering is enabled
-
followCrossOriginEntityRedirects
public boolean followCrossOriginEntityRedirects()Description copied from interface:HttpClientConfigWhether redirects that preserve request method and entity may be followed across origins.When disabled,
307and308redirects, and301and302redirects of aQUERYrequest, to a different origin fail instead of replaying the request entity to the redirect target.- Specified by:
followCrossOriginEntityRedirectsin interfaceHttpClientConfig- Returns:
- whether cross-origin redirects may replay request entities
-
redirectSensitiveHeaders
Description copied from interface:HttpClientConfigRequest header names to strip on cross-origin redirects.Header names are matched case-insensitively. The returned set always contains "Authorization", "Cookie", and "Proxy-Authorization", even if any was not explicitly configured.
- Specified by:
redirectSensitiveHeadersin interfaceHttpClientConfig- Returns:
- sensitive redirect headers
-
mediaTypeParserMode
Description copied from interface:HttpClientConfigConfigure media type parsing mode for HTTPContent-Typeheader.- Specified by:
mediaTypeParserModein interfaceHttpClientConfig- Returns:
- media type parsing mode
-
contentEncoding
Description copied from interface:HttpClientConfigConfigure the listener specificContentEncodingContext. This method discards all previously registered ContentEncodingContext. If no content encoding context is registered, default encoding context is used.- Specified by:
contentEncodingin interfaceHttpClientConfig- Returns:
- content encoding context
-
mediaContext
Description copied from interface:HttpClientConfigConfigure the listener specificMediaContext. This method discards all previously registered MediaContext. If no media context is registered, default media context is used.- Specified by:
mediaContextin interfaceHttpClientConfig- Returns:
- media context
-
mediaSupports
Description copied from interface:HttpClientConfigMedia supports (manually added). If bothHttpClientConfig.mediaContext()and this is configured, there will be a new context created from return of this method, with fallback ofHttpClientConfig.mediaContext().- Specified by:
mediaSupportsin interfaceHttpClientConfig- Returns:
- list of explicitly added media supports
-
services
Description copied from interface:HttpClientConfigWebClient services.- Specified by:
servicesin interfaceHttpClientConfig- Returns:
- services to use with this web client
-
relativeUris
public boolean relativeUris()Description copied from interface:HttpClientConfigCan be set totrueto force the use of relative URIs in all requests, regardless of the presence or absence of proxies or no-proxy lists.- Specified by:
relativeUrisin interfaceHttpClientConfig- Returns:
- relative URIs flag
-
executor
Description copied from interface:HttpClientConfigClient executor service.- Specified by:
executorin interfaceHttpClientConfig- Returns:
- executor service to use when needed (such as for HTTP/2)
-
sendExpectContinue
public boolean sendExpectContinue()Description copied from interface:HttpClientConfigWhether Expect-100-Continue header is sent to verify server availability before sending an entity.Defaults to
true.- Specified by:
sendExpectContinuein interfaceHttpClientConfig- Returns:
- whether Expect:100-Continue header should be sent on streamed transfers
-
connectionCacheSize
public int connectionCacheSize()Description copied from interface:HttpClientConfigMaximum number of reusable physical connections each HTTP protocol retains for a single connection target. A connection target identifies the logical HTTP authority, TLS configuration and generation, configured SNI, DNS resolver and address lookup, selected proxy route, and physical transport. For UNIX domain socket transports, the target includes the socket path and does not include proxy configuration.Each configured HTTP protocol honors this common option independently; it is not an aggregate cache quota across protocol versions. This is a retention limit, not a limit on concurrent requests or streams and not a hard cap on live sockets. Active or draining connections may temporarily cause the number of live sockets for a target to exceed this value. Each protocol retains at most
1,000connection-target entries; adding another target retires the oldest cached target entry. The value must be greater than zero. Defaults to256.- Specified by:
connectionCacheSizein interfaceHttpClientConfig- Returns:
- maximum number of reusable physical connections retained per target by each HTTP protocol
-
cookieManager
Description copied from interface:HttpClientConfigWebClient cookie manager.- Specified by:
cookieManagerin interfaceHttpClientConfig- Returns:
- cookie manager to use
-
readContinueTimeout
Description copied from interface:HttpClientConfigSocket 100-Continue read timeout. Default is 1 second. This read timeout is used when 100-Continue is sent by the client, before it sends an entity.- Specified by:
readContinueTimeoutin interfaceHttpClientConfig- Returns:
- read 100-Continue timeout duration
-
maxInMemoryEntity
public int maxInMemoryEntity()Description copied from interface:HttpClientConfigIf the entity is expected to be smaller that this number of bytes, it would be buffered in memory to optimize performance. If bigger, streaming will be used.Note that for some entity types we cannot use streaming, as they are already fully in memory (String, byte[]), for such cases, this option is ignored. Default is 128Kb.
- Specified by:
maxInMemoryEntityin interfaceHttpClientConfig- Returns:
- maximal number of bytes to buffer in memory for supported writers
-
writeBufferSize
public int writeBufferSize()Description copied from interface:HttpClientConfigBuffer size used when writing data to the underlying socket on a client TCP connection. A value that is less or equal to 1 can be set to disable buffering at this level. Note that if writing data to the socket in small chunks, they may not be delivered to the network immediately due to Nagle's algorithm (i.e., if TCP_NO_DELAY is turned off).- Specified by:
writeBufferSizein interfaceHttpClientConfig- Returns:
- number of bytes in write buffer
-
connectionListener
Description copied from interface:HttpClientConfigSocket lifecycle callbacks. The default implementation does nothing, and Initializer logic that is called immediately after the client connection is established, before any TLS or HTTP data is written. The default initializer does nothing.- Specified by:
connectionListenerin interfaceHttpClientConfig- Returns:
- The socket listener.
-
toString
- Overrides:
toStringin classHttpConfigBase.BuilderBase.HttpConfigBaseImpl
-
equals
- Overrides:
equalsin classHttpConfigBase.BuilderBase.HttpConfigBaseImpl
-
hashCode
public int hashCode()- Overrides:
hashCodein classHttpConfigBase.BuilderBase.HttpConfigBaseImpl
-