WsHandshakeRequest (Apache Tomcat 9.0.118 API Documentation)
Description: declaration: package: org.apache.tomcat.websocket.server, class: WsHandshakeRequest

# 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 HandshakeRequest

  `SEC_WEBSOCKET_EXTENSIONS, SEC_WEBSOCKET_KEY, SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  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 Object

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

- ## Constructor Details

  - ### WsHandshakeRequest

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

- ## Method Details

  - ### 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.