类 UserDestinationResult
- java.lang.Object
- org.springframework.messaging.simp.user.UserDestinationResult
public class UserDestinationResult extends Object
Contains the result from parsing a "user" destination from a source message and translating it to target destinations (one per active user session).- 从以下版本开始:
- 4.0.2
- 作者:
- Rossen Stoyanchev
- 另请参阅:
UserDestinationResolver
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getSourceDestination()
The "user" destination from the source message.String
getSubscribeDestination()
The user destination in the form expected when a client subscribes, e.g.Set<String>
getTargetDestinations()
The target destinations that the source destination was translated to, one per active user session, e.g.String
getUser()
The user for this user destination.String
toString()
方法详细资料
getSourceDestination
public String getSourceDestination()
The "user" destination from the source message. This may look like "/user/queue/position-updates" when subscribing or "/user/{username}/queue/position-updates" when sending a message.- 返回:
- the "user" destination, never
null
.
getTargetDestinations
public Set<String> getTargetDestinations()
The target destinations that the source destination was translated to, one per active user session, e.g. "/queue/position-updates-useri9oqdfzo".- 返回:
- the target destinations, never
null
but possibly an empty set if there are no active sessions for the user.
getSubscribeDestination
public String getSubscribeDestination()
The user destination in the form expected when a client subscribes, e.g. "/user/queue/position-updates".- 返回:
- the subscribe form of the "user" destination, never
null
.
getUser
@Nullable public String getUser()
The user for this user destination.- 返回:
- the user name or
null
if we have a session id only such as when the user is not authenticated; in such cases it is possible to use sessionId in place of a user name thus removing the need for a user-to-session lookup viaSimpUserRegistry
.