Interface JettyServerUpgradeResponse
- All Superinterfaces:
 UpgradeResponse
- 
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a header value to the response.booleanReturns a boolean indicating if the response has been committed.voidSends an error response to the client using the specified status.voidsendForbidden(String message) Issue a forbidden upgrade response.voidsetAcceptedSubProtocol(String protocol) Set the accepted WebSocket Protocol.voidsetExtensions(List<ExtensionConfig> extensions) Set the list of extensions that are approved for use with this websocket.voidSet a headervoidSet a headervoidsetStatusCode(int statusCode) Set the HTTP Response status codeMethods inherited from interface UpgradeResponse
getAcceptedSubProtocol, getExtensions, getHeader, getHeaderNames, getHeaders, getHeaders, getStatusCode 
- 
Method Details
- 
addHeader
 - 
setHeader
 - 
setHeader
 - 
sendForbidden
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:
 IOException- if unable to send the forbidden
 - 
sendError
Sends an error response to the client using the specified status.- Parameters:
 statusCode- the error status codemessage- the descriptive message- Throws:
 IOException- If an input or output exception occursIllegalStateException- If the response was committed
 - 
setAcceptedSubProtocol
Set the accepted WebSocket Protocol.- Parameters:
 protocol- the protocol to list as accepted
 - 
setExtensions
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 
 - 
setStatusCode
void setStatusCode(int statusCode) Set the HTTP Response status code- Parameters:
 statusCode- the status code
 - 
isCommitted
boolean isCommitted()Returns a boolean indicating if the response has been committed. A committed response has already had its status code and headers written.- Returns:
 - a boolean indicating if the response has been committed.
 
 
 -