public class MockPortletRequest extends Object implements PortletRequest
PortletRequest
interface.PortletRequest.P3PUserInfos
ACTION_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 |
---|
MockPortletRequest()
Create a new MockPortletRequest with a default
MockPortalContext
and a default MockPortletContext . |
MockPortletRequest(PortalContext portalContext,
PortletContext portletContext)
Create a new MockPortletRequest.
|
MockPortletRequest(PortletContext portletContext)
Create a new MockPortletRequest with a default
MockPortalContext . |
public MockPortletRequest()
MockPortalContext
and a default MockPortletContext
.MockPortalContext
,
MockPortletContext
public MockPortletRequest(PortletContext portletContext)
MockPortalContext
.portletContext
- the PortletContext that the request runs inMockPortalContext
public MockPortletRequest(PortalContext portalContext, PortletContext portletContext)
portalContext
- the PortalContext that the request runs inportletContext
- the PortletContext that the request runs inprotected String getLifecyclePhase()
public boolean isActive()
public void close()
protected void checkActive() throws IllegalStateException
IllegalStateException
public boolean isWindowStateAllowed(WindowState windowState)
isWindowStateAllowed
in interface PortletRequest
public boolean isPortletModeAllowed(PortletMode portletMode)
isPortletModeAllowed
in interface PortletRequest
public void setPortletMode(PortletMode portletMode)
public PortletMode getPortletMode()
getPortletMode
in interface PortletRequest
public void setWindowState(WindowState windowState)
public WindowState getWindowState()
getWindowState
in interface PortletRequest
public void setPreferences(PortletPreferences preferences)
public PortletPreferences getPreferences()
getPreferences
in interface PortletRequest
public void setSession(PortletSession session)
public PortletSession getPortletSession()
getPortletSession
in interface PortletRequest
public PortletSession getPortletSession(boolean create)
getPortletSession
in interface PortletRequest
public void setProperty(String key, String value)
If there are already one or more values registered for the given property key, they will be replaced.
public void addProperty(String key, String value)
If there are already one or more values registered for the given property key, the given value will be added to the end of the list.
public String getProperty(String key)
getProperty
in interface PortletRequest
public Enumeration<String> getProperties(String key)
getProperties
in interface PortletRequest
public Enumeration<String> getPropertyNames()
getPropertyNames
in interface PortletRequest
public PortalContext getPortalContext()
getPortalContext
in interface PortletRequest
public void setAuthType(String authType)
public String getAuthType()
getAuthType
in interface PortletRequest
public void setContextPath(String contextPath)
public String getContextPath()
getContextPath
in interface PortletRequest
public void setRemoteUser(String remoteUser)
public String getRemoteUser()
getRemoteUser
in interface PortletRequest
public void setUserPrincipal(Principal userPrincipal)
public Principal getUserPrincipal()
getUserPrincipal
in interface PortletRequest
public void addUserRole(String role)
public boolean isUserInRole(String role)
isUserInRole
in interface PortletRequest
public Object getAttribute(String name)
getAttribute
in interface PortletRequest
public Enumeration<String> getAttributeNames()
getAttributeNames
in interface PortletRequest
public String getParameter(String name)
getParameter
in interface PortletRequest
public Enumeration<String> getParameterNames()
getParameterNames
in interface PortletRequest
public String[] getParameterValues(String name)
getParameterValues
in interface PortletRequest
public Map<String,String[]> getParameterMap()
getParameterMap
in interface PortletRequest
public void setSecure(boolean secure)
public boolean isSecure()
isSecure
in interface PortletRequest
public void setAttribute(String name, Object value)
setAttribute
in interface PortletRequest
public void removeAttribute(String name)
removeAttribute
in interface PortletRequest
public String getRequestedSessionId()
getRequestedSessionId
in interface PortletRequest
public void setRequestedSessionIdValid(boolean requestedSessionIdValid)
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface PortletRequest
public void addResponseContentType(String responseContentType)
public void addPreferredResponseContentType(String responseContentType)
public String getResponseContentType()
getResponseContentType
in interface PortletRequest
public Enumeration<String> getResponseContentTypes()
getResponseContentTypes
in interface PortletRequest
public void addLocale(Locale locale)
public void addPreferredLocale(Locale locale)
public Locale getLocale()
getLocale
in interface PortletRequest
public Enumeration<Locale> getLocales()
getLocales
in interface PortletRequest
public void setScheme(String scheme)
public String getScheme()
getScheme
in interface PortletRequest
public void setServerName(String serverName)
public String getServerName()
getServerName
in interface PortletRequest
public void setServerPort(int serverPort)
public int getServerPort()
getServerPort
in interface PortletRequest
public void setWindowID(String windowID)
public String getWindowID()
getWindowID
in interface PortletRequest
public void setCookies(Cookie... cookies)
public Cookie[] getCookies()
getCookies
in interface PortletRequest
public Map<String,String[]> getPrivateParameterMap()
getPrivateParameterMap
in interface PortletRequest
public Map<String,String[]> getPublicParameterMap()
getPublicParameterMap
in interface PortletRequest
public void registerPublicParameter(String name)