Class WebMvcStompWebSocketEndpointRegistration
- java.lang.Object
- org.springframework.web.socket.config.annotation.WebMvcStompWebSocketEndpointRegistration
- All Implemented Interfaces:
StompWebSocketEndpointRegistration
public class WebMvcStompWebSocketEndpointRegistration extends Object implements StompWebSocketEndpointRegistration
An abstract base class for configuring STOMP over WebSocket/SockJS endpoints.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StompWebSocketEndpointRegistration
addInterceptors(HandshakeInterceptor... interceptors)
Configure the HandshakeInterceptor's to use.protected HandshakeInterceptor[]
getInterceptors()
MultiValueMap<HttpRequestHandler,String>
getMappings()
StompWebSocketEndpointRegistration
setAllowedOrigins(String... allowedOrigins)
Configure allowedOrigin
header values.StompWebSocketEndpointRegistration
setHandshakeHandler(HandshakeHandler handshakeHandler)
Configure the HandshakeHandler to use.SockJsServiceRegistration
withSockJS()
Enable SockJS fallback options.
Constructor Detail
WebMvcStompWebSocketEndpointRegistration
public WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)
Method Detail
setHandshakeHandler
public StompWebSocketEndpointRegistration setHandshakeHandler(HandshakeHandler handshakeHandler)
Description copied from interface:StompWebSocketEndpointRegistration
Configure the HandshakeHandler to use.- Specified by:
setHandshakeHandler
in interfaceStompWebSocketEndpointRegistration
addInterceptors
public StompWebSocketEndpointRegistration addInterceptors(HandshakeInterceptor... interceptors)
Description copied from interface:StompWebSocketEndpointRegistration
Configure the HandshakeInterceptor's to use.- Specified by:
addInterceptors
in interfaceStompWebSocketEndpointRegistration
setAllowedOrigins
public StompWebSocketEndpointRegistration setAllowedOrigins(String... allowedOrigins)
Description copied from interface:StompWebSocketEndpointRegistration
Configure allowedOrigin
header values. This check is mostly designed for browser clients. There is nothing preventing other types of client to modify theOrigin
header value.When SockJS is enabled and origins are restricted, transport types that do not allow to check request origin (JSONP and Iframe based transports) are disabled. As a consequence, IE 6 to 9 are not supported when origins are restricted.
Each provided allowed origin must start by "http://", "https://" or be "*" (means that all origins are allowed). By default, only same origin requests are allowed (empty list).
- Specified by:
setAllowedOrigins
in interfaceStompWebSocketEndpointRegistration
- See Also:
- RFC 6454: The Web Origin Concept, SockJS supported transports by browser
withSockJS
public SockJsServiceRegistration withSockJS()
Description copied from interface:StompWebSocketEndpointRegistration
Enable SockJS fallback options.- Specified by:
withSockJS
in interfaceStompWebSocketEndpointRegistration
getInterceptors
protected HandshakeInterceptor[] getInterceptors()
getMappings
public final MultiValueMap<HttpRequestHandler,String> getMappings()