Example usage for org.springframework.messaging.simp.user UserDestinationResult UserDestinationResult

List of usage examples for org.springframework.messaging.simp.user UserDestinationResult UserDestinationResult

Introduction

In this page you can find the example usage for org.springframework.messaging.simp.user UserDestinationResult UserDestinationResult.

Prototype

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

Source Link

Usage

From source file:org.springframework.messaging.simp.user.DefaultUserDestinationResolver.java

@Override
@Nullable//from   w  ww. ja  v  a  2s .  c o  m
public UserDestinationResult resolveDestination(Message<?> message) {
    ParseResult parseResult = parse(message);
    if (parseResult == null) {
        return null;
    }
    String user = parseResult.getUser();
    String sourceDestination = parseResult.getSourceDestination();
    Set<String> targetSet = new HashSet<>();
    for (String sessionId : parseResult.getSessionIds()) {
        String actualDestination = parseResult.getActualDestination();
        String targetDestination = getTargetDestination(sourceDestination, actualDestination, sessionId, user);
        if (targetDestination != null) {
            targetSet.add(targetDestination);
        }
    }
    String subscribeDestination = parseResult.getSubscribeDestination();
    return new UserDestinationResult(sourceDestination, targetSet, subscribeDestination, user);
}