类 UserSessionRegistryAdapter
- java.lang.Object
- org.springframework.messaging.simp.user.UserSessionRegistryAdapter
- 所有已实现的接口:
SimpUserRegistry
public class UserSessionRegistryAdapter extends Object implements SimpUserRegistry
An adapter that allows aUserSessionRegistry
, which is deprecated in favor ofSimpUserRegistry
, to be used as aSimpUserRegistry
. Due to the more limited information available, methods such asgetUsers()
andfindSubscriptions(org.springframework.messaging.simp.user.SimpSubscriptionMatcher)
are not supported.As of 4.2, this adapter is used only in applications that explicitly register a custom
UserSessionRegistry
bean by overridingAbstractMessageBrokerConfiguration.userSessionRegistry()
.- 从以下版本开始:
- 4.2
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 UserSessionRegistryAdapter(UserSessionRegistry registry)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Set<SimpSubscription>
findSubscriptions(SimpSubscriptionMatcher matcher)
Find subscriptions with the given matcher.SimpUser
getUser(String userName)
Get the user for the given name.int
getUserCount()
Return the count of all connected users.Set<SimpUser>
getUsers()
Return a snapshot of all connected users.
构造器详细资料
UserSessionRegistryAdapter
public UserSessionRegistryAdapter(UserSessionRegistry registry)
方法详细资料
getUser
public SimpUser getUser(String userName)
从接口复制的说明:SimpUserRegistry
Get the user for the given name.- 指定者:
getUser
在接口中SimpUserRegistry
- 参数:
userName
- the name of the user to look up- 返回:
- the user, or
null
if not connected
getUsers
public Set<SimpUser> getUsers()
从接口复制的说明:SimpUserRegistry
Return a snapshot of all connected users.The returned set is a copy and will not reflect further changes.
- 指定者:
getUsers
在接口中SimpUserRegistry
- 返回:
- the connected users, or an empty set if none
getUserCount
public int getUserCount()
从接口复制的说明:SimpUserRegistry
Return the count of all connected users.- 指定者:
getUserCount
在接口中SimpUserRegistry
- 返回:
- the number of connected users
findSubscriptions
public Set<SimpSubscription> findSubscriptions(SimpSubscriptionMatcher matcher)
从接口复制的说明:SimpUserRegistry
Find subscriptions with the given matcher.- 指定者:
findSubscriptions
在接口中SimpUserRegistry
- 参数:
matcher
- the matcher to use- 返回:
- a set of matching subscriptions, or an empty set if none