| Modifier and Type | Field and Description |
|---|---|
| private volatile String | |
| private volatile ServerHttpAsyncRequestControl | |
| private volatile SockJsFrameFormat | |
| private volatile HttpHeaders | |
| private volatile InetSocketAddress | |
| private final Queue | |
| private volatile Principal | |
| private boolean | |
| private volatile InetSocketAddress | |
| private volatile ServerHttpResponse | |
| private volatile URI |
| Access | Constructor and Description |
|---|---|
| public | AbstractHttpSockJsSession(String id, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String, Object> attributes)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| protected void | disconnect(CloseStatus status)
Implements abstract org. Actually close the underlying WebSocket session or in the case of HTTP transports complete the underlying request. |
| protected abstract void | |
| public String | getAcceptedProtocol()
Implements org. Return the selected sub-protocol to use. |
| public int | getBinaryMessageSizeLimit()
Implements org. Get the configured maximum size for an incoming binary message. |
| public List | getExtensions()
Implements org. Determine the negotiated extensions. |
| public HttpHeaders | getHandshakeHeaders()
Implements org. Return the headers used in the handshake request (never |
| public InetSocketAddress | getLocalAddress()
Implements org. Return the address on which the request was received. |
| protected Queue | getMessageCache()
Return the SockJS buffer for messages stored transparently between polling requests. |
| public Principal | getPrincipal()
Implements org. Return a |
| public InetSocketAddress | getRemoteAddress()
Implements org. Return the address of the remote client. |
| public int | getTextMessageSizeLimit()
Implements org. Get the configured maximum size for an incoming text message. |
| public URI | getUri()
Implements org. Return the URI used to open the WebSocket connection. |
| public void | handleInitialRequest(ServerHttpRequest
the current request request, ServerHttpResponse the current response response, SockJsFrameFormat the transport-specific SocksJS frame format to use frameFormat)Handle the first request for receiving messages on a SockJS HTTP transport based session. |
| protected abstract void | handleRequestInternal(ServerHttpRequest
the current request request, ServerHttpResponse the current response response, boolean whether it is the first request for the session initialRequest)Invoked when a SockJS transport request is received. |
| public void | handleSuccessiveRequest(ServerHttpRequest
the current request request, ServerHttpResponse the current response response, SockJsFrameFormat the transport-specific SocksJS frame format to use frameFormat)Handle all requests, except the first one, to receive messages on a SockJS HTTP transport based session. |
| public boolean | isActive()
Implements abstract org. Polling and Streaming sessions periodically close the current HTTP request and wait for the next request to come through. |
| protected void | |
| protected final void | sendMessageInternal(String message)
Implements abstract org.
|
| public void | setAcceptedProtocol(String
the sub-protocol to set protocol)Unlike WebSocket where sub-protocol negotiation is part of the initial handshake, in HTTP transports the same negotiation must be emulated and the selected protocol set through this setter. |
| public void | setBinaryMessageSizeLimit(int messageSizeLimit)
Implements org. Configure the maximum size for an incoming binary message. |
| public void | setTextMessageSizeLimit(int messageSizeLimit)
Implements org. Configure the maximum size for an incoming text message. |
| protected void |
| acceptedProtocol | back to summary |
|---|---|
| private volatile String acceptedProtocol
| |
| asyncRequestControl | back to summary |
|---|---|
| private volatile ServerHttpAsyncRequestControl asyncRequestControl
| |
| frameFormat | back to summary |
|---|---|
| private volatile SockJsFrameFormat frameFormat
| |
| handshakeHeaders | back to summary |
|---|---|
| private volatile HttpHeaders handshakeHeaders
| |
| localAddress | back to summary |
|---|---|
| private volatile InetSocketAddress localAddress
| |
| messageCache | back to summary |
|---|---|
| private final Queue<String> messageCache | |
| principal | back to summary |
|---|---|
| private volatile Principal principal
| |
| readyToSend | back to summary |
|---|---|
| private boolean readyToSend | |
| remoteAddress | back to summary |
|---|---|
| private volatile InetSocketAddress remoteAddress
| |
| response | back to summary |
|---|---|
| private volatile ServerHttpResponse response
| |
| uri | back to summary |
|---|---|
| private volatile URI uri
| |
| AbstractHttpSockJsSession | back to summary |
|---|---|
| public AbstractHttpSockJsSession(String id, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String, Object> attributes) | |
| disableShallowEtagHeaderFilter | back to summary |
|---|---|
| private void disableShallowEtagHeaderFilter(ServerHttpRequest request) | |
| disconnect | back to summary |
|---|---|
| protected void disconnect(CloseStatus status) Implements abstract org. Doc from org. Actually close the underlying WebSocket session or in the case of HTTP transports complete the underlying request.
| |
| flushCache | back to summary |
|---|---|
| protected abstract void flushCache() throws SockJsTransportFailureException Called when the connection is active and ready to write to the response. Subclasses should only call this method from a method where the "responseLock" is acquired. | |
| getAcceptedProtocol | back to summary |
|---|---|
| public String getAcceptedProtocol() Implements org. Return the selected sub-protocol to use.
| |
| getBinaryMessageSizeLimit | back to summary |
|---|---|
| public int getBinaryMessageSizeLimit() Implements org. Doc from org. Get the configured maximum size for an incoming binary message.
| |
| getExtensions | back to summary |
|---|---|
| public List Implements org. Doc from org. Determine the negotiated extensions.
| |
| getHandshakeHeaders | back to summary |
|---|---|
| public HttpHeaders getHandshakeHeaders() Implements org. Doc from org. Return the headers used in the handshake request (never
| |
| getLocalAddress | back to summary |
|---|---|
| public InetSocketAddress getLocalAddress() Implements org. Doc from org. Return the address on which the request was received. | |
| getMessageCache | back to summary |
|---|---|
| protected Queue Return the SockJS buffer for messages stored transparently between polling requests. If the polling request takes longer than 5 seconds, the session is closed. | |
| getPrincipal | back to summary |
|---|---|
| public Principal getPrincipal() Implements org. Doc from org. Return a If the user has not been authenticated, the method returns | |
| getRemoteAddress | back to summary |
|---|---|
| public InetSocketAddress getRemoteAddress() Implements org. Doc from org. Return the address of the remote client. | |
| getTextMessageSizeLimit | back to summary |
|---|---|
| public int getTextMessageSizeLimit() Implements org. Doc from org. Get the configured maximum size for an incoming text message.
| |
| getUri | back to summary |
|---|---|
| public URI getUri() Implements org. Doc from org. Return the URI used to open the WebSocket connection.
| |
| handleInitialRequest | back to summary |
|---|---|
| public void handleInitialRequest(ServerHttpRequest request, ServerHttpResponse response, SockJsFrameFormat frameFormat) throws SockJsException Handle the first request for receiving messages on a SockJS HTTP transport based session. Long polling-based transports (e.g. "xhr", "jsonp") complete the request after writing the open frame. Streaming-based transports ("xhr_streaming", "eventsource", and "htmlfile") leave the response open longer for further streaming of message frames but will also close it eventually after some amount of data has been sent.
| |
| handleRequestInternal | back to summary |
|---|---|
| protected abstract void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) throws IOException Invoked when a SockJS transport request is received.
| |
| handleSuccessiveRequest | back to summary |
|---|---|
| public void handleSuccessiveRequest(ServerHttpRequest request, ServerHttpResponse response, SockJsFrameFormat frameFormat) throws SockJsException Handle all requests, except the first one, to receive messages on a SockJS HTTP transport based session. Long polling-based transports (e.g. "xhr", "jsonp") complete the request after writing any buffered message frames (or the next one). Streaming-based transports ("xhr_streaming", "eventsource", and "htmlfile") leave the response open longer for further streaming of message frames but will also close it eventually after some amount of data has been sent.
| |
| isActive | back to summary |
|---|---|
| public boolean isActive() Implements abstract org. Doc from org. Polling and Streaming sessions periodically close the current HTTP request and wait for the next request to come through. During this "downtime" the session is still open but inactive and unable to send messages and therefore has to buffer them temporarily. A WebSocket session by contrast is stateful and remain active until closed.
| |
| resetRequest | back to summary |
|---|---|
| protected void resetRequest() | |
| sendMessageInternal | back to summary |
|---|---|
| protected final void sendMessageInternal(String message) throws SockJsTransportFailureException Implements abstract org.
| |
| setAcceptedProtocol | back to summary |
|---|---|
| public void setAcceptedProtocol(String protocol) Unlike WebSocket where sub-protocol negotiation is part of the initial handshake, in HTTP transports the same negotiation must be emulated and the selected protocol set through this setter.
| |
| setBinaryMessageSizeLimit | back to summary |
|---|---|
| public void setBinaryMessageSizeLimit(int messageSizeLimit) Implements org. Doc from org. Configure the maximum size for an incoming binary message.
| |
| setTextMessageSizeLimit | back to summary |
|---|---|
| public void setTextMessageSizeLimit(int messageSizeLimit) Implements org. Doc from org. Configure the maximum size for an incoming text message.
| |
| writeFrameInternal | back to summary |
|---|---|
| protected void writeFrameInternal(SockJsFrame frame) throws IOException Implements abstract org.
| |