public abstract class AbstractClientSockJsSession extends java.lang.Object implements WebSocketSession
WebSocketSession の SockJS クライアント実装の基本クラス。受信 SockJS メッセージフレームの処理を提供し、ライフサイクルイベントとメッセージを(アプリケーション)WebSocketHandler に委譲します。サブクラスは、実際の送信と切断ロジックを実装します。| 修飾子 | コンストラクターと説明 |
|---|---|
protected | AbstractClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture) |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterTransportClosed(CloseStatus closeStatus) |
void | close() ステータス 1000 で WebSocket 接続を閉じます。 |
void | close(CloseStatus status) 指定されたクローズ状態で WebSocket 接続を閉じます。 |
protected void | closeInternal(CloseStatus status) |
protected abstract void | disconnect(CloseStatus status) |
java.util.Map<java.lang.String,java.lang.Object> | getAttributes()WebSocket セッションに関連付けられた属性を持つマップを返します。 |
HttpHeaders | getHandshakeHeaders() ハンドシェイクリクエストで使用されるヘッダーを返します(非 null)。 |
java.lang.String | getId() 一意のセッション識別子を返します。 |
SockJsMessageCodec | getMessageCodec() |
java.security.Principal | getPrincipal() 認証されたユーザーの名前を含む Principal インスタンスを返します。 |
java.net.URI | getUri()WebSocket 接続を開くために使用される URI を返します。 |
WebSocketHandler | getWebSocketHandler() |
void | handleFrame(java.lang.String payload) |
void | handleTransportError(java.lang.Throwable error) |
boolean | isDisconnected() |
boolean | isOpen() 接続がまだ開いているかどうかを返します。 |
protected abstract void | sendInternal(TextMessage textMessage) |
void | sendMessage(WebSocketMessage<?> message)WebSocket メッセージを送信する: TextMessage または BinaryMessage のいずれか。 |
java.lang.String | toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAcceptedProtocol, getBinaryMessageSizeLimit, getExtensions, getLocalAddress, getRemoteAddress, getTextMessageSizeLimit, setBinaryMessageSizeLimit, setTextMessageSizeLimitprotected final Log logger
protected AbstractClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
public java.lang.String getId()
WebSocketSessionWebSocketSession 内の getId public java.net.URI getUri()
WebSocketSessionWebSocketSession 内の getUri public HttpHeaders getHandshakeHeaders()
WebSocketSessionnull)。WebSocketSession 内の getHandshakeHeaders public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
WebSocketSession サーバー側では、最初に HandshakeInterceptor を介してマップにデータを入力できます。クライアント側では、WebSocketClient ハンドシェイクメソッドを介してマップにデータを入力できます。
WebSocketSession 内の getAttributes null ではない)public java.security.Principal getPrincipal()
WebSocketSessionPrincipal インスタンスを返します。 ユーザーが認証されていない場合、メソッドは null を返します。
WebSocketSession 内の getPrincipal public SockJsMessageCodec getMessageCodec()
public WebSocketHandler getWebSocketHandler()
public boolean isOpen()
WebSocketSessionWebSocketSession 内の isOpen public boolean isDisconnected()
public final void sendMessage(WebSocketMessage<?> message) throws java.io.IOException
WebSocketSessionTextMessage または BinaryMessage のいずれか。WebSocketSession 内の sendMessage java.io.IOExceptionprotected abstract void sendInternal(TextMessage textMessage) throws java.io.IOException
java.io.IOExceptionpublic final void close()
throws java.io.IOExceptionWebSocketSessionsession.close(CloseStatus.NORMAL);
java.io.Closeable 内の close java.lang.AutoCloseable 内の close WebSocketSession 内の close java.io.IOExceptionpublic final void close(CloseStatus status) throws java.io.IOException
WebSocketSessionWebSocketSession 内の close java.io.IOExceptionprotected void closeInternal(CloseStatus status) throws java.io.IOException
java.io.IOExceptionprotected abstract void disconnect(CloseStatus status) throws java.io.IOException
java.io.IOExceptionpublic void handleFrame(java.lang.String payload)
public void handleTransportError(java.lang.Throwable error)
public void afterTransportClosed(@Nullable CloseStatus closeStatus)
public java.lang.String toString()
java.lang.Object の toString