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 |
|---|---|
java.lang.Object |
getContextAttribute(java.lang.String name)
Access the ServletContext (if any) attributes.
|
java.lang.String |
getContextInitParameter(java.lang.String name)
Access the ServletContext (if any) init parameter.
|
java.lang.String |
getCookie(java.lang.String name)
Get a transport cookie.
|
java.lang.String |
getHeader(java.lang.String name)
Get a transport header.
|
java.util.List<java.lang.String> |
getHeaderValues(java.lang.String name)
Get a multi valued transport header.
|
java.lang.Object |
getHttpSessionAttribute(java.lang.String name)
Access the HTTP Session (if any) attributes.
|
java.lang.String |
getHttpSessionId()
Access the HTTP Session (if any) ID.
|
java.net.InetSocketAddress |
getLocalAddress() |
java.util.List<java.util.Locale> |
getLocales() |
java.lang.String |
getParameter(java.lang.String name)
Get a transport parameter.
|
java.util.List<java.lang.String> |
getParameterValues(java.lang.String name)
Get a multi valued transport parameter.
|
java.net.InetSocketAddress |
getRemoteAddress() |
java.lang.Object |
getRequestAttribute(java.lang.String name)
Access the Request (if any) attributes.
|
java.lang.String |
getURL() |
java.security.Principal |
getUserPrincipal() |
void |
invalidateHttpSession()
Invalidate the HTTP Session.
|
boolean |
isUserInRole(java.lang.String role) |
void |
setHttpSessionAttribute(java.lang.String name,
java.lang.Object value)
Access the HTTP Session (if any) attributes.
|
java.security.Principal getUserPrincipal()
boolean isUserInRole(java.lang.String role)
role - the role to check whether the user belongs tojava.net.InetSocketAddress getRemoteAddress()
java.net.InetSocketAddress getLocalAddress()
java.lang.String getHeader(java.lang.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 headerjava.util.List<java.lang.String> getHeaderValues(java.lang.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 headerjava.lang.String getParameter(java.lang.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 parameterjava.util.List<java.lang.String> getParameterValues(java.lang.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 parameterjava.lang.String getCookie(java.lang.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 cookiejava.lang.String getHttpSessionId()
Session.getId() should be used in preference to the HTTP Session.java.lang.Object getHttpSessionAttribute(java.lang.String name)
Session.getAttribute(String) should be used in preference to the HTTP Session.name - the attribute namevoid setHttpSessionAttribute(java.lang.String name,
java.lang.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.java.lang.Object getRequestAttribute(java.lang.String name)
name - the attribute namejava.lang.Object getContextAttribute(java.lang.String name)
name - the attribute namejava.lang.String getContextInitParameter(java.lang.String name)
name - the init parameter namejava.lang.String getURL()
java.util.List<java.util.Locale> getLocales()
Copyright © 2008–2019 The CometD Project. All rights reserved.