Package org.eclipse.jetty.websocket.api
Interface UpgradeResponse
-
- All Known Implementing Classes:
ClientUpgradeResponse,ServletUpgradeResponse,ServletWebSocketResponse,UpgradeResponseAdapter
@Deprecated(since="2021-05-27") public interface UpgradeResponseDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.The HTTP Upgrade to WebSocket Response
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddHeader(java.lang.String name, java.lang.String value)Deprecated.Add a header value to the response.java.lang.StringgetAcceptedSubProtocol()Deprecated.Get the accepted WebSocket protocol.java.util.List<ExtensionConfig>getExtensions()Deprecated.Get the list of extensions that should be used for the websocket.java.lang.StringgetHeader(java.lang.String name)Deprecated.Get a header valuejava.util.Set<java.lang.String>getHeaderNames()Deprecated.Get the header namesjava.util.Map<java.lang.String,java.util.List<java.lang.String>>getHeaders()Deprecated.Get the headers mapjava.util.List<java.lang.String>getHeaders(java.lang.String name)Deprecated.Get the multi-value header valueintgetStatusCode()Deprecated.Get the HTTP Response Status Codejava.lang.StringgetStatusReason()Deprecated.Get the HTTP Response Status ReasonbooleanisSuccess()Deprecated.this has no replacement, will be removed in Jetty 10voidsendForbidden(java.lang.String message)Deprecated.Issue a forbidden upgrade response.voidsetAcceptedSubProtocol(java.lang.String protocol)Deprecated.Set the accepted WebSocket Protocol.voidsetExtensions(java.util.List<ExtensionConfig> extensions)Deprecated.Set the list of extensions that are approved for use with this websocket.voidsetHeader(java.lang.String name, java.lang.String value)Deprecated.Set a headervoidsetStatusCode(int statusCode)Deprecated.Set the HTTP Response status codevoidsetStatusReason(java.lang.String statusReason)Deprecated.Set the HTTP Response status reason phrasevoidsetSuccess(boolean success)Deprecated.this has no replacement, will be removed in Jetty 10
-
-
-
Method Detail
-
addHeader
void addHeader(java.lang.String name, java.lang.String value)Deprecated.Add a header value to the response.- Parameters:
name- the header namevalue- the header value
-
getAcceptedSubProtocol
java.lang.String getAcceptedSubProtocol()
Deprecated.Get the accepted WebSocket protocol.- Returns:
- the accepted WebSocket protocol.
-
getExtensions
java.util.List<ExtensionConfig> getExtensions()
Deprecated.Get the list of extensions that should be used for the websocket.- Returns:
- the list of negotiated extensions to use.
-
getHeader
java.lang.String getHeader(java.lang.String name)
Deprecated.Get a header value- Parameters:
name- the header name- Returns:
- the value (null if header doesn't exist)
-
getHeaderNames
java.util.Set<java.lang.String> getHeaderNames()
Deprecated.Get the header names- Returns:
- the set of header names
-
getHeaders
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
Deprecated.Get the headers map- Returns:
- the map of headers
-
getHeaders
java.util.List<java.lang.String> getHeaders(java.lang.String name)
Deprecated.Get the multi-value header value- Parameters:
name- the header name- Returns:
- the list of values (null if header doesn't exist)
-
getStatusCode
int getStatusCode()
Deprecated.Get the HTTP Response Status Code- Returns:
- the status code
-
getStatusReason
java.lang.String getStatusReason()
Deprecated.Get the HTTP Response Status Reason- Returns:
- the HTTP Response status reason
-
isSuccess
@Deprecated boolean isSuccess()
Deprecated.this has no replacement, will be removed in Jetty 10Test if upgrade response is successful.Merely notes if the response was sent as a WebSocket Upgrade, or was failed (resulting in no upgrade handshake)
- Returns:
- true if upgrade response was generated, false if no upgrade response was generated
-
sendForbidden
void sendForbidden(java.lang.String message) throws java.io.IOExceptionDeprecated.Issue a forbidden upgrade response.This means that the websocket endpoint was valid, but the conditions to use a WebSocket resulted in a forbidden access.
Use this when the origin or authentication is invalid.
- Parameters:
message- the short 1 line detail message about the forbidden response- Throws:
java.io.IOException- if unable to send the forbidden
-
setAcceptedSubProtocol
void setAcceptedSubProtocol(java.lang.String protocol)
Deprecated.Set the accepted WebSocket Protocol.- Parameters:
protocol- the protocol to list as accepted
-
setExtensions
void setExtensions(java.util.List<ExtensionConfig> extensions)
Deprecated.Set the list of extensions that are approved for use with this websocket.Notes:
- Per the spec you cannot add extensions that have not been seen in the
UpgradeRequest, just remove entries you don't want to use - If this is unused, or a null is passed, then the list negotiation will follow default behavior and use the complete list of extensions that are available in this WebSocket server implementation.
- Parameters:
extensions- the list of extensions to use.
- Per the spec you cannot add extensions that have not been seen in the
-
setHeader
void setHeader(java.lang.String name, java.lang.String value)Deprecated.Set a headerOverrides previous value of header (if set)
- Parameters:
name- the header namevalue- the header value
-
setStatusCode
void setStatusCode(int statusCode)
Deprecated.Set the HTTP Response status code- Parameters:
statusCode- the status code
-
setStatusReason
void setStatusReason(java.lang.String statusReason)
Deprecated.Set the HTTP Response status reason phraseNote, not all implementation of UpgradeResponse can support this feature
- Parameters:
statusReason- the status reason phrase
-
setSuccess
@Deprecated void setSuccess(boolean success)
Deprecated.this has no replacement, will be removed in Jetty 10Set the success of the upgrade response.- Parameters:
success- true to indicate a response to the upgrade handshake was sent, false to indicate no upgrade response was sent
-
-