public class ServletWebSocketResponse extends UpgradeResponse
SEC_WEBSOCKET_PROTOCOL
Constructor and Description |
---|
ServletWebSocketResponse(HttpServletResponse resp) |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
String value) |
int |
getStatusCode() |
String |
getStatusReason() |
boolean |
isCommitted() |
void |
sendError(int statusCode,
String message) |
void |
sendForbidden(String message)
Issue a forbidden upgrade response.
|
void |
setHeader(String name,
String value) |
void |
setStatus(int status) |
getAcceptedSubProtocol, getExtensions, getHeader, getHeaderNames, getHeaders, getHeaders, isSuccess, setAcceptedSubProtocol, setExtensions, setStatusCode, setStatusReason, setSuccess
public ServletWebSocketResponse(HttpServletResponse resp)
public void addHeader(String name, String value)
addHeader
in class UpgradeResponse
public int getStatusCode()
getStatusCode
in class UpgradeResponse
public String getStatusReason()
getStatusReason
in class UpgradeResponse
public boolean isCommitted()
public void sendError(int statusCode, String message) throws IOException
IOException
public void sendForbidden(String message) throws IOException
UpgradeResponse
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.
sendForbidden
in class UpgradeResponse
message
- the short 1 line detail message about the forbidden responseIOException
public void setHeader(String name, String value)
setHeader
in class UpgradeResponse
public void setStatus(int status)
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.