Class HttpClientBuilder

java.lang.Object
io.vertx.mutiny.core.http.HttpClientBuilder
All Implemented Interfaces:
MutinyDelegate

public class HttpClientBuilder extends Object implements MutinyDelegate
A builder for HttpClient.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Julien Viet
See Also:
  • HttpClientBuilder
  • Field Details

  • Constructor Details

    • HttpClientBuilder

      public HttpClientBuilder(io.vertx.core.http.HttpClientBuilder delegate)
      Create a new instance of HttpClientBuilder delegating to the given (non-null) instance of HttpClientBuilder.
    • HttpClientBuilder

      public HttpClientBuilder(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.http.HttpClientBuilder getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • with

      public HttpClientBuilder with(io.vertx.core.http.HttpClientOptions options)
      Configure the client options.
      Parameters:
      options - the client options
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(io.vertx.core.http.HttpClientConfig config)
      Configure the client.
      Parameters:
      config - the client config
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(io.vertx.core.http.PoolOptions options)
      Configure the client with the given pool options.
      Parameters:
      options - the pool options
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(io.vertx.core.net.ClientSSLOptions options)
      Configure the client with the given SSL options.
      Parameters:
      options - the SSL options
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(io.vertx.core.net.SSLEngineOptions engine)
      Configure the client with the given SSL engine.
      Parameters:
      engine - the SSL engine options
      Returns:
      a reference to this, so the API can be used fluently
    • withConnectHandler

      public HttpClientBuilder withConnectHandler(Consumer<HttpConnection> handler)
      Set a connection handler for the client. This handler is called when a new connection is established.
      Returns:
      a reference to this, so the API can be used fluently
    • withRedirectHandler

      public HttpClientBuilder withRedirectHandler(Function<HttpClientResponse,io.smallrye.mutiny.Uni<io.vertx.core.http.RequestOptions>> handler)
      Set a redirect handler for the http client.

      The redirect handler is called when a 3xx response is received and the request is configured to follow redirects with HttpClientRequest.setFollowRedirects(boolean).

      The redirect handler is passed the HttpClientResponse, it can return an HttpClientRequest or null.

      • when null is returned, the original response is processed by the original request response handler
      • when a new Future<HttpClientRequest> is returned, the client will send this new request
      The new request will get a copy of the previous request headers unless headers are set. In this case, the client assumes that the redirect handler exclusively managers the headers of the new request.

      The handler must return a Future<HttpClientRequest> unsent so the client can further configure it and send it.

      Parameters:
      handler - the new redirect handler
      Returns:
      a reference to this, so the API can be used fluently
    • withAddressResolver

      public HttpClientBuilder withAddressResolver(io.vertx.core.net.AddressResolver<?> resolver)
      Configure the client to use a specific address resolver.
      Parameters:
      resolver - the address resolver
    • withLoadBalancer

      public HttpClientBuilder withLoadBalancer(io.vertx.core.net.endpoint.LoadBalancer loadBalancer)
      Configure the client to use a load balancer.
      Parameters:
      loadBalancer - the load balancer
    • build

      public HttpClientAgent build()
      Build and return the client.
      Returns:
      the client as configured by this builder
    • newInstance

      public static HttpClientBuilder newInstance(io.vertx.core.http.HttpClientBuilder delegate)
      Creates a new instance of the HttpClientBuilder.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object