public interface TransportHandler
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. |
TransportType |
getTransportType()
Return the transport type supported by this handler.
|
void |
handleRequest(ServerHttpRequest request,
ServerHttpResponse response,
WebSocketHandler handler,
SockJsSession session)
Handle the given request and delegate messages to the provided
WebSocketHandler . |
void |
initialize(SockJsServiceConfig serviceConfig)
Initialize this handler with the given configuration.
|
void initialize(SockJsServiceConfig serviceConfig)
serviceConfig
- the configuration as defined by the containing
SockJsService
TransportType getTransportType()
boolean checkSessionType(SockJsSession session)
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 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
otherwisevoid handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler handler, SockJsSession session) throws SockJsException
WebSocketHandler
.request
- the current requestresponse
- the current responsehandler
- the target WebSocketHandler (never null
)session
- the SockJS session (never null
)SockJsException
- raised when request processing fails as
explained in SockJsService