org.springframework.web.socket.server.jetty

## Class Jetty10RequestUpgradeStrategy

- java.lang.Object
- - org.springframework.web.socket.server.jetty.Jetty10RequestUpgradeStrategy

- All Implemented Interfaces:
    RequestUpgradeStrategy

      public class Jetty10RequestUpgradeStrategy
      extends Object
      implements RequestUpgradeStrategy

  A `RequestUpgradeStrategy` for Jetty 10.
  Since:
    5.3.4
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Jetty10RequestUpgradeStrategy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<WebSocketExtension>` | `getSupportedExtensions(ServerHttpRequest request)` Return the WebSocket protocol extensions supported by the underlying WebSocket server.
    `String[]` | `getSupportedVersions()` Return the supported WebSocket protocol versions.
    `void` | `upgrade(ServerHttpRequest request, ServerHttpResponse response, String selectedProtocol, List<WebSocketExtension> selectedExtensions, Principal user, WebSocketHandler handler, Map<String,Object> attributes)` Perform runtime specific steps to complete the upgrade.

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

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

- - ### Constructor Detail

    - #### Jetty10RequestUpgradeStrategy

          public Jetty10RequestUpgradeStrategy()

  - ### Method Detail

    - #### getSupportedVersions

          public String[] getSupportedVersions()

      Description copied from interface: `RequestUpgradeStrategy`
      Return the supported WebSocket protocol versions.
      Specified by:
        `getSupportedVersions` in interface `RequestUpgradeStrategy`

    - #### getSupportedExtensions

          public List<WebSocketExtension> getSupportedExtensions(ServerHttpRequest request)

      Description copied from interface: `RequestUpgradeStrategy`
      Return the WebSocket protocol extensions supported by the underlying WebSocket server.
      Specified by:
        `getSupportedExtensions` in interface `RequestUpgradeStrategy`

    - #### upgrade

          public void upgrade(ServerHttpRequest request,
                              ServerHttpResponse response,
                              @Nullable
                              String selectedProtocol,
                              List<WebSocketExtension> selectedExtensions,
                              @Nullable
                              Principal user,
                              WebSocketHandler handler,
                              Map<String,Object> attributes)
                       throws HandshakeFailureException

      Description copied from interface: `RequestUpgradeStrategy`
      Perform runtime specific steps to complete the upgrade. Invoked after successful negotiation of the handshake request.
      Specified by:
        `upgrade` in interface `RequestUpgradeStrategy`
      Parameters:
        `request` - the current request
        `response` - the current response
        `selectedProtocol` - the selected sub-protocol, if any
        `selectedExtensions` - the selected WebSocket protocol extensions
        `user` - the user to associate with the WebSocket session
        `handler` - the handler for WebSocket messages
        `attributes` - handshake request specific attributes to be set on the WebSocket session via `HandshakeInterceptor` and thus made available to the `WebSocketHandler`
      Throws:
        `HandshakeFailureException` - thrown when handshake processing failed to complete due to an internal, unrecoverable error, i.e. a server error as opposed to a failure to successfully negotiate the requirements of the handshake request.