Top Fields Constructors Methods
org.eclipse.jetty.ee10.websocket.jakarta.server.internal

public Class JsrHandshakeRequest

extends Object
implements HandshakeRequest
Class Inheritance
All Implemented Interfaces
jakarta.websocket.server.HandshakeRequest
Imports
java.net.URI, java.security.Principal, java.util.ArrayList, .Collections, .HashMap, .List, .Map, java.util.stream.Collectors, jakarta.servlet.http.HttpServletRequest, jakarta.websocket.server.HandshakeRequest, org.eclipse.jetty.ee10.websocket.jakarta.server.JakartaWebSocketServerContainer, org.eclipse.jetty.http.pathmap.PathSpec, org.eclipse.jetty.server.Request, org.eclipse.jetty.util.Fields, org.eclipse.jetty.websocket.core.WebSocketConstants, org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest

Field Summary

Modifier and TypeField and Description
private final ServerUpgradeRequest
private final HttpServletRequest
private Map<String, List<String>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Map<String, List<String>>
getHeaders()

Implements jakarta.websocket.server.HandshakeRequest.getHeaders.

Return the read only map of HTTP headers to header values that came with the handshake request.

public Object
getHttpSession()

Implements jakarta.websocket.server.HandshakeRequest.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.

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

Implements jakarta.websocket.server.HandshakeRequest.getParameterMap.

Return the request parameters associated with the request.

public Map<String, String>
public String
getQueryString()

Implements jakarta.websocket.server.HandshakeRequest.getQueryString.

Return the query string associated with the request.

public PathSpec
public URI
getRequestURI()

Implements jakarta.websocket.server.HandshakeRequest.getRequestURI.

Return the request URI of the handshake request.

public Principal
getUserPrincipal()

Implements jakarta.websocket.server.HandshakeRequest.getUserPrincipal.

Return the authenticated user or null if no user is authenticated for this handshake.

public boolean
isUserInRole(String
the role being checked.
role
)

Implements jakarta.websocket.server.HandshakeRequest.isUserInRole.

Checks whether the current user is in the given role.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final ServerUpgradeRequest delegate
httpServletRequestback to summary
private final HttpServletRequest httpServletRequest
parameterMapback to summary
private Map<String, List<String>> parameterMap

Constructor Detail

JsrHandshakeRequestback to summary
public JsrHandshakeRequest(ServerUpgradeRequest req)

Method Detail

getHeadersback to summary
public Map<String, List<String>> getHeaders()

Implements jakarta.websocket.server.HandshakeRequest.getHeaders.

Doc from jakarta.websocket.server.HandshakeRequest.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:Map<String, List<String>>

the list of headers.

Annotations
@Override
getHttpSessionback to summary
public Object getHttpSession()

Implements jakarta.websocket.server.HandshakeRequest.getHttpSession.

Doc from jakarta.websocket.server.HandshakeRequest.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:Object

the http session or null if either the websocket implementation is not part of a Java EE web container, or there is no HttpSession associated with the opening handshake request.

Annotations
@Override
getParameterMapback to summary
public Map<String, List<String>> getParameterMap()

Implements jakarta.websocket.server.HandshakeRequest.getParameterMap.

Doc from jakarta.websocket.server.HandshakeRequest.getParameterMap.

Return the request parameters associated with the request.

Returns:Map<String, List<String>>

the unmodifiable map of the request parameters.

Annotations
@Override
getPathParamsback to summary
public Map<String, String> getPathParams()
Annotations
@SuppressWarnings:unchecked
getQueryStringback to summary
public String getQueryString()

Implements jakarta.websocket.server.HandshakeRequest.getQueryString.

Doc from jakarta.websocket.server.HandshakeRequest.getQueryString.

Return the query string associated with the request.

Returns:String

the query string.

Annotations
@Override
getRequestPathSpecback to summary
public PathSpec getRequestPathSpec()
getRequestURIback to summary
public URI getRequestURI()

Implements jakarta.websocket.server.HandshakeRequest.getRequestURI.

Doc from jakarta.websocket.server.HandshakeRequest.getRequestURI.

Return the request URI of the handshake request.

Returns:URI

the request uri of the handshake request.

Annotations
@Override
getUserPrincipalback to summary
public Principal getUserPrincipal()

Implements jakarta.websocket.server.HandshakeRequest.getUserPrincipal.

Doc from jakarta.websocket.server.HandshakeRequest.getUserPrincipal.

Return the authenticated user or null if no user is authenticated for this handshake.

Returns:Principal

the user principal.

Annotations
@Override
isUserInRoleback to summary
public boolean isUserInRole(String role)

Implements jakarta.websocket.server.HandshakeRequest.isUserInRole.

Doc from jakarta.websocket.server.HandshakeRequest.isUserInRole.

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 returns false.

Parameters
role:String

the role being checked.

Returns:boolean

whether the authenticated user is in the role, or false if the user has not been authenticated.

Annotations
@Override