public final class RequestContext extends UpgradeRequest
| Modifier and Type | Class and Description |
|---|---|
static class |
RequestContext.Builder
RequestContext builder. |
AUTHORIZATION, CLUSTER_CONNECTION_ID_HEADER, CONNECTION, ENABLE_TRACING_HEADER, HOST, ORIGIN_HEADER, RESPONSE_CODE_MESSAGE, SEC_WS_ORIGIN_HEADER, SERVER_KEY_HASH, TRACING_THRESHOLD, UPGRADE, WEBSOCKETSEC_WEBSOCKET_EXTENSIONS, SEC_WEBSOCKET_KEY, SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION| Modifier and Type | Method and Description |
|---|---|
String |
getHeader(String name)
Returns the header value corresponding to the name.
|
Map<String,List<String>> |
getHeaders()
Get headers.
|
Object |
getHttpSession()
Return a reference to the HttpSession that the web socket handshake that
started this conversation was part of, if the implementation
is part of a Java EE web container.
|
Map<String,List<String>> |
getParameterMap()
Return the request parameters associated with the request.
|
String |
getQueryString()
Return the query string associated with the request.
|
String |
getRemoteAddr()
Get the Internet Protocol (IP) address of the client or last proxy that sent the request.
|
String |
getRequestUri()
Get the undecoded request uri (up to the query string) of underlying
HTTP handshake request.
|
URI |
getRequestURI()
Return the request URI of the handshake request.
|
Principal |
getUserPrincipal()
Return the authenticated user or
null if no user is authenticated
for this handshake. |
boolean |
isSecure()
Indicates whether this request was made using a secure channel
(such as HTTPS).
|
boolean |
isUserInRole(String role)
Checks whether the current user is in the given role.
|
void |
lock()
Make headers and parameter map read-only.
|
public Map<String,List<String>> getHeaders()
public String getHeader(String name)
getHeader in class UpgradeRequestname - header name.List of header values iff found, null otherwise.public void lock()
public Principal getUserPrincipal()
HandshakeRequestnull if no user is authenticated
for this handshake.public URI getRequestURI()
HandshakeRequestpublic boolean isUserInRole(String role)
HandshakeRequestfalse.role - the role being checked.public Object getHttpSession()
HandshakeRequestnull if either the websocket
implementation is not part of a Java EE web container, or there is
no HttpSession associated with the opening handshake request.public Map<String,List<String>> getParameterMap()
HandshakeRequestpublic String getQueryString()
HandshakeRequestpublic String getRequestUri()
UpgradeRequestgetRequestUri in class UpgradeRequestpublic boolean isSecure()
UpgradeRequestisSecure in class UpgradeRequestCopyright © 2012-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.