org.apache.pluto.internal.impl
Class PortletRequestImpl

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by org.apache.pluto.internal.impl.PortletRequestImpl
All Implemented Interfaces:
PortletRequest, javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest, InternalPortletRequest
Direct Known Subclasses:
ActionRequestImpl, EventRequestImpl, RenderRequestImpl, ResourceRequestImpl

public abstract class PortletRequestImpl
extends javax.servlet.http.HttpServletRequestWrapper
implements PortletRequest, InternalPortletRequest

Abstract javax.portlet.PortletRequest implementation. This class also implements InternalPortletRequest.


Field Summary
protected  PortletContainer container
          The parent container within which this request was created.
protected  InternalPortletWindow internalPortletWindow
          The portlet window which is the target of this portlet request.
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
PortletRequestImpl(InternalPortletRequest internalPortletRequest)
           
PortletRequestImpl(PortletContainer container, InternalPortletWindow internalPortletWindow, javax.servlet.http.HttpServletRequest servletRequest)
          Creates a PortletRequestImpl instance.
 
Method Summary
protected  java.util.Map baseGetParameterMap()
          The base method that returns the parameter map in this portlet request.
 java.util.Map createUserInfoMap()
           
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
 java.util.Enumeration getAttributeNames()
          Returns an Enumeration containing the names of the attributes available to this request.
 java.lang.String getAuthType()
          Returns the name of the authentication scheme used for the connection between client and portal, for example, BASIC_AUTH, CLIENT_CERT_AUTH, a custom one or null if there was no authentication.
 java.lang.String getContextPath()
          Returns the context path which is the path prefix associated with the deployed portlet application.
 javax.servlet.http.Cookie[] getCookies()
          Returns an array containing all of the Cookie properties.
 long getDateHeader(java.lang.String arg0)
           
 java.lang.String getHeader(java.lang.String arg0)
           
 java.util.Enumeration getHeaderNames()
           
 java.util.Enumeration getHeaders(java.lang.String arg0)
           
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
           
 javax.servlet.ServletInputStream getInputStream()
           
 InternalPortletWindow getInternalPortletWindow()
           
 int getIntHeader(java.lang.String arg0)
           
 java.lang.String getLifecyclePhase()
           
 java.lang.String getLocalAddr()
           
 java.util.Locale getLocale()
          Returns the preferred Locale in which the portal will accept content.
 java.util.Enumeration getLocales()
          Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale in which the portal will accept content for this request.
 java.lang.String getLocalName()
           
 int getLocalPort()
           
 java.lang.String getParameter(java.lang.String name)
          Returns the value of a request parameter as a String, or null if the parameter does not exist.
 java.util.Map getParameterMap()
          Returns a Map of the parameters of this request.
 java.util.Enumeration getParameterNames()
          Returns an Enumeration of String objects containing the names of the parameters contained in this request.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
 java.lang.String getPathInfo()
           
 java.lang.String getPathTranslated()
           
 PortalContext getPortalContext()
          Returns the context of the calling portal.
 PortletContainer getPortletContainer()
           
 PortletMode getPortletMode()
          Returns the current portlet mode of the portlet.
 PortletSession getPortletSession()
          Returns the current portlet session or, if there is no current session, creates one and returns the new session.
 PortletSession getPortletSession(boolean create)
          Returns the portlet session.
 PortletPreferences getPreferences()
          Returns the preferences object associated with the portlet.
 java.util.Map<java.lang.String,java.lang.String[]> getPrivateParameterMap()
          Returns a Map of the private parameters of this request.
 java.util.Enumeration getProperties(java.lang.String name)
          Returns all the values of the specified request property as a Enumeration of String objects.
 java.lang.String getProperty(java.lang.String name)
          Returns the value of the specified request property as a String.
 java.util.Enumeration getPropertyNames()
          Returns a Enumeration of all the property names this request contains.
 java.lang.String getProtocol()
           
 java.util.Map<java.lang.String,java.lang.String[]> getPublicParameterMap()
          Returns a Map of the public parameters of this request.
 java.lang.String getQueryString()
           
 java.io.BufferedReader getReader()
           
 java.lang.String getRealPath(java.lang.String arg0)
           
 java.lang.String getRemoteAddr()
           
 java.lang.String getRemoteHost()
           
 int getRemotePort()
           
 java.lang.String getRemoteUser()
          Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
 javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
           
 java.lang.String getRequestedSessionId()
          Returns the session ID indicated in the client request.
 java.lang.String getRequestURI()
           
 java.lang.StringBuffer getRequestURL()
           
 java.lang.String getResponseContentType()
          Returns the portal preferred content type for the response.
 java.util.Enumeration getResponseContentTypes()
          Gets a list of content types which the portal accepts for the response.
 java.lang.String getScheme()
          Returns the name of the scheme used to make this request.
 java.lang.String getServerName()
          Returns the host name of the server that received the request.
 int getServerPort()
          Returns the port number on which this request was received.
 java.lang.String getServletPath()
           
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean arg0)
           
 java.security.Principal getUserPrincipal()
          Returns a java.security.Principal object containing the name of the current authenticated user.
 java.lang.String getWindowId()
           
 java.lang.String getWindowID()
          Returns the portlet window ID.
 WindowState getWindowState()
          Returns the current window state of the portlet.
 void init(PortletContext portletContext, javax.servlet.http.HttpServletRequest req)
          Initializes the portlet request for use within the target context.
 boolean isForwarded()
           
 boolean isIncluded()
          Returns true if a jsp or servlet is included.
 boolean isPortletModeAllowed(PortletMode mode)
          Returns true, if the given portlet mode is a valid one to set for this portlet in the context of the current request.
 boolean isRequestedSessionIdValid()
          Checks whether the requested session ID is still valid.
 boolean isSecure()
          Returns a boolean indicating whether this request was made using a secure channel between client and the portal, such as HTTPS.
 boolean isUserInRole(java.lang.String roleName)
          Determines whether a user is mapped to the specified role.
 boolean isWindowStateAllowed(WindowState state)
          Determine whether or not the specified WindowState is allowed for this portlet.
 void release()
          TODO: Implement this properly.
 void removeAttribute(java.lang.String name)
          Removes an attribute from this request.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Stores an attribute in this request.
