Top Description Fields Constructors Methods
org.springframework.web.socket.config.annotation

public Class WebMvcStompWebSocketEndpointRegistration

extends Object
implements StompWebSocketEndpointRegistration
Class Inheritance
All Implemented Interfaces
org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration
Imports
java.util.ArrayList, .Arrays, .List, org.springframework.lang.Nullable, org.springframework.scheduling.TaskScheduler, org.springframework.util.Assert, .LinkedMultiValueMap, .MultiValueMap, .ObjectUtils, .StringUtils, org.springframework.web.HttpRequestHandler, org.springframework.web.socket.WebSocketHandler, org.springframework.web.socket.server.HandshakeHandler, .HandshakeInterceptor, org.springframework.web.socket.server.support.OriginHandshakeInterceptor, .WebSocketHttpRequestHandler, org.springframework.web.socket.sockjs.SockJsService, org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler, org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler

An abstract base class for configuring STOMP over WebSocket/SockJS endpoints.
Author
Rossen Stoyanchev
Since
4.0

Field Summary

Modifier and TypeField and Description
private final List<String>
private final List<String>
private HandshakeHandler
private final List<HandshakeInterceptor>
private final String[]
private SockJsServiceRegistration
private final TaskScheduler
private final WebSocketHandler

Constructor Summary

AccessConstructor and Description
public
WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)

Method Summary

Modifier and TypeMethod and Description
public StompWebSocketEndpointRegistration
protected HandshakeInterceptor[]
public final MultiValueMap<HttpRequestHandler, String>
public StompWebSocketEndpointRegistration
setAllowedOriginPatterns(String... allowedOriginPatterns)

Implements org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setAllowedOriginPatterns.

Alternative to setAllowedOrigins(String...) that supports more flexible patterns for specifying the origins for which cross-origin requests are allowed from a browser.

public StompWebSocketEndpointRegistration
setAllowedOrigins(String... allowedOrigins)

Implements org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setAllowedOrigins.

Set the origins for which cross-origin requests are allowed from a browser.

public StompWebSocketEndpointRegistration
public SockJsServiceRegistration
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowedOriginPatternsback to summary
private final List<String> allowedOriginPatterns
allowedOriginsback to summary
private final List<String> allowedOrigins
handshakeHandlerback to summary
private HandshakeHandler handshakeHandler
Annotations
@Nullable
interceptorsback to summary
private final List<HandshakeInterceptor> interceptors
pathsback to summary
private final String[] paths
registrationback to summary
private SockJsServiceRegistration registration
Annotations
@Nullable
sockJsTaskSchedulerback to summary
private final TaskScheduler sockJsTaskScheduler
webSocketHandlerback to summary
private final WebSocketHandler webSocketHandler

Constructor Detail

WebMvcStompWebSocketEndpointRegistrationback to summary
public WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)

Method Detail

addInterceptorsback to summary
public StompWebSocketEndpointRegistration addInterceptors(HandshakeInterceptor... interceptors)

Implements org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.addInterceptors.

Doc from org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.addInterceptors.

Configure the HandshakeInterceptor's to use.

Annotations
@Override
getInterceptorsback to summary
protected HandshakeInterceptor[] getInterceptors()
getMappingsback to summary
public final MultiValueMap<HttpRequestHandler, String> getMappings()
setAllowedOriginPatternsback to summary
public StompWebSocketEndpointRegistration setAllowedOriginPatterns(String... allowedOriginPatterns)

Implements org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setAllowedOriginPatterns.

Doc from org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setAllowedOriginPatterns.

Alternative to setAllowedOrigins(String...) that supports more flexible patterns for specifying the origins for which cross-origin requests are allowed from a browser. Please, refer to CorsConfiguration#setAllowedOriginPatterns(List) for format details and other considerations.

By default this is not set.

Annotations
@Override
setAllowedOriginsback to summary
public StompWebSocketEndpointRegistration setAllowedOrigins(String... allowedOrigins)

Implements org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setAllowedOrigins.

Doc from org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setAllowedOrigins.

Set the origins for which cross-origin requests are allowed from a browser. Please, refer to CorsConfiguration#setAllowedOrigins(List) for format details and considerations, and keep in mind that the CORS spec does not allow use of "*" with allowCredentials=true. For more flexible origin patterns use setAllowedOriginPatterns instead.

By default, no origins are allowed. When allowedOriginPatterns is also set, then that takes precedence over this property.

Note when SockJS is enabled and origins are restricted, transport types that do not allow to check request origin (Iframe based transports) are disabled. As a consequence, IE 6 to 9 are not supported when origins are restricted.

Annotations
@Override
setHandshakeHandlerback to summary
public StompWebSocketEndpointRegistration setHandshakeHandler(HandshakeHandler handshakeHandler)

Implements org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setHandshakeHandler.

Doc from org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.setHandshakeHandler.

Configure the HandshakeHandler to use.

Annotations
@Override
withSockJSback to summary
public SockJsServiceRegistration withSockJS()

Implements org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.withSockJS.

Doc from org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration.withSockJS.

Enable SockJS fallback options.

Annotations
@Override