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, setSuccess
public ServletUpgradeResponse(HttpServletResponse response)
public int getStatusCode()
getStatusCode
in class UpgradeResponse
public void setStatus(int status)
public String getStatusReason()
getStatusReason
in class UpgradeResponse
public boolean isCommitted()
public boolean isExtensionsNegotiated()
public boolean isSubprotocolNegotiated()
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 setAcceptedSubProtocol(String protocol)
UpgradeResponse
setAcceptedSubProtocol
in class UpgradeResponse
protocol
- the protocol to list as acceptedpublic void setExtensions(List<ExtensionConfig> extensions)
UpgradeResponse
Notes:
UpgradeRequest
, just remove entries you don't want to usesetExtensions
in class UpgradeResponse
extensions
- the list of extensions to use.public void complete()
Copyright © 1995-2015 Webtide. All Rights Reserved.