Package api.log.socket
Class SessionContext
java.lang.Object
api.log.socket.SessionContext
Session上下文
- Author:
- chenenwei
-
Constructor Summary
ConstructorsConstructorDescriptionSessionContext(org.springframework.web.socket.WebSocketSession session) 构造方法 -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.socket.WebSocketSession获取session获取用户IDboolean连接状态voidsetConnected(boolean connected) 设置连接状态voidsetSession(org.springframework.web.socket.WebSocketSession session) 设置sessionvoid设置用户ID
-
Constructor Details
-
SessionContext
public SessionContext(org.springframework.web.socket.WebSocketSession session) 构造方法- Parameters:
session- WebSocketSession
-
-
Method Details
-
getSession
public org.springframework.web.socket.WebSocketSession getSession()获取session- Returns:
- WebSocketSession
-
setSession
public void setSession(org.springframework.web.socket.WebSocketSession session) 设置session- Parameters:
session- WebSocketSession
-
getUserId
获取用户ID- Returns:
- String
-
setUserId
设置用户ID- Parameters:
userId- String
-
isConnected
public boolean isConnected()连接状态- Returns:
- boolean
-
setConnected
public void setConnected(boolean connected) 设置连接状态- Parameters:
connected- boolean
-