Class HttpClientConnection

  • All Implemented Interfaces:
    HttpClient

    public class HttpClientConnection
    extends HttpConnection
    implements 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.

    • Constructor Detail

      • HttpClientConnection

        public HttpClientConnection​(Object delegate)
    • Method Detail

      • request

        public Future<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 Future<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 Future<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 Future<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 Future<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 Future<Void> shutdown​(long timeout,
                                     TimeUnit unit)
        Description copied from class: HttpConnection
        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.
        Specified by:
        shutdown in interface HttpClient
        Overrides:
        shutdown in class HttpConnection
        Parameters:
        timeout - the amount of time after which all resources are forcibly closed
        unit - the of the timeout
        Returns:
        a future completed when shutdown has completed
      • rxShutdown

        public Completable rxShutdown​(long timeout,
                                      TimeUnit unit)
        Description copied from class: HttpConnection
        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.
        Specified by:
        rxShutdown in interface HttpClient
        Overrides:
        rxShutdown in class HttpConnection
        Parameters:
        timeout - the amount of time after which all resources are forcibly closed
        unit - the of the timeout
        Returns:
        a future completed when shutdown has completed