Class ClientUpgradeResponse
java.lang.Object
org.eclipse.jetty.websocket.common.UpgradeResponseAdapter
org.eclipse.jetty.websocket.client.ClientUpgradeResponse
- All Implemented Interfaces:
UpgradeResponse
-
Field Summary
FieldsFields inherited from class org.eclipse.jetty.websocket.common.UpgradeResponseAdapter
SEC_WEBSOCKET_PROTOCOL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the list of extensions that should be used for the websocket.boolean
Test if upgrade response is successful.void
sendForbidden
(String message) Issue a forbidden upgrade response.Methods inherited from class org.eclipse.jetty.websocket.common.UpgradeResponseAdapter
addHeader, getAcceptedSubProtocol, getHeader, getHeaderNames, getHeaders, getHeaders, getStatusCode, getStatusReason, setAcceptedSubProtocol, setExtensions, setHeader, setStatusCode, setStatusReason, setSuccess
-
Field Details
-
extensions
-
-
Constructor Details
-
ClientUpgradeResponse
public ClientUpgradeResponse() -
ClientUpgradeResponse
public ClientUpgradeResponse(org.eclipse.jetty.client.HttpResponse response)
-
-
Method Details
-
isSuccess
public boolean isSuccess()Description copied from interface:UpgradeResponse
Test if upgrade response is successful.Merely notes if the response was sent as a WebSocket Upgrade, or was failed (resulting in no upgrade handshake)
- Specified by:
isSuccess
in interfaceUpgradeResponse
- Overrides:
isSuccess
in classUpgradeResponseAdapter
- Returns:
- true if upgrade response was generated, false if no upgrade response was generated
-
getExtensions
Description copied from class:UpgradeResponseAdapter
Get the list of extensions that should be used for the websocket.- Specified by:
getExtensions
in interfaceUpgradeResponse
- Overrides:
getExtensions
in classUpgradeResponseAdapter
- Returns:
- the list of negotiated extensions to use.
-
sendForbidden
Description copied from class:UpgradeResponseAdapter
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.
- Specified by:
sendForbidden
in interfaceUpgradeResponse
- Overrides:
sendForbidden
in classUpgradeResponseAdapter
- Parameters:
message
- the short 1 line detail message about the forbidden response- Throws:
IOException
- if unable to send the forbidden
-