WebSocketSession.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| protected static final IdGenerator | |
| protected static final Log | |
| private T |
| Access | Constructor and Description |
|---|---|
| public | AbstractWebSocketSession(Map<String, Object>
the attributes from the HTTP handshake to associate with the WebSocket
session; the provided attributes are copied, the original map is not used. attributes)Create a new instance and associate the given attributes with it. |
| Modifier and Type | Method and Description |
|---|---|
| protected final 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 abstract void | |
| public Map | getAttributes()
Implements org. Return the map with attributes associated with the WebSocket session. |
| public T | getNativeSession()
Implements org. Return the underlying native WebSocketSession. |
| public <R> R | getNativeSession(Class<R>
the required type of the session requiredType)Implements org. Return the underlying native WebSocketSession, if available. |
| public void | |
| protected abstract void | |
| public final void | sendMessage(WebSocketMessage<?> message)
Implements org. Send a WebSocket message: either |
| protected abstract void | |
| protected abstract void | |
| protected abstract void | |
| public String |
| attributes | back to summary |
|---|---|
| private final Map<String, Object> attributes | |
| idGenerator | back to summary |
|---|---|
| protected static final IdGenerator idGenerator | |
| logger | back to summary |
|---|---|
| protected static final Log logger | |
| nativeSession | back to summary |
|---|---|
| private T nativeSession
| |
| AbstractWebSocketSession | back to summary |
|---|---|
| public AbstractWebSocketSession(Map<String, Object> attributes) Create a new instance and associate the given attributes with it. | |
| checkNativeSessionInitialized | back to summary |
|---|---|
| protected final void checkNativeSessionInitialized() | |
| 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 abstract void closeInternal(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
| |
| getNativeSession | back to summary |
|---|---|
| public T getNativeSession() Implements org. Doc from org. Return the underlying native WebSocketSession.
| |
| getNativeSession | back to summary |
|---|---|
| public <R> R getNativeSession(Class<R> requiredType) Implements org. Doc from org. Return the underlying native WebSocketSession, if available.
| |
| initializeNativeSession | back to summary |
|---|---|
| public void initializeNativeSession(T session) | |
| sendBinaryMessage | back to summary |
|---|---|
| protected abstract void sendBinaryMessage(BinaryMessage message) 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
| |
| sendPingMessage | back to summary |
|---|---|
| protected abstract void sendPingMessage(PingMessage message) throws IOException | |
| sendPongMessage | back to summary |
|---|---|
| protected abstract void sendPongMessage(PongMessage message) throws IOException | |
| sendTextMessage | back to summary |
|---|---|
| protected abstract void sendTextMessage(TextMessage message) throws IOException | |
| 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- | |