org.springframework.web.reactive.socket.server

## Interface RequestUpgradeStrategy

All Known Implementing Classes:
  JettyRequestUpgradeStrategy, ReactorNettyRequestUpgradeStrategy, TomcatRequestUpgradeStrategy, UndertowRequestUpgradeStrategy

    public interface RequestUpgradeStrategy

A strategy for upgrading an HTTP request to a WebSocket session depending on the underlying network runtime.

Typically there is one such strategy for every `ServerHttpRequest` and `ServerHttpResponse` type except in the case of Servlet containers for which the standard Java WebSocket API JSR-356 does not define a way to upgrade a request so a custom strategy is needed for every Servlet container.

Since:
  5.0
Author:
  Rossen Stoyanchev

### Method Summary

All Methods Instance Methods Default Methods Deprecated Methods
`default reactor.core.publisher.Mono<Void>` `upgrade(org.springframework.web.server.ServerWebExchange exchange, WebSocketHandler webSocketHandler, String subProtocol)` Deprecated. as of 5.1 in favor of `upgrade(ServerWebExchange, WebSocketHandler, String, Supplier)`
`default reactor.core.publisher.Mono<Void>` `upgrade(org.springframework.web.server.ServerWebExchange exchange, WebSocketHandler webSocketHandler, String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory)` Upgrade to a WebSocket session and handle it with the given handler.

### Method Detail

#### upgrade

    @Deprecated
    default reactor.core.publisher.Mono<Void> upgrade(org.springframework.web.server.ServerWebExchange exchange,
                                                                  WebSocketHandler webSocketHandler,
                                                                  @Nullable
                                                                  String subProtocol)

Deprecated. as of 5.1 in favor of `upgrade(ServerWebExchange, WebSocketHandler, String, Supplier)`
Upgrade to a WebSocket session and handle it with the given handler.

Parameters:
  `exchange` - the current exchange
  `webSocketHandler` - handler for the WebSocket session
  `subProtocol` - the selected sub-protocol got the handler
Returns:
  completion `Mono<Void>` to indicate the outcome of the WebSocket session handling.

#### upgrade

    default reactor.core.publisher.Mono<Void> upgrade(org.springframework.web.server.ServerWebExchange exchange,
                                                      WebSocketHandler webSocketHandler,
                                                      @Nullable
                                                      String subProtocol,
                                                      Supplier<HandshakeInfo> handshakeInfoFactory)

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

Parameters:
  `exchange` - the current exchange
  `webSocketHandler` - handler for the WebSocket session
  `subProtocol` - the selected sub-protocol got the handler
  `handshakeInfoFactory` - factory to create HandshakeInfo for the WebSocket session
Returns:
  completion `Mono<Void>` to indicate the outcome of the WebSocket session handling.
Since:
  5.1