接口 TransportRequest
public interface TransportRequest
Exposes information, typically toTransport
andsession
implementations, about a request to connect to a SockJS server endpoint over a given transport.Note that a single request to connect via
SockJsClient
may result in multiple instances ofTransportRequest
, one for each transport before a connection is successfully established.- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
addTimeoutTask(Runnable runnable)
Register a timeout cleanup task to invoke if the SockJS session is not fully established within the calculated retransmission timeout period.HttpHeaders
getHandshakeHeaders()
Return the headers to send with the connect request.HttpHeaders
getHttpRequestHeaders()
Return the headers to add to all other HTTP requests besides the handshake request such as XHR receive and send requests.SockJsMessageCodec
getMessageCodec()
Return the message codec to use for encoding SockJS messages.SockJsUrlInfo
getSockJsUrlInfo()
Return information about the SockJS URL including server and session ID.URI
getTransportUrl()
Return the transport URL for the given transport.Principal
getUser()
Return the user associated with the request, if any.
方法详细资料
getSockJsUrlInfo
SockJsUrlInfo getSockJsUrlInfo()
Return information about the SockJS URL including server and session ID.
getHandshakeHeaders
HttpHeaders getHandshakeHeaders()
Return the headers to send with the connect request.
getHttpRequestHeaders
HttpHeaders getHttpRequestHeaders()
Return the headers to add to all other HTTP requests besides the handshake request such as XHR receive and send requests.- 从以下版本开始:
- 4.2
getTransportUrl
URI getTransportUrl()
Return the transport URL for the given transport.For an
XhrTransport
this is the URL for receiving messages.
getMessageCodec
SockJsMessageCodec getMessageCodec()
Return the message codec to use for encoding SockJS messages.
addTimeoutTask
void addTimeoutTask(Runnable runnable)
Register a timeout cleanup task to invoke if the SockJS session is not fully established within the calculated retransmission timeout period.