Class JettyRequestUpgradeStrategy
java.lang.Object
org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy
- All Implemented Interfaces:
RequestUpgradeStrategy
A
RequestUpgradeStrategy
for Jetty 11.- Since:
- 5.3.4
- Author:
- Rossen Stoyanchev
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetSupportedExtensions
(ServerHttpRequest request) Return the WebSocket protocol extensions supported by the underlying WebSocket server.String[]
Return the supported WebSocket protocol versions.void
upgrade
(ServerHttpRequest request, ServerHttpResponse response, String selectedProtocol, List<WebSocketExtension> selectedExtensions, Principal user, WebSocketHandler handler, Map<String, Object> attributes) Perform runtime specific steps to complete the upgrade.
-
Constructor Details
-
JettyRequestUpgradeStrategy
public JettyRequestUpgradeStrategy()
-
-
Method Details
-
getSupportedVersions
Description copied from interface:RequestUpgradeStrategy
Return the supported WebSocket protocol versions.- Specified by:
getSupportedVersions
in interfaceRequestUpgradeStrategy
-
getSupportedExtensions
Description copied from interface:RequestUpgradeStrategy
Return the WebSocket protocol extensions supported by the underlying WebSocket server.- Specified by:
getSupportedExtensions
in interfaceRequestUpgradeStrategy
-
upgrade
public void upgrade(ServerHttpRequest request, ServerHttpResponse response, @Nullable String selectedProtocol, List<WebSocketExtension> selectedExtensions, @Nullable Principal user, WebSocketHandler handler, Map<String, Object> attributes) throws HandshakeFailureExceptionDescription copied from interface:RequestUpgradeStrategy
Perform runtime specific steps to complete the upgrade. Invoked after successful negotiation of the handshake request.- Specified by:
upgrade
in interfaceRequestUpgradeStrategy
- Parameters:
request
- the current requestresponse
- the current responseselectedProtocol
- the selected sub-protocol, if anyselectedExtensions
- the selected WebSocket protocol extensionsuser
- the user to associate with the WebSocket sessionhandler
- the handler for WebSocket messagesattributes
- handshake request specific attributes to be set on the WebSocket session viaHandshakeInterceptor
and thus made available to theWebSocketHandler
- Throws:
HandshakeFailureException
- thrown when handshake processing failed to complete due to an internal, unrecoverable error, i.e. a server error as opposed to a failure to successfully negotiate the requirements of the handshake request.
-