public class PortletRequestWrapper extends Object implements PortletRequest
PortletRequestWrapper provides a convenient
implementation of the PortletRequest interface
and is extended by other request wrappers.
This class implements the Wrapper or Decorator pattern.
Methods default to calling through to the wrapped request object.PortletRequestPortletRequest.P3PUserInfosACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO| Constructor and Description |
|---|
PortletRequestWrapper(PortletRequest request)
Creates an
PortletRequest adaptor
wrapping the given request object. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name)
The default behavior of this method is to call
getAttribute(String name) on the wrapped request object. |
Enumeration<String> |
getAttributeNames()
The default behavior of this method is to call
getAttributeNames() on the wrapped request object. |
String |
getAuthType()
The default behavior of this method is to call
getAuthType() on the wrapped request object. |
String |
getContextPath()
The default behavior of this method is to call
getContextPath() on the wrapped request object. |
javax.servlet.http.Cookie[] |
getCookies()
The default behavior of this method is to call
getCookies() on the wrapped request object. |
Locale |
getLocale()
The default behavior of this method is to call
getLocale() on the wrapped request object. |
Enumeration<Locale> |
getLocales()
The default behavior of this method is to call
getLocales() on the wrapped request object. |
String |
getParameter(String name)
The default behavior of this method is to call
getParameter(String name) on the wrapped request object. |
Map<String,String[]> |
getParameterMap()
The default behavior of this method is to call
getParameterMap() on the wrapped request object. |
Enumeration<String> |
getParameterNames()
The default behavior of this method is to call
getParameterNames() on the wrapped request object. |
String[] |
getParameterValues(String name)
The default behavior of this method is to call
getParameterValues(name) on the wrapped request object. |
PortalContext |
getPortalContext()
The default behavior of this method is to call
getPortalContext() on the wrapped request object. |
PortletMode |
getPortletMode()
The default behavior of this method is to call
getPortletMode() on the wrapped request object. |
PortletSession |
getPortletSession()
The default behavior of this method is to call
getPortletSession() on the wrapped request object. |
PortletSession |
getPortletSession(boolean create)
The default behavior of this method is to call
getPortletSession(create) on the wrapped request object. |
PortletPreferences |
getPreferences()
The default behavior of this method is to call
getPreferences() on the wrapped request object. |
Map<String,String[]> |
getPrivateParameterMap()
The default behavior of this method is to call
getPrivateParameterMap() on the wrapped request object. |
Enumeration<String> |
getProperties(String name)
The default behavior of this method is to call
getProperteis(name) on the wrapped request object. |
String |
getProperty(String name)
The default behavior of this method is to call
getProperty(name) on the wrapped request object. |
Enumeration<String> |
getPropertyNames()
The default behavior of this method is to call
getPropertyNames() on the wrapped request object. |
Map<String,String[]> |
getPublicParameterMap()
The default behavior of this method is to call
getPublicParameterMap() on the wrapped request object. |
String |
getRemoteUser()
The default behavior of this method is to call
getRemoteUser() on the wrapped request object. |
PortletRequest |
getRequest()
Return the wrapped request object.
|
String |
getRequestedSessionId()
The default behavior of this method is to call
getRequestedSessionId() on the wrapped request object. |
String |
getResponseContentType()
The default behavior of this method is to call
getResponseContentType() on the wrapped request object. |
Enumeration<String> |
getResponseContentTypes()
The default behavior of this method is to call
getResponseContentTypes() on the wrapped request object. |
String |
getScheme()
The default behavior of this method is to call
getScheme() on the wrapped request object. |
String |
getServerName()
The default behavior of this method is to call
getServerName() on the wrapped request object. |
int |
getServerPort()
The default behavior of this method is to call
getServerPort() on the wrapped request object. |
Principal |
getUserPrincipal()
The default behavior of this method is to call
getUserPrincipal() on the wrapped request object. |
String |
getWindowID()
The default behavior of this method is to call
getWindowId() on the wrapped request object. |
WindowState |
getWindowState()
The default behavior of this method is to call
getWindowState() on the wrapped request object. |
boolean |
isPortletModeAllowed(PortletMode mode)
The default behavior of this method is to call
isPortletModeAllowed(mode) on the wrapped request object. |
boolean |
isRequestedSessionIdValid()
The default behavior of this method is to call
isRequestedSessionIdValid() on the wrapped request object. |
boolean |
isSecure()
The default behavior of this method is to call
isSecure() on the wrapped request object. |
boolean |
isUserInRole(String role)
The default behavior of this method is to call
isUserInRole(role) on the wrapped request object. |
boolean |
isWindowStateAllowed(WindowState state)
The default behavior of this method is to call
isWindowStateAllowed(state) on the wrapped request object. |
void |
removeAttribute(String name)
The default behavior of this method is to call
removeAttribute(name) on the wrapped request object. |
void |
setAttribute(String name,
Object o)
The default behavior of this method is to call
setAttribute(name, o) on the wrapped request object. |
void |
setRequest(PortletRequest request)
Sets the request object being wrapped.
|
public PortletRequestWrapper(PortletRequest request)
PortletRequest adaptor
wrapping the given request object.request - the portlet request to wrapIllegalArgumentException - if the request is nullpublic Object getAttribute(String name)
getAttribute(String name) on the wrapped request object.getAttribute in interface PortletRequestname - a String specifying the name of
the attributeObject containing the value
of the attribute, or null if
the attribute does not exist.public Enumeration<String> getAttributeNames()
getAttributeNames() on the wrapped request object.getAttributeNames in interface PortletRequestEnumeration of strings
containing the names
of the request attributes, or an empty
Enumeration if the request
has no attributes available to it.public String getAuthType()
getAuthType() on the wrapped request object.getAuthType in interface PortletRequestBASIC_AUTH,
FORM_AUTH, CLIENT_CERT_AUTH,
DIGEST_AUTH (suitable for == comparison)
indicating the authentication scheme,
a custom one, or
null if the request was
not authenticated.public String getContextPath()
getContextPath() on the wrapped request object.getContextPath in interface PortletRequestString specifying the
portion of the request URL that indicates the context
of the requestPortletResponse.encodeURL(java.lang.String)public Locale getLocale()
getLocale() on the wrapped request object.getLocale in interface PortletRequestpublic Enumeration<Locale> getLocales()
getLocales() on the wrapped request object.getLocales in interface PortletRequestpublic String getParameter(String name)
getParameter(String name) on the wrapped request object.getParameter in interface PortletRequestname - a String specifying the
name of the parameterString representing the
single value of the parameterPortletRequest.getParameterValues(java.lang.String)public Map<String,String[]> getParameterMap()
getParameterMap() on the wrapped request object.getParameterMap in interface PortletRequestMap containing parameter names as
keys and parameter values as map values, or an empty Map
if no parameters exist. The keys in the parameter
map are of type String. The values in the parameter map are of type
String array (String[]).public Enumeration<String> getParameterNames()
getParameterNames() on the wrapped request object.getParameterNames in interface PortletRequestEnumeration of String
objects, each String containing
the name of a request parameter; or an
empty Enumeration if the
request has no parameters.public String[] getParameterValues(String name)
getParameterValues(name) on the wrapped request object.getParameterValues in interface PortletRequestname - a String containing the name of
the parameter the value of which is requestedString objects
containing the parameter values.PortletRequest.getParameter(java.lang.String)public PortalContext getPortalContext()
getPortalContext() on the wrapped request object.getPortalContext in interface PortletRequestpublic PortletMode getPortletMode()
getPortletMode() on the wrapped request object.getPortletMode in interface PortletRequestpublic PortletSession getPortletSession()
getPortletSession() on the wrapped request object.getPortletSession in interface PortletRequestpublic PortletSession getPortletSession(boolean create)
getPortletSession(create) on the wrapped request object.getPortletSession in interface PortletRequestcreate - true to create a new session, false to return null if there
is no current sessionpublic PortletPreferences getPreferences()
getPreferences() on the wrapped request object.getPreferences in interface PortletRequestpublic Enumeration<String> getProperties(String name)
getProperteis(name) on the wrapped request object.getProperties in interface PortletRequestname - a String specifying the
property nameEnumeration containing
the values of the requested property. If
the request does not have any properties of
that name return an empty Enumeration.public String getProperty(String name)
getProperty(name) on the wrapped request object.getProperty in interface PortletRequestname - a String specifying the
property nameString containing the
value of the requested
property, or null
if the request does not
have a property of that name.public Enumeration<String> getPropertyNames()
getPropertyNames() on the wrapped request object.getPropertyNames in interface PortletRequestEnumeration of all the
property names sent with this
request; if the request has
no properties, an empty Enumeration.public String getRemoteUser()
getRemoteUser() on the wrapped request object.getRemoteUser in interface PortletRequestString specifying the login
of the user making this request, or null
if the user login is not known.public String getRequestedSessionId()
getRequestedSessionId() on the wrapped request object.getRequestedSessionId in interface PortletRequestString specifying the session
ID, or null if the request did
not specify a session IDPortletRequest.isRequestedSessionIdValid()public String getResponseContentType()
getResponseContentType() on the wrapped request object.getResponseContentType in interface PortletRequestpublic Enumeration<String> getResponseContentTypes()
getResponseContentTypes() on the wrapped request object.getResponseContentTypes in interface PortletRequestpublic String getScheme()
getScheme() on the wrapped request object.getScheme in interface PortletRequestString containing the name
of the scheme used to make this requestpublic String getServerName()
getServerName() on the wrapped request object.getServerName in interface PortletRequestString containing the name
of the server to which the request was sentpublic int getServerPort()
getServerPort() on the wrapped request object.getServerPort in interface PortletRequestpublic Principal getUserPrincipal()
getUserPrincipal() on the wrapped request object.getUserPrincipal in interface PortletRequestjava.security.Principal containing
the name of the user making this request, or
null if the user has not been
authenticated.public String getWindowID()
getWindowId() on the wrapped request object.getWindowID in interface PortletRequestpublic WindowState getWindowState()
getWindowState() on the wrapped request object.getWindowState in interface PortletRequestpublic boolean isPortletModeAllowed(PortletMode mode)
isPortletModeAllowed(mode) on the wrapped request object.isPortletModeAllowed in interface PortletRequestmode - portlet mode to checkpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid() on the wrapped request object.isRequestedSessionIdValid in interface PortletRequesttrue if this
request has an id for a valid session
in the current session context;
false otherwisePortletRequest.getRequestedSessionId(),
PortletRequest.getPortletSession()public boolean isSecure()
isSecure() on the wrapped request object.isSecure in interface PortletRequestpublic boolean isUserInRole(String role)
isUserInRole(role) on the wrapped request object.isUserInRole in interface PortletRequestrole - a String specifying the name
of the roleboolean indicating whether
the user making this request belongs to a given role;
false if the user has not been
authenticated.public boolean isWindowStateAllowed(WindowState state)
isWindowStateAllowed(state) on the wrapped request object.isWindowStateAllowed in interface PortletRequeststate - window state to checkedpublic void removeAttribute(String name)
removeAttribute(name) on the wrapped request object.removeAttribute in interface PortletRequestname - a String specifying
the name of the attribute to be removedpublic void setAttribute(String name, Object o)
setAttribute(name, o) on the wrapped request object.setAttribute in interface PortletRequestname - a String specifying
the name of the attributeo - the Object to be storedpublic PortletRequest getRequest()
public void setRequest(PortletRequest request)
request - the request to setIllegalArgumentException - if the request is null.public javax.servlet.http.Cookie[] getCookies()
getCookies() on the wrapped request object.getCookies in interface PortletRequestnull if no cookies exist.PortletResponse.addProperty(Cookie)public Map<String,String[]> getPrivateParameterMap()
getPrivateParameterMap() on the wrapped request object.getPrivateParameterMap in interface PortletRequestMap containing private parameter names as
keys and private parameter values as map values, or an empty Map
if no private parameters exist. The keys in the parameter
map are of type String. The values in the parameter map are of type
String array (String[]).public Map<String,String[]> getPublicParameterMap()
getPublicParameterMap() on the wrapped request object.getPublicParameterMap in interface PortletRequestMap containing public parameter names as
keys and public parameter values as map values, or an empty Map
if no public parameters exist. The keys in the parameter
map are of type String. The values in the parameter map are of type
String array (String[]).Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.