Top Description Fields Constructors Methods
org.glassfish.tyrus.spi

public abstract Class UpgradeRequest

extends Object
implements HandshakeRequest
Class Inheritance
All Implemented Interfaces
jakarta.websocket.server.HandshakeRequest
Imports
jakarta.websocket.server.HandshakeRequest

Abstraction for a HTTP upgrade request. A transport creates an implementation for this and uses WebSocketEngine#upgrade method to upgrade the request.
Authors
Danny Coward, Pavel Bucek

Field Summary

Modifier and TypeField and Description
public static final String
AUTHORIZATION

HTTP "Authorization" header name.

public static final String
CLUSTER_CONNECTION_ID_HEADER

Tyrus cluster connection ID header name.

public static final String
CONNECTION

HTTP "Connection" header name.

public static final String
ENABLE_TRACING_HEADER

If this header is present in the handshake request and the tracing type is configured to "ON_DEMAND", tracing headers will be sent in the handshake response.

public static final String
HOST

HTTP "Host" header name.

public static final String
ORIGIN_HEADER

HTTP "Origin" header name.

public static final String
RESPONSE_CODE_MESSAGE

HTTP reason phrase for successful handshake response.

public static final String
SEC_WS_ORIGIN_HEADER

WebSocket origin header name from previous versions.

public static final String
SERVER_KEY_HASH

Server key hash used to compute "Sec-WebSocket-Accept" header value.

public static final String
TRACING_THRESHOLD

This header allows temporarily changing tracing threshold.

public static final String
UPGRADE

HTTP "Upgrade" header name and "Connection" header expected value.

public static final String
WEBSOCKET

Expected value in HTTP handshake "Upgrade" header.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract String

Returns:

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

Returns the value of the specified request header name.

public abstract String

Returns:

request uri.
getRequestUri
()

Get the undecoded request uri (up to the query string) of underlying HTTP handshake request.

public abstract boolean

Returns:

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

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AUTHORIZATIONback to summary
public static final String AUTHORIZATION

HTTP "Authorization" header name.

CLUSTER_CONNECTION_ID_HEADERback to summary
public static final String CLUSTER_CONNECTION_ID_HEADER

Tyrus cluster connection ID header name.

CONNECTIONback to summary
public static final String CONNECTION

HTTP "Connection" header name.

ENABLE_TRACING_HEADERback to summary
public static final String ENABLE_TRACING_HEADER

If this header is present in the handshake request and the tracing type is configured to "ON_DEMAND", tracing headers will be sent in the handshake response. The value of the header is no taken into account.

Setting this header does not have any effect if the tracing type is configured to "ALL" or "OFF".

HOSTback to summary
public static final String HOST

HTTP "Host" header name.

ORIGIN_HEADERback to summary
public static final String ORIGIN_HEADER

HTTP "Origin" header name.

RESPONSE_CODE_MESSAGEback to summary
public static final String RESPONSE_CODE_MESSAGE

HTTP reason phrase for successful handshake response.

SEC_WS_ORIGIN_HEADERback to summary
public static final String SEC_WS_ORIGIN_HEADER

WebSocket origin header name from previous versions.

Keeping here only for backwards compatibility, not used anymore.

Annotations
@SuppressWarnings:UnusedDeclaration
SERVER_KEY_HASHback to summary
public static final String SERVER_KEY_HASH

Server key hash used to compute "Sec-WebSocket-Accept" header value.

Defined in RFC 6455.

TRACING_THRESHOLDback to summary
public static final String TRACING_THRESHOLD

This header allows temporarily changing tracing threshold. If present in the handshake request, the tracing threshold will be changed for the handshake the request is part of.

The expected values are "SUMMARY" or "TRACE", of which "TRACE" will provide more fine-grained information.

UPGRADEback to summary
public static final String UPGRADE

HTTP "Upgrade" header name and "Connection" header expected value.

WEBSOCKETback to summary
public static final String WEBSOCKET

Expected value in HTTP handshake "Upgrade" header.

(Registered in RFC 6455).

Constructor Detail

UpgradeRequestback to summary
public UpgradeRequest()

Method Detail

getHeaderback to summary
public abstract String getHeader(String name)

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.

getRequestUriback to summary
public abstract String getRequestUri()

Get the undecoded request uri (up to the query string) of underlying HTTP handshake request.

Returns:String

request uri.

isSecureback to summary
public abstract boolean 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.