Class HttpClient.HttpClientImpl

java.lang.Object
io.vertx.mutiny.core.http.HttpClient.HttpClientImpl
All Implemented Interfaces:
MutinyDelegate, HttpClient
Enclosing interface:
HttpClient

public static class HttpClient.HttpClientImpl extends Object implements HttpClient
  • Constructor Details

    • HttpClientImpl

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

    • getDelegate

      public io.vertx.core.http.HttpClient 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 HttpClient
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • request

      @CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request()
      Create an HTTP request to send to the server with the default host and port of the client.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      request in interface HttpClient
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.request()
    • requestAndAwait

      public HttpClientRequest requestAndAwait()
      Create an HTTP request to send to the server with the default host and port of the client.

      Unlike the bare Vert.x variant, this method returns a HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • HttpClient.request()
    • requestAndForget

      public HttpClient.HttpClientImpl requestAndForget()
      Create an HTTP request to send to the server with the default host and port of the client.

      Unlike the bare Vert.x variant, this method ignores the HttpClientRequest result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.request()
    • request

      @CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.RequestOptions options)
      Create an HTTP request to send to the server.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      request in interface HttpClient
      Parameters:
      options - the request options
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.request(RequestOptions)
    • requestAndAwait

      public HttpClientRequest requestAndAwait(io.vertx.core.http.RequestOptions options)
      Create an HTTP request to send to the server.

      Unlike the bare Vert.x variant, this method returns a HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      options - the request options
      Returns:
      The operation result
      See Also:
      • HttpClient.request(RequestOptions)
    • requestAndForget

      public HttpClient.HttpClientImpl requestAndForget(io.vertx.core.http.RequestOptions options)
      Create an HTTP request to send to the server.

      Unlike the bare Vert.x variant, this method ignores the HttpClientRequest result or any failure.

      Parameters:
      options - the request options
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.request(RequestOptions)
    • request

      @CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI)
      Create an HTTP request to send to the server at the host and port.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      request in interface HttpClient
      Parameters:
      method - the HTTP method
      port - the port
      host - the host
      requestURI - the relative URI
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.request(HttpMethod, int, String, String)
    • requestAndAwait

      public HttpClientRequest requestAndAwait(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI)
      Create an HTTP request to send to the server at the host and port.

      Unlike the bare Vert.x variant, this method returns a HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      method - the HTTP method
      port - the port
      host - the host
      requestURI - the relative URI
      Returns:
      The operation result
      See Also:
      • HttpClient.request(HttpMethod, int, String, String)
    • requestAndForget

      public HttpClient.HttpClientImpl requestAndForget(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI)
      Create an HTTP request to send to the server at the host and port.

      Unlike the bare Vert.x variant, this method ignores the HttpClientRequest result or any failure.

      Parameters:
      method - the HTTP method
      port - the port
      host - the host
      requestURI - the relative URI
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.request(HttpMethod, int, String, String)
    • request

      @CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.HttpMethod method, String host, String requestURI)
      Create an HTTP request to send to the server at the host and default port.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      request in interface HttpClient
      Parameters:
      method - the HTTP method
      host - the host
      requestURI - the relative URI
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.request(HttpMethod, String, String)
    • requestAndAwait

      public HttpClientRequest requestAndAwait(io.vertx.core.http.HttpMethod method, String host, String requestURI)
      Create an HTTP request to send to the server at the host and default port.

      Unlike the bare Vert.x variant, this method returns a HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      method - the HTTP method
      host - the host
      requestURI - the relative URI
      Returns:
      The operation result
      See Also:
      • HttpClient.request(HttpMethod, String, String)
    • requestAndForget

      public HttpClient.HttpClientImpl requestAndForget(io.vertx.core.http.HttpMethod method, String host, String requestURI)
      Create an HTTP request to send to the server at the host and default port.

      Unlike the bare Vert.x variant, this method ignores the HttpClientRequest result or any failure.

      Parameters:
      method - the HTTP method
      host - the host
      requestURI - the relative URI
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.request(HttpMethod, String, String)
    • request

      @CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.HttpMethod method, String requestURI)
      Create an HTTP request to send to the server at the default host and port.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      request in interface HttpClient
      Parameters:
      method - the HTTP method
      requestURI - the relative URI
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.request(HttpMethod, String)
    • requestAndAwait

      public HttpClientRequest requestAndAwait(io.vertx.core.http.HttpMethod method, String requestURI)
      Create an HTTP request to send to the server at the default host and port.

      Unlike the bare Vert.x variant, this method returns a HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      method - the HTTP method
      requestURI - the relative URI
      Returns:
      The operation result
      See Also:
      • HttpClient.request(HttpMethod, String)
    • requestAndForget

      public HttpClient.HttpClientImpl requestAndForget(io.vertx.core.http.HttpMethod method, String requestURI)
      Create an HTTP request to send to the server at the default host and port.

      Unlike the bare Vert.x variant, this method ignores the HttpClientRequest result or any failure.

      Parameters:
      method - the HTTP method
      requestURI - the relative URI
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.request(HttpMethod, String)
    • shutdown

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> shutdown()
      Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      shutdown in interface HttpClient
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.shutdown()
    • shutdownAndAwait

      public void shutdownAndAwait()
      Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • HttpClient.shutdown()
    • shutdownAndForget

      public HttpClient.HttpClientImpl shutdownAndForget()
      Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.shutdown()
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Close immediately (shutdown(0, TimeUnit.SECONDS).

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      close in interface HttpClient
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.close()
    • closeAndAwait

      public void closeAndAwait()
      Close immediately (shutdown(0, TimeUnit.SECONDS).

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • HttpClient.close()
    • closeAndForget

      public HttpClient.HttpClientImpl closeAndForget()
      Close immediately (shutdown(0, TimeUnit.SECONDS).

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.close()
    • shutdown

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> shutdown(long timeout, TimeUnit unit)
      Calls shutdown(Duration).

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      shutdown in interface HttpClient
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.shutdown(long, TimeUnit)
    • shutdownAndAwait

      public void shutdownAndAwait(long timeout, TimeUnit unit)
      Calls shutdown(Duration).

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • HttpClient.shutdown(long, TimeUnit)
    • shutdownAndForget

      public HttpClient.HttpClientImpl shutdownAndForget(long timeout, TimeUnit unit)
      Calls shutdown(Duration).

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.shutdown(long, TimeUnit)
    • shutdown

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> shutdown(Duration timeout)
      Initiate the client shutdown sequence.

      Connections are taken out of service and closed when all inflight requests are processed, client connection are immediately removed from the pool. When all connections are closed the client is closed. When the timeout expires, all unclosed connections are immediately closed.

      • HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close
      • HTTP/1.x client connection will be closed after the current response is received

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      shutdown in interface HttpClient
      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClient.shutdown(Duration)
    • shutdownAndAwait

      public void shutdownAndAwait(Duration timeout)
      Initiate the client shutdown sequence.

      Connections are taken out of service and closed when all inflight requests are processed, client connection are immediately removed from the pool. When all connections are closed the client is closed. When the timeout expires, all unclosed connections are immediately closed.

      • HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close
      • HTTP/1.x client connection will be closed after the current response is received

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      See Also:
      • HttpClient.shutdown(Duration)
    • shutdownAndForget

      public HttpClient.HttpClientImpl shutdownAndForget(Duration timeout)
      Initiate the client shutdown sequence.

      Connections are taken out of service and closed when all inflight requests are processed, client connection are immediately removed from the pool. When all connections are closed the client is closed. When the timeout expires, all unclosed connections are immediately closed.

      • HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close
      • HTTP/1.x client connection will be closed after the current response is received

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClient.shutdown(Duration)