Browse Source

SessionDisconnectEvent actually preserves given session user

Issue: SPR-13871
pull/1469/head
Juergen Hoeller 9 years ago
parent
commit
cdc9bf76a9
  1. 16
      spring-websocket/src/main/java/org/springframework/web/socket/messaging/SessionDisconnectEvent.java

16
spring-websocket/src/main/java/org/springframework/web/socket/messaging/SessionDisconnectEvent.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -53,15 +53,24 @@ public class SessionDisconnectEvent extends AbstractSubProtocolEvent { @@ -53,15 +53,24 @@ public class SessionDisconnectEvent extends AbstractSubProtocolEvent {
this(source, message, sessionId, closeStatus, null);
}
/**
* Create a new SessionDisconnectEvent.
* @param source the component that published the event (never {@code null})
* @param message the message
* @param sessionId the disconnect message
* @param closeStatus the status object
* @param user the current session user
*/
public SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId,
CloseStatus closeStatus, Principal user) {
super(source, message);
Assert.notNull(sessionId, "'sessionId' must not be null");
super(source, message, user);
Assert.notNull(sessionId, "Session id must not be null");
this.sessionId = sessionId;
this.status = closeStatus;
}
/**
* Return the session id.
*/
@ -76,6 +85,7 @@ public class SessionDisconnectEvent extends AbstractSubProtocolEvent { @@ -76,6 +85,7 @@ public class SessionDisconnectEvent extends AbstractSubProtocolEvent {
return this.status;
}
@Override
public String toString() {
return "SessionDisconnectEvent[sessionId=" + this.sessionId + ", " +

Loading…
Cancel
Save