protected  void setBodyAccessed()
           
 void setCharacterEncoding(java.lang.String encoding)
          TODO: why check bodyAccessed?
 void setForwarded(boolean forwarded)
           
 void setForwardedQueryString(java.lang.String queryString)
           
 void setIncluded(boolean included)
          Is set true when a jsp, servlet is included.
 void setIncludedQueryString(java.lang.String queryString)
           
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getMethod, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getCharacterEncoding, getContentLength, getContentType, getRequest, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getCharacterEncoding, getContentLength, getContentType
 

Field Detail

container

protected PortletContainer container
The parent container within which this request was created.


internalPortletWindow

protected InternalPortletWindow internalPortletWindow
The portlet window which is the target of this portlet request.

Constructor Detail

PortletRequestImpl

public PortletRequestImpl(InternalPortletRequest internalPortletRequest)

PortletRequestImpl

public PortletRequestImpl(PortletContainer container,
                          InternalPortletWindow internalPortletWindow,
                          javax.servlet.http.HttpServletRequest servletRequest)
Creates a PortletRequestImpl instance.

Parameters:
container - the portlet container.
internalPortletWindow - the internal portlet window.
servletRequest - the underlying servlet request.
Method Detail

getWindowId

public java.lang.String getWindowId()

isWindowStateAllowed

public boolean isWindowStateAllowed(WindowState state)
Determine whether or not the specified WindowState is allowed for this portlet.

Specified by:
isWindowStateAllowed in interface PortletRequest
Parameters:
state - the state in question
Returns:
true if the state is allowed.

isPortletModeAllowed

public boolean isPortletModeAllowed(PortletMode mode)
Description copied from interface: PortletRequest
Returns true, if the given portlet mode is a valid one to set for this portlet in the context of the current request.

Specified by:
isPortletModeAllowed in interface PortletRequest
Parameters:
mode - portlet mode to check
Returns:
true, if it is valid for this portlet in this request to change to the given portlet mode

