public class ServletUpgradeResponse extends UpgradeResponse
SEC_WEBSOCKET_PROTOCOL| Constructor and Description |
|---|
ServletUpgradeResponse(HttpServletResponse response) |
| Modifier and Type | Method and Description |
|---|---|
void |
complete() |
int |
getStatusCode() |
String |
getStatusReason() |
boolean |
isCommitted() |
boolean |
isExtensionsNegotiated() |
boolean |
isSubprotocolNegotiated() |
void |
sendError(int statusCode,
String message) |
void |
sendForbidden(String message)
Issue a forbidden upgrade response.
|
void |
setAcceptedSubProtocol(String protocol)
Set the accepted WebSocket Protocol.
|
void |
setExtensions(List<ExtensionConfig> extensions)
Set the list of extensions that are approved for use with this websocket.
|
void |
setStatus(int status) |
addHeader, getAcceptedSubProtocol, getExtensions, getHeader, getHeaderNames, getHeaders, getHeaders, isSuccess, setHeader, setStatusCode, setStatusReason, setSuccesspublic ServletUpgradeResponse(HttpServletResponse response)
public int getStatusCode()
getStatusCode in class UpgradeResponsepublic void setStatus(int status)
public String getStatusReason()
getStatusReason in class UpgradeResponsepublic boolean isCommitted()
public boolean isExtensionsNegotiated()
public boolean isSubprotocolNegotiated()
public void sendError(int statusCode,
String message)
throws IOException
IOExceptionpublic void sendForbidden(String message) throws IOException
UpgradeResponseThis 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.
sendForbidden in class UpgradeResponsemessage - the short 1 line detail message about the forbidden responseIOExceptionpublic void setAcceptedSubProtocol(String protocol)
UpgradeResponsesetAcceptedSubProtocol in class UpgradeResponseprotocol - the protocol to list as acceptedpublic void setExtensions(List<ExtensionConfig> extensions)
UpgradeResponseNotes:
UpgradeRequest, just remove entries you don't want to usesetExtensions in class UpgradeResponseextensions - the list of extensions to use.public void complete()
Copyright © 1995-2015 Webtide. All Rights Reserved.