类 UserAttributeHandshakeInterceptor
java.lang.Object
com.sie.mbm.mom.framework.websocket.custom.UserAttributeHandshakeInterceptor
- 所有已实现的接口:
org.springframework.web.socket.server.HandshakeInterceptor
@Order(-2147483647)
public class UserAttributeHandshakeInterceptor
extends Object
implements org.springframework.web.socket.server.HandshakeInterceptor
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidafterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Exception exception) Invoked after the handshake is done.booleanbeforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Map<String, Object> attributes) Invoked before the handshake is processed.
-
构造器详细资料
-
UserAttributeHandshakeInterceptor
public UserAttributeHandshakeInterceptor()
-
-
方法详细资料
-
beforeHandshake
public boolean beforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Map<String, Object> attributes) Invoked before the handshake is processed.- 指定者:
beforeHandshake在接口中org.springframework.web.socket.server.HandshakeInterceptor- 参数:
request- the current requestresponse- the current responsewsHandler- the target WebSocket handlerattributes- the attributes from the HTTP handshake to associate with the WebSocket session; the provided attributes are copied, the original map is not used.- 返回:
- whether to proceed with the handshake (
true) or abort (false)
-
afterHandshake
public void afterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Exception exception) Invoked after the handshake is done. The response status and headers indicate the results of the handshake, i.e. whether it was successful or not.- 指定者:
afterHandshake在接口中org.springframework.web.socket.server.HandshakeInterceptor- 参数:
request- the current requestresponse- the current responsewsHandler- the target WebSocket handlerexception- an exception raised during the handshake, ornullif none
-