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

## Class AbstractHttpReceivingTransportHandler

- java.lang.Object
- - org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
  - - org.springframework.web.socket.sockjs.transport.handler.AbstractHttpReceivingTransportHandler

All Implemented Interfaces:
  TransportHandler

Direct Known Subclasses:
  XhrReceivingTransportHandler

    public abstract class AbstractHttpReceivingTransportHandler
    extends AbstractTransportHandler

Base class for HTTP transport handlers that receive messages via HTTP POST.

Since:
  4.0
Author:
  Rossen Stoyanchev

### Field Summary

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

`logger`

### Constructor Summary

Constructors
Constructor and Description
`AbstractHttpReceivingTransportHandler()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`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.
`protected abstract org.springframework.http.HttpStatus` `getResponseStatus()`
`void` `handleRequest(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession)` Handle the given request and delegate messages to the provided `WebSocketHandler`.
`protected void` `handleRequestInternal(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, WebSocketHandler wsHandler, AbstractHttpSockJsSession sockJsSession)`
`protected abstract String[]` `readMessages(org.springframework.http.server.ServerHttpRequest request)`

### 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.TransportHandler

`getTransportType`

### Constructor Detail

#### AbstractHttpReceivingTransportHandler

    public AbstractHttpReceivingTransportHandler()

### Method Detail

#### checkSessionType

    public boolean checkSessionType(SockJsSession session)

Description copied from interface: `TransportHandler`
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:
  `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` otherwise

#### 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`.

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,
                                         WebSocketHandler wsHandler,
                                         AbstractHttpSockJsSession sockJsSession)
                                  throws SockJsException

Throws:
  `SockJsException`

#### readMessages

    @Nullable
    protected abstract String[] readMessages(org.springframework.http.server.ServerHttpRequest request)
                                                throws IOException

Throws:
  `IOException`

#### getResponseStatus

    protected abstract org.springframework.http.HttpStatus getResponseStatus()