Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.securityfilter.filter
Class SecurityRequestWrapper  view SecurityRequestWrapper download SecurityRequestWrapper.java

java.lang.Object
  extended byjavax.servlet.ServletRequestWrapper
      extended byjavax.servlet.http.HttpServletRequestWrapper
          extended byorg.securityfilter.filter.SecurityRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class SecurityRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper

SecurityRequestWrapper

Version:
$Revision: 1.9 $ $Date: 2003/07/07 13:12:57 $

Field Summary
private  java.lang.String authType
           
private  javax.servlet.http.HttpServletRequest currentRequest
           
private  java.lang.String matchableURL
           
static java.lang.String PRINCIPAL_SESSION_KEY
           
private  org.securityfilter.realm.SecurityRealmInterface realm
           
private  SavedRequest savedRequest
           
 
Fields inherited from class javax.servlet.ServletRequestWrapper
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
SecurityRequestWrapper(javax.servlet.http.HttpServletRequest request, SavedRequest savedRequest, org.securityfilter.realm.SecurityRealmInterface realm, java.lang.String authType)
          Construct a new SecurityRequestWrapper.
 
Method Summary
 java.lang.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.
 java.lang.String getMatchableURL()
          Get a URL that can be matched against security URL patterns.
 java.lang.String getMethod()
          Returns the HTTP method used to make this request.
 java.lang.String getParameter(java.lang.String s)
          Get a parameter value by name.
 java.util.Map getParameterMap()
          Get a map of parameter values for this request.
 java.util.Enumeration getParameterNames()
          Get an enumeration of paramaeter names for this request.
 java.lang.String[] getParameterValues(java.lang.String s)
          Get an array of values for a parameter.
 java.lang.String getRemoteUser()
          Get the remote user's login name
 java.security.Principal getUserPrincipal()
          Get a Principal object for the current user.
private  void initMatchableURL()
          Initilize the matchableURL.
 boolean isUserInRole(java.lang.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(java.security.Principal principal)
          Set the username of the current user.
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid
 
Methods inherited from class javax.servlet.ServletRequestWrapper
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Field Detail

PRINCIPAL_SESSION_KEY

public static final java.lang.String PRINCIPAL_SESSION_KEY

currentRequest

private javax.servlet.http.HttpServletRequest currentRequest

realm

private org.securityfilter.realm.SecurityRealmInterface realm

savedRequest

private SavedRequest savedRequest

authType

private java.lang.String authType

matchableURL

private java.lang.String matchableURL
Constructor Detail

SecurityRequestWrapper

public SecurityRequestWrapper(javax.servlet.http.HttpServletRequest request,
                              SavedRequest savedRequest,
                              org.securityfilter.realm.SecurityRealmInterface realm,
                              java.lang.String authType)
Construct a new SecurityRequestWrapper.

Method Detail

getCurrentRequest

public javax.servlet.http.HttpServletRequest getCurrentRequest()
Get the original HttpServletRequest object.


getParameter

public java.lang.String getParameter(java.lang.String s)
Get a parameter value by name. If multiple values are available, the first value is returned.


getParameterMap

public java.util.Map getParameterMap()
Get a map of parameter values for this request.


getParameterNames

public java.util.Enumeration getParameterNames()
Get an enumeration of paramaeter names for this request.


getParameterValues

public java.lang.String[] getParameterValues(java.lang.String s)
Get an array of values for a parameter.


setRequest

public void setRequest(javax.servlet.ServletRequest request)
Set the request that is to be wrapped.


isUserInRole

public boolean isUserInRole(java.lang.String role)
Check if a user is in a role.


getRemoteUser

public java.lang.String getRemoteUser()
Get the remote user's login name


getUserPrincipal

public java.security.Principal getUserPrincipal()
Get a Principal object for the current user.


getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
This method is provided to restore functionality of this method in case the wrapper class we are extending has disabled it. This method is needed to process multi-part requests downstream, and it appears that some wrapper implementations just return null. WebLogic 6.1.2.0 is one such implementation.


setUserPrincipal

public void setUserPrincipal(java.security.Principal principal)
Set the username of the current user. WARNING: Calling this method will set the user for this session -- authenticate the user before calling this method.


getAuthType

public java.lang.String getAuthType()
Returns the auth type (e.g. FORM, BASIC, etc.).


getMethod

public java.lang.String getMethod()
Returns the HTTP method used to make this request. If the savedRequest is non-null, the HTTP method of the saved request will be returned.


getMatchableURL

public java.lang.String getMatchableURL()
Get a URL that can be matched against security URL patterns. This is the part after the contextPath, with the pathInfo, but without the query string. http://server:8080/contextPath/someURL.jsp?param=value becomes /someURL.jsp


initMatchableURL

private void initMatchableURL()
Initilize the matchableURL.