WebSocketSession.
Provides processing of incoming SockJS message frames and delegates lifecycle
events and messages to the (application) WebSocketHandler.
Subclasses implement actual send as well as disconnect logic.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private volatile CloseStatus | |
| private final CompletableFuture | |
| protected final Log | |
| private final TransportRequest | |
| private volatile AbstractClientSockJsSession. | |
| private final WebSocketHandler |
| Access | Constructor and Description |
|---|---|
| protected | AbstractClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
Deprecated
since 6.0. as of 6.0, in favor of
AbstractClientSockJsSession(TransportRequest, WebSocketHandler, CompletableFuture)
Create a new |
| protected | AbstractClientSockJsSession(TransportRequest request, WebSocketHandler handler, CompletableFuture<WebSocketSession> connectFuture)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public final void | close()
Implements org. Close the WebSocket connection with status 1000, i.e. equivalent to: session.close(CloseStatus.NORMAL); |
| public final void | close(CloseStatus status)
Implements org. Close the WebSocket connection with the given close status. |
| protected void | |
| protected abstract void | |
| public Map | getAttributes()
Implements org. Return the map with attributes associated with the WebSocket session. |
| public HttpHeaders | getHandshakeHeaders()
Implements org. Return the headers used in the handshake request (never |
| public String | getId()
Implements org. Return a unique session identifier. |
| public SockJsMessageCodec | |
| public Principal | getPrincipal()
Implements org. Return a |
| pack-priv Runnable | getTimeoutTask()
Return a timeout cleanup task to invoke if the SockJS sessions is not
fully established within the retransmission timeout period calculated in
|
| public URI | getUri()
Implements org. Return the URI used to open the WebSocket connection. |
| public WebSocketHandler | |
| private void | |
| public void | |
| private void | |
| private void | |
| public void | |
| public boolean | |
| public boolean | isOpen()
Implements org. Whether the underlying connection is open. |
| private boolean | |
| protected abstract void | |
| public final void | sendMessage(WebSocketMessage<?> message)
Implements org. Send a WebSocket message: either |
| private void | |
| public String |
| attributes | back to summary |
|---|---|
| private final Map<String, Object> attributes | |
| closeStatus | back to summary |
|---|---|
| private volatile CloseStatus closeStatus
| |
| connectFuture | back to summary |
|---|---|
| private final CompletableFuture<WebSocketSession> connectFuture | |
| logger | back to summary |
|---|---|
| protected final Log logger | |
| request | back to summary |
|---|---|
| private final TransportRequest request | |
| state | back to summary |
|---|---|
| private volatile AbstractClientSockJsSession. | |
| webSocketHandler | back to summary |
|---|---|
| private final WebSocketHandler webSocketHandler | |
| AbstractClientSockJsSession | back to summary |
|---|---|
| protected AbstractClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
Deprecated since 6.0. as of 6.0, in favor of Create a new
| |
| AbstractClientSockJsSession | back to summary |
|---|---|
| protected AbstractClientSockJsSession(TransportRequest request, WebSocketHandler handler, CompletableFuture<WebSocketSession> connectFuture) | |
| afterTransportClosed | back to summary |
|---|---|
| public void afterTransportClosed(CloseStatus closeStatus) | |
| close | back to summary |
|---|---|
| public final void close() throws IOException Implements org. Doc from org. Close the WebSocket connection with status 1000, i.e. equivalent to: session.close(CloseStatus.NORMAL);
| |
| close | back to summary |
|---|---|
| public final void close(CloseStatus status) throws IOException Implements org. Doc from org. Close the WebSocket connection with the given close status.
| |
| closeInternal | back to summary |
|---|---|
| protected void closeInternal(CloseStatus status) throws IOException | |
| disconnect | back to summary |
|---|---|
| protected abstract void disconnect(CloseStatus status) throws IOException | |
| getAttributes | back to summary |
|---|---|
| public Map Implements org. Doc from org. Return the map with attributes associated with the WebSocket session. On the server side the map can be populated initially through a
| |
| getHandshakeHeaders | back to summary |
|---|---|
| public HttpHeaders getHandshakeHeaders() Implements org. Doc from org. Return the headers used in the handshake request (never
| |
| getId | back to summary |
|---|---|
| public String getId() Implements org. Doc from org. Return a unique session identifier.
| |
| getMessageCodec | back to summary |
|---|---|
| public SockJsMessageCodec getMessageCodec() | |
| getPrincipal | back to summary |
|---|---|
| public Principal getPrincipal() Implements org. Doc from org. Return a If the user has not been authenticated, the method returns
| |
| getTimeoutTask | back to summary |
|---|---|
| pack-priv Runnable getTimeoutTask() Return a timeout cleanup task to invoke if the SockJS sessions is not
fully established within the retransmission timeout period calculated in
| |
| getUri | back to summary |
|---|---|
| public URI getUri() Implements org. Doc from org. Return the URI used to open the WebSocket connection.
| |
| getWebSocketHandler | back to summary |
|---|---|
| public WebSocketHandler getWebSocketHandler() | |
| handleCloseFrame | back to summary |
|---|---|
| private void handleCloseFrame(SockJsFrame frame) | |
| handleFrame | back to summary |
|---|---|
| public void handleFrame(String payload) | |
| handleMessageFrame | back to summary |
|---|---|
| private void handleMessageFrame(SockJsFrame frame) | |
| handleOpenFrame | back to summary |
|---|---|
| private void handleOpenFrame() | |
| handleTransportError | back to summary |
|---|---|
| public void handleTransportError(Throwable error) | |
| isDisconnected | back to summary |
|---|---|
| public boolean isDisconnected() | |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements org. Doc from org. Whether the underlying connection is open.
| |
| isUserSetStatus | back to summary |
|---|---|
| private boolean isUserSetStatus(CloseStatus status) | |
| sendInternal | back to summary |
|---|---|
| protected abstract void sendInternal(TextMessage textMessage) throws IOException | |
| sendMessage | back to summary |
|---|---|
| public final void sendMessage(WebSocketMessage<?> message) throws IOException Implements org. Doc from org. Send a WebSocket message: either Note The underlying standard WebSocket session (JSR-356) does
not allow concurrent sending. Therefore, sending must be synchronized. To ensure
that, one option is to wrap the
| |
| silentClose | back to summary |
|---|---|
| private void silentClose(CloseStatus status) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| public static final AbstractClientSockJsSession. | |
| public static final AbstractClientSockJsSession. | |
| public static final AbstractClientSockJsSession. | |
| public static final AbstractClientSockJsSession. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static AbstractClientSockJsSession. | |
| public static AbstractClientSockJsSession. |
| CLOSED | back to summary |
|---|---|
| public static final AbstractClientSockJsSession. | |
| CLOSING | back to summary |
|---|---|
| public static final AbstractClientSockJsSession. | |
| NEW | back to summary |
|---|---|
| public static final AbstractClientSockJsSession. | |
| OPEN | back to summary |
|---|---|
| public static final AbstractClientSockJsSession. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static AbstractClientSockJsSession. | |
| values | back to summary |
|---|---|
| public static AbstractClientSockJsSession. | |