public class PortletRequestWrapper extends RenderStateWrapper 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.PortletRequest
PortletRequest.P3PUserInfos
wrapped
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, HEADER_PHASE, 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. |
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)
Deprecated.
|
Map<String,String[]> |
getParameterMap()
Deprecated.
|
Enumeration<String> |
getParameterNames()
Deprecated.
|
String[] |
getParameterValues(String name)
Deprecated.
|
PortalContext |
getPortalContext()
The default behavior of this method is to call
getPortalContext() on the wrapped request object. |
PortletContext |
getPortletContext()
Returns the
PortletContext of the portlet application
the portlet is in. |
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()
Deprecated.
|
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()
Deprecated.
|
String |
getRemoteUser()
The default behavior of this method is to call
getRemoteUser() on the wrapped request object. |
RenderParameters |
getRenderParameters()
The default behavior of this method is to call
getRenderParameters() 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. |
String |
getUserAgent()
Returns the user agent for the request.
|
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.
|
getWrapped, setWrapped
public PortletRequestWrapper(PortletRequest request)
PortletRequest
adaptor
wrapping the given request object.request
- the portlet request to wrapIllegalArgumentException
- if the request is null
public PortletRequest getRequest()
public void setRequest(PortletRequest request)
request
- the request to setIllegalArgumentException
- if the request is null.public Object getAttribute(String name)
getAttribute(String name)
on the wrapped request object.getAttribute
in interface PortletRequest
name
- 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 PortletRequest
Enumeration
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 PortletRequest
BASIC_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 PortletRequest
String
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 PortletRequest
public Enumeration<Locale> getLocales()
getLocales()
on the wrapped request object.getLocales
in interface PortletRequest
public RenderParameters getRenderParameters()
getRenderParameters()
on the wrapped request object.
getRenderParameters
in interface RenderState
getRenderParameters
in class RenderStateWrapper
RenderParameters
object representing
the private and public render parametersPortletParameters
,
RenderParameters
@Deprecated public String getParameter(String name)
getParameter(String name)
on the wrapped request object.getParameter
in interface PortletRequest
name
- a String
specifying the
name of the parameterString
representing the
single value of the parameterPortletRequest.getParameterValues(java.lang.String)
@Deprecated public Map<String,String[]> getParameterMap()
getParameterMap()
on the wrapped request object.getParameterMap
in interface PortletRequest
Map
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[]
).@Deprecated public Enumeration<String> getParameterNames()
getParameterNames()
on the wrapped request object.getParameterNames
in interface PortletRequest
Enumeration
of String
objects, each String
containing
the name of a request parameter; or an
empty Enumeration
if the
request has no parameters.@Deprecated public String[] getParameterValues(String name)
getParameterValues(name)
on the wrapped request object.getParameterValues
in interface PortletRequest
name
- 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 PortletRequest
public PortletContext getPortletContext()
PortletRequest
PortletContext
of the portlet application
the portlet is in.
getPortletContext
in interface PortletRequest
PortletContext
object, used by the
caller to interact with its portlet containerPortletContext
public PortletMode getPortletMode()
getPortletMode()
on the wrapped request object.getPortletMode
in interface RenderState
getPortletMode
in class RenderStateWrapper
PortletMode.UNDEFINED
is returned.PortletMode
public PortletSession getPortletSession()
getPortletSession()
on the wrapped request object.getPortletSession
in interface PortletRequest
public PortletSession getPortletSession(boolean create)
getPortletSession(create)
on the wrapped request object.getPortletSession
in interface PortletRequest
create
- 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 PortletRequest
public Enumeration<String> getProperties(String name)
getProperteis(name)
on the wrapped request object.getProperties
in interface PortletRequest
name
- 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 PortletRequest
name
- 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 PortletRequest
Enumeration
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 PortletRequest
String
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 PortletRequest
String
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 PortletRequest
public Enumeration<String> getResponseContentTypes()
getResponseContentTypes()
on the wrapped request object.getResponseContentTypes
in interface PortletRequest
public String getScheme()
getScheme()
on the wrapped request object.getScheme
in interface PortletRequest
String
containing the name
of the scheme used to make this requestpublic String getServerName()
getServerName()
on the wrapped request object.getServerName
in interface PortletRequest
String
containing the name
of the server to which the request was sentpublic int getServerPort()
getServerPort()
on the wrapped request object.getServerPort
in interface PortletRequest
public Principal getUserPrincipal()
getUserPrincipal()
on the wrapped request object.getUserPrincipal
in interface PortletRequest
java.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 PortletRequest
public WindowState getWindowState()
getWindowState()
on the wrapped request object.getWindowState
in interface RenderState
getWindowState
in class RenderStateWrapper
WindowState.UNDEFINED
is returned.WindowState
public boolean isPortletModeAllowed(PortletMode mode)
isPortletModeAllowed(mode)
on the wrapped request object.isPortletModeAllowed
in interface PortletRequest
mode
- portlet mode to checkpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid()
on the wrapped request object.isRequestedSessionIdValid
in interface PortletRequest
true
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 PortletRequest
public boolean isUserInRole(String role)
isUserInRole(role)
on the wrapped request object.isUserInRole
in interface PortletRequest
role
- 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 PortletRequest
state
- window state to checkedpublic void removeAttribute(String name)
removeAttribute(name)
on the wrapped request object.removeAttribute
in interface PortletRequest
name
- 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 PortletRequest
name
- a String
specifying
the name of the attributeo
- the Object
to be storedpublic Cookie[] getCookies()
getCookies()
on the wrapped request object.getCookies
in interface PortletRequest
null
if no cookies exist.PortletResponse.addProperty(Cookie)
@Deprecated public Map<String,String[]> getPrivateParameterMap()
getPrivateParameterMap()
on the wrapped request object.getPrivateParameterMap
in interface PortletRequest
Map
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[]
).@Deprecated public Map<String,String[]> getPublicParameterMap()
getPublicParameterMap()
on the wrapped request object.getPublicParameterMap
in interface PortletRequest
Map
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[]
).public String getUserAgent()
PortletRequest
getUserAgent
in interface PortletRequest
Java Portlet 3.0 API Specification. See the Copyright and License provided with this distribution. Use is subject to license terms.