public class OsgiHttpServletRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper
This HttpServletRequestWrapper ensures that servlets/filters will always get proper
ServletContext that implements proper, specification-defined delegation of selected methods.
This wrapper also implements security requirements defined in 140.14.2.11 chapter of OSGi CMPN Whiteboard Service and 102.10.2.6 chapter of OSGi CMPN Http Service specs.
If the specified request has been authenticated, this method must set the AUTHENTICATION_TYPE request attribute to the type of authentication used, and the REMOTE_USER request attribute to the remote user (request attributes are set using the setAttribute method on the request). If this method does not perform any authentication, it must not set these attributes. If the authenticated user is also authorized to access certain resources, this method must set the AUTHORIZATION request attribute to the Authorization object obtained from the org.osgi.service.useradmin.UserAdmin service. The servlet responsible for servicing the specified request determines the authentication type and remote user by calling the getAuthType and getRemoteUser methods, respectively, on the request.
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
OsgiHttpServletRequestWrapper(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext context,
OsgiSessionAttributeListener osgiSessionsBridge)
Constructs a request object wrapping the given request.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthType() |
String |
getRemoteUser() |
javax.servlet.ServletContext |
getServletContext() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean create) |
Principal |
getUserPrincipal()
Whiteboard/Http Service say nothing about this method synced with
org.osgi.service.http.authentication.remote.user attribute, so let's not override it. |
void |
setAttribute(String name,
Object o) |
authenticate, changeSessionId, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getTrailerFields, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgradegetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setCharacterEncoding, setRequest, startAsync, startAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setCharacterEncoding, startAsync, startAsyncpublic OsgiHttpServletRequestWrapper(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext context,
OsgiSessionAttributeListener osgiSessionsBridge)
request - the HttpServletRequest to be wrapped.request - context - osgiSessionsBridge - IllegalArgumentException - if the request is nullpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface javax.servlet.ServletRequestgetServletContext in class javax.servlet.ServletRequestWrapperpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestgetSession in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestgetSession in class javax.servlet.http.HttpServletRequestWrapperpublic void setAttribute(String name, Object o)
setAttribute in interface javax.servlet.ServletRequestsetAttribute in class javax.servlet.ServletRequestWrapperpublic String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestgetAuthType in class javax.servlet.http.HttpServletRequestWrapperpublic String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestgetRemoteUser in class javax.servlet.http.HttpServletRequestWrapperpublic Principal getUserPrincipal()
org.osgi.service.http.authentication.remote.user attribute, so let's not override it.getUserPrincipal in interface javax.servlet.http.HttpServletRequestgetUserPrincipal in class javax.servlet.http.HttpServletRequestWrapperCopyright © 2006–2024 OPS4J - Open Participation Software for Java. All rights reserved.