|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.mock.web.portlet.MockPortletRequest
public class MockPortletRequest
Mock implementation of the PortletRequest interface.
| Field Summary |
|---|
| Fields inherited from interface javax.portlet.PortletRequest |
|---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH, USER_INFO |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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 |
getAttributeNames()
|
String |
getAuthType()
|
String |
getContextPath()
|
Locale |
getLocale()
|
Enumeration |
getLocales()
|
String |
getParameter(String name)
|
Map |
getParameterMap()
|
Enumeration |
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()
|
Enumeration |
getProperties(String key)
|
String |
getProperty(String key)
|
Enumeration |
getPropertyNames()
|
String |
getRemoteUser()
|
String |
getRequestedSessionId()
|
String |
getResponseContentType()
|
Enumeration |
getResponseContentTypes()
|
String |
getScheme()
|
String |
getServerName()
|
int |
getServerPort()
|
Principal |
getUserPrincipal()
|
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 |
removeAttribute(String name)
|
void |
setAttribute(String name,
Object value)
|
void |
setAuthType(String authType)
|
void |
setContextPath(String contextPath)
|
void |
setParameter(String key,
String value)
|
void |
setParameter(String key,
String[] values)
|
void |
setParameters(Map 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 |
setWindowState(javax.portlet.WindowState windowState)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockPortletRequest()
MockPortalContext
and a default MockPortletContext.
MockPortalContext,
MockPortletContextpublic MockPortletRequest(javax.portlet.PortletContext portletContext)
MockPortalContext.
portletContext - the PortletContext that the request runs inMockPortalContext
public MockPortletRequest(javax.portlet.PortalContext portalContext,
javax.portlet.PortletContext portletContext)
portalContext - the PortalContext that the request runs inportletContext - the PortletContext that the request runs in| Method Detail |
|---|
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.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 javax.portlet.PortletRequestpublic Enumeration getProperties(String key)
getProperties in interface javax.portlet.PortletRequestpublic Enumeration 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 getAttributeNames()
getAttributeNames in interface javax.portlet.PortletRequestpublic void setParameters(Map parameters)
public void setParameter(String key,
String value)
public void setParameter(String key,
String[] values)
public void addParameter(String name,
String value)
public void addParameter(String name,
String[] values)
public String getParameter(String name)
getParameter in interface javax.portlet.PortletRequestpublic Enumeration getParameterNames()
getParameterNames in interface javax.portlet.PortletRequestpublic String[] getParameterValues(String name)
getParameterValues in interface javax.portlet.PortletRequestpublic Map getParameterMap()
getParameterMap in interface javax.portlet.PortletRequestpublic void setSecure(boolean secure)
public boolean isSecure()
isSecure in interface javax.portlet.PortletRequest
public 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 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 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.PortletRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||