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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, close, getAttributes, getHandshakeHeaders, getId, getPrincipal, getUri, isOpen, sendMessage
public WebSocketClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
public java.lang.Object getNativeSession()
NativeWebSocketSession
getNativeSession
in interface NativeWebSocketSession
null
public <T> T getNativeSession(java.lang.Class<T> requiredType)
NativeWebSocketSession
getNativeSession
in interface NativeWebSocketSession
requiredType
- the required type of the sessionnull
public java.net.InetSocketAddress getLocalAddress()
WebSocketSession
getLocalAddress
in interface WebSocketSession
public java.net.InetSocketAddress getRemoteAddress()
WebSocketSession
getRemoteAddress
in interface WebSocketSession
public java.lang.String getAcceptedProtocol()
WebSocketSession
null
if none was specified or
negotiated successfully.getAcceptedProtocol
in interface WebSocketSession
public void setTextMessageSizeLimit(int messageSizeLimit)
WebSocketSession
setTextMessageSizeLimit
in interface WebSocketSession
public int getTextMessageSizeLimit()
WebSocketSession
getTextMessageSizeLimit
in interface WebSocketSession
public void setBinaryMessageSizeLimit(int messageSizeLimit)
WebSocketSession
setBinaryMessageSizeLimit
in interface WebSocketSession
public int getBinaryMessageSizeLimit()
WebSocketSession
getBinaryMessageSizeLimit
in interface WebSocketSession
public java.util.List<WebSocketExtension> getExtensions()
WebSocketSession
null
if none was specified or
negotiated successfully.getExtensions
in interface WebSocketSession
public void initializeDelegateSession(WebSocketSession session)
protected void sendInternal(TextMessage textMessage) throws java.io.IOException
sendInternal
in class AbstractClientSockJsSession
java.io.IOException
protected void disconnect(CloseStatus status) throws java.io.IOException
disconnect
in class AbstractClientSockJsSession
java.io.IOException