javax.websocket.server
Interface HandshakeRequest


public interface HandshakeRequest

The handshake request represents the web socket defined Http request that for the opening handshake of a web socket session.

Since:
DRAFT 003
Author:
dannycoward

Field Summary
static String SEC_WEBSOCKET_EXTENSIONS
          The Sec-WebSocket-Extensions header name
static String SEC_WEBSOCKET_KEY
          The Sec-WebSocket-Key header name
static String SEC_WEBSOCKET_PROTOCOL
          The Sec-WebSocket-Protocol header name
static String SEC_WEBSOCKET_VERSION
          The Sec-WebSocket-Version header name
 
Method Summary
 Map<String,List<String>> getHeaders()
          Return the read only Map of Http Headers that came with the handshake request.
 Map<String,List<String>> getParameterMap()
          Return the request parameters associated with the request.
 String getQueryString()
          Return the query string associated with the request.
 URI getRequestURI()
          Return the request URI of the handshake request.
 Object getSession()
          Return a reference to the HttpSession that the web socket handshake that started this conversation was part of, if applicable.
 Principal getUserPrincipal()
          Return the authenticated user or null if no user is authenticated for this handshake.
 boolean isUserInRole(String role)
          Checks whether the current user is in the given role.
 

Field Detail

SEC_WEBSOCKET_KEY

static final String SEC_WEBSOCKET_KEY
The Sec-WebSocket-Key header name

See Also:
Constant Field Values

SEC_WEBSOCKET_PROTOCOL

static final String SEC_WEBSOCKET_PROTOCOL
The Sec-WebSocket-Protocol header name

See Also:
Constant Field Values

SEC_WEBSOCKET_VERSION

static final String SEC_WEBSOCKET_VERSION
The Sec-WebSocket-Version header name

See Also:
Constant Field Values

SEC_WEBSOCKET_EXTENSIONS

static final String SEC_WEBSOCKET_EXTENSIONS
The Sec-WebSocket-Extensions header name

See Also:
Constant Field Values
Method Detail

getHeaders

Map<String,List<String>> getHeaders()
Return the read only Map of Http Headers that came with the handshake request. The header names are case insensitive.

Returns:
the list of headers.

getUserPrincipal

Principal getUserPrincipal()
Return the authenticated user or null if no user is authenticated for this handshake.

Returns:
the user principal.

getRequestURI

URI getRequestURI()
Return the request URI of the handshake request.

Returns:
the request uri of the handshake request.

isUserInRole

boolean isUserInRole(String role)
Checks whether the current user is in the given role.

Parameters:
role - the role being checked
Returns:
whether the user is in the role

getSession

Object getSession()
Return a reference to the HttpSession that the web socket handshake that started this conversation was part of, if applicable.

Returns:
the http session.

getParameterMap

Map<String,List<String>> getParameterMap()
Return the request parameters associated with the request.

Returns:
the unmodifiable map of the request parameters.

getQueryString

String getQueryString()
Return the query string associated with the request.

Returns:
the query string≄



Copyright © 2012-2013 Oracle and/or its affiliates. All rights reserved.