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

public Class XhrStreamingTransportHandler

extends AbstractHttpSendingTransportHandler
Class Inheritance
Imports
java.nio.charset.StandardCharsets, java.util.Arrays, .Map, org.springframework.http.MediaType, org.springframework.http.server.ServerHttpRequest, org.springframework.web.socket.WebSocketHandler, org.springframework.web.socket.sockjs.frame.DefaultSockJsFrameFormat, .SockJsFrameFormat, org.springframework.web.socket.sockjs.transport.SockJsServiceConfig, .SockJsSession, .TransportHandler, .TransportType, org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession

A TransportHandler that sends messages over an HTTP streaming request.
Author
Rossen Stoyanchev
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
checkSessionType(SockJsSession session)

Implements org.springframework.web.socket.sockjs.transport.TransportHandler.checkSessionType.

Check whether the type of the given session matches the transport type of this TransportHandler where session id and the transport type are extracted from the SockJS URL.

public StreamingSockJsSession
createSession(String
the ID of the session
sessionId
,
WebSocketHandler
the underlying WebSocketHandler
handler
,
Map<String, Object>
handshake request specific attributes
attributes
)

Implements org.springframework.web.socket.sockjs.transport.SockJsSessionFactory.createSession.

Create a new SockJS session.

protected MediaType
protected SockJsFrameFormat
public TransportType
getTransportType()

Implements org.springframework.web.socket.sockjs.transport.TransportHandler.getTransportType.

Return the transport type supported by this handler.

Inherited from org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler:
getCallbackParamhandleRequesthandleRequestInternal

Field Detail

PRELUDEback to summary
private static final byte[] PRELUDE

Constructor Detail

XhrStreamingTransportHandlerback to summary
public XhrStreamingTransportHandler()

Method Detail

checkSessionTypeback to summary
public boolean checkSessionType(SockJsSession session)

Implements org.springframework.web.socket.sockjs.transport.TransportHandler.checkSessionType.

Doc from org.springframework.web.socket.sockjs.transport.TransportHandler.checkSessionType.

Check whether the type of the given session matches the transport type of this TransportHandler where session id and the transport type are extracted from the SockJS URL.

Returns:boolean

true if the session matches (and would therefore get accepted by handleRequest), or false otherwise

Annotations
@Override
createSessionback to summary
public StreamingSockJsSession createSession(String sessionId, WebSocketHandler handler, Map<String, Object> attributes)

Implements org.springframework.web.socket.sockjs.transport.SockJsSessionFactory.createSession.

Doc from org.springframework.web.socket.sockjs.transport.SockJsSessionFactory.createSession.

Create a new SockJS session.

Parameters
sessionId:String

the ID of the session

handler:WebSocketHandler

the underlying WebSocketHandler

attributes:Map<String, Object>

handshake request specific attributes

Returns:StreamingSockJsSession

a new session, never null

Annotations
@Override
getContentTypeback to summary
protected MediaType getContentType()

Implements abstract org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler.getContentType.

Annotations
@Override
getFrameFormatback to summary
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request)

Implements abstract org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler.getFrameFormat.

Annotations
@Override
getTransportTypeback to summary
public TransportType getTransportType()

Implements org.springframework.web.socket.sockjs.transport.TransportHandler.getTransportType.

Doc from org.springframework.web.socket.sockjs.transport.TransportHandler.getTransportType.

Return the transport type supported by this handler.

Annotations
@Override
org.springframework.web.socket.sockjs.transport.handler back to summary

private Class XhrStreamingTransportHandler.XhrStreamingSockJsSession

extends StreamingSockJsSession
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected byte[]
getPrelude(ServerHttpRequest request)

Implements abstract org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession.getPrelude.

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

Inherited from org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession:
flushCachehandleRequestInternal

Constructor Detail

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

Method Detail

getPreludeback to summary
protected byte[] getPrelude(ServerHttpRequest request)

Implements abstract org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession.getPrelude.

Doc from org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession.getPrelude.

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

Annotations
@Override