org.springframework.web.socket.server.standard

## Class TomcatRequestUpgradeStrategy

- java.lang.Object
- - org.springframework.web.socket.server.standard.AbstractStandardUpgradeStrategy
  - - org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy

- All Implemented Interfaces:
    RequestUpgradeStrategy

      public class TomcatRequestUpgradeStrategy
      extends AbstractStandardUpgradeStrategy

  Tomcat support for upgrading an `HttpServletRequest` during a WebSocket handshake. To modify properties of the underlying `ServerContainer` you can use `ServletServerContainerFactoryBean` in XML configuration or if using Java configuration, access the container instance through the "javax.websocket.server.ServerContainer" ServletContext attribute.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Field Summary

    - ### Fields inherited from class org.springframework.web.socket.server.standard.AbstractStandardUpgradeStrategy

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TomcatRequestUpgradeStrategy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.tomcat.websocket.server.WsServerContainer` | `getContainer(HttpServletRequest request)`
    `String[]` | `getSupportedVersions()` Return the supported WebSocket protocol versions.
    `void` | `upgradeInternal(ServerHttpRequest request, ServerHttpResponse response, String selectedProtocol, List<javax.websocket.Extension> selectedExtensions, javax.websocket.Endpoint endpoint)`

    - ### Methods inherited from class org.springframework.web.socket.server.standard.AbstractStandardUpgradeStrategy

      `getHttpServletRequest, getHttpServletResponse, getInstalledExtensions, getSupportedExtensions, upgrade`

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

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

- - ### Constructor Detail

    - #### TomcatRequestUpgradeStrategy

          public TomcatRequestUpgradeStrategy()

  - ### Method Detail

    - #### getSupportedVersions

          public String[] getSupportedVersions()

      Description copied from interface: `RequestUpgradeStrategy`
      Return the supported WebSocket protocol versions.

    - #### upgradeInternal

          public void upgradeInternal(ServerHttpRequest request,
                                      ServerHttpResponse response,
                                      String selectedProtocol,
                                      List<javax.websocket.Extension> selectedExtensions,
                                      javax.websocket.Endpoint endpoint)
                               throws HandshakeFailureException

      Specified by:
        `upgradeInternal` in class `AbstractStandardUpgradeStrategy`
      Throws:
        `HandshakeFailureException`

    - #### getContainer

          public org.apache.tomcat.websocket.server.WsServerContainer getContainer(HttpServletRequest request)

      Overrides:
        `getContainer` in class `AbstractStandardUpgradeStrategy`