Package org.atmosphere.webtransport
Interface WebTransportProcessor
- All Known Implementing Classes:
WebTransportProcessorAdapter
public interface WebTransportProcessor
WebTransport processing SPI. Mirrors
WebSocketProcessor
but without servlet handshake validation (WebTransport uses HTTP/3 extended CONNECT,
validated at the Reactor Netty level) and without InputStream/Reader
overloads (QUIC streams are natively byte-oriented).
The default implementation lives in the Spring Boot starter module since it requires Reactor Netty. The SPI here is transport-agnostic.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classException type for WebTransport processing errors.static final classProxy that associates aWebTransportHandlerwith aBroadcasterclass, mirroringWebSocketProcessor.WebSocketHandlerProxy. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(WebTransportSession session, int closeCode) Invoked when the WebTransport session is closed.configure(AtmosphereConfig config) Configure this processor.voiddestroy()Destroy all resources associated with this processor.voidinvokeWebTransportProtocol(WebTransportSession session, byte[] data, int offset, int length) Invoked when a binary message is received on a bidirectional stream.voidinvokeWebTransportProtocol(WebTransportSession session, String message) Invoked when a text message is received on a bidirectional stream.voidnotifyListener(WebTransportSession session, WebTransportEventListener.WebTransportEvent<?> event) Notify allWebTransportEventListeners of an event.voidopen(WebTransportSession session, AtmosphereRequest request, AtmosphereResponse response) Invoked when a WebTransport session is opened.Register aWebTransportHandlerfor a given path.
-
Method Details
-
configure
Configure this processor.- Parameters:
config- theAtmosphereConfig- Returns:
- this
-
registerWebTransportHandler
WebTransportProcessor registerWebTransportHandler(String path, WebTransportProcessor.WebTransportHandlerProxy handler) Register aWebTransportHandlerfor a given path.- Parameters:
path- the URI mappinghandler- aWebTransportProcessor.WebTransportHandlerProxy- Returns:
- this
-
open
void open(WebTransportSession session, AtmosphereRequest request, AtmosphereResponse response) throws IOException Invoked when a WebTransport session is opened.- Parameters:
session- theWebTransportSessionrequest- the initialAtmosphereRequestresponse- theAtmosphereResponse- Throws:
IOException
-
invokeWebTransportProtocol
Invoked when a text message is received on a bidirectional stream.- Parameters:
session- theWebTransportSessionmessage- the text message
-
invokeWebTransportProtocol
Invoked when a binary message is received on a bidirectional stream.- Parameters:
session- theWebTransportSessiondata- the raw bytesoffset- start offsetlength- number of bytes
-
close
Invoked when the WebTransport session is closed.- Parameters:
session- theWebTransportSessioncloseCode- the HTTP/3 error code (0-255)
-
notifyListener
void notifyListener(WebTransportSession session, WebTransportEventListener.WebTransportEvent<?> event) Notify allWebTransportEventListeners of an event.- Parameters:
session- theWebTransportSessionevent- the event
-
destroy
void destroy()Destroy all resources associated with this processor.
-