public abstract class AbstractBayeuxContext extends Object implements BayeuxContext
Constructor and Description |
---|
AbstractBayeuxContext(javax.servlet.ServletContext context,
String uri,
String query,
Map<String,List<String>> headers,
Map<String,List<String>> parameters,
Principal principal,
javax.servlet.http.HttpSession session,
InetSocketAddress local,
InetSocketAddress remote,
List<Locale> locales,
String protocol,
boolean secure) |
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.
|
public AbstractBayeuxContext(javax.servlet.ServletContext context, String uri, String query, Map<String,List<String>> headers, Map<String,List<String>> parameters, Principal principal, javax.servlet.http.HttpSession session, InetSocketAddress local, InetSocketAddress remote, List<Locale> locales, String protocol, boolean secure)
public String getURL()
getURL
in interface BayeuxContext
public String getHeader(String name)
BayeuxContext
Get a header for any current transport mechanism (eg HTTP request). For transports like websocket, the header may be from the initial handshake.
getHeader
in interface BayeuxContext
name
- The name of the headerpublic List<String> getHeaderValues(String name)
BayeuxContext
Get a header for any current transport mechanism (eg HTTP request). For transports like websocket, the header may be from the initial handshake.
getHeaderValues
in interface BayeuxContext
name
- The name of the headerpublic String getParameter(String name)
BayeuxContext
Get a parameter for any current transport mechanism (eg HTTP request). For transports like websocket, the parameter may be from the initial handshake.
getParameter
in interface BayeuxContext
name
- The name of the parameterpublic List<String> getParameterValues(String name)
BayeuxContext
Get a parameter for any current transport mechanism (eg HTTP request). For transports like websocket, the parameter may be from the initial handshake.
getParameterValues
in interface BayeuxContext
name
- The name of the parameterpublic Principal getUserPrincipal()
getUserPrincipal
in interface BayeuxContext
public boolean isUserInRole(String role)
isUserInRole
in interface BayeuxContext
role
- the role to check whether the user belongs topublic String getHttpSessionId()
BayeuxContext
Session.getId()
should be used in preference to the HTTP Session.getHttpSessionId
in interface BayeuxContext
public Object getHttpSessionAttribute(String name)
BayeuxContext
Session.getAttribute(String)
should be used in preference to the HTTP Session.getHttpSessionAttribute
in interface BayeuxContext
name
- the attribute namepublic void setHttpSessionAttribute(String name, Object value)
BayeuxContext
Session.setAttribute(String, Object)
should be used in preference to the HTTP Session.setHttpSessionAttribute
in interface BayeuxContext
name
- the attribute namevalue
- the attribute valuepublic void invalidateHttpSession()
BayeuxContext
Session.getId()
should be used in preference to the HTTP Session.invalidateHttpSession
in interface BayeuxContext
public InetSocketAddress getRemoteAddress()
getRemoteAddress
in interface BayeuxContext
public InetSocketAddress getLocalAddress()
getLocalAddress
in interface BayeuxContext
public List<Locale> getLocales()
getLocales
in interface BayeuxContext
public String getCookie(String name)
BayeuxContext
Get a cookie for any current transport mechanism (eg HTTP request). For transports like websocket, the cookie may be from the initial handshake.
getCookie
in interface BayeuxContext
name
- The name of the cookiepublic Object getRequestAttribute(String name)
BayeuxContext
getRequestAttribute
in interface BayeuxContext
name
- the attribute namepublic Object getContextAttribute(String name)
BayeuxContext
getContextAttribute
in interface BayeuxContext
name
- the attribute namepublic String getContextInitParameter(String name)
BayeuxContext
getContextInitParameter
in interface BayeuxContext
name
- the init parameter namepublic String getContextPath()
getContextPath
in interface BayeuxContext
public String getProtocol()
getProtocol
in interface BayeuxContext
public boolean isSecure()
isSecure
in interface BayeuxContext
Copyright © 2008–2024 The CometD Project. All rights reserved.