public final class RequestContext extends Object implements javax.websocket.server.HandshakeRequest, SPIHandshakeRequest, WebSocketRequest
| Modifier and Type | Class and Description |
|---|---|
static class |
RequestContext.Builder
RequestContext builder. |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection() |
String |
getFirstHeaderValue(String name)
Gets the first header value from the
List of header values corresponding to the name. |
String |
getHeader(String name)
Returns the header value corresponding to the name.
|
Map<String,List<String>> |
getHeaders()
Get headers.
|
Object |
getHttpSession() |
Map<String,List<String>> |
getParameterMap() |
String |
getQueryString() |
String |
getRequestPath() |
String |
getRequestUri() |
URI |
getRequestURI() |
Principal |
getUserPrincipal() |
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
void |
lock()
Make headers and parameter map read-only.
|
void |
putSingleHeader(String headerName,
String headerValue) |
void |
setRequestPath(String requestPath) |
public Map<String,List<String>> getHeaders()
getHeaders in interface javax.websocket.server.HandshakeRequestgetHeaders in interface WebSocketRequestpublic String getHeader(String name)
getHeader in interface SPIHandshakeRequestgetHeader in interface WebSocketRequestname - header name.List of header values iff found, null otherwise.public String getFirstHeaderValue(String name)
List of header values corresponding to the name.getFirstHeaderValue in interface WebSocketRequestname - header name.String value iff it exists, null otherwise.public void lock()
public void putSingleHeader(String headerName, String headerValue)
putSingleHeader in interface WebSocketRequestpublic String getRequestPath()
getRequestPath in interface WebSocketRequestpublic void setRequestPath(String requestPath)
setRequestPath in interface WebSocketRequestpublic Principal getUserPrincipal()
getUserPrincipal in interface javax.websocket.server.HandshakeRequestgetUserPrincipal in interface SPIHandshakeRequestpublic URI getRequestURI()
getRequestURI in interface javax.websocket.server.HandshakeRequestgetRequestURI in interface WebSocketRequestpublic boolean isUserInRole(String role)
isUserInRole in interface javax.websocket.server.HandshakeRequestpublic Object getHttpSession()
getHttpSession in interface javax.websocket.server.HandshakeRequestpublic Map<String,List<String>> getParameterMap()
getParameterMap in interface javax.websocket.server.HandshakeRequestgetParameterMap in interface SPIHandshakeRequestgetParameterMap in interface WebSocketRequestpublic String getQueryString()
getQueryString in interface javax.websocket.server.HandshakeRequestgetQueryString in interface SPIHandshakeRequestgetQueryString in interface WebSocketRequestpublic String getRequestUri()
getRequestUri in interface SPIHandshakeRequestpublic boolean isSecure()
isSecure in interface SPIHandshakeRequestisSecure in interface WebSocketRequestpublic Connection getConnection()
getConnection in interface WebSocketRequestCopyright © 2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.