public class HttpSessionHandshakeInterceptor extends java.lang.Object implements HandshakeInterceptor
WebSocketSession.getAttributes().| Constructor and Description |
|---|
HttpSessionHandshakeInterceptor()
A constructor for copying all available HTTP session attributes.
|
HttpSessionHandshakeInterceptor(java.util.Collection<java.lang.String> attributeNames)
A constructor for copying a subset of HTTP session attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterHandshake(org.springframework.http.server.ServerHttpRequest request,
org.springframework.http.server.ServerHttpResponse response,
WebSocketHandler wsHandler,
java.lang.Exception ex)
Invoked after the handshake is done.
|
boolean |
beforeHandshake(org.springframework.http.server.ServerHttpRequest request,
org.springframework.http.server.ServerHttpResponse response,
WebSocketHandler wsHandler,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Invoked before the handshake is processed.
|
public HttpSessionHandshakeInterceptor()
public HttpSessionHandshakeInterceptor(java.util.Collection<java.lang.String> attributeNames)
attributeNames - the HTTP session attributes to copypublic boolean beforeHandshake(org.springframework.http.server.ServerHttpRequest request,
org.springframework.http.server.ServerHttpResponse response,
WebSocketHandler wsHandler,
java.util.Map<java.lang.String,java.lang.Object> attributes)
throws java.lang.Exception
HandshakeInterceptorbeforeHandshake in interface HandshakeInterceptorrequest - the current requestresponse - the current responsewsHandler - the target WebSocket handlerattributes - attributes from the HTTP handshake to associate with the WebSocket
session; the provided attributes are copied, the original map is not used.true or abort falsejava.lang.Exceptionpublic void afterHandshake(org.springframework.http.server.ServerHttpRequest request,
org.springframework.http.server.ServerHttpResponse response,
WebSocketHandler wsHandler,
java.lang.Exception ex)
HandshakeInterceptorafterHandshake in interface HandshakeInterceptorrequest - the current requestresponse - the current responsewsHandler - the target WebSocket handlerex - an exception raised during the handshake, or null