public class JettyRequestUpgradeStrategy extends Object implements RequestUpgradeStrategy
RequestUpgradeStrategy for use with Jetty 9. Based on Jetty's internal
org.eclipse.jetty.websocket.server.WebSocketHandler class.| Constructor and Description |
|---|
JettyRequestUpgradeStrategy()
Default constructor that creates <code>WebSocketServerFactory</code> through its default
constructor thus using a default <code>WebSocketPolicy</code>.
|
JettyRequestUpgradeStrategy(org.eclipse.jetty.websocket.server.WebSocketServerFactory factory)
A constructor accepting a <code>WebSocketServerFactory</code>.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
getSupportedVersions()
Return the supported WebSocket protocol versions.
|
void |
upgrade(org.springframework.http.server.ServerHttpRequest request,
org.springframework.http.server.ServerHttpResponse response,
String protocol,
WebSocketHandler wsHandler,
Map<String,Object> attrs)
Perform runtime specific steps to complete the upgrade.
|
public JettyRequestUpgradeStrategy()
public JettyRequestUpgradeStrategy(org.eclipse.jetty.websocket.server.WebSocketServerFactory factory)
WebSocketServerFactory.getPolicy().public String[] getSupportedVersions()
RequestUpgradeStrategygetSupportedVersions in interface RequestUpgradeStrategypublic void upgrade(org.springframework.http.server.ServerHttpRequest request,
org.springframework.http.server.ServerHttpResponse response,
String protocol,
WebSocketHandler wsHandler,
Map<String,Object> attrs)
throws HandshakeFailureException
RequestUpgradeStrategyupgrade in interface RequestUpgradeStrategyrequest - the current requestresponse - the current responseprotocol - the accepted sub-protocol, if anywsHandler - the handler for WebSocket messagesattrs - handshake context attributesHandshakeFailureException - 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.