fedora.server.security.servletfilters
Class ExtendedHttpServletRequestWrapper

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by fedora.server.security.servletfilters.ExtendedHttpServletRequestWrapper
All Implemented Interfaces:
ExtendedHttpServletRequest, javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class ExtendedHttpServletRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper
implements ExtendedHttpServletRequest

Author:
Bill Niebel (niebel@virginia.edu)

Field Summary
static java.lang.String AUTHORIZATION
           
static java.lang.String BASIC
           
static java.lang.String FROM
           
 
Fields inherited from interface fedora.server.security.servletfilters.ExtendedHttpServletRequest
FAILED, IMMUTABLE_NULL_SET, SUCCEEDED
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
ExtendedHttpServletRequestWrapper(javax.servlet.http.HttpServletRequest wrappedRequest)
           
 
Method Summary
 void addAttributes(java.lang.String authority, java.util.Map attributes)
           
 void audit()
           
 void auditInnerMap(java.util.Map map)
           
 void auditInnerSet(java.util.Set set)
           
 void auditOuterMap(java.util.Map map, java.lang.String desc)
           
 java.util.Map getAllAttributes()
           
 boolean getAttributeDefined(java.lang.String key)
           
 java.util.Set getAttributeValues(java.lang.String key)
           
 java.lang.String getAuthority()
           
 java.lang.String getAuthorizationHeader()
           
 java.lang.String getFromHeader()
           
 java.lang.String getPassword()
           
 java.lang.String getRealPath(java.lang.String path)
          Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext#getRealPath(java.lang.String).
 java.lang.String getRemoteUser()
           
 java.lang.String getUser()
           
 java.security.Principal getUserPrincipal()
           
 boolean hasAttributeValues(java.lang.String key)
           
 boolean isAttributeDefined(java.lang.String key)
           
 boolean isAuthenticated()
           
 boolean isRequestedSessionIdFromUrl()
          Deprecated. As of Version 2.1 of the Java Servlet API, use HttpServletRequestWrapper.isRequestedSessionIdFromURL().
 boolean isSecure()
           
protected  boolean isSponsoredUserRequested()
           
 boolean isUserSponsored()
           
 void lockSponsoredUser()
           
 void lockWrapper()
           
 void setAuthenticated(java.security.Principal userPrincipal, java.lang.String authority)
           
 void setSponsoredUser()
           
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, removeAttribute, setAttribute, setCharacterEncoding, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, removeAttribute, setAttribute, setCharacterEncoding
 

Field Detail

BASIC

public static final java.lang.String BASIC
See Also:
Constant Field Values

AUTHORIZATION

public static final java.lang.String AUTHORIZATION
See Also:
Constant Field Values

FROM

public static final java.lang.String FROM
See Also:
Constant Field Values
Constructor Detail

ExtendedHttpServletRequestWrapper

public ExtendedHttpServletRequestWrapper(javax.servlet.http.HttpServletRequest wrappedRequest)
                                  throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

lockWrapper

public final void lockWrapper()
                       throws java.lang.Exception
Specified by:
lockWrapper in interface ExtendedHttpServletRequest
Throws:
java.lang.Exception

setSponsoredUser

public void setSponsoredUser()
                      throws java.lang.Exception
Specified by:
setSponsoredUser in interface ExtendedHttpServletRequest
Throws:
java.lang.Exception

lockSponsoredUser

public void lockSponsoredUser()
                       throws java.lang.Exception
Specified by:
lockSponsoredUser in interface ExtendedHttpServletRequest
Throws:
java.lang.Exception

setAuthenticated

public void setAuthenticated(java.security.Principal userPrincipal,
                             java.lang.String authority)
                      throws java.lang.Exception
Specified by:
setAuthenticated in interface ExtendedHttpServletRequest
Throws:
java.lang.Exception

getUserPrincipal

public java.security.Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface javax.servlet.http.HttpServletRequest
Overrides:
getUserPrincipal in class javax.servlet.http.HttpServletRequestWrapper

isUserSponsored

public final boolean isUserSponsored()
Specified by:
isUserSponsored in interface ExtendedHttpServletRequest

isSponsoredUserRequested

protected boolean isSponsoredUserRequested()

isAuthenticated

public final boolean isAuthenticated()
Specified by:
isAuthenticated in interface ExtendedHttpServletRequest

getRemoteUser

public java.lang.String getRemoteUser()
Specified by:
getRemoteUser in interface javax.servlet.http.HttpServletRequest
Overrides:
getRemoteUser in class javax.servlet.http.HttpServletRequestWrapper

auditInnerMap

public final void auditInnerMap(java.util.Map map)

auditInnerSet

public final void auditInnerSet(java.util.Set set)

auditOuterMap

public final void auditOuterMap(java.util.Map map,
                                java.lang.String desc)

audit

public void audit()
Specified by:
audit in interface ExtendedHttpServletRequest

getAttributeDefined

public boolean getAttributeDefined(java.lang.String key)
                            throws AuthzOperationalException
Throws:
AuthzOperationalException

getAttributeValues

public java.util.Set getAttributeValues(java.lang.String key)
                                 throws AuthzOperationalException
Specified by:
getAttributeValues in interface ExtendedHttpServletRequest
Throws:
AuthzOperationalException

hasAttributeValues

public boolean hasAttributeValues(java.lang.String key)
                           throws AuthzOperationalException
Specified by:
hasAttributeValues in interface ExtendedHttpServletRequest
Throws:
AuthzOperationalException

isAttributeDefined

public boolean isAttributeDefined(java.lang.String key)
                           throws AuthzOperationalException
Specified by:
isAttributeDefined in interface ExtendedHttpServletRequest
Throws:
AuthzOperationalException

addAttributes

public void addAttributes(java.lang.String authority,
                          java.util.Map attributes)
                   throws java.lang.Exception
Specified by:
addAttributes in interface ExtendedHttpServletRequest
Throws:
java.lang.Exception

getAllAttributes

public java.util.Map getAllAttributes()
                               throws AuthzOperationalException
Specified by:
getAllAttributes in interface ExtendedHttpServletRequest
Throws:
AuthzOperationalException

getAuthorizationHeader

public final java.lang.String getAuthorizationHeader()

getFromHeader

public final java.lang.String getFromHeader()
Specified by:
getFromHeader in interface ExtendedHttpServletRequest

getUser

public final java.lang.String getUser()
                               throws java.lang.Exception
Specified by:
getUser in interface ExtendedHttpServletRequest
Throws:
java.lang.Exception

getPassword

public final java.lang.String getPassword()
                                   throws java.lang.Exception
Specified by:
getPassword in interface ExtendedHttpServletRequest
Throws:
java.lang.Exception

getAuthority

public final java.lang.String getAuthority()
Specified by:
getAuthority in interface ExtendedHttpServletRequest

getRealPath

@Deprecated
public java.lang.String getRealPath(java.lang.String path)
Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext#getRealPath(java.lang.String).

Specified by:
getRealPath in interface javax.servlet.ServletRequest
Overrides:
getRealPath in class javax.servlet.ServletRequestWrapper

isRequestedSessionIdFromUrl

@Deprecated
public boolean isRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use HttpServletRequestWrapper.isRequestedSessionIdFromURL().

Specified by:
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
Overrides:
isRequestedSessionIdFromUrl in class javax.servlet.http.HttpServletRequestWrapper

isSecure

public boolean isSecure()
Specified by:
isSecure in interface javax.servlet.ServletRequest
Overrides:
isSecure in class javax.servlet.ServletRequestWrapper