Class AbstractHttpSendingTransportHandler

java.lang.Object
org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler
All Implemented Interfaces:
SockJsSessionFactory, TransportHandler
Direct Known Subclasses:
EventSourceTransportHandler, HtmlFileTransportHandler, XhrPollingTransportHandler, XhrStreamingTransportHandler

public abstract class AbstractHttpSendingTransportHandler extends AbstractTransportHandler implements SockJsSessionFactory
Base class for HTTP transport handlers that push messages to connected clients.
Since:
4.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • AbstractHttpSendingTransportHandler

      public AbstractHttpSendingTransportHandler()
  • Method Details

    • handleRequest

      public final void handleRequest(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession) throws SockJsException
      Description copied from interface: TransportHandler
      Handle the given request and delegate messages to the provided WebSocketHandler.
      Specified by:
      handleRequest in interface TransportHandler
      Parameters:
      request - the current request
      response - the current response
      wsHandler - the target WebSocketHandler (never null)
      wsSession - the SockJS session (never null)
      Throws:
      SockJsException - raised when request processing fails as explained in SockJsService
    • handleRequestInternal

      protected void handleRequestInternal(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, AbstractHttpSockJsSession sockJsSession) throws SockJsException
      Throws:
      SockJsException
    • getContentType

      protected abstract org.springframework.http.MediaType getContentType()
    • getFrameFormat

      protected abstract SockJsFrameFormat getFrameFormat(org.springframework.http.server.ServerHttpRequest request)
    • getCallbackParam

      @Nullable protected final String getCallbackParam(org.springframework.http.server.ServerHttpRequest request)