Class HttpClientConnection

java.lang.Object
io.vertx.rxjava3.core.http.HttpConnection
io.vertx.rxjava3.core.http.HttpClientConnection
All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate, HttpClient

public class HttpClientConnection extends HttpConnection implements io.vertx.lang.rx.RxDelegate, HttpClient
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 RX-ified interface using Vert.x codegen.

  • Field Details

  • Constructor Details

    • HttpClientConnection

      public HttpClientConnection(HttpClientConnection delegate)
    • HttpClientConnection

      public HttpClientConnection(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class HttpConnection
    • equals

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

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

      public HttpClientConnection getDelegate()
      Specified by:
      getDelegate in interface HttpClient
      Specified by:
      getDelegate in interface io.vertx.lang.rx.RxDelegate
      Overrides:
      getDelegate in class HttpConnection
    • request

      public Single<HttpClientRequest> request()
      Create an HTTP request to send to the server with the default host and port of the client.
      Specified by:
      request in interface HttpClient
      Returns:
      a future notified when the request is ready to be sent
    • rxRequest

      public Single<HttpClientRequest> rxRequest()
      Create an HTTP request to send to the server with the default host and port of the client.
      Specified by:
      rxRequest in interface HttpClient
      Returns:
      a future notified when the request is ready to be sent
    • request

      public Single<HttpClientRequest> request(RequestOptions options)
      Create an HTTP request to send to the server.
      Specified by:
      request in interface HttpClient
      Parameters:
      options - the request options
      Returns:
      a future notified when the request is ready to be sent
    • rxRequest

      public Single<HttpClientRequest> rxRequest(RequestOptions options)
      Create an HTTP request to send to the server.
      Specified by:
      rxRequest in interface HttpClient
      Parameters:
      options - the request options
      Returns:
      a future notified when the request is ready to be sent
    • request

      public Single<HttpClientRequest> request(HttpMethod method, int port, String host, String requestURI)
      Create an HTTP request to send to the server at the host and port.
      Specified by:
      request in interface HttpClient
      Parameters:
      method - the HTTP method
      port - the port
      host - the host
      requestURI - the relative URI
      Returns:
      a future notified when the request is ready to be sent
    • rxRequest

      public Single<HttpClientRequest> rxRequest(HttpMethod method, int port, String host, String requestURI)
      Create an HTTP request to send to the server at the host and port.
      Specified by:
      rxRequest in interface HttpClient
      Parameters:
      method - the HTTP method
      port - the port
      host - the host
      requestURI - the relative URI
      Returns:
      a future notified when the request is ready to be sent
    • request

      public Single<HttpClientRequest> request(HttpMethod method, String host, String requestURI)
      Create an HTTP request to send to the server at the host and default port.
      Specified by:
      request in interface HttpClient
      Parameters:
      method - the HTTP method
      host - the host
      requestURI - the relative URI
      Returns:
      a future notified when the request is ready to be sent
    • rxRequest

      public Single<HttpClientRequest> rxRequest(HttpMethod method, String host, String requestURI)
      Create an HTTP request to send to the server at the host and default port.
      Specified by:
      rxRequest in interface HttpClient
      Parameters:
      method - the HTTP method
      host - the host
      requestURI - the relative URI
      Returns:
      a future notified when the request is ready to be sent
    • request

      public Single<HttpClientRequest> request(HttpMethod method, String requestURI)
      Create an HTTP request to send to the server at the default host and port.
      Specified by:
      request in interface HttpClient
      Parameters:
      method - the HTTP method
      requestURI - the relative URI
      Returns:
      a future notified when the request is ready to be sent
    • rxRequest

      public Single<HttpClientRequest> rxRequest(HttpMethod method, String requestURI)
      Create an HTTP request to send to the server at the default host and port.
      Specified by:
      rxRequest in interface HttpClient
      Parameters:
      method - the HTTP method
      requestURI - the relative URI
      Returns:
      a future notified when the request is ready to be sent
    • 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
    • shutdown

      public Completable shutdown()
      Description copied from class: HttpConnection
      Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).
      Specified by:
      shutdown in interface HttpClient
      Overrides:
      shutdown in class HttpConnection
      Returns:
      a future completed when shutdown has completed
    • rxShutdown

      public Completable rxShutdown()
      Description copied from class: HttpConnection
      Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).
      Specified by:
      rxShutdown in interface HttpClient
      Overrides:
      rxShutdown in class HttpConnection
      Returns:
      a future completed when shutdown has completed
    • shutdown

      public Completable shutdown(long timeout, TimeUnit unit)
      Description copied from class: HttpConnection
      Specified by:
      shutdown in interface HttpClient
      Overrides:
      shutdown in class HttpConnection
      Parameters:
      timeout -
      unit -
      Returns:
    • rxShutdown

      public Completable rxShutdown(long timeout, TimeUnit unit)
      Description copied from class: HttpConnection
      Specified by:
      rxShutdown in interface HttpClient
      Overrides:
      rxShutdown in class HttpConnection
      Parameters:
      timeout -
      unit -
      Returns:
    • close

      public Completable close()
      Description copied from class: HttpConnection
      Close immediately (shutdown(0, TimeUnit.SECONDS).
      Specified by:
      close in interface HttpClient
      Overrides:
      close in class HttpConnection
      Returns:
      a future notified when the client is closed
    • rxClose

      public Completable rxClose()
      Description copied from class: HttpConnection
      Close immediately (shutdown(0, TimeUnit.SECONDS).
      Specified by:
      rxClose in interface HttpClient
      Overrides:
      rxClose in class HttpConnection
      Returns:
      a future notified when the client is closed
    • shutdown

      public Completable 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
      Overrides:
      shutdown in class HttpConnection
      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      Returns:
      a future notified when the client is closed
    • rxShutdown

      public Completable rxShutdown(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
      Overrides:
      rxShutdown in class HttpConnection
      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      Returns:
      a future notified when the client is closed
    • newInstance

      public static HttpClientConnection newInstance(HttpClientConnection arg)