public abstract class UpgradeResponse extends java.lang.Object implements HandshakeResponse
WebSocketEngine.upgrade(org.glassfish.tyrus.spi.UpgradeRequest, org.glassfish.tyrus.spi.UpgradeResponse)
method
to upgrade the request.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOCATION
Header containing a new URI when
getStatus() . |
static java.lang.String |
RETRY_AFTER
Header containing delay or date in which client can try to reconnect to the server.
|
static java.lang.String |
TRACING_HEADER_PREFIX
Prefix of headers used for including tracing information into handshake response.
|
static java.lang.String |
WWW_AUTHENTICATE
Header containing challenge with authentication scheme and parameters.
|
SEC_WEBSOCKET_ACCEPT
Constructor and Description |
---|
UpgradeResponse() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFirstHeaderValue(java.lang.String name)
Gets the value of the response header with the given name.
|
abstract java.lang.String |
getReasonPhrase()
Get HTTP reason phrase.
|
abstract int |
getStatus()
Get the current HTTP status code of this response.
|
abstract void |
setReasonPhrase(java.lang.String reason)
Set HTTP reason phrase.
|
abstract void |
setStatus(int status)
Set HTTP status code for this response.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHeaders
public static final java.lang.String WWW_AUTHENTICATE
public static final java.lang.String LOCATION
getStatus()
.public static final java.lang.String RETRY_AFTER
public static final java.lang.String TRACING_HEADER_PREFIX
public abstract int getStatus()
public abstract void setStatus(int status)
status
- HTTP status code for this response.public abstract void setReasonPhrase(java.lang.String reason)
Warning: The Reason Phrase is removed from HTTP/2 and from Servlet 6.
reason
- reason phrase to be set.public abstract java.lang.String getReasonPhrase()
Warning: The Reason Phrase is removed from HTTP/2 and from Servlet 6.
public final java.lang.String getFirstHeaderValue(java.lang.String name)
If a response header with the given name exists and contains multiple values, the value that was added first will be returned.
name
- header name.Copyright © 2012–2020 Oracle Corporation. All rights reserved.