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, isRequestedSessionIdValid
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
public 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.ServletRequest
getParameter
in class javax.servlet.ServletRequestWrapper
s
- parameter namepublic Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
getParameterMap
in class javax.servlet.ServletRequestWrapper
public Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
getParameterNames
in class javax.servlet.ServletRequestWrapper
public String[] getParameterValues(String s)
getParameterValues
in interface javax.servlet.ServletRequest
getParameterValues
in class javax.servlet.ServletRequestWrapper
s
- parameter namepublic void setRequest(javax.servlet.ServletRequest request)
setRequest
in class javax.servlet.ServletRequestWrapper
request
- wrap this requestpublic boolean isUserInRole(String role)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
isUserInRole
in class javax.servlet.http.HttpServletRequestWrapper
role
- name of role to checkpublic String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
getRemoteUser
in class javax.servlet.http.HttpServletRequestWrapper
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
getUserPrincipal
in class javax.servlet.http.HttpServletRequestWrapper
public javax.servlet.ServletInputStream getInputStream() throws IOException
getInputStream
in interface javax.servlet.ServletRequest
getInputStream
in class javax.servlet.ServletRequestWrapper
IOException
public void setUserPrincipal(Principal principal)
principal
- the user Principal objectpublic String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
getAuthType
in class javax.servlet.http.HttpServletRequestWrapper
public String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
getMethod
in class javax.servlet.http.HttpServletRequestWrapper
public String getMatchableURL()
Copyright © 2020 B3Partners B.V.. All rights reserved.