Top Description Methods
org.springframework.web.socket.sockjs.client

public Interface TransportRequest

Known Direct Implementers
org.springframework.web.socket.sockjs.client.DefaultTransportRequest
Imports
java.net.URI, java.security.Principal, org.springframework.http.HttpHeaders, org.springframework.lang.Nullable, org.springframework.web.socket.sockjs.frame.SockJsMessageCodec

Exposes information, typically to Transport and session 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 of TransportRequest, one for each transport before a connection is successfully established.

Author
Rossen Stoyanchev
Since
4.1

Method Summary

Modifier and TypeMethod and Description
public 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.

public HttpHeaders
getHandshakeHeaders()

Return the headers to send with the connect request.

public HttpHeaders
getHttpRequestHeaders()

Return the headers to add to all other HTTP requests besides the handshake request such as XHR receive and send requests.

public SockJsMessageCodec
getMessageCodec()

Return the message codec to use for encoding SockJS messages.

public SockJsUrlInfo
getSockJsUrlInfo()

Return information about the SockJS URL including server and session ID.

public URI
getTransportUrl()

Return the transport URL for the given transport.

public Principal
getUser()

Return the user associated with the request, if any.

Method Detail

addTimeoutTaskback to summary
public 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.

getHandshakeHeadersback to summary
public HttpHeaders getHandshakeHeaders()

Return the headers to send with the connect request.

getHttpRequestHeadersback to summary
public HttpHeaders getHttpRequestHeaders()

Return the headers to add to all other HTTP requests besides the handshake request such as XHR receive and send requests.

Since
4.2
getMessageCodecback to summary
public SockJsMessageCodec getMessageCodec()

Return the message codec to use for encoding SockJS messages.

getSockJsUrlInfoback to summary
public SockJsUrlInfo getSockJsUrlInfo()

Return information about the SockJS URL including server and session ID.

getTransportUrlback to summary
public URI getTransportUrl()

Return the transport URL for the given transport.

For an XhrTransport this is the URL for receiving messages.

getUserback to summary
public Principal getUser()

Return the user associated with the request, if any.

Annotations
@Nullable