getPortletMode

public PortletMode getPortletMode()
Description copied from interface: PortletRequest
Returns the current portlet mode of the portlet.

Specified by:
getPortletMode in interface PortletRequest
Returns:
the portlet mode

getWindowState

public WindowState getWindowState()
Description copied from interface: PortletRequest
Returns the current window state of the portlet.

Specified by:
getWindowState in interface PortletRequest
Returns:
the window state

getPortletSession

public PortletSession getPortletSession()
Description copied from interface: PortletRequest
Returns the current portlet session or, if there is no current session, creates one and returns the new session.

Creating a new portlet session will result in creating a new HttpSession on which the portlet session is based on.

Specified by:
getPortletSession in interface PortletRequest
Returns:
the portlet session

getPortletSession

public PortletSession getPortletSession(boolean create)
Returns the portlet session.

Note that since portlet request instance is created everytime the portlet container receives an incoming request, the portlet session instance held by the request instance is also re-created for each incoming request.

Specified by:
getPortletSession in interface PortletRequest
Parameters:
create - true to create a new session,
false to return null if there is no current session
Returns:
the portlet session

getProperty

public java.lang.String getProperty(java.lang.String name)
                             throws java.lang.IllegalArgumentException
Description copied from interface: PortletRequest
Returns the value of the specified request property as a String. If the request did not include a property of the specified name, this method returns null.

A portlet can access portal/portlet-container specific properties through this method and, if available, the headers of the HTTP client request.

This method should only be used if the property has only one value. If the property might have more than one value, use PortletRequest.getProperties(java.lang.String).

If this method is used with a multivalued parameter, the value returned is equal to the first value in the Enumeration returned by getProperties.

Specified by:
getProperty in interface PortletRequest
Parameters:
name - a String specifying the property name
Returns:
a String containing the value of the requested property, or null if the request does not have a property of that name.
Throws:
java.lang.IllegalArgumentException - if name is null.

getProperties

public java.util.Enumeration getProperties(java.lang.String name)
Description copied from interface: PortletRequest
Returns all the values of the specified request property as a Enumeration of String objects.

If the request did not include any properties of the specified name, this method returns an empty Enumeration. The property name is case insensitive. You can use this method with any request property.

Specified by:
getProperties in interface PortletRequest
Parameters:
name - a String specifying the property name
Returns:
a Enumeration containing the values of the requested property. If the request does not have any properties of that name return an empty Enumeration.

getPropertyNames

public java.util.Enumeration getPropertyNames()
Description copied from interface: PortletRequest
Returns a Enumeration of all the property names this request contains. If the request has no properties, this method returns an empty Enumeration.

Specified by:
getPropertyNames in interface PortletRequest
Returns:
an Enumeration of all the property names sent with this request; if the request has no properties, an empty Enumeration.

getPortalContext

public PortalContext getPortalContext()
Description copied from interface: PortletRequest
Returns the context of the calling portal.

Specified by:
getPortalContext in interface PortletRequest
Returns:
the context of the calling portal

getAuthType

public java.lang.String getAuthType()
Description copied from interface: PortletRequest
Returns the name of the authentication scheme used for the connection between client and portal, for example, BASIC_AUTH, CLIENT_CERT_AUTH, a custom one or null if there was no authentication.

Specified by:
getAuthType in interface PortletRequest
Specified by:
getAuthType in interface javax.servlet.http.HttpServletRequest
Overrides:
getAuthType in class javax.servlet.http.HttpServletRequestWrapper
Returns:
one of the static members 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.

getContextPath

public java.lang.String getContextPath()
Description copied from interface: PortletRequest
Returns the context path which is the path prefix associated with the deployed portlet application. If the portlet application is rooted at the base of the web server URL namespace (also known as "default" context), this path must be an empty string. Otherwise, it must be the path the portlet application is rooted to, the path must start with a '/' and it must not end with a '/' character.

To encode a URL the PortletResponse.encodeURL(java.lang.String) method must be used.

