Class HttpClientConnection

java.lang.Object
io.vertx.mutiny.core.http.HttpConnection
io.vertx.mutiny.core.http.HttpClientConnection
All Implemented Interfaces:
MutinyDelegate, HttpClient

public class HttpClientConnection extends HttpConnection implements HttpClient, MutinyDelegate
Represents an HTTP client connection.

You can use this connection to create requests to the connected server.

Depending on the nature of the connection, requests might just be sent to the server or might be queued until a connection request is available.

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

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

  • Constructor Details

    • HttpClientConnection

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

      public HttpClientConnection(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.http.HttpClientConnection 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
      Overrides:
      getDelegate in class HttpConnection
      Returns:
      the delegate instance
    • shutdown

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> shutdown()

      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
      Overrides:
      shutdown in class HttpConnection
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClientConnection.shutdown()
    • shutdownAndAwait

      public void shutdownAndAwait()

      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).

      Overrides:
      shutdownAndAwait in class HttpConnection
      See Also:
      • HttpClientConnection.shutdown()
    • shutdownAndForget

      public HttpClientConnection shutdownAndForget()

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

      Overrides:
      shutdownAndForget in class HttpConnection
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClientConnection.shutdown()
    • shutdown

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

      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
      Overrides:
      shutdown in class HttpConnection
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClientConnection.shutdown(long, TimeUnit)
    • shutdownAndAwait

      public void shutdownAndAwait(long timeout, TimeUnit unit)

      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).

      Overrides:
      shutdownAndAwait in class HttpConnection
      See Also:
      • HttpClientConnection.shutdown(long, TimeUnit)
    • shutdownAndForget

      public HttpClientConnection shutdownAndForget(long timeout, TimeUnit unit)

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

      Overrides:
      shutdownAndForget in class HttpConnection
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClientConnection.shutdown(long, TimeUnit)
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()

      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
      Overrides:
      close in class HttpConnection
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpClientConnection.close()
    • closeAndAwait

      public void closeAndAwait()

      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).

      Overrides:
      closeAndAwait in class HttpConnection
      See Also:
      • HttpClientConnection.close()
    • closeAndForget

      public HttpClientConnection closeAndForget()

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

      Overrides:
      closeAndForget in class HttpConnection
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpClientConnection.close()
    • ping

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.buffer.Buffer> ping(io.vertx.core.buffer.Buffer arg0)
      Send a PING frame to the remote endpoint.

      This is not implemented for HTTP/1.x.

      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.

      Overrides:
      ping in class HttpConnection
      Parameters:
      data - the 8 bytes data of the frame
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpConnection.ping(Buffer)
    • pingAndAwait

      public io.vertx.core.buffer.Buffer pingAndAwait(io.vertx.core.buffer.Buffer arg0)
      Send a PING frame to the remote endpoint.

      This is not implemented for HTTP/1.x.

      Unlike the bare Vert.x variant, this method returns a Buffer. 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).

      Overrides:
      pingAndAwait in class HttpConnection
      Parameters:
      data - the 8 bytes data of the frame
      Returns:
      The operation result
      See Also:
      • HttpConnection.ping(Buffer)
    • pingAndForget

      public HttpClientConnection pingAndForget(io.vertx.core.buffer.Buffer arg0)
      Send a PING frame to the remote endpoint.

      This is not implemented for HTTP/1.x.

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

      Overrides:
      pingAndForget in class HttpConnection
      Parameters:
      data - the 8 bytes data of the frame
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpConnection.ping(Buffer)
    • request

      @CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.HttpMethod arg0, int arg1, String arg2, String arg3)
      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 arg0, int arg1, String arg2, String arg3)
      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 HttpClientConnection requestAndForget(io.vertx.core.http.HttpMethod arg0, int arg1, String arg2, String arg3)
      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 arg0, String arg1)
      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 arg0, String arg1)
      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 HttpClientConnection requestAndForget(io.vertx.core.http.HttpMethod arg0, String arg1)
      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(Duration arg0)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after a timeout the connection will be closed. Client connection are immediately removed from the pool.
      • HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
      • HTTP/1.x connection will be closed.

      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
      Overrides:
      shutdown in class HttpConnection
      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:
      • HttpConnection.shutdown(Duration)
    • shutdownAndAwait

      public void shutdownAndAwait(Duration arg0)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after a timeout the connection will be closed. Client connection are immediately removed from the pool.
      • HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
      • HTTP/1.x connection will be closed.

      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).

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

      public HttpClientConnection shutdownAndForget(Duration arg0)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after a timeout the connection will be closed. Client connection are immediately removed from the pool.
      • HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
      • HTTP/1.x connection will be closed.

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

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

      @CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.RequestOptions arg0)
      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 arg0)
      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 HttpClientConnection requestAndForget(io.vertx.core.http.RequestOptions arg0)
      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)
    • updateSettings

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> updateSettings(io.vertx.core.http.HttpSettings arg0)
      Send to the remote endpoint an update of this endpoint settings

      The completionHandler will be notified when the remote endpoint has acknowledged the settings.

      This is not implemented for HTTP/1.x.

      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.

      Overrides:
      updateSettings in class HttpConnection
      Parameters:
      settings - the new settings
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HttpConnection.updateSettings(HttpSettings)
    • updateSettingsAndAwait

      public void updateSettingsAndAwait(io.vertx.core.http.HttpSettings arg0)
      Send to the remote endpoint an update of this endpoint settings

      The completionHandler will be notified when the remote endpoint has acknowledged the settings.

      This is not implemented for HTTP/1.x.

      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).

      Overrides:
      updateSettingsAndAwait in class HttpConnection
      Parameters:
      settings - the new settings
      See Also:
      • HttpConnection.updateSettings(HttpSettings)
    • updateSettingsAndForget

      public HttpClientConnection updateSettingsAndForget(io.vertx.core.http.HttpSettings arg0)
      Send to the remote endpoint an update of this endpoint settings

      The completionHandler will be notified when the remote endpoint has acknowledged the settings.

      This is not implemented for HTTP/1.x.

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

      Overrides:
      updateSettingsAndForget in class HttpConnection
      Parameters:
      settings - the new settings
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HttpConnection.updateSettings(HttpSettings)
    • 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 HttpClientConnection 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.HttpMethod arg0, String arg1, String arg2)
      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 arg0, String arg1, String arg2)
      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 HttpClientConnection requestAndForget(io.vertx.core.http.HttpMethod arg0, String arg1, String arg2)
      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)
    • activeStreams

      public long activeStreams()
      Returns:
      the number of active request/response (streams)
    • maxActiveStreams

      public long maxActiveStreams()
      Returns:
      the max number of concurrent active streams this connection can handle
    • newInstance

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

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

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

      public String toString()
      Overrides:
      toString in class HttpConnection