WsHttpUpgradeHandler (Apache Tomcat 10.1.7 API Documentation)

Package org.apache.tomcat.websocket.server

## Class WsHttpUpgradeHandler

- java.lang.Object
- - org.apache.tomcat.websocket.server.WsHttpUpgradeHandler

- All Implemented Interfaces:
    `HttpUpgradeHandler`, `InternalHttpUpgradeHandler`

      public class WsHttpUpgradeHandler
      extends Object
      implements InternalHttpUpgradeHandler

  Servlet 3.1 HTTP upgrade handler for WebSocket connections.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WsHttpUpgradeHandler()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `destroy()` | This method is called after the upgraded connection has been closed.
    `UpgradeInfo` | `getUpgradeInfo()` |
    `void` | `init​(WebConnection connection)` | This method is called once the request/response pair where `HttpServletRequest.upgrade(Class)` is called has completed processing and is the point where control of the connection passes from the container to the `HttpUpgradeHandler`.
    `void` | `pause()` |
    `void` | `preInit​(ServerEndpointConfig serverEndpointConfig, WsServerContainer wsc, WsHandshakeRequest handshakeRequest, List<Extension> negotiatedExtensionsPhase2, String subProtocol, Transformation transformation, Map<String,​String> pathParameters, boolean secure)` |
    `void` | `setSocketWrapper​(SocketWrapperBase<?> socketWrapper)` |
    `void` | `setSslSupport​(SSLSupport sslSupport)` |
    `void` | `timeoutAsync​(long now)` |
    `AbstractEndpoint.Handler.SocketState` | `upgradeDispatch​(SocketEvent status)` |

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

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

    - ### Methods inherited from interface org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler

      `hasAsyncIO`

- - ### Constructor Detail

    - #### WsHttpUpgradeHandler

          public WsHttpUpgradeHandler()

  - ### Method Detail

    - #### setSocketWrapper

          public void setSocketWrapper​(SocketWrapperBase<?> socketWrapper)

      Specified by:
        `setSocketWrapper` in interface `InternalHttpUpgradeHandler`

    - #### preInit

          public void preInit​(ServerEndpointConfig serverEndpointConfig,
                              WsServerContainer wsc,
                              WsHandshakeRequest handshakeRequest,
                              List<Extension> negotiatedExtensionsPhase2,
                              String subProtocol,
                              Transformation transformation,
                              Map<String,​String> pathParameters,
                              boolean secure)

    - #### init

          public void init​(WebConnection connection)

      Description copied from interface: `jakarta.servlet.http.HttpUpgradeHandler`
      This method is called once the request/response pair where `HttpServletRequest.upgrade(Class)` is called has completed processing and is the point where control of the connection passes from the container to the `HttpUpgradeHandler`.
      Specified by:
        `init` in interface `HttpUpgradeHandler`
      Parameters:
        `connection` - The connection that has been upgraded

    - #### getUpgradeInfo

          public UpgradeInfo getUpgradeInfo()

      Specified by:
        `getUpgradeInfo` in interface `InternalHttpUpgradeHandler`

    - #### upgradeDispatch

          public AbstractEndpoint.Handler.SocketState upgradeDispatch​(SocketEvent status)

      Specified by:
        `upgradeDispatch` in interface `InternalHttpUpgradeHandler`

    - #### timeoutAsync

          public void timeoutAsync​(long now)

      Specified by:
        `timeoutAsync` in interface `InternalHttpUpgradeHandler`

    - #### pause

          public void pause()

      Specified by:
        `pause` in interface `InternalHttpUpgradeHandler`

    - #### destroy

          public void destroy()

      Description copied from interface: `jakarta.servlet.http.HttpUpgradeHandler`
      This method is called after the upgraded connection has been closed.
      Specified by:
        `destroy` in interface `HttpUpgradeHandler`

    - #### setSslSupport

          public void setSslSupport​(SSLSupport sslSupport)

      Specified by:
        `setSslSupport` in interface `InternalHttpUpgradeHandler`