Specified by:
getContextPath in interface PortletRequest
Specified by:
getContextPath in interface javax.servlet.http.HttpServletRequest
Overrides:
getContextPath in class javax.servlet.http.HttpServletRequestWrapper
Returns:
a String specifying the portion of the request URL that indicates the context of the request
See Also:
PortletResponse.encodeURL(java.lang.String)

getRemoteUser

public java.lang.String getRemoteUser()
Description copied from interface: PortletRequest
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.

Specified by:
getRemoteUser in interface PortletRequest
Specified by:
getRemoteUser in interface javax.servlet.http.HttpServletRequest
Overrides:
getRemoteUser in class javax.servlet.http.HttpServletRequestWrapper
Returns:
a String specifying the login of the user making this request, or null if the user login is not known.

getUserPrincipal

public java.security.Principal getUserPrincipal()
Description copied from interface: PortletRequest
Returns a java.security.Principal object containing the name of the current authenticated user.

Specified by:
getUserPrincipal in interface PortletRequest
Specified by:
getUserPrincipal in interface javax.servlet.http.HttpServletRequest
Overrides:
getUserPrincipal in class javax.servlet.http.HttpServletRequestWrapper
Returns:
a java.security.Principal containing the name of the user making this request, or null if the user has not been authenticated.

isUserInRole

public boolean isUserInRole(java.lang.String roleName)
Determines whether a user is mapped to the specified role. As specified in PLT-20-3, we must reference the <security-role-ref> mappings within the deployment descriptor. If no mapping is available, then, and only then, do we check use the actual role name specified against the web application deployment descriptor.

Specified by:
isUserInRole in interface PortletRequest
Specified by:
isUserInRole in interface javax.servlet.http.HttpServletRequest
Overrides:
isUserInRole in class javax.servlet.http.HttpServletRequestWrapper
Parameters:
roleName - the name of the role
Returns:
true if it is determined the user has the given role.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface: PortletRequest
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

Attribute names should follow the same conventions as package names. This specification reserves names matching java.*, and javax.*.

In a distributed portlet web application the Object needs to be serializable.

Specified by:
getAttribute in interface PortletRequest
Specified by:
getAttribute in interface javax.servlet.ServletRequest
Overrides:
getAttribute in class javax.servlet.ServletRequestWrapper
Parameters:
name - a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if the attribute does not exist.

getAttributeNames

public java.util.Enumeration getAttributeNames()
Description copied from interface: PortletRequest
Returns an Enumeration containing the names of the attributes available to this request. This method returns an empty Enumeration if the request has no attributes available to it.

Specified by:
getAttributeNames in interface PortletRequest
Specified by:
getAttributeNames in interface javax.servlet.ServletRequest
Overrides:
getAttributeNames in class javax.servlet.ServletRequestWrapper
Returns:
an Enumeration of strings containing the names of the request attributes, or an empty Enumeration if the request has no attributes available to it.

createUserInfoMap

public java.util.Map createUserInfoMap()

getParameter

public java.lang.String getParameter(java.lang.String name)
Description copied from interface: PortletRequest
Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. The returned parameter are "x-www-form-urlencoded" decoded.

Only parameters targeted to the current portlet are accessible.

This method should only be used if the parameter has only one value. If the parameter might have more than one value, use PortletRequest.getParameterValues(java.lang.String).

If this method is used with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.

Specified by:
getParameter in interface PortletRequest
Specified by:
getParameter in interface javax.servlet.ServletRequest
Overrides:
getParameter in class javax.servlet.ServletRequestWrapper
Parameters:
name - a String specifying the name of the parameter
Returns:
a String representing the single value of the parameter
See Also:
PortletRequest.getParameterValues(java.lang.String)

getParameterNames

public java.util.Enumeration getParameterNames()
Description copied from interface: PortletRequest
Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.

Only parameters targeted to the current portlet are returned.

Specified by:
getParameterNames in interface PortletRequest
Specified by:
getParameterNames in interface javax.servlet.ServletRequest
Overrides:
getParameterNames in class javax.servlet.ServletRequestWrapper
Returns:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters.

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Description copied from interface: PortletRequest
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. The returned parameters are "x-www-form-urlencoded" decoded.

