Class WsHandshakeRequest
java.lang.Object
org.apache.tomcat.websocket.server.WsHandshakeRequest
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionWsHandshakeRequest(HttpServletRequest request, Map<String, String> pathParams) Constructs a new WsHandshakeRequest. -
Method Summary
Modifier and TypeMethodDescriptionReturns the HTTP headers from the handshake request.Get the HTTP Session object associated with this request.Returns the query parameters from the handshake request.Returns the query string from the handshake request.Returns the URI of the handshake request.Returns the principal of the user associated with this request, ornullif the user is not authenticated.booleanisUserInRole(String role) Returns whether the user associated with this request is in the given role.
-
Constructor Details
-
WsHandshakeRequest
Constructs a new WsHandshakeRequest.- Parameters:
request- The HTTP servlet requestpathParams- The path parameters
-
-
Method Details
-
getRequestURI
Description copied from interface:jakarta.websocket.server.HandshakeRequestReturns the URI of the handshake request.- Specified by:
getRequestURIin interfaceHandshakeRequest- Returns:
- The request URI
-
getParameterMap
Description copied from interface:jakarta.websocket.server.HandshakeRequestReturns the query parameters from the handshake request.- Specified by:
getParameterMapin interfaceHandshakeRequest- Returns:
- The query parameter map
-
getQueryString
Description copied from interface:jakarta.websocket.server.HandshakeRequestReturns the query string from the handshake request.- Specified by:
getQueryStringin interfaceHandshakeRequest- Returns:
- The query string
-
getUserPrincipal
Description copied from interface:jakarta.websocket.server.HandshakeRequestReturns the principal of the user associated with this request, ornullif the user is not authenticated.- Specified by:
getUserPrincipalin interfaceHandshakeRequest- Returns:
- The user principal
-
getHeaders
Description copied from interface:jakarta.websocket.server.HandshakeRequestReturns the HTTP headers from the handshake request.- Specified by:
getHeadersin interfaceHandshakeRequest- Returns:
- The HTTP headers
-
isUserInRole
Description copied from interface:jakarta.websocket.server.HandshakeRequestReturns whether the user associated with this request is in the given role.- Specified by:
isUserInRolein interfaceHandshakeRequest- Parameters:
role- The role to check- Returns:
trueif the user is in the specified role
-
getHttpSession
Description copied from interface:jakarta.websocket.server.HandshakeRequestGet the HTTP Session object associated with this request. Object is used to avoid a direct dependency on the Servlet API.- Specified by:
getHttpSessionin interfaceHandshakeRequest- Returns:
- The jakarta.servlet.http.HttpSession object associated with this request, if any.
-