Interface BayeuxContext
- All Known Implementing Classes:
AbstractBayeuxContext
public interface BayeuxContext
The Bayeux Context provides information about the current context of a Bayeux message.
This information may be from an associated HTTP request, or from a HTTP request originally used to establish the connection to the server (for example in a WebSocket upgrade).
-
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)
-
Method Details
-
getUserPrincipal
-
isUserInRole
- 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
SocketAddress getRemoteAddress()- Returns:
- the remote socket address
-
getLocalAddress
SocketAddress getLocalAddress()- Returns:
- the local socket address
-
getHeader
-
getHeaderValues
-
getParameter
-
getParameterValues
-
getCookie
-
getContextAttribute
-
getRequestAttribute
-
getSessionId
String getSessionId()Returns the HTTP session id, or
null
if there is no HTTP session.- Returns:
- the HTTP session id, or
null
if there is no HTTP session
-
getSessionAttribute
Returns an HTTP session attribute value.
Session.getAttribute(String)
should be used to retrieve attribute values in session scope.- Parameters:
name
- the HTTP session attribute name- Returns:
- the HTTP session attribute value, or
null
if no such attribute
-
getContextPath
String getContextPath()- Returns:
- the web application context path
-
getURL
String getURL()- Returns:
- the full request URI complete with query string if present
-
getLocales
-
getProtocol
String getProtocol()- Returns:
- a string containing the protocol name and version number
-
isSecure
boolean isSecure()- Returns:
- whether the request was made over a secure transport
-