org.apache.pluto.core
Class DefaultRequestAttributeService

java.lang.Object
  extended by org.apache.pluto.core.DefaultRequestAttributeService
All Implemented Interfaces:
RequestAttributeService

public class DefaultRequestAttributeService
extends java.lang.Object
implements RequestAttributeService

Delegates request attribute storage and retrieval to the passed HttpServletRequest. Also includes logic for retrieving and filtering the PortletRequest.USER_INFO Map in createUserInfoMap(PortletRequest, PortletWindow)

Version:
$Revision$
Author:
Eric Dalquist

Constructor Summary
DefaultRequestAttributeService()
           
DefaultRequestAttributeService(OptionalContainerServices optionalContainerServices)
           
 
Method Summary
protected  java.util.Map createUserInfoMap(javax.portlet.PortletRequest portletRequest, PortletWindow portletWindow)
          Retrieves the UserInfoService from the OptionalContainerServices, gets the user-info Map and fitlers it for the attributes in the portlet descriptor.
protected  java.lang.String encodeAttributeName(PortletWindow portletWindow, java.lang.String name)
          Encodes the attribute name using the portlet window id if it is not reserved
 java.lang.Object getAttribute(javax.portlet.PortletRequest portletRequest, javax.servlet.http.HttpServletRequest httpServletRequest, PortletWindow portletWindow, java.lang.String name)
          Retrieve the named attribute for the HttpServletRequest and PortletWindow
 java.util.Enumeration getAttributeNames(javax.portlet.PortletRequest portletRequest, javax.servlet.http.HttpServletRequest httpServletRequest, PortletWindow portletWindow)
          Get an Enumeration of all available attribute names for the HttpServletRequest and PortletWindow
 OptionalContainerServices getOptionalContainerServices()
           
protected  boolean isNameReserved(java.lang.String name)
          Is this attribute name a reserved name (by the J2EE spec)?.
 void removeAttribute(javax.portlet.PortletRequest portletRequest, javax.servlet.http.HttpServletRequest httpServletRequest, PortletWindow portletWindow, java.lang.String name)
          Remove a named attribute for the HttpServletRequest and PortletWindow
 void setAttribute(javax.portlet.PortletRequest portletRequest, javax.servlet.http.HttpServletRequest httpServletRequest, PortletWindow portletWindow, java.lang.String name, java.lang.Object value)
          Set an attribute for the HttpServletRequest and PortletWindow
 void setOptionalContainerServices(OptionalContainerServices optionalContainerServices)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRequestAttributeService

public DefaultRequestAttributeService()

DefaultRequestAttributeService

public DefaultRequestAttributeService(OptionalContainerServices optionalContainerServices)
Method Detail

getOptionalContainerServices

public OptionalContainerServices getOptionalContainerServices()

setOptionalContainerServices

public void setOptionalContainerServices(OptionalContainerServices optionalContainerServices)

getAttribute

public java.lang.Object getAttribute(javax.portlet.PortletRequest portletRequest,
                                     javax.servlet.http.HttpServletRequest httpServletRequest,
                                     PortletWindow portletWindow,
                                     java.lang.String name)
Description copied from interface: RequestAttributeService
Retrieve the named attribute for the HttpServletRequest and PortletWindow

Specified by:
getAttribute in interface RequestAttributeService

getAttributeNames

public java.util.Enumeration getAttributeNames(javax.portlet.PortletRequest portletRequest,
                                               javax.servlet.http.HttpServletRequest httpServletRequest,
                                               PortletWindow portletWindow)
Description copied from interface: RequestAttributeService
Get an Enumeration of all available attribute names for the HttpServletRequest and PortletWindow

Specified by:
getAttributeNames in interface RequestAttributeService

removeAttribute

public void removeAttribute(javax.portlet.PortletRequest portletRequest,
                            javax.servlet.http.HttpServletRequest httpServletRequest,
                            PortletWindow portletWindow,
                            java.lang.String name)
Description copied from interface: RequestAttributeService
Remove a named attribute for the HttpServletRequest and PortletWindow

Specified by:
removeAttribute in interface RequestAttributeService

setAttribute

public void setAttribute(javax.portlet.PortletRequest portletRequest,
                         javax.servlet.http.HttpServletRequest httpServletRequest,
                         PortletWindow portletWindow,
                         java.lang.String name,
                         java.lang.Object value)
Description copied from interface: RequestAttributeService
Set an attribute for the HttpServletRequest and PortletWindow

Specified by:
setAttribute in interface RequestAttributeService

isNameReserved

protected boolean isNameReserved(java.lang.String name)
Is this attribute name a reserved name (by the J2EE spec)?. Reserved names begin with "java." or "javax.".

Returns:
true if the name is reserved.

encodeAttributeName

protected java.lang.String encodeAttributeName(PortletWindow portletWindow,
                                               java.lang.String name)
Encodes the attribute name using the portlet window id if it is not reserved


createUserInfoMap

protected java.util.Map createUserInfoMap(javax.portlet.PortletRequest portletRequest,
                                          PortletWindow portletWindow)
Retrieves the UserInfoService from the OptionalContainerServices, gets the user-info Map and fitlers it for the attributes in the portlet descriptor.



Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.