public class SessionCenter extends Object
维护所有的会话
| 构造器和说明 |
|---|
SessionCenter() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addSocketSession(SocketSession<GunsSocketOperator> socketSession)
设置会话
|
static void |
closed(String sessionId)
连接关闭
|
static SocketSession<GunsSocketOperator> |
deleteById(String sessionId)
删除维护关系
|
static SocketSession<GunsSocketOperator> |
getSessionBySessionId(String sessionId)
根据会话ID获取会话信息
|
static List<SocketSession<GunsSocketOperator>> |
getSessionByUserId(String userId)
根据用户ID获取会话信息列表
|
static List<SocketSession<GunsSocketOperator>> |
getSessionByUserIdAndMsgType(String userId)
根据用户ID和消息类型获取会话信息列表
|
static ConcurrentMap<String,List<SocketSession<GunsSocketOperator>>> |
getSocketSessionMap()
获取维护的所有会话
|
public static ConcurrentMap<String,List<SocketSession<GunsSocketOperator>>> getSocketSessionMap()
String, SocketSession> public static List<SocketSession<GunsSocketOperator>> getSessionByUserId(String userId)
public static List<SocketSession<GunsSocketOperator>> getSessionByUserIdAndMsgType(String userId)
public static SocketSession<GunsSocketOperator> getSessionBySessionId(String sessionId)
public static void addSocketSession(SocketSession<GunsSocketOperator> socketSession)
socketSession - 会话详情public static void closed(String sessionId)
sessionId - 会话IDpublic static SocketSession<GunsSocketOperator> deleteById(String sessionId)
Copyright © 2022. All rights reserved.