If the parameter has a single value, the array has a length of 1.

Specified by:
getParameterValues in interface PortletRequest
Specified by:
getParameterValues in interface javax.servlet.ServletRequest
Overrides:
getParameterValues in class javax.servlet.ServletRequestWrapper
Parameters:
name - a String containing the name of the parameter the value of which is requested
Returns:
an array of String objects containing the parameter values.
See Also:
PortletRequest.getParameter(java.lang.String)

getParameterMap

public java.util.Map getParameterMap()
Description copied from interface: PortletRequest
Returns a Map of the parameters of this request. Request parameters are extra information sent with the request. The returned parameters are "x-www-form-urlencoded" decoded.

The values in the returned Map are from type String array (String[]).

If no parameters exist this method returns an empty Map.

Specified by:
getParameterMap in interface PortletRequest
Specified by:
getParameterMap in interface javax.servlet.ServletRequest
Overrides:
getParameterMap in class javax.servlet.ServletRequestWrapper
Returns:
an immutable 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[]).

isSecure

public boolean isSecure()
Description copied from interface: PortletRequest
Returns a boolean indicating whether this request was made using a secure channel between client and the portal, such as HTTPS.

Specified by:
isSecure in interface PortletRequest
Specified by:
isSecure in interface javax.servlet.ServletRequest
Overrides:
isSecure in class javax.servlet.ServletRequestWrapper
Returns:
true, if the request was made using a secure channel.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Description copied from interface: PortletRequest
Stores an attribute in this request.

Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.* are reserved.
If the value passed into this method is null, the effect is the same as calling PortletRequest.removeAttribute(java.lang.String).

Specified by:
setAttribute in interface PortletRequest
Specified by:
setAttribute in interface javax.servlet.ServletRequest
Specified by:
setAttribute in interface InternalPortletRequest
Overrides:
setAttribute in class javax.servlet.ServletRequestWrapper
Parameters:
name - a String specifying the name of the attribute
value - the Object to be stored

removeAttribute

public void removeAttribute(java.lang.String name)
Description copied from interface: PortletRequest
Removes an attribute from this request. This method is not generally needed, as attributes only persist as long as the request is being handled.

Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.* are reserved.

Specified by:
removeAttribute in interface PortletRequest
Specified by:
removeAttribute in interface javax.servlet.ServletRequest
Overrides:
removeAttribute in class javax.servlet.ServletRequestWrapper
Parameters:
name - a String specifying the name of the attribute to be removed

getRequestedSessionId

public java.lang.String getRequestedSessionId()
Description copied from interface: PortletRequest
Returns the session ID indicated in the client request. This session ID may not be a valid one, it may be an old one that has expired or has been invalidated. If the client request did not specify a session ID, this method returns null.

Specified by:
getRequestedSessionId in interface PortletRequest
Specified by:
getRequestedSessionId in interface javax.servlet.http.HttpServletRequest
Overrides:
getRequestedSessionId in class javax.servlet.http.HttpServletRequestWrapper
Returns:
a String specifying the session ID, or null if the request did not specify a session ID
See Also:
PortletRequest.isRequestedSessionIdValid()

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Description copied from interface: PortletRequest
Checks whether the requested session ID is still valid.

Specified by:
isRequestedSessionIdValid in interface PortletRequest
Specified by:
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
Overrides:
isRequestedSessionIdValid in class javax.servlet.http.HttpServletRequestWrapper
Returns:
true if this request has an id for a valid session in the current session context; false otherwise
See Also:
PortletRequest.getRequestedSessionId(), PortletRequest.getPortletSession()

getResponseContentType

public java.lang.String getResponseContentType()
Description copied from interface: PortletRequest
Returns the portal preferred content type for the response.

For ActionRequest, EventRequest, and RenderRequest the following restrictions apply:

Specified by:
getResponseContentType in interface PortletRequest
Returns:
preferred MIME type of the response

getResponseContentTypes

public java.util.Enumeration getResponseContentTypes()
Description copied from interface: PortletRequest
Gets a list of content types which the portal accepts for the response. This list is ordered with the most preferable types listed first.

For ActionRequest, EventRequest, and RenderRequest the following restrictions apply:

