org.springframework.web.socket.sockjs.transport.handler

## 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, JsonpPollingTransportHandler, 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

- - ### Field Summary

    - ### Fields inherited from class org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler

      `logger, UTF8_CHARSET`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractHttpSendingTransportHandler()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `getCallbackParam(ServerHttpRequest request)`
    `protected abstract MediaType` | `getContentType()`
    `protected abstract SockJsFrameFormat` | `getFrameFormat(ServerHttpRequest request)`
    `void` | `handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession)` Handle the given request and delegate messages to the provided `WebSocketHandler`.
    `protected void` | `handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, AbstractHttpSockJsSession sockJsSession)`

    - ### Methods inherited from class org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler

      `getServiceConfig, initialize`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.springframework.web.socket.sockjs.transport.SockJsSessionFactory

      `createSession`

    - ### Methods inherited from interface org.springframework.web.socket.sockjs.transport.TransportHandler

      `getTransportType`

- - ### Constructor Detail

    - #### AbstractHttpSendingTransportHandler

          public AbstractHttpSendingTransportHandler()

  - ### Method Detail

    - #### handleRequest

          public final void handleRequest(ServerHttpRequest request,
                                          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(ServerHttpRequest request,
                                               ServerHttpResponse response,
                                               AbstractHttpSockJsSession sockJsSession)
                                        throws SockJsException

      Throws:
        `SockJsException`

    - #### getContentType

          protected abstract MediaType getContentType()

    - #### getFrameFormat

          protected abstract SockJsFrameFormat getFrameFormat(ServerHttpRequest request)

    - #### getCallbackParam

          protected final String getCallbackParam(ServerHttpRequest request)