public class MockPortletRequest extends Object implements javax.portlet.PortletRequest
PortletRequest interface.| Constructor and Description |
|---|
MockPortletRequest()
Create a new MockPortletRequest with a default
MockPortalContext
and a default MockPortletContext. |
MockPortletRequest(javax.portlet.PortalContext portalContext,
javax.portlet.PortletContext portletContext)
Create a new MockPortletRequest.
|
MockPortletRequest(javax.portlet.PortletContext portletContext)
Create a new MockPortletRequest with a default
MockPortalContext. |
| Modifier and Type | Method and Description |
|---|---|
void |
addLocale(Locale locale) |
void |
addParameter(String name,
String value) |
void |
addParameter(String name,
String[] values) |
void |
addPreferredLocale(Locale locale) |
void |
addPreferredResponseContentType(String responseContentType) |
void |
addProperty(String key,
String value)
Add a single value for the specified property.
|
void |
addResponseContentType(String responseContentType) |
void |
addUserRole(String role) |
protected void |
checkActive()
Check whether this request is still active (that is, not completed yet),
throwing an IllegalStateException if not active anymore.
|
void |
close()
Mark this request as completed.
|
Object |
getAttribute(String name) |
Enumeration<String> |
getAttributeNames() |
String |
getAuthType() |
String |
getContextPath() |
javax.servlet.http.Cookie[] |
getCookies() |
protected String |
getLifecyclePhase()
Return the Portlet 2.0 lifecycle id for the current phase.
|
Locale |
getLocale() |
Enumeration<Locale> |
getLocales() |
String |
getParameter(String name) |
Map<String,String[]> |
getParameterMap() |
Enumeration<String> |
getParameterNames() |
String[] |
getParameterValues(String name) |
javax.portlet.PortalContext |
getPortalContext() |
javax.portlet.PortletMode |
getPortletMode() |
javax.portlet.PortletSession |
getPortletSession() |
javax.portlet.PortletSession |
getPortletSession(boolean create) |
javax.portlet.PortletPreferences |
getPreferences() |
Map<String,String[]> |
getPrivateParameterMap() |
Enumeration<String> |
getProperties(String key) |
String |
getProperty(String key) |
Enumeration<String> |
getPropertyNames() |
Map<String,String[]> |
getPublicParameterMap() |
String |
getRemoteUser() |
String |
getRequestedSessionId() |
String |
getResponseContentType() |
Enumeration<String> |
getResponseContentTypes() |
String |
getScheme() |
String |
getServerName() |
int |
getServerPort() |
Principal |
getUserPrincipal() |
String |
getWindowID() |
javax.portlet.WindowState |
getWindowState() |
boolean |
isActive()
Return whether this request is still active (that is, not completed yet).
|
boolean |
isPortletModeAllowed(javax.portlet.PortletMode portletMode) |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
boolean |
isWindowStateAllowed(javax.portlet.WindowState windowState) |
void |
registerPublicParameter(String name) |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
Object value) |
void |
setAuthType(String authType) |
void |
setContextPath(String contextPath) |
void |
setCookies(javax.servlet.http.Cookie... cookies) |
void |
setParameter(String key,
String value) |
void |
setParameter(String key,
String[] values) |
void |
setParameters(Map<String,String[]> parameters) |
void |
setPortletMode(javax.portlet.PortletMode portletMode) |
void |
setPreferences(javax.portlet.PortletPreferences preferences) |
void |
setProperty(String key,
String value)
Set a single value for the specified property.
|
void |
setRemoteUser(String remoteUser) |
void |
setRequestedSessionIdValid(boolean requestedSessionIdValid) |
void |
setScheme(String scheme) |
void |
setSecure(boolean secure) |
void |
setServerName(String serverName) |
void |
setServerPort(int serverPort) |
void |
setSession(javax.portlet.PortletSession session) |
void |
setUserPrincipal(Principal userPrincipal) |
void |
setWindowID(String windowID) |
void |
setWindowState(javax.portlet.WindowState windowState) |
public MockPortletRequest()
MockPortalContext
and a default MockPortletContext.MockPortalContext,
MockPortletContextpublic MockPortletRequest(javax.portlet.PortletContext portletContext)
MockPortalContext.portletContext - the PortletContext that the request runs inMockPortalContextpublic MockPortletRequest(javax.portlet.PortalContext portalContext,
javax.portlet.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
IllegalStateExceptionpublic boolean isWindowStateAllowed(javax.portlet.WindowState windowState)
isWindowStateAllowed in interface javax.portlet.PortletRequestpublic boolean isPortletModeAllowed(javax.portlet.PortletMode portletMode)
isPortletModeAllowed in interface javax.portlet.PortletRequestpublic void setPortletMode(javax.portlet.PortletMode portletMode)
public javax.portlet.PortletMode getPortletMode()
getPortletMode in interface javax.portlet.PortletRequestpublic void setWindowState(javax.portlet.WindowState windowState)
public javax.portlet.WindowState getWindowState()
getWindowState in interface javax.portlet.PortletRequestpublic void setPreferences(javax.portlet.PortletPreferences preferences)
public javax.portlet.PortletPreferences getPreferences()
getPreferences in interface javax.portlet.PortletRequestpublic void setSession(javax.portlet.PortletSession session)
public javax.portlet.PortletSession getPortletSession()
getPortletSession in interface javax.portlet.PortletRequestpublic javax.portlet.PortletSession getPortletSession(boolean create)
getPortletSession in interface javax.portlet.PortletRequestpublic 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 javax.portlet.PortletRequestpublic Enumeration<String> getProperties(String key)
getProperties in interface javax.portlet.PortletRequestpublic Enumeration<String> getPropertyNames()
getPropertyNames in interface javax.portlet.PortletRequestpublic javax.portlet.PortalContext getPortalContext()
getPortalContext in interface javax.portlet.PortletRequestpublic void setAuthType(String authType)
public String getAuthType()
getAuthType in interface javax.portlet.PortletRequestpublic void setContextPath(String contextPath)
public String getContextPath()
getContextPath in interface javax.portlet.PortletRequestpublic void setRemoteUser(String remoteUser)
public String getRemoteUser()
getRemoteUser in interface javax.portlet.PortletRequestpublic void setUserPrincipal(Principal userPrincipal)
public Principal getUserPrincipal()
getUserPrincipal in interface javax.portlet.PortletRequestpublic void addUserRole(String role)
public boolean isUserInRole(String role)
isUserInRole in interface javax.portlet.PortletRequestpublic Object getAttribute(String name)
getAttribute in interface javax.portlet.PortletRequestpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface javax.portlet.PortletRequestpublic String getParameter(String name)
getParameter in interface javax.portlet.PortletRequestpublic Enumeration<String> getParameterNames()
getParameterNames in interface javax.portlet.PortletRequestpublic String[] getParameterValues(String name)
getParameterValues in interface javax.portlet.PortletRequestpublic Map<String,String[]> getParameterMap()
getParameterMap in interface javax.portlet.PortletRequestpublic void setSecure(boolean secure)
public boolean isSecure()
isSecure in interface javax.portlet.PortletRequestpublic void setAttribute(String name, Object value)
setAttribute in interface javax.portlet.PortletRequestpublic void removeAttribute(String name)
removeAttribute in interface javax.portlet.PortletRequestpublic String getRequestedSessionId()
getRequestedSessionId in interface javax.portlet.PortletRequestpublic void setRequestedSessionIdValid(boolean requestedSessionIdValid)
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.portlet.PortletRequestpublic void addResponseContentType(String responseContentType)
public void addPreferredResponseContentType(String responseContentType)
public String getResponseContentType()
getResponseContentType in interface javax.portlet.PortletRequestpublic Enumeration<String> getResponseContentTypes()
getResponseContentTypes in interface javax.portlet.PortletRequestpublic void addLocale(Locale locale)
public void addPreferredLocale(Locale locale)
public Locale getLocale()
getLocale in interface javax.portlet.PortletRequestpublic Enumeration<Locale> getLocales()
getLocales in interface javax.portlet.PortletRequestpublic void setScheme(String scheme)
public String getScheme()
getScheme in interface javax.portlet.PortletRequestpublic void setServerName(String serverName)
public String getServerName()
getServerName in interface javax.portlet.PortletRequestpublic void setServerPort(int serverPort)
public int getServerPort()
getServerPort in interface javax.portlet.PortletRequestpublic void setWindowID(String windowID)
public String getWindowID()
getWindowID in interface javax.portlet.PortletRequestpublic void setCookies(javax.servlet.http.Cookie... cookies)
public javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.portlet.PortletRequestpublic Map<String,String[]> getPrivateParameterMap()
getPrivateParameterMap in interface javax.portlet.PortletRequestpublic Map<String,String[]> getPublicParameterMap()
getPublicParameterMap in interface javax.portlet.PortletRequestpublic void registerPublicParameter(String name)
Copyright © 2015. All rights reserved.