Class AbstractBayeuxContext
java.lang.Object
org.cometd.server.websocket.common.AbstractBayeuxContext
- All Implemented Interfaces:
BayeuxContext
-
Constructor Summary
Constructors -
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, ornullif there is no HTTP session.getURL()booleanisSecure()booleanisUserInRole(String role)
-
Constructor Details
-
AbstractBayeuxContext
-
-
Method Details
-
getURL
- Specified by:
getURLin interfaceBayeuxContext- Returns:
- the full request URI complete with query string if present
-
getHeader
- Specified by:
getHeaderin interfaceBayeuxContext- Parameters:
name- the name of the request header- Returns:
- the value of the header, or
nullif there is no such header
-
getHeaderValues
- Specified by:
getHeaderValuesin interfaceBayeuxContext- Parameters:
name- the name of the request header- Returns:
- the values of the header, or
nullif no such header
-
getParameter
- Specified by:
getParameterin interfaceBayeuxContext- Parameters:
name- the name of the query parameter- Returns:
- the value of the query parameter, or
nullif no such parameter
-
getParameterValues
- Specified by:
getParameterValuesin interfaceBayeuxContext- Parameters:
name- the name of the query parameter- Returns:
- the values of the query parameter, or
nullif no such parameter
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfaceBayeuxContext- Returns:
- the user
Principal(if any)
-
isUserInRole
- Specified by:
isUserInRolein 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:
getRemoteAddressin interfaceBayeuxContext- Returns:
- the remote socket address
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceBayeuxContext- Returns:
- the local socket address
-
getLocales
- Specified by:
getLocalesin interfaceBayeuxContext- Returns:
- the request
Locales, in order of preference, or the default serverLocaleif the request does not specify locales
-
getCookie
- Specified by:
getCookiein interfaceBayeuxContext- Parameters:
name- the name of the cookie- Returns:
- the value of the cookie value, or
nullif no such cookie
-
getContextAttribute
- Specified by:
getContextAttributein interfaceBayeuxContext- Parameters:
name- the context attribute name- Returns:
- the context attribute value, or
nullif no such attribute
-
getRequestAttribute
- Specified by:
getRequestAttributein interfaceBayeuxContext- Parameters:
name- the request attribute name- Returns:
- the request attribute value, or
nullif no such attribute
-
getSessionId
Description copied from interface:BayeuxContextReturns the HTTP session id, or
nullif there is no HTTP session.- Specified by:
getSessionIdin interfaceBayeuxContext- Returns:
- the HTTP session id, or
nullif there is no HTTP session
-
getSessionAttribute
Description copied from interface:BayeuxContextReturns an HTTP session attribute value.
Session.getAttribute(String)should be used to retrieve attribute values in session scope.- Specified by:
getSessionAttributein interfaceBayeuxContext- Parameters:
name- the HTTP session attribute name- Returns:
- the HTTP session attribute value, or
nullif no such attribute
-
getContextPath
- Specified by:
getContextPathin interfaceBayeuxContext- Returns:
- the web application context path
-
getProtocol
- Specified by:
getProtocolin interfaceBayeuxContext- Returns:
- a string containing the protocol name and version number
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfaceBayeuxContext- Returns:
- whether the request was made over a secure transport
-