Package org.apache.hc.core5.reactor
Interface ProtocolIOSession
- All Superinterfaces:
AutoCloseable,ByteChannel,Channel,Closeable,Identifiable,IOSession,ModalCloseable,ReadableByteChannel,SocketModalCloseable,TransportSecurityLayer,WritableByteChannel
- All Known Implementing Classes:
InternalDataChannel
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
Modifier and TypeMethodDescriptiondefault voidregisterProtocol(String protocolId, ProtocolUpgradeHandler upgradeHandler) Registers protocol upgrade handler with the given application protocol ID.default voidswitchProtocol(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.util.Identifiable
getIdMethods 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, upgradeMethods inherited from interface org.apache.hc.core5.io.ModalCloseable
closeMethods inherited from interface java.nio.channels.ReadableByteChannel
readMethods inherited from interface org.apache.hc.core5.reactor.ssl.TransportSecurityLayer
getTlsDetails, startTls, startTlsMethods inherited from interface java.nio.channels.WritableByteChannel
write
-
Method Details
-
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 IDcallback- the result callback- Throws:
UnsupportedOperationException- if application protocol switch is not supported.
-
registerProtocol
Registers protocol upgrade handler with the given application protocol ID.- Parameters:
protocolId- the application protocol IDupgradeHandler- the upgrade handler.- Since:
- 5.2, 5.2
-
getInitialEndpoint
NamedEndpoint getInitialEndpoint()
-