Top Description Fields Constructors Methods
org.springframework.web.socket.sockjs.transport.session

public abstract Class StreamingSockJsSession

extends AbstractHttpSockJsSession
Class Inheritance
Known Direct Subclasses
org.springframework.web.socket.sockjs.transport.handler.EventSourceTransportHandler.EventSourceStreamingSockJsSession, org.springframework.web.socket.sockjs.transport.handler.HtmlFileTransportHandler.HtmlFileStreamingSockJsSession, org.springframework.web.socket.sockjs.transport.handler.XhrStreamingTransportHandler.XhrStreamingSockJsSession
Imports
java.io.IOException, java.util.Map, org.springframework.http.server.ServerHttpRequest, .ServerHttpResponse, org.springframework.web.socket.WebSocketHandler, org.springframework.web.socket.sockjs.SockJsTransportFailureException, org.springframework.web.socket.sockjs.frame.SockJsFrame, .SockJsMessageCodec, org.springframework.web.socket.sockjs.transport.SockJsServiceConfig

A SockJS session for use with streaming HTTP transports.
Author
Rossen Stoyanchev
Since
4.0

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
flushCache()

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.flushCache.

Called when the connection is active and ready to write to the response.

protected abstract byte[]
getPrelude(ServerHttpRequest request)

Get the prelude to write to the response before any other data.

protected void
handleRequestInternal(ServerHttpRequest
the current request
request
,
ServerHttpResponse
the current response
response
,
boolean
whether it is the first request for the session
initialRequest
)

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleRequestInternal.

Invoked when a SockJS transport request is received.

Inherited from org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession:
disconnectgetAcceptedProtocolgetBinaryMessageSizeLimitgetExtensionsgetHandshakeHeadersgetLocalAddressgetMessageCachegetPrincipalgetRemoteAddressgetTextMessageSizeLimitgetUrihandleInitialRequesthandleSuccessiveRequestisActiveresetRequestsendMessageInternalsetAcceptedProtocolsetBinaryMessageSizeLimitsetTextMessageSizeLimitwriteFrameInternal

Field Detail

byteCountback to summary
private int byteCount

Constructor Detail

StreamingSockJsSessionback to summary
public StreamingSockJsSession(String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String, Object> attributes)

Method Detail

flushCacheback to summary
protected void flushCache() throws SockJsTransportFailureException

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.flushCache.

Doc from org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.flushCache.

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.

Annotations
@Override
getPreludeback to summary
protected abstract byte[] getPrelude(ServerHttpRequest request)

Get the prelude to write to the response before any other data.

Since
4.2
handleRequestInternalback to summary
protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) throws IOException

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleRequestInternal.

Doc from org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleRequestInternal.

Invoked when a SockJS transport request is received.

Parameters
request:ServerHttpRequest

the current request

response:ServerHttpResponse

the current response

initialRequest:boolean

whether it is the first request for the session

Annotations
@Override