Top Description Fields Constructors Methods
org.glassfish.tyrus.container.jdk.client

pack-priv abstract Class JdkUpgradeRequest

extends UpgradeRequest
Class Inheritance
Imports
java.net.URI, java.security.Principal, java.util.List, .Map, org.glassfish.tyrus.spi.UpgradeRequest

Adds getHttpMethod method to @UpgradeRequest. Wraps an upgrade request and delegates all method calls except getHttpMethod() to it.
Author
Petr Janouch

Field Summary

Modifier and TypeField and Description
private final UpgradeRequest
Inherited from org.glassfish.tyrus.spi.UpgradeRequest:
AUTHORIZATIONCLUSTER_CONNECTION_ID_HEADERCONNECTIONENABLE_TRACING_HEADERHOSTORIGIN_HEADERRESPONSE_CODE_MESSAGESEC_WS_ORIGIN_HEADERSERVER_KEY_HASHTRACING_THRESHOLDUPGRADEWEBSOCKET

Constructor Summary

AccessConstructor and Description
pack-priv
JdkUpgradeRequest(UpgradeRequest
wrapped upgrade request.
upgradeRequest
)

Create new org.glassfish.tyrus.container.jdk.client.JdkUpgradeRequest wrapping

Method Summary

Modifier and TypeMethod and Description
public String
getHeader(String
a header name.
name
)

Implements abstract org.glassfish.tyrus.spi.UpgradeRequest.getHeader.

Returns the value of the specified request header name.

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 abstract String

Returns:

a HTTP method.
getHttpMethod
()

Returns a HTTP method that should be used when composing HTTP 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 String
getQueryString()

Implements jakarta.websocket.server.HandshakeRequest.getQueryString.

Return the query string associated with the request.

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
isSecure()

Implements abstract org.glassfish.tyrus.spi.UpgradeRequest.isSecure.

Indicates whether this request was made using a secure channel (such as HTTPS).

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 org.glassfish.tyrus.spi.UpgradeRequest:
getRequestUri

Field Detail

upgradeRequestback to summary
private final UpgradeRequest upgradeRequest

Constructor Detail

JdkUpgradeRequestback to summary
pack-priv JdkUpgradeRequest(UpgradeRequest upgradeRequest)

Create new org.glassfish.tyrus.container.jdk.client.JdkUpgradeRequest wrapping

Parameters
upgradeRequest:UpgradeRequest

wrapped upgrade request.

Method Detail

getHeaderback to summary
public String getHeader(String name)

Implements abstract org.glassfish.tyrus.spi.UpgradeRequest.getHeader.

Doc from org.glassfish.tyrus.spi.UpgradeRequest.getHeader.

Returns the value of the specified request header name. If there are multiple headers with the same name, this method returns the first header in the request. The header name is case insensitive.

Parameters
name:String

a header name.

Returns:String

value of the specified header name, null if the request doesn't have a header of that name.

Annotations
@Override
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
getHttpMethodback to summary
public abstract String getHttpMethod()

Returns a HTTP method that should be used when composing HTTP request.

Returns:String

a HTTP method.

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
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
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
isSecureback to summary
public boolean isSecure()

Implements abstract org.glassfish.tyrus.spi.UpgradeRequest.isSecure.

Doc from org.glassfish.tyrus.spi.UpgradeRequest.isSecure.

Indicates whether this request was made using a secure channel (such as HTTPS).

Returns:boolean

true if the request was made using secure channel, false otherwise.

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