io.vertx.rxjava.core.http

## Class HttpConnection

- java.lang.Object
- - io.vertx.rxjava.core.http.HttpConnection

-     public class HttpConnection
      extends Object

  Represents an HTTP connection.

  HTTP/1.x connection provides an limited implementation, the following methods are implemented:
  - `close()`
  - `closeHandler(io.vertx.core.Handler<java.lang.Void>)`
  - `exceptionHandler(io.vertx.core.Handler<java.lang.Throwable>)`

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpConnection(HttpConnection delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the connection and all the currently active streams.
    `HttpConnection` | `closeHandler(Handler<Void> handler)` Set a close handler.
    `HttpConnection` | `exceptionHandler(Handler<Throwable> handler)` Set an handler called when a connection error happens
    `Object` | `getDelegate()`
    `int` | `getWindowSize()`
    `HttpConnection` | `goAway(long errorCode)` Like `goAway(long)` with a last stream id `2^31-1`.
    `HttpConnection` | `goAway(long errorCode, int lastStreamId)` Like `goAway(long)` with no buffer.
    `HttpConnection` | `goAway(long errorCode, int lastStreamId, Buffer debugData)` Send a go away frame to the remote endpoint of the connection.
    `HttpConnection` | `goAwayHandler(Handler<GoAway> handler)` Set an handler called when a frame is received.
    `static HttpConnection` | `newInstance(HttpConnection arg)`
    `HttpConnection` | `ping(Buffer data, Handler<AsyncResult<Buffer>> pongHandler)` Send a frame to the remote endpoint.
    `HttpConnection` | `pingHandler(Handler<Buffer> handler)` Set an handler notified when a frame is received from the remote endpoint.
    `Observable<Buffer>` | `pingObservable(Buffer data)` Send a frame to the remote endpoint.
    `Http2Settings` | `remoteSettings()`
    `HttpConnection` | `remoteSettingsHandler(Handler<Http2Settings> handler)` Set an handler that is called when remote endpoint `Http2Settings` are updated.
    `Http2Settings` | `settings()`
    `HttpConnection` | `setWindowSize(int windowSize)` Update the current connection wide window size to a new size.
    `HttpConnection` | `shutdown()` Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current active streams are closed or after a time out of 30 seconds.
    `HttpConnection` | `shutdown(long timeoutMs)` Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current streams will be closed or the `timeout` is fired.
    `HttpConnection` | `shutdownHandler(Handler<Void> handler)` Set an handler called when a frame has been sent or received and all connections are closed.
    `HttpConnection` | `updateSettings(Http2Settings settings)` Send to the remote endpoint an update of the server settings.
    `HttpConnection` | `updateSettings(Http2Settings settings, Handler<AsyncResult<Void>> completionHandler)` Send to the remote endpoint an update of this endpoint settings The `completionHandler` will be notified when the remote endpoint has acknowledged the settings.
    `Observable<Void>` | `updateSettingsObservable(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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HttpConnection

          public HttpConnection(HttpConnection delegate)

  - ### Method Detail

    - #### getDelegate

          public Object getDelegate()

    - #### getWindowSize

          public int getWindowSize()

      Returns:
        the current connection window size or `-1` for HTTP/1.x

    - #### setWindowSize

          public HttpConnection setWindowSize(int windowSize)

      Update the current connection wide window size to a new size.

      Increasing this value, gives better performance when several data streams are multiplexed

      This is not implemented for HTTP/1.x.
      Parameters:
        `windowSize` - the new window size
      Returns:
        a reference to this, so the API can be used fluently

    - #### goAway

          public HttpConnection goAway(long errorCode)

      Like `goAway(long)` with a last stream id `2^31-1`.
      Parameters:
        `errorCode` -
      Returns:

    - #### goAway

          public HttpConnection goAway(long errorCode,
                                       int lastStreamId)

      Like `goAway(long)` with no buffer.
      Parameters:
        `errorCode` -
        `lastStreamId` -
      Returns:

    - #### goAway

          public HttpConnection goAway(long errorCode,
                                       int lastStreamId,
                                       Buffer debugData)

      Send a go away frame to the remote endpoint of the connection.

      - a frame is sent to the to the remote endpoint with the `errorCode` and `debugData`
      - any stream created after the stream identified by `lastStreamId` will be closed
      - for an is different than `0` when all the remaining streams are closed this connection will be closed automatically

      This is not implemented for HTTP/1.x.
      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(Handler<GoAway> handler)

      Set an handler called when a frame is received.

      This is not implemented for HTTP/1.x.
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### shutdownHandler

          public HttpConnection shutdownHandler(Handler<Void> handler)

      Set an handler called when a frame has been sent or received and all connections are closed.

      This is not implemented for HTTP/1.x.
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### shutdown

          public HttpConnection shutdown()

      Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current active streams are closed or after a time out of 30 seconds.

      This is not implemented for HTTP/1.x.
      Returns:
        a reference to this, so the API can be used fluently

    - #### shutdown

          public HttpConnection shutdown(long timeoutMs)

      Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current streams will be closed or the `timeout` is fired.

      This is not implemented for HTTP/1.x.
      Parameters:
        `timeoutMs` - the timeout in milliseconds
      Returns:
        a reference to this, so the API can be used fluently

    - #### closeHandler

          public HttpConnection closeHandler(Handler<Void> handler)

      Set a close handler. The handler will get notified when the connection is closed.
      Parameters:
        `handler` - the handler to be notified
      Returns:
        a reference to this, so the API can be used fluently

    - #### close

          public void close()

      Close the connection and all the currently active streams.

      An HTTP/2 connection will send a frame before.

    - #### settings

          public Http2Settings settings()

      Returns:
        the latest server settings acknowledged by the remote endpoint - this is not implemented for HTTP/1.x

    - #### updateSettings

          public HttpConnection updateSettings(Http2Settings settings)

      Send to the remote endpoint an update of the server settings.

      This is not implemented for HTTP/1.x.
      Parameters:
        `settings` - the new settings
      Returns:
        a reference to this, so the API can be used fluently

    - #### updateSettings

          public HttpConnection updateSettings(Http2Settings settings,
                                               Handler<AsyncResult<Void>> completionHandler)

      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.
      Parameters:
        `settings` - the new settings
        `completionHandler` - the handler notified when the settings have been acknowledged by the remote endpoint
      Returns:
        a reference to this, so the API can be used fluently

    - #### updateSettingsObservable

          public Observable<Void> updateSettingsObservable(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.
      Parameters:
        `settings` - the new settings
      Returns:

    - #### remoteSettings

          public Http2Settings remoteSettings()

      Returns:
        the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x

    - #### remoteSettingsHandler

          public HttpConnection remoteSettingsHandler(Handler<Http2Settings> handler)

      Set an handler that is called when remote endpoint `Http2Settings` are updated.

      This is not implemented for HTTP/1.x.
      Parameters:
        `handler` - the handler for remote endpoint settings
      Returns:
        a reference to this, so the API can be used fluently

    - #### ping

          public HttpConnection ping(Buffer data,
                                     Handler<AsyncResult<Buffer>> pongHandler)

      Send a frame to the remote endpoint.

      This is not implemented for HTTP/1.x.
      Parameters:
        `data` - the 8 bytes data of the frame
        `pongHandler` - an async result handler notified with pong reply or the failure
      Returns:
        a reference to this, so the API can be used fluently

    - #### pingObservable

          public Observable<Buffer> pingObservable(Buffer data)

      Send a frame to the remote endpoint.

      This is not implemented for HTTP/1.x.
      Parameters:
        `data` - the 8 bytes data of the frame
      Returns:

    - #### pingHandler

          public HttpConnection pingHandler(Handler<Buffer> handler)

      Set an handler notified when a frame is received from the remote endpoint.

      This is not implemented for HTTP/1.x.
      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(Handler<Throwable> handler)

      Set an handler called when a connection error happens
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### newInstance

          public static HttpConnection newInstance(HttpConnection arg)

Copyright © 2016. All rights reserved.