All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.healthy.common.websocket.session.WebSocketSessionStore Maven / Gradle / Ivy

There is a newer version: 2.0.0-M1
Show newest version
package com.healthy.common.websocket.session;

import org.springframework.web.socket.WebSocketSession;

import java.util.Collection;

/**
 * WebSocketSessionStore
 *
 * @author xm.z
 */
public interface WebSocketSessionStore {

	/**
	 * 添加一个 session
	 * @param session 待添加的 WebSocketSession
	 */
	void addSession(WebSocketSession session);

	/**
	 * 删除一个 session
	 * @param session WebSocketSession
	 */
	void removeSession(WebSocketSession session);

	/**
	 * 获取当前所有在线的 wsSessions
	 * @return session集合
	 */
	Collection getSessions();

	/**
	 * 根据指定的 sessionKey 获取对应的 wsSessions
	 * @param sessionKey wsSession 标识
	 * @return session集合
	 */
	Collection getSessions(Object sessionKey);

	/**
	 * 获取所有的 sessionKeys
	 * @return sessionKey 集合
	 */
	Collection getSessionKeys();

}