Class HttpClientConfig.BuilderBase.HttpClientConfigImpl

java.lang.Object
io.helidon.webclient.api.HttpConfigBase.BuilderBase.HttpConfigBaseImpl
io.helidon.webclient.api.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>

protected static class HttpClientConfig.BuilderBase.HttpClientConfigImpl extends HttpConfigBase.BuilderBase.HttpConfigBaseImpl implements HttpClientConfig
Generated implementation of the prototype, can be extended by descendant prototype implementations.
  • Constructor Details

    • HttpClientConfigImpl

      protected HttpClientConfigImpl(HttpClientConfig.BuilderBase<?,?> builder)
      Create an instance providing a builder.
      Parameters:
      builder - extending builder base of this prototype
  • Method Details

    • baseUri

      public Optional<ClientUri> baseUri()
      Description copied from interface: HttpClientConfig
      Base uri used by the client in all requests.
      Specified by:
      baseUri in interface HttpClientConfig
      Returns:
      base uri of the client requests
    • baseAddress

      public Optional<SocketAddress> baseAddress()
      Description copied from interface: HttpClientConfig
      Base 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 the Host header, HTTP/2 :authority, SNI, and endpoint identification.

      Specified by:
      baseAddress in interface HttpClientConfig
      Returns:
      base address of the client requests
    • sni

      public Optional<SniConfig> sni()
      Description copied from interface: HttpClientConfig
      Client-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 explicit mode, the resolved request URI host is used.

      Specified by:
      sni in interface HttpClientConfig
      Returns:
      SNI configuration
    • altSvc

      public Optional<ClientAltSvcConfig> altSvc()
      Description copied from interface: HttpClientConfig
      Client policy for accepting and using HTTP Alt-Svc response advertisements.

      Alternative service handling is disabled when this configuration is absent. Configure an empty ClientAltSvcConfig to opt in with its defaults.

      Specified by:
      altSvc in interface HttpClientConfig
      Returns:
      alternative service policy, or empty if alternative service handling is disabled
    • baseQuery

      public Optional<UriQuery> baseQuery()
      Description copied from interface: HttpClientConfig
      Base query used by the client in all requests.
      Specified by:
      baseQuery in interface HttpClientConfig
      Returns:
      base query of the client requests
    • baseFragment

      public Optional<UriFragment> baseFragment()
      Description copied from interface: HttpClientConfig
      Base fragment used by the client in all requests (unless overwritten on per-request basis).
      Specified by:
      baseFragment in interface HttpClientConfig
      Returns:
      fragment to use
    • socketOptions

      public SocketOptions socketOptions()
      Description copied from interface: HttpClientConfig
      Socket 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:
      socketOptions in interface HttpClientConfig
      Returns:
      socket options
    • dnsResolver

      public DnsResolver dnsResolver()
      Description copied from interface: HttpClientConfig
      DNS resolver to be used by this client.
      Specified by:
      dnsResolver in interface HttpClientConfig
      Returns:
      dns resolver
    • dnsAddressLookup

      public DnsAddressLookup dnsAddressLookup()
      Description copied from interface: HttpClientConfig
      DNS address lookup preferences to be used by this client. Default value is determined by capabilities of the system.
      Specified by:
      dnsAddressLookup in interface HttpClientConfig
      Returns:
      dns address lookup strategy
    • defaultHeadersMap

      public Map<String,String> defaultHeadersMap()
      Description copied from interface: HttpClientConfig
      Default headers to be used in every request from configuration.
      Specified by:
      defaultHeadersMap in interface HttpClientConfig
      Returns:
      default headers
    • headers

      public Set<Header> headers()
      Description copied from interface: HttpClientConfig
      Default headers to be used in every request.
      Specified by:
      headers in interface HttpClientConfig
      Returns:
      default headers
    • filterRedirectHeaders

      public boolean filterRedirectHeaders()
      Description copied from interface: HttpClientConfig
      Whether 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:
      filterRedirectHeaders in interface HttpClientConfig
      Returns:
      whether redirect header filtering is enabled
    • followCrossOriginEntityRedirects

      public boolean followCrossOriginEntityRedirects()
      Description copied from interface: HttpClientConfig
      Whether redirects that preserve request method and entity may be followed across origins.

      When disabled, 307 and 308 redirects, and 301 and 302 redirects of a QUERY request, to a different origin fail instead of replaying the request entity to the redirect target.

      Specified by:
      followCrossOriginEntityRedirects in interface HttpClientConfig
      Returns:
      whether cross-origin redirects may replay request entities
    • redirectSensitiveHeaders

      public Set<HeaderName> redirectSensitiveHeaders()
      Description copied from interface: HttpClientConfig
      Request 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:
      redirectSensitiveHeaders in interface HttpClientConfig
      Returns:
      sensitive redirect headers
    • mediaTypeParserMode

      public ParserMode mediaTypeParserMode()
      Description copied from interface: HttpClientConfig
      Configure media type parsing mode for HTTP Content-Type header.
      Specified by:
      mediaTypeParserMode in interface HttpClientConfig
      Returns:
      media type parsing mode
    • contentEncoding

      public ContentEncodingContext contentEncoding()
      Description copied from interface: HttpClientConfig
      Configure the listener specific ContentEncodingContext. This method discards all previously registered ContentEncodingContext. If no content encoding context is registered, default encoding context is used.
      Specified by:
      contentEncoding in interface HttpClientConfig
      Returns:
      content encoding context
    • mediaContext

      public MediaContext mediaContext()
      Description copied from interface: HttpClientConfig
      Configure the listener specific MediaContext. This method discards all previously registered MediaContext. If no media context is registered, default media context is used.
      Specified by:
      mediaContext in interface HttpClientConfig
      Returns:
      media context
    • mediaSupports

      public List<MediaSupport> mediaSupports()
      Description copied from interface: HttpClientConfig
      Media supports (manually added). If both HttpClientConfig.mediaContext() and this is configured, there will be a new context created from return of this method, with fallback of HttpClientConfig.mediaContext().
      Specified by:
      mediaSupports in interface HttpClientConfig
      Returns:
      list of explicitly added media supports
    • services

      public List<WebClientService> services()
      Description copied from interface: HttpClientConfig
      WebClient services.
      Specified by:
      services in interface HttpClientConfig
      Returns:
      services to use with this web client
    • relativeUris

      public boolean relativeUris()
      Description copied from interface: HttpClientConfig
      Can be set to true to force the use of relative URIs in all requests, regardless of the presence or absence of proxies or no-proxy lists.
      Specified by:
      relativeUris in interface HttpClientConfig
      Returns:
      relative URIs flag
    • executor

      public ExecutorService executor()
      Description copied from interface: HttpClientConfig
      Client executor service.
      Specified by:
      executor in interface HttpClientConfig
      Returns:
      executor service to use when needed (such as for HTTP/2)
    • sendExpectContinue

      public boolean sendExpectContinue()
      Description copied from interface: HttpClientConfig
      Whether Expect-100-Continue header is sent to verify server availability before sending an entity.

      Defaults to true.

      Specified by:
      sendExpectContinue in interface HttpClientConfig
      Returns:
      whether Expect:100-Continue header should be sent on streamed transfers
    • connectionCacheSize

      public int connectionCacheSize()
      Description copied from interface: HttpClientConfig
      Maximum 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,000 connection-target entries; adding another target retires the oldest cached target entry. The value must be greater than zero. Defaults to 256.

      Specified by:
      connectionCacheSize in interface HttpClientConfig
      Returns:
      maximum number of reusable physical connections retained per target by each HTTP protocol
    • cookieManager

      public Optional<WebClientCookieManager> cookieManager()
      Description copied from interface: HttpClientConfig
      WebClient cookie manager.
      Specified by:
      cookieManager in interface HttpClientConfig
      Returns:
      cookie manager to use
    • readContinueTimeout

      public Duration readContinueTimeout()
      Description copied from interface: HttpClientConfig
      Socket 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:
      readContinueTimeout in interface HttpClientConfig
      Returns:
      read 100-Continue timeout duration
    • shareConnectionCache

      public boolean shareConnectionCache()
      Description copied from interface: HttpClientConfig
      Whether to use protocol-specific JVM-wide connection caches shared by compatible WebClient instances.

      When true, each HTTP protocol uses its own JVM-wide cache. Closing an individual client does not close that shared cache. For each connection target, the first shared client to create the target entry establishes its capacity from HttpClientConfig.connectionCacheSize() for as long as that entry remains cached. When false, each client owns its connection caches, which are closed when the client is closed. Defaults to true.

      Specified by:
      shareConnectionCache in interface HttpClientConfig
      Returns:
      whether to use protocol-specific JVM-wide shared connection caches
    • maxInMemoryEntity

      public int maxInMemoryEntity()
      Description copied from interface: HttpClientConfig
      If 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:
      maxInMemoryEntity in interface HttpClientConfig
      Returns:
      maximal number of bytes to buffer in memory for supported writers
    • writeBufferSize

      public int writeBufferSize()
      Description copied from interface: HttpClientConfig
      Buffer 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:
      writeBufferSize in interface HttpClientConfig
      Returns:
      number of bytes in write buffer
    • connectionListener

      public ConnectionListener connectionListener()
      Description copied from interface: HttpClientConfig
      Socket 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:
      connectionListener in interface HttpClientConfig
      Returns:
      The socket listener.
    • toString

      public String toString()
      Overrides:
      toString in class HttpConfigBase.BuilderBase.HttpConfigBaseImpl
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class HttpConfigBase.BuilderBase.HttpConfigBaseImpl
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class HttpConfigBase.BuilderBase.HttpConfigBaseImpl