Class HttpConnection

    • Constructor Detail

      • HttpConnection

        public HttpConnection​(io.vertx.core.http.HttpConnection delegate)
    • Method Detail

      • getDelegate

        public io.vertx.core.http.HttpConnection getDelegate()
      • hashCode

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

        public int getWindowSize()
        Returns:
        the current connection window size or -1 for HTTP/1.x
      • setWindowSize

        public HttpConnection setWindowSize​(int windowSize)
        Parameters:
        windowSize - the new window size
        Returns:
        a reference to this, so the API can be used fluently
      • goAway

        public HttpConnection goAway​(long errorCode)
        Parameters:
        errorCode -
        Returns:
      • goAway

        public HttpConnection goAway​(long errorCode,
                                     int lastStreamId)
        Parameters:
        errorCode -
        lastStreamId -
        Returns:
      • goAway

        public HttpConnection goAway​(long errorCode,
                                     int lastStreamId,
                                     Buffer debugData)
        Parameters:
        errorCode - the error code
        lastStreamId - the last stream id
        debugData - additional debug data sent to the remote endpoint
        Returns:
        a reference to this, so the API can be used fluently
      • goAwayHandler

        public HttpConnection goAwayHandler​(Consumer<io.vertx.core.http.GoAway> handler)
        Parameters:
        handler - the handler
        Returns:
        a reference to this, so the API can be used fluently
      • shutdownHandler

        public HttpConnection shutdownHandler​(Consumer<Void> handler)
        Parameters:
        handler - the handler
        Returns:
        a reference to this, so the API can be used fluently
      • shutdown

        public HttpConnection shutdown()
        Returns:
        a reference to this, so the API can be used fluently
      • shutdown

        public HttpConnection shutdown​(long timeoutMs)
        Parameters:
        timeoutMs - the timeout in milliseconds
        Returns:
        a reference to this, so the API can be used fluently
      • closeHandler

        public HttpConnection closeHandler​(Consumer<Void> handler)
        Parameters:
        handler - the handler to be notified
        Returns:
        a reference to this, so the API can be used fluently
      • close

        public void close()
      • settings

        public io.vertx.core.http.Http2Settings settings()
        Returns:
        the latest server settings acknowledged by the remote endpoint - this is not implemented for HTTP/1.x
      • updateSettings

        public io.smallrye.mutiny.Uni<Void> updateSettings​(io.vertx.core.http.Http2Settings settings)
        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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        settings - the new settings
        Returns:
        a reference to this, so the API can be used fluently
      • updateSettingsAndAwait

        public Void updateSettingsAndAwait​(io.vertx.core.http.Http2Settings settings)
        Blocking variant of updateSettings(Http2Settings).

        This method waits 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:
        settings - the new settings
        Returns:
        a reference to this, so the API can be used fluently
      • remoteSettings

        public io.vertx.core.http.Http2Settings remoteSettings()
        Returns:
        the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x
      • remoteSettingsHandler

        public HttpConnection remoteSettingsHandler​(Consumer<io.vertx.core.http.Http2Settings> handler)
        Parameters:
        handler - the handler for remote endpoint settings
        Returns:
        a reference to this, so the API can be used fluently
      • ping

        public io.smallrye.mutiny.Uni<Buffer> ping​(Buffer data)
        Send a frame to the remote endpoint.

        This is not implemented for HTTP/1.x.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        data - the 8 bytes data of the frame
        Returns:
        a reference to this, so the API can be used fluently
      • pingAndAwait

        public Buffer pingAndAwait​(Buffer data)
        Blocking variant of ping(io.vertx.mutiny.core.buffer.Buffer).

        This method waits 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:
        data - the 8 bytes data of the frame
        Returns:
        a reference to this, so the API can be used fluently
      • pingHandler

        public HttpConnection pingHandler​(Consumer<Buffer> handler)
        Parameters:
        handler - the handler to be called when a is received
        Returns:
        a reference to this, so the API can be used fluently
      • exceptionHandler

        public HttpConnection exceptionHandler​(Consumer<Throwable> handler)
        Parameters:
        handler - the handler
        Returns:
        a reference to this, so the API can be used fluently
      • remoteAddress

        public SocketAddress remoteAddress()
        Returns:
        the remote address for this connection, possibly null (e.g a server bound on a domain socket)
      • localAddress

        public SocketAddress localAddress()
        Returns:
        the local address for this connection, possibly null (e.g a server bound on a domain socket)
      • isSsl

        public boolean isSsl()
        Returns:
        true if this HttpConnection is encrypted via SSL/TLS.
      • indicatedServerName

        public String indicatedServerName()
        Returns:
        the indicated server name
      • sslSession

        public SSLSession sslSession()
        Returns:
        SSLSession associated with the underlying socket. Returns null if connection is not SSL.
      • updateSettingsAndForget

        public HttpConnection updateSettingsAndForget​(io.vertx.core.http.Http2Settings settings)
        Variant of updateSettings(Http2Settings) that ignores the result of the operation.

        This method subscribes on the result of updateSettings(Http2Settings), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from updateSettings(Http2Settings) but you don't need to compose it with other operations.

        Parameters:
        settings - the new settings
        Returns:
        a reference to this, so the API can be used fluently
      • newInstance

        public static HttpConnection newInstance​(io.vertx.core.http.HttpConnection arg)