Package org.glassfish.tyrus.spi
Class UpgradeRequest
- java.lang.Object
-
- org.glassfish.tyrus.spi.UpgradeRequest
-
- All Implemented Interfaces:
jakarta.websocket.server.HandshakeRequest
- Direct Known Subclasses:
RequestContext
public abstract class UpgradeRequest extends java.lang.Object implements jakarta.websocket.server.HandshakeRequestAbstraction for a HTTP upgrade request. A transport creates an implementation for this and usesWebSocketEngine.upgrade(org.glassfish.tyrus.spi.UpgradeRequest, org.glassfish.tyrus.spi.UpgradeResponse)method to upgrade the request.- Author:
- Danny Coward, Pavel Bucek
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTHORIZATIONHTTP "Authorization" header name.static java.lang.StringCLUSTER_CONNECTION_ID_HEADERTyrus cluster connection ID header name.static java.lang.StringCONNECTIONHTTP "Connection" header name.static java.lang.StringENABLE_TRACING_HEADERIf 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.static java.lang.StringHOSTHTTP "Host" header name.static java.lang.StringORIGIN_HEADERHTTP "Origin" header name.static java.lang.StringRESPONSE_CODE_MESSAGEHTTP reason phrase for successful handshake response.static java.lang.StringSEC_WS_ORIGIN_HEADERWebSocket origin header name from previous versions.static java.lang.StringSERVER_KEY_HASHServer key hash used to compute "Sec-WebSocket-Accept" header value.static java.lang.StringTRACING_THRESHOLDThis header allows temporarily changing tracing threshold.static java.lang.StringUPGRADEHTTP "Upgrade" header name and "Connection" header expected value.static java.lang.StringWEBSOCKETExpected value in HTTP handshake "Upgrade" header.
-
Constructor Summary
Constructors Constructor Description UpgradeRequest()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.StringgetHeader(java.lang.String name)Returns the value of the specified request header name.abstract java.lang.StringgetRequestUri()Get the undecoded request uri (up to the query string) of underlying HTTP handshake request.abstract booleanisSecure()Indicates whether this request was made using a secure channel (such as HTTPS).
-
-
-
Field Detail
-
WEBSOCKET
public static final java.lang.String WEBSOCKET
Expected value in HTTP handshake "Upgrade" header.(Registered in RFC 6455).
- See Also:
- Constant Field Values
-
RESPONSE_CODE_MESSAGE
public static final java.lang.String RESPONSE_CODE_MESSAGE
HTTP reason phrase for successful handshake response.- See Also:
- Constant Field Values
-
UPGRADE
public static final java.lang.String UPGRADE
HTTP "Upgrade" header name and "Connection" header expected value.- See Also:
- Constant Field Values
-
CONNECTION
public static final java.lang.String CONNECTION
HTTP "Connection" header name.- See Also:
- Constant Field Values
-
HOST
public static final java.lang.String HOST
HTTP "Host" header name.- See Also:
- Constant Field Values
-
SEC_WS_ORIGIN_HEADER
public static final java.lang.String SEC_WS_ORIGIN_HEADER
WebSocket origin header name from previous versions.Keeping here only for backwards compatibility, not used anymore.
- See Also:
- Constant Field Values
-
ORIGIN_HEADER
public static final java.lang.String ORIGIN_HEADER
HTTP "Origin" header name.- See Also:
- Constant Field Values
-
CLUSTER_CONNECTION_ID_HEADER
public static final java.lang.String CLUSTER_CONNECTION_ID_HEADER
Tyrus cluster connection ID header name.- See Also:
- Constant Field Values
-
SERVER_KEY_HASH
public static final java.lang.String SERVER_KEY_HASH
Server key hash used to compute "Sec-WebSocket-Accept" header value.Defined in RFC 6455.
- See Also:
- Constant Field Values
-
AUTHORIZATION
public static final java.lang.String AUTHORIZATION
HTTP "Authorization" header name.- See Also:
- Constant Field Values
-
ENABLE_TRACING_HEADER
public static final java.lang.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".
- See Also:
- Constant Field Values
-
TRACING_THRESHOLD
public static final java.lang.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.
- See Also:
- Constant Field Values
-
-
Method Detail
-
getHeader
public abstract java.lang.String getHeader(java.lang.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- a header name.- Returns:
- value of the specified header name, null if the request doesn't have a header of that name.
-
getRequestUri
public abstract java.lang.String getRequestUri()
Get the undecoded request uri (up to the query string) of underlying HTTP handshake request.- Returns:
- request uri.
-
isSecure
public abstract boolean isSecure()
Indicates whether this request was made using a secure channel (such as HTTPS).- Returns:
- true if the request was made using secure channel, false otherwise.
-
-