public class WebSocketClientSockJsSession extends AbstractClientSockJsSession implements NativeWebSocketSession
AbstractClientSockJsSession wrapping and delegating
to an actual WebSocket session.logger| Constructor and Description |
|---|
WebSocketClientSockJsSession(TransportRequest request,
WebSocketHandler handler,
SettableListenableFuture<WebSocketSession> connectFuture) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
disconnect(CloseStatus status) |
java.lang.String |
getAcceptedProtocol()
Return the negotiated sub-protocol or
null if none was specified or
negotiated successfully. |
int |
getBinaryMessageSizeLimit()
Get the configured maximum size for an incoming binary message.
|
java.util.List<WebSocketExtension> |
getExtensions()
Return the negotiated extensions or
null if none was specified or
negotiated successfully. |
java.net.InetSocketAddress |
getLocalAddress()
Return the address on which the request was received.
|
java.lang.Object |
getNativeSession()
Return the underlying native WebSocketSession, if available.
|
<T> T |
getNativeSession(java.lang.Class<T> requiredType)
Return the underlying native WebSocketSession, if available.
|
java.net.InetSocketAddress |
getRemoteAddress()
Return the address of the remote client.
|
int |
getTextMessageSizeLimit()
Get the configured maximum size for an incoming text message.
|
void |
initializeDelegateSession(WebSocketSession session) |
protected void |
sendInternal(TextMessage textMessage) |
void |
setBinaryMessageSizeLimit(int messageSizeLimit)
Configure the maximum size for an incoming binary message.
|
void |
setTextMessageSizeLimit(int messageSizeLimit)
Configure the maximum size for an incoming text message.
|
afterTransportClosed, close, close, closeInternal, getAttributes, getHandshakeHeaders, getId, getMessageCodec, getPrincipal, getUri, getWebSocketHandler, handleFrame, handleTransportError, isDisconnected, isOpen, sendMessage, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, close, getAttributes, getHandshakeHeaders, getId, getPrincipal, getUri, isOpen, sendMessagepublic WebSocketClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
public java.lang.Object getNativeSession()
NativeWebSocketSessiongetNativeSession in interface NativeWebSocketSessionnullpublic <T> T getNativeSession(java.lang.Class<T> requiredType)
NativeWebSocketSessiongetNativeSession in interface NativeWebSocketSessionrequiredType - the required type of the sessionnullpublic java.net.InetSocketAddress getLocalAddress()
WebSocketSessiongetLocalAddress in interface WebSocketSessionpublic java.net.InetSocketAddress getRemoteAddress()
WebSocketSessiongetRemoteAddress in interface WebSocketSessionpublic java.lang.String getAcceptedProtocol()
WebSocketSessionnull if none was specified or
negotiated successfully.getAcceptedProtocol in interface WebSocketSessionpublic void setTextMessageSizeLimit(int messageSizeLimit)
WebSocketSessionsetTextMessageSizeLimit in interface WebSocketSessionpublic int getTextMessageSizeLimit()
WebSocketSessiongetTextMessageSizeLimit in interface WebSocketSessionpublic void setBinaryMessageSizeLimit(int messageSizeLimit)
WebSocketSessionsetBinaryMessageSizeLimit in interface WebSocketSessionpublic int getBinaryMessageSizeLimit()
WebSocketSessiongetBinaryMessageSizeLimit in interface WebSocketSessionpublic java.util.List<WebSocketExtension> getExtensions()
WebSocketSessionnull if none was specified or
negotiated successfully.getExtensions in interface WebSocketSessionpublic void initializeDelegateSession(WebSocketSession session)
protected void sendInternal(TextMessage textMessage) throws java.io.IOException
sendInternal in class AbstractClientSockJsSessionjava.io.IOExceptionprotected void disconnect(CloseStatus status) throws java.io.IOException
disconnect in class AbstractClientSockJsSessionjava.io.IOException