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

public abstract Class UpgradeResponse

extends Object
implements HandshakeResponse
Class Inheritance
All Implemented Interfaces
jakarta.websocket.HandshakeResponse
Imports
java.util.List, jakarta.websocket.HandshakeResponse

Abstraction for a HTTP upgrade response. A transport creates an implementation for this and uses WebSocketEngine#upgrade method to upgrade the request.
Author
Pavel Bucek

Field Summary

Modifier and TypeField and Description
public static final String
LOCATION

Header containing a new URI when getStatus() .

public static final String
RETRY_AFTER

Header containing delay or date in which client can try to reconnect to the server.

public static final String
TRACING_HEADER_PREFIX

Prefix of headers used for including tracing information into handshake response.

public static final String
WWW_AUTHENTICATE

Header containing challenge with authentication scheme and parameters.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final String

Returns:

the value of the response header with the given name, null if no header with the given name has been set on this response. TODO rename to getHeader(String name) ?? similar to TODO HttpServletResponse#getHeader(String)
getFirstHeaderValue
(final String
header name.
name
)

Gets the value of the response header with the given name.

public abstract String
getReasonPhrase()

Get HTTP reason phrase.

public abstract int

Returns:

the current HTTP status code.
getStatus
()

Get the current HTTP status code of this response.

public abstract void
setReasonPhrase(String
reason phrase to be set.
reason
)

Set HTTP reason phrase.

public abstract void
setStatus(int
HTTP status code for this response.
status
)

Set HTTP status code for this response.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOCATIONback to summary
public static final String LOCATION

Header containing a new URI when getStatus() .

RETRY_AFTERback to summary
public static final String RETRY_AFTER

Header containing delay or date in which client can try to reconnect to the server.

TRACING_HEADER_PREFIXback to summary
public static final String TRACING_HEADER_PREFIX

Prefix of headers used for including tracing information into handshake response.

WWW_AUTHENTICATEback to summary
public static final String WWW_AUTHENTICATE

Header containing challenge with authentication scheme and parameters.

Constructor Detail

UpgradeResponseback to summary
public UpgradeResponse()

Method Detail

getFirstHeaderValueback to summary
public final String getFirstHeaderValue(final String name)

Gets the value of the response header with the given name.

If a response header with the given name exists and contains multiple values, the value that was added first will be returned.

Parameters
name:String

header name.

Returns:String

the value of the response header with the given name, null if no header with the given name has been set on this response. TODO rename to getHeader(String name) ?? similar to TODO HttpServletResponse#getHeader(String)

getReasonPhraseback to summary
public abstract String getReasonPhrase()

Get HTTP reason phrase.

Warning

The Reason Phrase is removed from HTTP/2 and from Servlet 6.

getStatusback to summary
public abstract int getStatus()

Get the current HTTP status code of this response.

Returns:int

the current HTTP status code.

setReasonPhraseback to summary
public abstract void setReasonPhrase(String reason)

Set HTTP reason phrase.

Warning

The Reason Phrase is removed from HTTP/2 and from Servlet 6.

Parameters
reason:String

reason phrase to be set.

setStatusback to summary
public abstract void setStatus(int status)

Set HTTP status code for this response.

Parameters
status:int

HTTP status code for this response.