org.apache.tomcat.websocket.server

## Class WsHandshakeRequest

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

- All Implemented Interfaces:
    HandshakeRequest

      public class WsHandshakeRequest
      extends Object
      implements HandshakeRequest

  Represents the request that this session was opened under.

- - ### Field Summary

    - ### Fields inherited from interface javax.websocket.server.HandshakeRequest

      `SEC_WEBSOCKET_EXTENSIONS, SEC_WEBSOCKET_KEY, SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WsHandshakeRequest(HttpServletRequest request, Map<String,String> pathParams)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,List<String>>` | `getHeaders()`
    `Object` | `getHttpSession()` Get the HTTP Session object associated with this request.
    `Map<String,List<String>>` | `getParameterMap()`
    `String` | `getQueryString()`
    `URI` | `getRequestURI()`
    `Principal` | `getUserPrincipal()`
    `boolean` | `isUserInRole(String role)`

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

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

- - ### Constructor Detail

    - #### WsHandshakeRequest

          public WsHandshakeRequest(HttpServletRequest request,
                            Map<String,String> pathParams)

  - ### Method Detail

    - #### getRequestURI

          public URI getRequestURI()

      Specified by:
        `getRequestURI` in interface `HandshakeRequest`

    - #### getParameterMap

          public Map<String,List<String>> getParameterMap()

      Specified by:
        `getParameterMap` in interface `HandshakeRequest`

    - #### getQueryString

          public String getQueryString()

      Specified by:
        `getQueryString` in interface `HandshakeRequest`

    - #### getUserPrincipal

          public Principal getUserPrincipal()

      Specified by:
        `getUserPrincipal` in interface `HandshakeRequest`

    - #### getHeaders

          public Map<String,List<String>> getHeaders()

      Specified by:
        `getHeaders` in interface `HandshakeRequest`

    - #### isUserInRole

          public boolean isUserInRole(String role)

      Specified by:
        `isUserInRole` in interface `HandshakeRequest`

    - #### getHttpSession

          public Object getHttpSession()

      Description copied from interface: `javax.websocket.server.HandshakeRequest`
      Get the HTTP Session object associated with this request. Object is used to avoid a direct dependency on the Servlet API.
      Specified by:
        `getHttpSession` in interface `HandshakeRequest`
      Returns:
        The javax.servlet.http.HttpSession object associated with this request, if any.

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.