Top Description Fields Constructors Methods
org.springframework.messaging.simp.user

public Class UserDestinationResult

extends Object
Class Inheritance
Imports
java.util.Collections, .Set, org.springframework.lang.Nullable, org.springframework.util.Assert

Contains the result from parsing a "user" destination from a source message and translating it to target destinations (one per active user session).
Author
Rossen Stoyanchev
Since
4.0.2
See Also
org.springframework.messaging.simp.user.UserDestinationResolver

Field Summary

Modifier and TypeField and Description
private final Set<String>
private final String
private final String
private final Set<String>
private final String

Constructor Summary

AccessConstructor and Description
public
UserDestinationResult(String sourceDestination, Set<String> targetDestinations, String subscribeDestination, String user)

public
UserDestinationResult(String sourceDestination, Set<String> targetDestinations, String subscribeDestination, String user, Set<String> sessionIds)

Additional constructor with the session id for each targetDestination.

Method Summary

Modifier and TypeMethod and Description
public Set<String>
getSessionIds()

Return the session id for the targetDestination.

public String

Returns:

the "user" destination, never null.
getSourceDestination
()

The "user" destination from the source message.

public String

Returns:

the subscribe form of the "user" destination, never null.
getSubscribeDestination
()

The user destination in the form expected when a client subscribes, e.g. "/user/queue/position-updates".

public Set<String>

Returns:

the target destinations, never null but possibly an empty set if there are no active sessions for the user.
getTargetDestinations
()

The target destinations that the source destination was translated to, one per active user session, e.g. "/queue/position-updates-useri9oqdfzo".

public String

Returns:

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 via SimpUserRegistry.
getUser
()

The user for this user destination.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

sessionIdsback to summary
private final Set<String> sessionIds
sourceDestinationback to summary
private final String sourceDestination
subscribeDestinationback to summary
private final String subscribeDestination
targetDestinationsback to summary
private final Set<String> targetDestinations
userback to summary
private final String user
Annotations
@Nullable

Constructor Detail

UserDestinationResultback to summary
public UserDestinationResult(String sourceDestination, Set<String> targetDestinations, String subscribeDestination, String user)
UserDestinationResultback to summary
public UserDestinationResult(String sourceDestination, Set<String> targetDestinations, String subscribeDestination, String user, Set<String> sessionIds)

Additional constructor with the session id for each targetDestination.

Since
6.1

Method Detail

getSessionIdsback to summary
public Set<String> getSessionIds()

Return the session id for the targetDestination.

Annotations
@Nullable
getSourceDestinationback to summary
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.

Returns:String

the "user" destination, never null.

getSubscribeDestinationback to summary
public String getSubscribeDestination()

The user destination in the form expected when a client subscribes, e.g. "/user/queue/position-updates".

Returns:String

the subscribe form of the "user" destination, never null.

getTargetDestinationsback to summary
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".

Returns:Set<String>

the target destinations, never null but possibly an empty set if there are no active sessions for the user.

getUserback to summary
public String getUser()

The user for this user destination.

Returns:String

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 via SimpUserRegistry.

Annotations
@Nullable
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override