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 a HTTP request used to originally establish the connection (for example in a websocket handshake).
Modifier and Type | Method and Description |
---|---|
Object |
getContextAttribute(String name)
Access the ServletContext (if any) attributes.
|
String |
getContextInitParameter(String name)
Access the ServletContext (if any) init parameter.
|
String |
getContextPath() |
String |
getCookie(String name)
Get a transport cookie.
|
String |
getHeader(String name)
Get a transport header.
|
List<String> |
getHeaderValues(String name)
Get a multi valued transport header.
|
Object |
getHttpSessionAttribute(String name)
Access the HTTP Session (if any) attributes.
|
String |
getHttpSessionId()
Access the HTTP Session (if any) ID.
|
InetSocketAddress |
getLocalAddress() |
List<Locale> |
getLocales() |
String |
getParameter(String name)
Get a transport parameter.
|
List<String> |
getParameterValues(String name)
Get a multi valued transport parameter.
|
String |
getProtocol() |
InetSocketAddress |
getRemoteAddress() |
Object |
getRequestAttribute(String name)
Access the Request (if any) attributes.
|
String |
getURL() |
Principal |
getUserPrincipal() |
void |
invalidateHttpSession()
Invalidate the HTTP Session.
|
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
void |
setHttpSessionAttribute(String name,
Object value)
Access the HTTP Session (if any) attributes.
|
Principal getUserPrincipal()
boolean isUserInRole(String role)
role
- the role to check whether the user belongs toInetSocketAddress getRemoteAddress()
InetSocketAddress getLocalAddress()
String getHeader(String name)
Get a header for any current transport mechanism (eg HTTP request). For transports like websocket, the header may be from the initial handshake.
name
- The name of the headerList<String> getHeaderValues(String name)
Get a header for any current transport mechanism (eg HTTP request). For transports like websocket, the header may be from the initial handshake.
name
- The name of the headerString getParameter(String name)
Get a parameter for any current transport mechanism (eg HTTP request). For transports like websocket, the parameter may be from the initial handshake.
name
- The name of the parameterList<String> getParameterValues(String name)
Get a parameter for any current transport mechanism (eg HTTP request). For transports like websocket, the parameter may be from the initial handshake.
name
- The name of the parameterString getCookie(String name)
Get a cookie for any current transport mechanism (eg HTTP request). For transports like websocket, the cookie may be from the initial handshake.
name
- The name of the cookieString getHttpSessionId()
Session.getId()
should be used in preference to the HTTP Session.Object getHttpSessionAttribute(String name)
Session.getAttribute(String)
should be used in preference to the HTTP Session.name
- the attribute namevoid setHttpSessionAttribute(String name, Object value)
Session.setAttribute(String, Object)
should be used in preference to the HTTP Session.name
- the attribute namevalue
- the attribute valuevoid invalidateHttpSession()
Session.getId()
should be used in preference to the HTTP Session.Object getRequestAttribute(String name)
name
- the attribute nameObject getContextAttribute(String name)
name
- the attribute nameString getContextInitParameter(String name)
name
- the init parameter nameString getContextPath()
String getURL()
List<Locale> getLocales()
String getProtocol()
boolean isSecure()
Copyright © 2008–2024 The CometD Project. All rights reserved.