uPortal 2.4.1
API Documentation

org.jasig.portal.container.servlet
Class ServletRequestImpl

java.lang.Object
  extended byjavax.servlet.ServletRequestWrapper
      extended byjavax.servlet.http.HttpServletRequestWrapper
          extended byorg.jasig.portal.container.servlet.ServletRequestImpl
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class ServletRequestImpl
extends javax.servlet.http.HttpServletRequestWrapper

A wrapper of the real HttpServletRequest that allows modification of the request parameters and a uPortal implementation of security methods.

uPortal's IPerson and GroupService are used to determine the remote user its role memberships in the case that the container does not know.

Version:
$Revision: 1.13 $
Author:
Ken Weiner, kweiner@unicon.net

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
ServletRequestImpl(javax.servlet.http.HttpServletRequest request)
           
ServletRequestImpl(javax.servlet.http.HttpServletRequest request, IPerson person, org.apache.pluto.om.common.SecurityRoleRefSet securityRoleRefs)
           
 
Method Summary
 java.lang.String getParameter(java.lang.String name)
           
 java.util.Map getParameterMap()
           
 java.util.Enumeration getParameterNames()
           
 java.lang.String[] getParameterValues(java.lang.String name)
           
 java.lang.String getRemoteUser()
          Returns the remote user from the real HttpServletRequest if it is available.
 java.security.Principal getUserPrincipal()
          Returns the user principal from the real HttpServletRequest if it is available.
 boolean isUserInRole(java.lang.String role)
          Determines whether or not the user is in the given role.
 void setParameters(java.util.Map parameters)
          Replaces the existing request parameters with a new set of parameters.
 
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, isRequestedSessionIdFromURL, isRequestedSessionIdValid
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Constructor Detail

ServletRequestImpl

public ServletRequestImpl(javax.servlet.http.HttpServletRequest request)

ServletRequestImpl

public ServletRequestImpl(javax.servlet.http.HttpServletRequest request,
                          IPerson person,
                          org.apache.pluto.om.common.SecurityRoleRefSet securityRoleRefs)
Method Detail

getParameter

public java.lang.String getParameter(java.lang.String name)

getParameterMap

public java.util.Map getParameterMap()

getParameterNames

public java.util.Enumeration getParameterNames()

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)

setParameters

public void setParameters(java.util.Map parameters)
Replaces the existing request parameters with a new set of parameters.

Parameters:
parameters - the new parameters

getRemoteUser

public java.lang.String getRemoteUser()
Returns the remote user from the real HttpServletRequest if it is available. If it is not available, the username of the user will be returned provided that the user is authenticated. If not authenticated, then null will be returned.

Returns:
the name of the remote user or null

getUserPrincipal

public java.security.Principal getUserPrincipal()
Returns the user principal from the real HttpServletRequest if it is available. If it is not available, the principal representing the user will be returned provided that the user is authenticated. If not authenticated, then null will be returned.

Returns:
the user principal or null

isUserInRole

public boolean isUserInRole(java.lang.String role)
Determines whether or not the user is in the given role. The uPortal GroupService shall be used to represent the given role as a uPortal IGroupMember. Therefore, the role must be in the form of a uPortal group key such as local.0 or pags.students.

Parameters:
role - the role of the user
Returns:
true is the user is in the given role, otherwise false

uPortal 2.4.1
API Documentation