Package jakarta.websocket.server
Interface HandshakeRequest
- 
 public interface HandshakeRequestThe handshake request represents the WebSocket defined HTTP GET request for the opening handshake of a WebSocket session.- Author:
- dannycoward
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringSEC_WEBSOCKET_EXTENSIONSThe Sec-WebSocket-Extensions header namestatic StringSEC_WEBSOCKET_KEYThe Sec-WebSocket-Key header namestatic StringSEC_WEBSOCKET_PROTOCOLThe Sec-WebSocket-Protocol header namestatic StringSEC_WEBSOCKET_VERSIONThe Sec-WebSocket-Version header name
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,List<String>>getHeaders()Return the read only map of HTTP headers to header values that came with the handshake request.ObjectgetHttpSession()Return a reference to the HttpSession that the web socket handshake that started this conversation was part of, if the implementation is part of a Java EE web container.Map<String,List<String>>getParameterMap()Return the request parameters associated with the request.StringgetQueryString()Return the query string associated with the request.URIgetRequestURI()Return the request URI of the handshake request.PrincipalgetUserPrincipal()Return the authenticated user ornullif no user is authenticated for this handshake.booleanisUserInRole(String role)Checks whether the current user is in the given role.
 
- 
- 
- 
Field Detail- 
SEC_WEBSOCKET_KEYstatic final String SEC_WEBSOCKET_KEY The Sec-WebSocket-Key header name- See Also:
- Constant Field Values
 
 - 
SEC_WEBSOCKET_PROTOCOLstatic final String SEC_WEBSOCKET_PROTOCOL The Sec-WebSocket-Protocol header name- See Also:
- Constant Field Values
 
 - 
SEC_WEBSOCKET_VERSIONstatic final String SEC_WEBSOCKET_VERSION The Sec-WebSocket-Version header name- See Also:
- Constant Field Values
 
 - 
SEC_WEBSOCKET_EXTENSIONSstatic final String SEC_WEBSOCKET_EXTENSIONS The Sec-WebSocket-Extensions header name- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getHeadersMap<String,List<String>> getHeaders() Return the read only map of HTTP headers to header values that came with the handshake request. Note that the lookup of header names will be performed in a case insensitive manner.- Returns:
- the list of headers.
 
 - 
getUserPrincipalPrincipal getUserPrincipal() Return the authenticated user ornullif no user is authenticated for this handshake.- Returns:
- the user principal.
 
 - 
getRequestURIURI getRequestURI() Return the request URI of the handshake request.- Returns:
- the request uri of the handshake request.
 
 - 
isUserInRoleboolean isUserInRole(String role) Checks whether the current user is in the given role. Roles and role membership can be defined using deployment descriptors of the containing WAR file, if running in a Java EE web container. If the user has not been authenticated, the method returnsfalse.- Parameters:
- role- the role being checked.
- Returns:
- whether the authenticated user is in the role, or false if the user has not been authenticated.
 
 - 
getHttpSessionObject getHttpSession() Return a reference to the HttpSession that the web socket handshake that started this conversation was part of, if the implementation is part of a Java EE web container.- Returns:
- the http session or nullif either the websocket implementation is not part of a Java EE web container, or there is no HttpSession associated with the opening handshake request.
 
 - 
getParameterMapMap<String,List<String>> getParameterMap() Return the request parameters associated with the request.- Returns:
- the unmodifiable map of the request parameters.
 
 - 
getQueryStringString getQueryString() Return the query string associated with the request.- Returns:
- the query string.
 
 
- 
 
-