Allow hook to associate user with WebSocket session

This change adds a protected method to DefaultHandshakeHandler to
determine the user for the WebSocket session. By default it's
implemeted to obtain it from the request.

Issue: SPR-11228
This commit is contained in:
Rossen Stoyanchev
2014-01-13 16:36:41 -05:00
parent 6265bc1df7
commit a5c3143512
8 changed files with 72 additions and 19 deletions

View File

@@ -77,7 +77,7 @@ public class DefaultHandshakeHandlerTests extends AbstractHttpRequestTests {
this.handshakeHandler.doHandshake(this.request, this.response, handler, attributes);
verify(this.upgradeStrategy).upgrade(this.request, this.response,
"STOMP", Collections.<WebSocketExtension>emptyList(), handler, attributes);
"STOMP", Collections.<WebSocketExtension>emptyList(), null, handler, attributes);
}
@Test
@@ -99,7 +99,7 @@ public class DefaultHandshakeHandlerTests extends AbstractHttpRequestTests {
this.handshakeHandler.doHandshake(this.request, this.response, handler, attributes);
verify(this.upgradeStrategy).upgrade(this.request, this.response,
"v11.stomp", Collections.<WebSocketExtension>emptyList(), handler, attributes);
"v11.stomp", Collections.<WebSocketExtension>emptyList(), null, handler, attributes);
}
@Test
@@ -121,7 +121,7 @@ public class DefaultHandshakeHandlerTests extends AbstractHttpRequestTests {
this.handshakeHandler.doHandshake(this.request, this.response, handler, attributes);
verify(this.upgradeStrategy).upgrade(this.request, this.response,
null, Collections.<WebSocketExtension>emptyList(), handler, attributes);
null, Collections.<WebSocketExtension>emptyList(), null, handler, attributes);
}