WebSphere Portal 5.0.0.0

com.ibm.wps.pe.pc.legacy.cmpf
Class PortletRequestWrapper

java.lang.Object
  |
  +--javax.servlet.ServletRequestWrapper
        |
        +--javax.servlet.http.HttpServletRequestWrapper
              |
              +--com.ibm.wps.pe.pc.legacy.cmpf.PortletRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, PortletRequest, javax.servlet.ServletRequest

public class PortletRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper
implements PortletRequest

Provides a convenient implementation of the PortletRequest interface that can be subclassed by developers who wish to wrap the request to a Portlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.

See Also:
PortletRequest

Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
PortletRequestWrapper(PortletRequest portletRequest)
          Creates a PortletRequest adaptor wrapping the specified request object.
 
Method Summary
 Client getClient()
          Returns an object representing the client device that the user connects to the portal with.
 PortletData getData()
          Returns the data of the concrete portlet instance
 Portlet.Mode getMode()
          Returns the mode that the portlet is running in.
 PortletSession getPortletSession()
          Returns the current session or, if there is no current session, it creates one and returns it.
 PortletSession getPortletSession(boolean create)
          Returns the current session or, if there is no current session and the given flag is true, it creates one and returns it.
 PortletSettings getPortletSettings()
          Returns the PortletSettings object of the concrete portlet.
 Portlet.Mode getPreviousMode()
          Returns the mode that the portlet was running at last, or null if no previous mode exists.
 User getUser()
          Returns the user object.
 PortletWindow getWindow()
          Returns the window that the portlet is running in.
 void invalidateCache()
          Invalidates the cache for all window states, markups and locals
 void setModeModifier(Portlet.ModeModifier modeModifier)
          Defines which portlet mode is shown next.
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, 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 org.apache.jetspeed.portlet.PortletRequest
getAttribute, getAttributeNames, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getInputStream, getIntHeader, getLocale, getLocales, getMethod, getParameter, getParameterMap, getParameterNames, getParameterValues, isSecure, removeAttribute, setAttribute
 
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from interface javax.servlet.ServletRequest
getCharacterEncoding, getContentLength, getContentType, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, setCharacterEncoding
 

Constructor Detail

PortletRequestWrapper

public PortletRequestWrapper(PortletRequest portletRequest)
Creates a PortletRequest adaptor wrapping the specified request object.
Parameters:
portletRequest - the portlet request
Throws:
java.lang.IllegalArgumentException - if the request is null
Method Detail

getMode

public Portlet.Mode getMode()
Description copied from interface: PortletRequest
Returns the mode that the portlet is running in.
Specified by:
getMode in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the portlet mode

getPreviousMode

public Portlet.Mode getPreviousMode()
Description copied from interface: PortletRequest
Returns the mode that the portlet was running at last, or null if no previous mode exists.
Specified by:
getPreviousMode in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the previous portlet mode

setModeModifier

public void setModeModifier(Portlet.ModeModifier modeModifier)
                     throws AccessDeniedException
Description copied from interface: PortletRequest
Defines which portlet mode is shown next. Once the mode is changed it cannot be changed back to Portlet.ModeModifier.REQUESTED.

This function may only be used during event processing, in any other case the call has no effect.

Specified by:
setModeModifier in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Parameters:
modeModifier - the mode modifier
Throws:
AccessDeniedException - if the portlet tries to access this function outside of the action event processing

getClient

public final Client getClient()
Description copied from interface: PortletRequest
Returns an object representing the client device that the user connects to the portal with.
Specified by:
getClient in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the client

getWindow

public PortletWindow getWindow()
Description copied from interface: PortletRequest
Returns the window that the portlet is running in.
Specified by:
getWindow in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the portlet window

getData

public PortletData getData()
Description copied from interface: PortletRequest
Returns the data of the concrete portlet instance

If the portlet is run in CONFIGURE mode, the portlet data is not accessible and this method will return null.

Specified by:
getData in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the portlet data

getUser

public User getUser()
Description copied from interface: PortletRequest
Returns the user object. The user object contains useful information about the user and his or her preferences.

If the user has not logged in or does not grant access to the portlet, this method returns null.

Specified by:
getUser in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the user object

getPortletSession

public PortletSession getPortletSession()
Description copied from interface: PortletRequest
Returns the current session or, if there is no current session, it creates one and returns it.
Specified by:
getPortletSession in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the portlet session

getPortletSession

public PortletSession getPortletSession(boolean create)
Description copied from interface: PortletRequest
Returns the current session or, if there is no current session and the given flag is true, it creates one and returns it.

If the given flag is false and there is no current portlet session, this method returns null.

Specified by:
getPortletSession in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Parameters:
create - true to create a news session,
false to return null of there is no current session
Returns:
the portlet session

getPortletSettings

public PortletSettings getPortletSettings()
Description copied from interface: PortletRequest
Returns the PortletSettings object of the concrete portlet.
Specified by:
getPortletSettings in interface PortletRequest
Following copied from interface: org.apache.jetspeed.portlet.PortletRequest
Returns:
the PortletSettings object, or NULL if no PortletSettings object is available.

invalidateCache

public void invalidateCache()
Description copied from interface: PortletRequest
Invalidates the cache for all window states, markups and locals
Specified by:
invalidateCache in interface PortletRequest

WebSphere Portal 5.0.0.0