Class AbstractBayeuxContext
java.lang.Object
org.cometd.server.websocket.common.AbstractBayeuxContext
- All Implemented Interfaces:
BayeuxContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetContextAttribute
(String name) getHeaderValues
(String name) getParameter
(String name) getParameterValues
(String name) getRequestAttribute
(String name) getSessionAttribute
(String name) Returns an HTTP session attribute value.Returns the HTTP session id, ornull
if there is no HTTP session.getURL()
boolean
isSecure()
boolean
isUserInRole
(String role)
-
Constructor Details
-
AbstractBayeuxContext
-
-
Method Details
-
getURL
- Specified by:
getURL
in interfaceBayeuxContext
- Returns:
- the full request URI complete with query string if present
-
getHeader
- Specified by:
getHeader
in interfaceBayeuxContext
- Parameters:
name
- the name of the request header- Returns:
- the value of the header, or
null
if there is no such header
-
getHeaderValues
- Specified by:
getHeaderValues
in interfaceBayeuxContext
- Parameters:
name
- the name of the request header- Returns:
- the values of the header, or
null
if no such header
-
getParameter
- Specified by:
getParameter
in interfaceBayeuxContext
- Parameters:
name
- the name of the query parameter- Returns:
- the value of the query parameter, or
null
if no such parameter
-
getParameterValues
- Specified by:
getParameterValues
in interfaceBayeuxContext
- Parameters:
name
- the name of the query parameter- Returns:
- the values of the query parameter, or
null
if no such parameter
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfaceBayeuxContext
- Returns:
- the user
Principal
(if any)
-
isUserInRole
- Specified by:
isUserInRole
in interfaceBayeuxContext
- Parameters:
role
- the role to check whether the user belongs to- Returns:
- true if there is a known user and they are in the given role
-
getRemoteAddress
- Specified by:
getRemoteAddress
in interfaceBayeuxContext
- Returns:
- the remote socket address
-
getLocalAddress
- Specified by:
getLocalAddress
in interfaceBayeuxContext
- Returns:
- the local socket address
-
getLocales
- Specified by:
getLocales
in interfaceBayeuxContext
- Returns:
- the request
Locale
s, in order of preference, or the default serverLocale
if the request does not specify locales
-
getCookie
- Specified by:
getCookie
in interfaceBayeuxContext
- Parameters:
name
- the name of the cookie- Returns:
- the value of the cookie value, or
null
if no such cookie
-
getContextAttribute
- Specified by:
getContextAttribute
in interfaceBayeuxContext
- Parameters:
name
- the context attribute name- Returns:
- the context attribute value, or
null
if no such attribute
-
getRequestAttribute
- Specified by:
getRequestAttribute
in interfaceBayeuxContext
- Parameters:
name
- the request attribute name- Returns:
- the request attribute value, or
null
if no such attribute
-
getSessionId
Description copied from interface:BayeuxContext
Returns the HTTP session id, or
null
if there is no HTTP session.- Specified by:
getSessionId
in interfaceBayeuxContext
- Returns:
- the HTTP session id, or
null
if there is no HTTP session
-
getSessionAttribute
Description copied from interface:BayeuxContext
Returns an HTTP session attribute value.
Session.getAttribute(String)
should be used to retrieve attribute values in session scope.- Specified by:
getSessionAttribute
in interfaceBayeuxContext
- Parameters:
name
- the HTTP session attribute name- Returns:
- the HTTP session attribute value, or
null
if no such attribute
-
getContextPath
- Specified by:
getContextPath
in interfaceBayeuxContext
- Returns:
- the web application context path
-
getProtocol
- Specified by:
getProtocol
in interfaceBayeuxContext
- Returns:
- a string containing the protocol name and version number
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfaceBayeuxContext
- Returns:
- whether the request was made over a secure transport
-