Top Description Inners Constructors Methods
org.springframework.web.reactive.socket.server.upgrade

public Class UndertowRequestUpgradeStrategy

extends Object
implements RequestUpgradeStrategy
Class Inheritance
All Implemented Interfaces
org.springframework.web.reactive.socket.server.RequestUpgradeStrategy
Imports
java.util.Collections, .List, .Set, java.util.function.Supplier, io.undertow.server.HttpServerExchange, io.undertow.websockets.WebSocketConnectionCallback, .WebSocketProtocolHandshakeHandler, io.undertow.websockets.core.WebSocketChannel, io.undertow.websockets.core.protocol.Handshake, io.undertow.websockets.core.protocol.version13.Hybi13Handshake, io.undertow.websockets.spi.WebSocketHttpExchange, reactor.core.publisher.Mono, org.springframework.core.io.buffer.DataBufferFactory, org.springframework.http.server.reactive.ServerHttpRequestDecorator, org.springframework.lang.Nullable, org.springframework.web.reactive.socket.HandshakeInfo, .WebSocketHandler, org.springframework.web.reactive.socket.adapter.ContextWebSocketHandler, .UndertowWebSocketHandlerAdapter, .UndertowWebSocketSession, org.springframework.web.reactive.socket.server.RequestUpgradeStrategy, org.springframework.web.server.ServerWebExchange

A WebSocket RequestUpgradeStrategy for Undertow.
Authors
Violeta Georgieva, Rossen Stoyanchev, Brian Clozel
Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Mono<Void>
upgrade(ServerWebExchange
the current exchange
exchange
,
WebSocketHandler
handler for the WebSocket session
handler
,
String
the selected sub-protocol got the handler
subProtocol
,
Supplier<HandshakeInfo>
factory to create HandshakeInfo for the WebSocket session
handshakeInfoFactory
)

Implements org.springframework.web.reactive.socket.server.RequestUpgradeStrategy.upgrade.

Upgrade to a WebSocket session and handle it with the given handler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UndertowRequestUpgradeStrategyback to summary
public UndertowRequestUpgradeStrategy()

Method Detail

upgradeback to summary
public Mono<Void> upgrade(ServerWebExchange exchange, WebSocketHandler handler, String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory)

Implements org.springframework.web.reactive.socket.server.RequestUpgradeStrategy.upgrade.

Doc from org.springframework.web.reactive.socket.server.RequestUpgradeStrategy.upgrade.

Upgrade to a WebSocket session and handle it with the given handler.

Parameters
exchange:ServerWebExchange

the current exchange

handler:WebSocketHandler

handler for the WebSocket session

subProtocol:String

the selected sub-protocol got the handler

handshakeInfoFactory:Supplier<HandshakeInfo>

factory to create HandshakeInfo for the WebSocket session

Returns:Mono<Void>

completion Mono<Void> to indicate the outcome of the WebSocket session handling.

Annotations
@Override
org.springframework.web.reactive.socket.server.upgrade back to summary

private Class UndertowRequestUpgradeStrategy.DefaultCallback

extends Object
implements WebSocketConnectionCallback
Class Inheritance
  • java.lang.Object
  • org.springframework.web.reactive.socket.server.upgrade.UndertowRequestUpgradeStrategy.DefaultCallback
All Implemented Interfaces
io.undertow.websockets.WebSocketConnectionCallback

Field Summary

Modifier and TypeField and Description
private final DataBufferFactory
private final WebSocketHandler
private final HandshakeInfo

Constructor Summary

AccessConstructor and Description
public
DefaultCallback(HandshakeInfo handshakeInfo, WebSocketHandler handler, DataBufferFactory bufferFactory)

Method Summary

Modifier and TypeMethod and Description
private UndertowWebSocketSession
public void
onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel)

Implements io.undertow.websockets.WebSocketConnectionCallback.onConnect.

Is called once the WebSocket connection is established, which means the handshake was successful.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferFactoryback to summary
private final DataBufferFactory bufferFactory
handlerback to summary
private final WebSocketHandler handler
handshakeInfoback to summary
private final HandshakeInfo handshakeInfo

Constructor Detail

DefaultCallbackback to summary
public DefaultCallback(HandshakeInfo handshakeInfo, WebSocketHandler handler, DataBufferFactory bufferFactory)

Method Detail

createSessionback to summary
private UndertowWebSocketSession createSession(WebSocketChannel channel)
onConnectback to summary
public void onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel)

Implements io.undertow.websockets.WebSocketConnectionCallback.onConnect.

Doc from io.undertow.websockets.WebSocketConnectionCallback.onConnect.

Is called once the WebSocket connection is established, which means the handshake was successful.

Annotations
@Override