public class HtmlFileTransportHandler extends AbstractHttpSendingTransportHandler
TransportHandler
that uses a famous browser
document.domain technique
. See
stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do
for details.logger
Constructor and Description |
---|
HtmlFileTransportHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkSessionType(SockJsSession session)
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. |
StreamingSockJsSession |
createSession(java.lang.String sessionId,
WebSocketHandler handler,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Create a new SockJS session.
|
protected MediaType |
getContentType() |
protected SockJsFrameFormat |
getFrameFormat(ServerHttpRequest request) |
TransportType |
getTransportType()
Return the transport type supported by this handler.
|
void |
handleRequestInternal(ServerHttpRequest request,
ServerHttpResponse response,
AbstractHttpSockJsSession sockJsSession) |
getCallbackParam, handleRequest
getServiceConfig, initialize
public TransportType getTransportType()
TransportHandler
protected MediaType getContentType()
getContentType
in class AbstractHttpSendingTransportHandler
public boolean checkSessionType(SockJsSession session)
TransportHandler
TransportHandler
where session id and the transport type
are extracted from the SockJS URL.true
if the session matches (and would therefore get
accepted by TransportHandler.handleRequest(org.springframework.http.server.ServerHttpRequest, org.springframework.http.server.ServerHttpResponse, org.springframework.web.socket.WebSocketHandler, org.springframework.web.socket.sockjs.transport.SockJsSession)
), or false
otherwisepublic StreamingSockJsSession createSession(java.lang.String sessionId, WebSocketHandler handler, java.util.Map<java.lang.String,java.lang.Object> attributes)
SockJsSessionFactory
sessionId
- the ID of the sessionhandler
- the underlying WebSocketHandler
attributes
- handshake request specific attributesnull
public void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, AbstractHttpSockJsSession sockJsSession) throws SockJsException
handleRequestInternal
in class AbstractHttpSendingTransportHandler
SockJsException
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request)
getFrameFormat
in class AbstractHttpSendingTransportHandler