public class SecurityRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper
| Modifier and Type | Field and Description |
|---|---|
static String |
PRINCIPAL_SESSION_KEY |
| Constructor and Description |
|---|
SecurityRequestWrapper(javax.servlet.http.HttpServletRequest request,
SavedRequest savedRequest,
SecurityRealmInterface realm,
String authType)
Construct a new SecurityRequestWrapper.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthType()
Returns the auth type (e.g.
|
javax.servlet.http.HttpServletRequest |
getCurrentRequest()
Get the original HttpServletRequest object.
|
javax.servlet.ServletInputStream |
getInputStream()
This method is provided to restore functionality of this method in case the wrapper class we are extending
has disabled it.
|
String |
getMatchableURL()
Get a URL that can be matched against security URL patterns.
|
String |
getMethod()
Returns the HTTP method used to make this request.
|
String |
getParameter(String s)
Get a parameter value by name.
|
Map |
getParameterMap()
Get a map of parameter values for this request.
|
Enumeration |
getParameterNames()
Get an enumeration of paramaeter names for this request.
|
String[] |
getParameterValues(String s)
Get an array of values for a parameter.
|
String |
getRemoteUser()
Get the remote user's login name
|
Principal |
getUserPrincipal()
Get a Principal object for the current user.
|
boolean |
isUserInRole(String role)
Check if a user is in a role.
|
void |
setRequest(javax.servlet.ServletRequest request)
Set the request that is to be wrapped.
|
void |
setUserPrincipal(Principal principal)
Set the username of the current user.
|
getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValidgetAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncodingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncodingpublic static final String PRINCIPAL_SESSION_KEY
public SecurityRequestWrapper(javax.servlet.http.HttpServletRequest request,
SavedRequest savedRequest,
SecurityRealmInterface realm,
String authType)
request - the request to wraprealm - the SecurityRealmInterface implementationsavedRequest - SavedRequest (usually null, unless this is the request
that invoked the authorization sequence)public javax.servlet.http.HttpServletRequest getCurrentRequest()
public String getParameter(String s)
getParameter in interface javax.servlet.ServletRequestgetParameter in class javax.servlet.ServletRequestWrappers - parameter namepublic Map getParameterMap()
getParameterMap in interface javax.servlet.ServletRequestgetParameterMap in class javax.servlet.ServletRequestWrapperpublic Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestgetParameterNames in class javax.servlet.ServletRequestWrapperpublic String[] getParameterValues(String s)
getParameterValues in interface javax.servlet.ServletRequestgetParameterValues in class javax.servlet.ServletRequestWrappers - parameter namepublic void setRequest(javax.servlet.ServletRequest request)
setRequest in class javax.servlet.ServletRequestWrapperrequest - wrap this requestpublic boolean isUserInRole(String role)
isUserInRole in interface javax.servlet.http.HttpServletRequestisUserInRole in class javax.servlet.http.HttpServletRequestWrapperrole - name of role to checkpublic String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestgetRemoteUser in class javax.servlet.http.HttpServletRequestWrapperpublic Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestgetUserPrincipal in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.ServletInputStream getInputStream()
throws IOException
getInputStream in interface javax.servlet.ServletRequestgetInputStream in class javax.servlet.ServletRequestWrapperIOExceptionpublic void setUserPrincipal(Principal principal)
principal - the user Principal objectpublic String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestgetAuthType in class javax.servlet.http.HttpServletRequestWrapperpublic String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestgetMethod in class javax.servlet.http.HttpServletRequestWrapperpublic String getMatchableURL()
Copyright © 2020 B3Partners B.V.. All rights reserved.