Specified by:
getResponseContentTypes in interface PortletRequest
Returns:
ordered list of MIME types for the response

getLocale

public java.util.Locale getLocale()
Description copied from interface: PortletRequest
Returns the preferred Locale in which the portal will accept content. The Locale may be based on the Accept-Language header of the client.

Specified by:
getLocale in interface PortletRequest
Specified by:
getLocale in interface javax.servlet.ServletRequest
Overrides:
getLocale in class javax.servlet.ServletRequestWrapper
Returns:
the preferred Locale in which the portal will accept content.

getLocales

public java.util.Enumeration getLocales()
Description copied from interface: PortletRequest
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale in which the portal will accept content for this request. The Locales may be based on the Accept-Language header of the client.

Specified by:
getLocales in interface PortletRequest
Specified by:
getLocales in interface javax.servlet.ServletRequest
Overrides:
getLocales in class javax.servlet.ServletRequestWrapper
Returns:
an Enumeration of Locales, in decreasing order, in which the portal will accept content for this request

getScheme

public java.lang.String getScheme()
Description copied from interface: PortletRequest
Returns the name of the scheme used to make this request. For example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.

Specified by:
getScheme in interface PortletRequest
Specified by:
getScheme in interface javax.servlet.ServletRequest
Overrides:
getScheme in class javax.servlet.ServletRequestWrapper
Returns:
a String containing the name of the scheme used to make this request

getServerName

public java.lang.String getServerName()
Description copied from interface: PortletRequest
Returns the host name of the server that received the request.

Specified by:
getServerName in interface PortletRequest
Specified by:
getServerName in interface javax.servlet.ServletRequest
Overrides:
getServerName in class javax.servlet.ServletRequestWrapper
Returns:
a String containing the name of the server to which the request was sent

getServerPort

public int getServerPort()
Description copied from interface: PortletRequest
Returns the port number on which this request was received.

Specified by:
getServerPort in interface PortletRequest
Specified by:
getServerPort in interface javax.servlet.ServletRequest
Overrides:
getServerPort in class javax.servlet.ServletRequestWrapper
Returns:
an integer specifying the port number

baseGetParameterMap

protected java.util.Map baseGetParameterMap()
The base method that returns the parameter map in this portlet request. All parameter-related methods call this base method. Subclasses may just overwrite this protected method to change behavior of all parameter- related methods.

Returns:
the base parameter map from which parameters are retrieved.

setBodyAccessed

protected void setBodyAccessed()

getInternalPortletWindow

public InternalPortletWindow getInternalPortletWindow()
Specified by:
getInternalPortletWindow in interface InternalPortletRequest

getPortletContainer

public PortletContainer getPortletContainer()
Specified by:
getPortletContainer in interface InternalPortletRequest

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Specified by:
getHttpServletRequest in interface InternalPortletRequest

init

public void init(PortletContext portletContext,
                 javax.servlet.http.HttpServletRequest req)
Description copied from interface: InternalPortletRequest
Initializes the portlet request for use within the target context. This method ensures that the portlet utilizes resources from the included context, and not those from the intiating (portal) context.

Specified by:
init in interface InternalPortletRequest
Parameters:
portletContext - the target portlet context.
req - the servlet request.

release

public void release()
TODO: Implement this properly. Not required now

Specified by:
release in interface InternalPortletRequest

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.UnsupportedEncodingException,
                                        java.io.IOException
Specified by:
getReader in interface javax.servlet.ServletRequest
Overrides:
getReader in class javax.servlet.ServletRequestWrapper
Throws:
java.io.UnsupportedEncodingException
java.io.IOException

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
Specified by:
getInputStream in interface javax.servlet.ServletRequest
Overrides:
getInputStream in class javax.servlet.ServletRequestWrapper
Throws:
java.io.IOException

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
Specified by:
getRequestDispatcher in interface javax.servlet.ServletRequest
Overrides:
getRequestDispatcher in class javax.servlet.ServletRequestWrapper

setCharacterEncoding

public void setCharacterEncoding(java.lang.String encoding)
                          throws java.io.UnsupportedEncodingException
