org.springframework.web.socket.config.annotation

## 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 and Description
    `WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `StompWebSocketEndpointRegistration` | `addInterceptors(HandshakeInterceptor... interceptors)` Configure the HandshakeInterceptor's to use.
    `protected HandshakeInterceptor[]` | `getInterceptors()`
    `MultiValueMap<HttpRequestHandler,String>` | `getMappings()`
    `StompWebSocketEndpointRegistration` | `setAllowedOriginPatterns(String... allowedOriginPatterns)` Alternative to `StompWebSocketEndpointRegistration.setAllowedOrigins(String...)` that supports more flexible patterns for specifying the origins for which cross-origin requests are allowed from a browser.
    `StompWebSocketEndpointRegistration` | `setAllowedOrigins(String... allowedOrigins)` Set the origins for which cross-origin requests are allowed from a browser.
    `StompWebSocketEndpointRegistration` | `setHandshakeHandler(HandshakeHandler handshakeHandler)` Configure the HandshakeHandler to use.
    `SockJsServiceRegistration` | `withSockJS()` Enable SockJS fallback options.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 interface `StompWebSocketEndpointRegistration`

    - #### addInterceptors

          public StompWebSocketEndpointRegistration addInterceptors(HandshakeInterceptor... interceptors)

      Description copied from interface: `StompWebSocketEndpointRegistration`
      Configure the HandshakeInterceptor's to use.
      Specified by:
        `addInterceptors` in interface `StompWebSocketEndpointRegistration`

    - #### setAllowedOrigins

          public StompWebSocketEndpointRegistration setAllowedOrigins(String... allowedOrigins)

      Description copied from interface: `StompWebSocketEndpointRegistration`
      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 `StompWebSocketEndpointRegistration.setAllowedOriginPatterns(java.lang.String...)` 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.

      Specified by:
        `setAllowedOrigins` in interface `StompWebSocketEndpointRegistration`
      See Also:
        `StompWebSocketEndpointRegistration.setAllowedOriginPatterns(String...)`, RFC 6454: The Web Origin Concept, SockJS supported transports by browser

    - #### setAllowedOriginPatterns

          public StompWebSocketEndpointRegistration setAllowedOriginPatterns(String... allowedOriginPatterns)

      Description copied from interface: `StompWebSocketEndpointRegistration`
      Alternative to `StompWebSocketEndpointRegistration.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.

      Specified by:
        `setAllowedOriginPatterns` in interface `StompWebSocketEndpointRegistration`

    - #### withSockJS

          public SockJsServiceRegistration withSockJS()

      Description copied from interface: `StompWebSocketEndpointRegistration`
      Enable SockJS fallback options.
      Specified by:
        `withSockJS` in interface `StompWebSocketEndpointRegistration`

    - #### getInterceptors

          protected HandshakeInterceptor[] getInterceptors()

    - #### getMappings

          public final MultiValueMap<HttpRequestHandler,String> getMappings()