public abstract class AbstractHttpReceivingTransportHandler extends AbstractTransportHandler
logger
Constructor and Description |
---|
AbstractHttpReceivingTransportHandler() |
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. |
protected abstract HttpStatus |
getResponseStatus() |
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,
WebSocketHandler wsHandler,
AbstractHttpSockJsSession sockJsSession) |
protected abstract String[] |
readMessages(ServerHttpRequest request) |
getServiceConfig, initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTransportType
public AbstractHttpReceivingTransportHandler()
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 final void handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession) throws SockJsException
TransportHandler
WebSocketHandler
.request
- the current requestresponse
- the current responsewsHandler
- the target WebSocketHandler (never null
)wsSession
- the SockJS session (never null
)SockJsException
- raised when request processing fails as
explained in SockJsService
protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, AbstractHttpSockJsSession sockJsSession) throws SockJsException
SockJsException
@Nullable protected abstract String[] readMessages(ServerHttpRequest request) throws IOException
IOException
protected abstract HttpStatus getResponseStatus()