TODO: why check bodyAccessed?

Specified by:
setCharacterEncoding in interface javax.servlet.ServletRequest
Overrides:
setCharacterEncoding in class javax.servlet.ServletRequestWrapper
Throws:
java.io.UnsupportedEncodingException

isForwarded

public boolean isForwarded()
Specified by:
isForwarded in interface InternalPortletRequest

setForwarded

public void setForwarded(boolean forwarded)
Specified by:
setForwarded in interface InternalPortletRequest

setForwardedQueryString

public void setForwardedQueryString(java.lang.String queryString)
Specified by:
setForwardedQueryString in interface InternalPortletRequest

setIncluded

public void setIncluded(boolean included)
Description copied from interface: InternalPortletRequest
Is set true when a jsp, servlet is included.

Specified by:
setIncluded in interface InternalPortletRequest
Parameters:
included - true when included

isIncluded

public boolean isIncluded()
Description copied from interface: InternalPortletRequest
Returns true if a jsp or servlet is included.

Specified by:
isIncluded in interface InternalPortletRequest
Returns:
true if a jsp or servlet is included.

setIncludedQueryString

public void setIncludedQueryString(java.lang.String queryString)
                            throws java.lang.IllegalStateException
Specified by:
setIncludedQueryString in interface InternalPortletRequest
Throws:
java.lang.IllegalStateException

getPreferences

public PortletPreferences getPreferences()
Description copied from interface: PortletRequest
Returns the preferences object associated with the portlet.

Specified by:
getPreferences in interface PortletRequest
Returns:
the portlet preferences

getPrivateParameterMap

public java.util.Map<java.lang.String,java.lang.String[]> getPrivateParameterMap()
Description copied from interface: PortletRequest
Returns a Map of the private parameters of this request. Private parameters are not shared with other portlets or components. The returned parameters are "x-www-form-urlencoded" decoded.

The values in the returned Map are from type String array (String[]).

If no private parameters exist this method returns an empty Map.

Specified by:
getPrivateParameterMap in interface PortletRequest
Returns:
an immutable 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[]).

getPublicParameterMap

public java.util.Map<java.lang.String,java.lang.String[]> getPublicParameterMap()
Description copied from interface: PortletRequest
Returns a Map of the public parameters of this request. Public parameters may be shared with other portlets or components and defined in the portlet deployment descriptor with the supported-public-render-parameter element. The returned parameters are "x-www-form-urlencoded" decoded.

The values in the returned Map are from type String array (String[]).

If no public parameters exist this method returns an empty Map.

Specified by:
getPublicParameterMap in interface PortletRequest
Returns:
an immutable 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[]).

getWindowID

public java.lang.String getWindowID()
Description copied from interface: PortletRequest
Returns the portlet window ID. The portlet window ID is unique for this portlet window and is constant for the lifetime of the portlet window.

This ID is the same that is used by the portlet container for scoping the portlet-scope session attributes.

Specified by:
getWindowID in interface PortletRequest
Returns:
the portlet window ID

getLocalAddr

public java.lang.String getLocalAddr()
Specified by:
getLocalAddr in interface javax.servlet.ServletRequest
Overrides:
getLocalAddr in class javax.servlet.ServletRequestWrapper

getLocalName

public java.lang.String getLocalName()
Specified by:
getLocalName in interface javax.servlet.ServletRequest
Overrides:
getLocalName in class javax.servlet.ServletRequestWrapper

getLocalPort

public int getLocalPort()
Specified by:
getLocalPort in interface javax.servlet.ServletRequest
Overrides:
getLocalPort in class javax.servlet.ServletRequestWrapper

getProtocol

public java.lang.String getProtocol()
Specified by:
getProtocol in interface javax.servlet.ServletRequest
Overrides:
getProtocol in class javax.servlet.ServletRequestWrapper

getRealPath

public java.lang.String getRealPath(java.lang.String arg0)
Specified by:
getRealPath in interface javax.servlet.ServletRequest
Overrides:
getRealPath in class javax.servlet.ServletRequestWrapper

getRemoteAddr

