Skip to content

Commit 6273fc4

Browse files
committed
Rename SockJS session type to include "SockJs"
1 parent 2794224 commit 6273fc4

11 files changed

+29
-29
lines changed

spring-websocket/src/main/java/org/springframework/sockjs/server/AbstractServerSession.java renamed to spring-websocket/src/main/java/org/springframework/sockjs/server/AbstractServerSockJsSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
* @author Rossen Stoyanchev
3636
* @since 4.0
3737
*/
38-
public abstract class AbstractServerSession extends SockJsSessionSupport {
38+
public abstract class AbstractServerSockJsSession extends SockJsSessionSupport {
3939

4040
private final SockJsConfiguration sockJsConfig;
4141

4242
private ScheduledFuture<?> heartbeatTask;
4343

4444

45-
public AbstractServerSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
45+
public AbstractServerSockJsSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
4646
super(sessionId, sockJsHandler);
4747
this.sockJsConfig = sockJsConfig;
4848
}

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/AbstractHttpSendingTransportHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ public final void handleRequest(ServerHttpRequest request, ServerHttpResponse re
6666
// Set content type before writing
6767
response.getHeaders().setContentType(getContentType());
6868

69-
AbstractHttpServerSession httpServerSession = (AbstractHttpServerSession) session;
69+
AbstractHttpServerSockJsSession httpServerSession = (AbstractHttpServerSockJsSession) session;
7070
handleRequestInternal(request, response, httpServerSession);
7171
}
7272

7373
protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response,
74-
AbstractHttpServerSession httpServerSession) throws Exception, IOException {
74+
AbstractHttpServerSockJsSession httpServerSession) throws Exception, IOException {
7575

7676
if (httpServerSession.isNew()) {
7777
handleNewSession(request, response, httpServerSession);
@@ -87,7 +87,7 @@ else if (httpServerSession.isActive()) {
8787
}
8888

8989
protected void handleNewSession(ServerHttpRequest request, ServerHttpResponse response,
90-
AbstractHttpServerSession session) throws Exception {
90+
AbstractHttpServerSockJsSession session) throws Exception {
9191

9292
logger.debug("Opening " + getTransportType() + " connection");
9393
session.setFrameFormat(getFrameFormat(request));

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/AbstractHttpServerSession.java renamed to spring-websocket/src/main/java/org/springframework/sockjs/server/transport/AbstractHttpServerSockJsSession.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.springframework.http.server.ServerHttpRequest;
2424
import org.springframework.http.server.ServerHttpResponse;
2525
import org.springframework.sockjs.SockJsHandler;
26-
import org.springframework.sockjs.server.AbstractServerSession;
26+
import org.springframework.sockjs.server.AbstractServerSockJsSession;
2727
import org.springframework.sockjs.server.SockJsConfiguration;
2828
import org.springframework.sockjs.server.SockJsFrame;
2929
import org.springframework.sockjs.server.SockJsFrame.FrameFormat;
@@ -36,7 +36,7 @@
3636
* @author Rossen Stoyanchev
3737
* @since 4.0
3838
*/
39-
public abstract class AbstractHttpServerSession extends AbstractServerSession {
39+
public abstract class AbstractHttpServerSockJsSession extends AbstractServerSockJsSession {
4040

4141
private FrameFormat frameFormat;
4242

@@ -47,7 +47,7 @@ public abstract class AbstractHttpServerSession extends AbstractServerSession {
4747
private ServerHttpResponse response;
4848

4949

50-
public AbstractHttpServerSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
50+
public AbstractHttpServerSockJsSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
5151
super(sessionId, sockJsConfig, sockJsHandler);
5252
}
5353

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/AbstractStreamingTransportHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public abstract class AbstractStreamingTransportHandler extends AbstractHttpSend
3333

3434

3535
@Override
36-
public StreamingHttpServerSession createSession(String sessionId, SockJsHandler sockJsHandler) {
36+
public StreamingServerSockJsSession createSession(String sessionId, SockJsHandler sockJsHandler) {
3737
Assert.notNull(getSockJsConfig(), "This transport requires SockJsConfiguration");
38-
return new StreamingHttpServerSession(sessionId, getSockJsConfig(), sockJsHandler);
38+
return new StreamingServerSockJsSession(sessionId, getSockJsConfig(), sockJsHandler);
3939
}
4040

4141
@Override
4242
public void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response,
43-
AbstractHttpServerSession session) throws Exception {
43+
AbstractHttpServerSockJsSession session) throws Exception {
4444

4545
writePrelude(request, response);
4646
super.handleRequestInternal(request, response, session);
@@ -51,7 +51,7 @@ protected abstract void writePrelude(ServerHttpRequest request, ServerHttpRespon
5151

5252
@Override
5353
protected void handleNewSession(ServerHttpRequest request, ServerHttpResponse response,
54-
AbstractHttpServerSession session) throws IOException, Exception {
54+
AbstractHttpServerSockJsSession session) throws IOException, Exception {
5555

5656
super.handleNewSession(request, response, session);
5757

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/HtmlFileTransportHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected MediaType getContentType() {
7878

7979
@Override
8080
public void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response,
81-
AbstractHttpServerSession session) throws Exception {
81+
AbstractHttpServerSockJsSession session) throws Exception {
8282

8383
String callback = request.getQueryParams().getFirst("c");
8484
if (! StringUtils.hasText(callback)) {

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/JsonpPollingTransportHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ protected MediaType getContentType() {
5050
}
5151

5252
@Override
53-
public PollingHttpServerSession createSession(String sessionId, SockJsHandler sockJsHandler) {
53+
public PollingServerSockJsSession createSession(String sessionId, SockJsHandler sockJsHandler) {
5454
Assert.notNull(getSockJsConfig(), "This transport requires SockJsConfiguration");
55-
return new PollingHttpServerSession(sessionId, getSockJsConfig(), sockJsHandler);
55+
return new PollingServerSockJsSession(sessionId, getSockJsConfig(), sockJsHandler);
5656
}
5757

5858
@Override
5959
public void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response,
60-
AbstractHttpServerSession session) throws Exception {
60+
AbstractHttpServerSockJsSession session) throws Exception {
6161

6262
String callback = request.getQueryParams().getFirst("c");
6363
if (! StringUtils.hasText(callback)) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import org.springframework.sockjs.server.SockJsFrame;
2323

2424

25-
public class PollingHttpServerSession extends AbstractHttpServerSession {
25+
public class PollingServerSockJsSession extends AbstractHttpServerSockJsSession {
2626

27-
public PollingHttpServerSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
27+
public PollingServerSockJsSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
2828
super(sessionId, sockJsConfig, sockJsHandler);
2929
}
3030

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/SockJsWebSocketHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.apache.commons.logging.LogFactory;
2626
import org.springframework.sockjs.SockJsHandler;
2727
import org.springframework.sockjs.SockJsSessionSupport;
28-
import org.springframework.sockjs.server.AbstractServerSession;
28+
import org.springframework.sockjs.server.AbstractServerSockJsSession;
2929
import org.springframework.sockjs.server.SockJsConfiguration;
3030
import org.springframework.sockjs.server.SockJsFrame;
3131
import org.springframework.util.Assert;
@@ -82,7 +82,7 @@ public void newSession(WebSocketSession wsSession) throws Exception {
8282
if (logger.isDebugEnabled()) {
8383
logger.debug("New session: " + wsSession);
8484
}
85-
SockJsSessionSupport session = new WebSocketServerSession(wsSession, getSockJsConfig());
85+
SockJsSessionSupport session = new WebSocketServerSockJsSession(wsSession, getSockJsConfig());
8686
this.sessions.put(wsSession, session);
8787
}
8888

@@ -126,12 +126,12 @@ public void sessionClosed(WebSocketSession webSocketSession, int statusCode, Str
126126
}
127127

128128

129-
private class WebSocketServerSession extends AbstractServerSession {
129+
private class WebSocketServerSockJsSession extends AbstractServerSockJsSession {
130130

131131
private WebSocketSession webSocketSession;
132132

133133

134-
public WebSocketServerSession(WebSocketSession wsSession, SockJsConfiguration sockJsConfig) throws Exception {
134+
public WebSocketServerSockJsSession(WebSocketSession wsSession, SockJsConfiguration sockJsConfig) throws Exception {
135135
super(String.valueOf(wsSession.hashCode()), sockJsConfig, getSockJsHandler());
136136
this.webSocketSession = wsSession;
137137
this.webSocketSession.sendText(SockJsFrame.openFrame().getContent());
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
import org.springframework.sockjs.server.SockJsFrame;
2424

2525

26-
public class StreamingHttpServerSession extends AbstractHttpServerSession {
26+
public class StreamingServerSockJsSession extends AbstractHttpServerSockJsSession {
2727

2828
private int byteCount;
2929

3030

31-
public StreamingHttpServerSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
31+
public StreamingServerSockJsSession(String sessionId, SockJsConfiguration sockJsConfig, SockJsHandler sockJsHandler) {
3232
super(sessionId, sockJsConfig, sockJsHandler);
3333
}
3434

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/WebSocketSockJsHandlerAdapter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void newSession(WebSocketSession wsSession) throws Exception {
7575
if (logger.isDebugEnabled()) {
7676
logger.debug("New session: " + wsSession);
7777
}
78-
SockJsSessionSupport session = new WebSocketSessionAdapter(wsSession);
78+
SockJsSessionSupport session = new SockJsWebSocketSessionAdapter(wsSession);
7979
this.sessions.put(wsSession, session);
8080
}
8181

@@ -108,12 +108,12 @@ public void sessionClosed(WebSocketSession webSocketSession, int statusCode, Str
108108
}
109109

110110

111-
private class WebSocketSessionAdapter extends SockJsSessionSupport {
111+
private class SockJsWebSocketSessionAdapter extends SockJsSessionSupport {
112112

113113
private WebSocketSession wsSession;
114114

115115

116-
public WebSocketSessionAdapter(WebSocketSession wsSession) throws Exception {
116+
public SockJsWebSocketSessionAdapter(WebSocketSession wsSession) throws Exception {
117117
super(String.valueOf(wsSession.hashCode()), getSockJsHandler());
118118
this.wsSession = wsSession;
119119
connectionInitialized();

spring-websocket/src/main/java/org/springframework/sockjs/server/transport/XhrPollingTransportHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ protected FrameFormat getFrameFormat(ServerHttpRequest request) {
5050
return new DefaultFrameFormat("%s\n");
5151
}
5252

53-
public PollingHttpServerSession createSession(String sessionId, SockJsHandler sockJsHandler) {
53+
public PollingServerSockJsSession createSession(String sessionId, SockJsHandler sockJsHandler) {
5454
Assert.notNull(getSockJsConfig(), "This transport requires SockJsConfiguration");
55-
return new PollingHttpServerSession(sessionId, getSockJsConfig(), sockJsHandler);
55+
return new PollingServerSockJsSession(sessionId, getSockJsConfig(), sockJsHandler);
5656
}
5757

5858
}

0 commit comments

Comments
 (0)