public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession
DISCONNECTED_CLIENT_LOG_CATEGORY, disconnectedClientLogger, logger, responseLock
コンストラクターと説明 |
---|
AbstractHttpSockJsSession(StringSE id, SockJsServiceConfig config, WebSocketHandler wsHandler, MapSE<StringSE, ObjectSE> attributes) |
修飾子と型 | メソッドと説明 |
---|---|
protected void | disconnect(CloseStatus status) 実際に基になる WebSocket セッションを閉じるか、HTTP トランスポートの場合は基になるリクエストを完了します。 |
protected abstract void | flushCache() 接続がアクティブで、レスポンスに書き込む準備ができたときに呼び出されます。 |
StringSE | getAcceptedProtocol() 使用する選択したサブプロトコルを返します。 |
int | getBinaryMessageSizeLimit() 受信バイナリメッセージの構成済みの最大サイズを取得します。 |
ListSE<WebSocketExtension> | getExtensions() ネゴシエートされた拡張機能を決定します。 |
HttpHeaders | getHandshakeHeaders() ハンドシェイクリクエストで使用されるヘッダーを返します(非 null )。 |
InetSocketAddressSE | getLocalAddress() リクエストが受信されたアドレスを返します。 |
protected QueueSE<StringSE> | getMessageCache() ポーリングリクエスト間で透過的に保存されたメッセージの SockJS バッファーを返します。 |
PrincipalSE | getPrincipal() 認証されたユーザーの名前を含む Principal SE インスタンスを返します。 |
InetSocketAddressSE | getRemoteAddress() リモートクライアントのアドレスを返します。 |
int | getTextMessageSizeLimit() 受信テキストメッセージの構成済みの最大サイズを取得します。 |
URISE | getUri() WebSocket 接続を開くために使用される URI を返します。 |
void | handleInitialRequest(ServerHttpRequest request, ServerHttpResponse response, SockJsFrameFormat frameFormat) SockJS HTTP トランスポートベースのセッションでメッセージを受信するための最初のリクエストを処理します。 |
protected abstract void | handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) SockJS トランスポートリクエストが受信されると呼び出されます。 |
void | handleSuccessiveRequest(ServerHttpRequest request, ServerHttpResponse response, SockJsFrameFormat frameFormat) 最初のリクエストを除くすべてのリクエストを処理して、SockJS HTTP トランスポートベースのセッションでメッセージを受信します。 |
boolean | isActive() ポーリングセッションとストリーミングセッションは、定期的に現在の HTTP リクエストを閉じ、次のリクエストが送信されるのを待ちます。 |
protected void | resetRequest() |
protected void | sendMessageInternal(StringSE message) |
void | setAcceptedProtocol(StringSE protocol) サブプロトコルネゴシエーションが最初のハンドシェイクの一部である WebSocket とは異なり、HTTP トランスポートでは、同じネゴシエーションをエミュレートし、選択したプロトコルをこの setter を介して設定する必要があります。 |
void | setBinaryMessageSizeLimit(int messageSizeLimit) 受信バイナリメッセージの最大サイズを構成します。 |
void | setTextMessageSizeLimit(int messageSizeLimit) 受信テキストメッセージの最大サイズを構成します。 |
protected void | writeFrameInternal(SockJsFrame frame) |
cancelHeartbeat, close, close, delegateConnectionClosed, delegateConnectionEstablished, delegateError, delegateMessages, disableHeartbeat, getAttributes, getId, getMessageCodec, getSockJsServiceConfig, getTimeSinceLastActive, isClosed, isNew, isOpen, scheduleHeartbeat, sendHeartbeat, sendMessage, toString, tryCloseWithSockJsTransportError, updateLastActiveTime, writeFrame
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public AbstractHttpSockJsSession(StringSE id, SockJsServiceConfig config, WebSocketHandler wsHandler, MapSE<StringSE,ObjectSE> attributes)
public URISE getUri()
WebSocketSession
public HttpHeaders getHandshakeHeaders()
WebSocketSession
null
)。@Nullable public PrincipalSE getPrincipal()
WebSocketSession
Principal
SE インスタンスを返します。 ユーザーが認証されていない場合、メソッドは null
を返します。
@Nullable public InetSocketAddressSE getLocalAddress()
WebSocketSession
@Nullable public InetSocketAddressSE getRemoteAddress()
WebSocketSession
public void setAcceptedProtocol(@Nullable StringSE protocol)
protocol
- 設定するサブプロトコル @Nullable public StringSE getAcceptedProtocol()
null
protected QueueSE<StringSE> getMessageCache()
public boolean isActive()
AbstractSockJsSession
AbstractSockJsSession
の isActive
public void setTextMessageSizeLimit(int messageSizeLimit)
WebSocketSession
public int getTextMessageSizeLimit()
WebSocketSession
public void setBinaryMessageSizeLimit(int messageSizeLimit)
WebSocketSession
public int getBinaryMessageSizeLimit()
WebSocketSession
public ListSE<WebSocketExtension> getExtensions()
WebSocketSession
public void handleInitialRequest(ServerHttpRequest request, ServerHttpResponse response, SockJsFrameFormat frameFormat) throws SockJsException
長いポーリングベースのトランスポート( "xhr"、"jsonp" など)は、オープンフレームを書き込んだ後にリクエストを完了します。ストリーミングベースのトランスポート("xhr_streaming"、"eventsource"、および "htmlfile" )は、メッセージフレームをさらにストリーミングするためにレスポンスをより長く開いたままにしますが、ある程度のデータが送信された後、最終的には閉じます。
request
- 現在のリクエスト response
- 現在のレスポンス frameFormat
- 使用するトランスポート固有の SocksJS フレーム形式 SockJsException
public void handleSuccessiveRequest(ServerHttpRequest request, ServerHttpResponse response, SockJsFrameFormat frameFormat) throws SockJsException
長いポーリングベースのトランスポート( "xhr"、"jsonp" など)は、バッファリングされたメッセージフレーム(または次のフレーム)を書き込んだ後にリクエストを完了します。ストリーミングベースのトランスポート("xhr_streaming"、"eventsource"、および "htmlfile" )は、メッセージフレームをさらにストリーミングするためにレスポンスをより長く開いたままにしますが、ある程度のデータが送信された後、最終的には閉じます。
request
- 現在のリクエスト response
- 現在のレスポンス frameFormat
- 使用するトランスポート固有の SocksJS フレーム形式 SockJsException
protected abstract void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) throws IOExceptionSE
request
- 現在のリクエスト response
- 現在のレスポンス initialRequest
- セッションの最初のリクエストかどうか IOExceptionSE
protected final void sendMessageInternal(StringSE message) throws SockJsTransportFailureException
protected abstract void flushCache() throws SockJsTransportFailureException
protected void disconnect(CloseStatus status)
AbstractSockJsSession
AbstractSockJsSession
の disconnect
protected void resetRequest()
protected void writeFrameInternal(SockJsFrame frame) throws IOExceptionSE
AbstractSockJsSession
の writeFrameInternal
IOExceptionSE