Package org.apache.hc.core5.reactor
Interface ProtocolIOSession
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.nio.channels.ByteChannel
,java.nio.channels.Channel
,java.io.Closeable
,Identifiable
,IOSession
,ModalCloseable
,java.nio.channels.ReadableByteChannel
,SocketModalCloseable
,TransportSecurityLayer
,java.nio.channels.WritableByteChannel
- All Known Implementing Classes:
InternalDataChannel
public interface ProtocolIOSession extends IOSession, TransportSecurityLayer
TLS capable, protocol upgradableIOSession
.- 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 Description NamedEndpoint
getInitialEndpoint()
default void
registerProtocol(java.lang.String protocolId, ProtocolUpgradeHandler upgradeHandler)
Registers protocol upgrade handler with the given application protocol ID.default void
switchProtocol(java.lang.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
getId
-
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 org.apache.hc.core5.io.ModalCloseable
close
-
Methods inherited from interface org.apache.hc.core5.reactor.ssl.TransportSecurityLayer
getTlsDetails, startTls, startTls
-
-
-
-
Method Detail
-
switchProtocol
default void switchProtocol(java.lang.String protocolId, FutureCallback<ProtocolIOSession> callback) throws java.lang.UnsupportedOperationException
Switches this I/O session to the application protocol with the given ID.- Parameters:
protocolId
- the application protocol IDcallback
- the result callback- Throws:
java.lang.UnsupportedOperationException
- if application protocol switch is not supported.
-
registerProtocol
default void registerProtocol(java.lang.String protocolId, ProtocolUpgradeHandler upgradeHandler)
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()
-
-