public abstract class AbstractStandardUpgradeStrategy extends java.lang.Object implements RequestUpgradeStrategy
RequestUpgradeStrategy
implementations that build
on the standard WebSocket API for Java (JSR-356).Constructor and Description |
---|
AbstractStandardUpgradeStrategy() |
Modifier and Type | Method and Description |
---|---|
protected javax.websocket.server.ServerContainer |
getContainer(HttpServletRequest request) |
protected HttpServletRequest |
getHttpServletRequest(ServerHttpRequest request) |
protected HttpServletResponse |
getHttpServletResponse(ServerHttpResponse response) |
protected java.util.List<WebSocketExtension> |
getInstalledExtensions(javax.websocket.WebSocketContainer container) |
java.util.List<WebSocketExtension> |
getSupportedExtensions(ServerHttpRequest request)
Return the WebSocket protocol extensions supported by the underlying WebSocket server.
|
void |
upgrade(ServerHttpRequest request,
ServerHttpResponse response,
java.lang.String selectedProtocol,
java.util.List<WebSocketExtension> selectedExtensions,
java.security.Principal user,
WebSocketHandler wsHandler,
java.util.Map<java.lang.String,java.lang.Object> attrs)
Perform runtime specific steps to complete the upgrade.
|
protected abstract void |
upgradeInternal(ServerHttpRequest request,
ServerHttpResponse response,
java.lang.String selectedProtocol,
java.util.List<javax.websocket.Extension> selectedExtensions,
javax.websocket.Endpoint endpoint) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedVersions
protected final Log logger
protected javax.websocket.server.ServerContainer getContainer(HttpServletRequest request)
protected final HttpServletRequest getHttpServletRequest(ServerHttpRequest request)
protected final HttpServletResponse getHttpServletResponse(ServerHttpResponse response)
public java.util.List<WebSocketExtension> getSupportedExtensions(ServerHttpRequest request)
RequestUpgradeStrategy
getSupportedExtensions
in interface RequestUpgradeStrategy
protected java.util.List<WebSocketExtension> getInstalledExtensions(javax.websocket.WebSocketContainer container)
public void upgrade(ServerHttpRequest request, ServerHttpResponse response, java.lang.String selectedProtocol, java.util.List<WebSocketExtension> selectedExtensions, java.security.Principal user, WebSocketHandler wsHandler, java.util.Map<java.lang.String,java.lang.Object> attrs) throws HandshakeFailureException
RequestUpgradeStrategy
upgrade
in interface RequestUpgradeStrategy
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 sessionwsHandler
- the handler for WebSocket messagesattrs
- handshake request specific attributes to be set on the WebSocket
session via HandshakeInterceptor
and
thus made available to the WebSocketHandler
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.protected abstract void upgradeInternal(ServerHttpRequest request, ServerHttpResponse response, java.lang.String selectedProtocol, java.util.List<javax.websocket.Extension> selectedExtensions, javax.websocket.Endpoint endpoint) throws HandshakeFailureException
HandshakeFailureException