org.apache.hc.core5.http2.impl.nio

## Class ClientH2StreamMultiplexer

- java.lang.Object
- - org.apache.hc.core5.http2.impl.nio.ClientH2StreamMultiplexer

- All Implemented Interfaces:
    Closeable, AutoCloseable, HttpConnection, SocketModalCloseable, ModalCloseable, Identifiable

      @Internal
      public class ClientH2StreamMultiplexer
      extends Object

  I/O event handler for events fired by `ProtocolIOSession` that implements client side HTTP/2 messaging protocol with full support for multiplexed message transmission.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientH2StreamMultiplexer(ProtocolIOSession ioSession, FrameFactory frameFactory, HttpProcessor httpProcessor, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, H2Config h2Config, CharCodingConfig charCodingConfig, H2StreamListener streamListener)`
    `ClientH2StreamMultiplexer(ProtocolIOSession ioSession, HttpProcessor httpProcessor, H2Config h2Config, CharCodingConfig charCodingConfig)`
    `ClientH2StreamMultiplexer(ProtocolIOSession ioSession, HttpProcessor httpProcessor, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, H2Config h2Config, CharCodingConfig charCodingConfig)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes this connection gracefully.
    `void` | `close(CloseMode closeMode)` Closes this process or endpoint and releases any system resources associated with it.
    `EndpointDetails` | `getEndpointDetails()` Returns this connection's endpoint details.
    `String` | `getId()`
    `SocketAddress` | `getLocalAddress()` Returns this connection's local address or `null` if it is not bound yet.
    `ProtocolVersion` | `getProtocolVersion()` Returns this connection's protocol version or `null` if unknown.
    `SocketAddress` | `getRemoteAddress()` Returns this connection's remote address or `null` if it is not connected yet or unconnected.
    `Timeout` | `getSocketTimeout()` Returns the socket timeout value.
    `SSLSession` | `getSSLSession()` Returns this connection's SSL session or `null` if TLS has not been activated.
    `boolean` | `isOpen()` Checks if this connection is open.
    `void` | `onConnect()`
    `void` | `onDisconnect()`
    `void` | `onException(Exception cause)`
    `void` | `onInput(ByteBuffer src)`
    `void` | `onOutput()`
    `void` | `onTimeout(Timeout timeout)`
    `void` | `setSocketTimeout(Timeout timeout)` Sets the socket timeout value.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### ClientH2StreamMultiplexer

          public ClientH2StreamMultiplexer(ProtocolIOSession ioSession,
                                           FrameFactory frameFactory,
                                           HttpProcessor httpProcessor,
                                           HandlerFactory<AsyncPushConsumer> pushHandlerFactory,
                                           H2Config h2Config,
                                           CharCodingConfig charCodingConfig,
                                           H2StreamListener streamListener)

    - #### ClientH2StreamMultiplexer

          public ClientH2StreamMultiplexer(ProtocolIOSession ioSession,
                                           HttpProcessor httpProcessor,
                                           HandlerFactory<AsyncPushConsumer> pushHandlerFactory,
                                           H2Config h2Config,
                                           CharCodingConfig charCodingConfig)

    - #### ClientH2StreamMultiplexer

          public ClientH2StreamMultiplexer(ProtocolIOSession ioSession,
                                           HttpProcessor httpProcessor,
                                           H2Config h2Config,
                                           CharCodingConfig charCodingConfig)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `Identifiable`

    - #### onConnect

          public final void onConnect()
                               throws HttpException,
                                      IOException

      Throws:
        `HttpException`
        `IOException`

    - #### onInput

          public final void onInput(ByteBuffer src)
                             throws HttpException,
                                    IOException

      Throws:
        `HttpException`
        `IOException`

    - #### onOutput

          public final void onOutput()
                              throws HttpException,
                                     IOException

      Throws:
        `HttpException`
        `IOException`

    - #### onTimeout

          public final void onTimeout(Timeout timeout)
                               throws HttpException,
                                      IOException

      Throws:
        `HttpException`
        `IOException`

    - #### onDisconnect

          public final void onDisconnect()

    - #### onException

          public final void onException(Exception cause)

    - #### close

          public void close()
                     throws IOException

      Description copied from interface: `HttpConnection`
      Closes this connection gracefully. This method will attempt to flush the internal output buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Use `shutdown` instead.
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `HttpConnection`
      Throws:
        `IOException`

    - #### close

          public void close(CloseMode closeMode)

      Description copied from interface: `ModalCloseable`
      Closes this process or endpoint and releases any system resources associated with it. If the endpoint or the process is already closed then invoking this method has no effect.
      Specified by:
        `close` in interface `ModalCloseable`
      Parameters:
        `closeMode` - How to close the receiver.

    - #### isOpen

          public boolean isOpen()

      Description copied from interface: `HttpConnection`
      Checks if this connection is open.
      Specified by:
        `isOpen` in interface `HttpConnection`
      Returns:
        true if it is open, false if it is closed.

    - #### setSocketTimeout

          public void setSocketTimeout(Timeout timeout)

      Description copied from interface: `SocketModalCloseable`
      Sets the socket timeout value.
      Specified by:
        `setSocketTimeout` in interface `SocketModalCloseable`
      Parameters:
        `timeout` - timeout value

    - #### getSSLSession

          public SSLSession getSSLSession()

      Description copied from interface: `HttpConnection`
      Returns this connection's SSL session or `null` if TLS has not been activated.
      Specified by:
        `getSSLSession` in interface `HttpConnection`
      Returns:
        this connection's SSL session or `null` if TLS has not been activated.

    - #### getEndpointDetails

          public EndpointDetails getEndpointDetails()

      Description copied from interface: `HttpConnection`
      Returns this connection's endpoint details.
      Specified by:
        `getEndpointDetails` in interface `HttpConnection`
      Returns:
        this connection's endpoint details.

    - #### getSocketTimeout

          public Timeout getSocketTimeout()

      Description copied from interface: `SocketModalCloseable`
      Returns the socket timeout value.
      Specified by:
        `getSocketTimeout` in interface `SocketModalCloseable`
      Returns:
        timeout value.

    - #### getProtocolVersion

          public ProtocolVersion getProtocolVersion()

      Description copied from interface: `HttpConnection`
      Returns this connection's protocol version or `null` if unknown.
      Specified by:
        `getProtocolVersion` in interface `HttpConnection`
      Returns:
        this connection's protocol version or `null` if unknown.

    - #### getRemoteAddress

          public SocketAddress getRemoteAddress()

      Description copied from interface: `HttpConnection`
      Returns this connection's remote address or `null` if it is not connected yet or unconnected.
      Specified by:
        `getRemoteAddress` in interface `HttpConnection`
      Returns:
        this connection's remote address or `null` if it is not connected yet or unconnected.

    - #### getLocalAddress

          public SocketAddress getLocalAddress()

      Description copied from interface: `HttpConnection`
      Returns this connection's local address or `null` if it is not bound yet.
      Specified by:
        `getLocalAddress` in interface `HttpConnection`
      Returns:
        this connection's local address or `null` if it is not bound yet.

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.