类 WebSocketSessionHolder
java.lang.Object
com.sie.mbm.mom.framework.websocket.holder.WebSocketSessionHolder
WebSocketSession 持有者 主要用于保存当前所有在线的会话信息
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidaddSession(Object sessionKey, org.springframework.web.socket.WebSocketSession session) 添加一个 sessionstatic org.springframework.web.socket.WebSocketSessiongetSession(Object sessionKey) 获取指定标识的 session获取所有在线的用户标识static Collection<org.springframework.web.socket.WebSocketSession> 获取当前所有在线的 sessionstatic voidheartbeat(org.springframework.web.socket.WebSocketSession session) 心跳活跃连接static booleanisTimeOut(org.springframework.web.socket.WebSocketSession session) 是否超时未连接static voidremoveSession(Object sessionKey) 删除一个 session
-
字段详细资料
-
LAST_ACCESS_TIME
- 另请参阅:
-
CONNECT_OUT_TIME_SECONDES
-
USER_SESSION_MAP
-
-
构造器详细资料
-
WebSocketSessionHolder
private WebSocketSessionHolder()
-
-
方法详细资料
-
addSession
public static void addSession(Object sessionKey, org.springframework.web.socket.WebSocketSession session) 添加一个 session- 参数:
sessionKey- session 唯一标识session- 待添加的 WebSocketSession
-
removeSession
删除一个 session- 参数:
sessionKey- session唯一标识
-
getSession
获取指定标识的 session- 参数:
sessionKey- session唯一标识- 返回:
- WebSocketSession 该标识对应的 session
-
getSessions
获取当前所有在线的 session- 返回:
- Collection
session集合
-
getSessionKeys
获取所有在线的用户标识- 返回:
- Set
-
heartbeat
public static void heartbeat(org.springframework.web.socket.WebSocketSession session) 心跳活跃连接 -
isTimeOut
public static boolean isTimeOut(org.springframework.web.socket.WebSocketSession session) 是否超时未连接- 返回:
- Set
-