Class ApacheHc5TransportBuilder

java.lang.Object
org.apache.juneau.rest.client.apachehttpclient50.ApacheHc5TransportBuilder

public final class ApacheHc5TransportBuilder extends Object
Fluent builder for ApacheHc5Transport.

Obtain an instance via ApacheHc5Transport.builder().

See Also:
Since:
9.2.1
  • Method Details

    • httpClient

      public ApacheHc5TransportBuilder httpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient value)
      Sets the underlying CloseableHttpClient to use.

      If not set, the transport creates its own default clients: one for ordinary requests, and one with a separate connection pool whose connections are all pinned to a policy-allowed address, for SSRF-guard-active @Remote requests.

      A caller-supplied client cannot be given that pin-on-connect pool, so a transport built with one reports ApacheHc5Transport.supportsUrlPolicy() as false, and RestRequest refuses to send an SSRF-guard-active request through it.

      The transport takes ownership of the client and will close it when ApacheHc5Transport.close() is called.

      Parameters:
      value - The client to use. Must not be null.
      Returns:
      This object.
    • build

      Builds and returns the ApacheHc5Transport.
      Returns:
      A new instance. Never null.