public java.lang.String getRemoteAddr()
Specified by:
getRemoteAddr in interface javax.servlet.ServletRequest
Overrides:
getRemoteAddr in class javax.servlet.ServletRequestWrapper

getRemoteHost

public java.lang.String getRemoteHost()
Specified by:
getRemoteHost in interface javax.servlet.ServletRequest
Overrides:
getRemoteHost in class javax.servlet.ServletRequestWrapper

getRemotePort

public int getRemotePort()
Specified by:
getRemotePort in interface javax.servlet.ServletRequest
Overrides:
getRemotePort in class javax.servlet.ServletRequestWrapper

getCookies

public javax.servlet.http.Cookie[] getCookies()
Description copied from interface: PortletRequest
Returns an array containing all of the Cookie properties.

This method returns null if no cookies exist.

Specified by:
getCookies in interface PortletRequest
Specified by:
getCookies in interface javax.servlet.http.HttpServletRequest
Overrides:
getCookies in class javax.servlet.http.HttpServletRequestWrapper
Returns:
array of cookie properties, or null if no cookies exist.
See Also:
PortletResponse#addProperty(Cookie)

getDateHeader

public long getDateHeader(java.lang.String arg0)
Specified by:
getDateHeader in interface javax.servlet.http.HttpServletRequest
Overrides:
getDateHeader in class javax.servlet.http.HttpServletRequestWrapper

getHeader

public java.lang.String getHeader(java.lang.String arg0)
Specified by:
getHeader in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeader in class javax.servlet.http.HttpServletRequestWrapper

getHeaderNames

public java.util.Enumeration getHeaderNames()
Specified by:
getHeaderNames in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeaderNames in class javax.servlet.http.HttpServletRequestWrapper

getHeaders

public java.util.Enumeration getHeaders(java.lang.String arg0)
Specified by:
getHeaders in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeaders in class javax.servlet.http.HttpServletRequestWrapper

getIntHeader

public int getIntHeader(java.lang.String arg0)
Specified by:
getIntHeader in interface javax.servlet.http.HttpServletRequest
Overrides:
getIntHeader in class javax.servlet.http.HttpServletRequestWrapper

getPathInfo

public java.lang.String getPathInfo()
Specified by:
getPathInfo in interface javax.servlet.http.HttpServletRequest
Overrides:
getPathInfo in class javax.servlet.http.HttpServletRequestWrapper

getQueryString

public java.lang.String getQueryString()
Specified by:
getQueryString in interface javax.servlet.http.HttpServletRequest
Overrides:
getQueryString in class javax.servlet.http.HttpServletRequestWrapper

getPathTranslated

public java.lang.String getPathTranslated()
Specified by:
getPathTranslated in interface javax.servlet.http.HttpServletRequest
Overrides:
getPathTranslated in class javax.servlet.http.HttpServletRequestWrapper

getRequestURI

public java.lang.String getRequestURI()
Specified by:
getRequestURI in interface javax.servlet.http.HttpServletRequest
Overrides:
getRequestURI in class javax.servlet.http.HttpServletRequestWrapper

getServletPath

public java.lang.String getServletPath()
Specified by:
getServletPath in interface javax.servlet.http.HttpServletRequest
Overrides:
getServletPath in class javax.servlet.http.HttpServletRequestWrapper

getRequestURL

public java.lang.StringBuffer getRequestURL()
Specified by:
getRequestURL in interface javax.servlet.http.HttpServletRequest
Overrides:
getRequestURL in class javax.servlet.http.HttpServletRequestWrapper

getSession

public javax.servlet.http.HttpSession getSession()
Specified by:
getSession in interface javax.servlet.http.HttpServletRequest
Overrides:
getSession in class javax.servlet.http.HttpServletRequestWrapper

getSession

public javax.servlet.http.HttpSession getSession(boolean arg0)
Specified by:
getSession in interface javax.servlet.http.HttpServletRequest
Overrides:
getSession in class javax.servlet.http.HttpServletRequestWrapper

getLifecyclePhase

public java.lang.String getLifecyclePhase()
Specified by:
getLifecyclePhase in interface InternalPortletRequest


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