Interface Transport
- All Known Subinterfaces:
XhrTransport
- All Known Implementing Classes:
AbstractXhrTransport
,JettyXhrTransport
,RestTemplateXhrTransport
,UndertowXhrTransport
,WebSocketTransport
public interface Transport
A client-side implementation for a SockJS transport.
- Since:
- 4.1
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptiondefault ListenableFuture<WebSocketSession>
connect
(TransportRequest request, WebSocketHandler webSocketHandler) Deprecated.connectAsync
(TransportRequest request, WebSocketHandler webSocketHandler) Connect the transport.Get the SockJS transport types that this transport can be used for.
-
Method Details
-
getTransportTypes
List<TransportType> getTransportTypes()Get the SockJS transport types that this transport can be used for.In particular since from a client perspective there is no difference between XHR and XHR streaming, an
XhrTransport
could do both. -
connect
@Deprecated(since="6.0") default ListenableFuture<WebSocketSession> connect(TransportRequest request, WebSocketHandler webSocketHandler) Deprecated.as of 6.0, in favor ofconnectAsync(TransportRequest, WebSocketHandler)
Connect the transport.- Parameters:
request
- the transport requestwebSocketHandler
- the application handler to delegate lifecycle events to- Returns:
- a future to indicate success or failure to connect
-
connectAsync
CompletableFuture<WebSocketSession> connectAsync(TransportRequest request, WebSocketHandler webSocketHandler) Connect the transport.- Parameters:
request
- the transport requestwebSocketHandler
- the application handler to delegate lifecycle events to- Returns:
- a future to indicate success or failure to connect
- Since:
- 6.0
-
connectAsync(TransportRequest, WebSocketHandler)