org.apache.hc.core5.reactor

## Interface ProtocolIOSession

- All Superinterfaces:
    AutoCloseable, ByteChannel, Channel, Closeable, Identifiable, IOSession, ModalCloseable, ReadableByteChannel, SocketModalCloseable, TransportSecurityLayer, WritableByteChannel

      public interface ProtocolIOSession
      extends IOSession, TransportSecurityLayer

  TLS capable, protocol upgradable `IOSession`.
  Since:
    5.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.hc.core5.reactor.IOSession

      `IOSession.Status`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `NamedEndpoint` | `getInitialEndpoint()`
    `default void` | `registerProtocol(String protocolId, ProtocolUpgradeHandler upgradeHandler)` Registers protocol upgrade handler with the given application protocol ID.
    `default void` | `switchProtocol(String protocolId, FutureCallback<ProtocolIOSession> callback)` Switches this I/O session to the application protocol with the given ID.

    - ### Methods inherited from interface org.apache.hc.core5.reactor.IOSession

      `channel, clearEvent, close, enqueue, getEventMask, getHandler, getLastEventTime, getLastReadTime, getLastWriteTime, getLocalAddress, getLock, getRemoteAddress, getSocketTimeout, getStatus, hasCommands, poll, setEvent, setEventMask, setSocketTimeout, updateReadTime, updateWriteTime, upgrade`

    - ### Methods inherited from interface java.nio.channels.ReadableByteChannel

      `read`

    - ### Methods inherited from interface java.nio.channels.WritableByteChannel

      `write`

    - ### Methods inherited from interface java.nio.channels.Channel

      `isOpen`

    - ### Methods inherited from interface org.apache.hc.core5.io.ModalCloseable

      `close`

    - ### Methods inherited from interface org.apache.hc.core5.util.Identifiable

      `getId`

    - ### Methods inherited from interface org.apache.hc.core5.reactor.ssl.TransportSecurityLayer

      `getTlsDetails, startTls, startTls`

- - ### Method Detail

    - #### switchProtocol

          default void switchProtocol(String protocolId,
                                      FutureCallback<ProtocolIOSession> callback)
                               throws UnsupportedOperationException

      Switches this I/O session to the application protocol with the given ID.
      Parameters:
        `protocolId` - the application protocol ID
        `callback` - the result callback
      Throws:
        `UnsupportedOperationException` - if application protocol switch is not supported.

    - #### registerProtocol

          default void registerProtocol(String protocolId,
                                        ProtocolUpgradeHandler upgradeHandler)

      Registers protocol upgrade handler with the given application protocol ID.
      Parameters:
        `protocolId` - the application protocol ID
        `upgradeHandler` - the upgrade handler.
      Since:
        5.2, 5.2

    - #### getInitialEndpoint

          NamedEndpoint getInitialEndpoint()

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