站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

MockPortletRequest (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.mock.web.portlet
Class MockPortletRequest

java.lang.Object
  extended by org.springframework.mock.web.portlet.MockPortletRequest
All Implemented Interfaces:
PortletRequest
Direct Known Subclasses:
MockActionRequest, MockRenderRequest

public class MockPortletRequest
extends Object
implements PortletRequest

Mock implementation of the PortletRequest interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

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(PortalContext portalContext, PortletContext portletContext)
          Create a new MockPortletRequest.
MockPortletRequest(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)
           
 PortalContext getPortalContext()
           
 PortletMode getPortletMode()
           
 PortletSession getPortletSession()
           
 PortletSession getPortletSession(boolean create)
           
 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()
           
 WindowState getWindowState()
           
 boolean isActive()
          Return whether this request is still active (that is, not completed yet).
 boolean isPortletModeAllowed(PortletMode portletMode)
           
 boolean isRequestedSessionIdValid()
           
 boolean isSecure()
           
 boolean isUserInRole(String role)
           
 boolean isWindowStateAllowed(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(PortletMode portletMode)
           
 void setPreferences(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(PortletSession session)
           
 void setUserPrincipal(Principal userPrincipal)
           
 void setWindowState(WindowState windowState)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockPortletRequest

public MockPortletRequest()
Create a new MockPortletRequest with a default MockPortalContext and a default MockPortletContext.

See Also:
MockPortalContext, MockPortletContext

MockPortletRequest

public MockPortletRequest(PortletContext portletContext)
Create a new MockPortletRequest with a default MockPortalContext.

Parameters:
portletContext - the PortletContext that the request runs in
See Also:
MockPortalContext

MockPortletRequest

public MockPortletRequest(PortalContext portalContext,
                          PortletContext portletContext)
Create a new MockPortletRequest.

Parameters:
portalContext - the PortalContext that the request runs in
portletContext - the PortletContext that the request runs in
Method Detail

isActive

public boolean isActive()
Return whether this request is still active (that is, not completed yet).


close

public void close()
Mark this request as completed.


checkActive

protected void checkActive()
                    throws IllegalStateException
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.

Throws:
IllegalStateException

isWindowStateAllowed

public boolean isWindowStateAllowed(WindowState windowState)
Specified by:
isWindowStateAllowed in interface PortletRequest

isPortletModeAllowed

public boolean isPortletModeAllowed(PortletMode portletMode)
Specified by:
isPortletModeAllowed in interface PortletRequest

setPortletMode

public void setPortletMode(PortletMode portletMode)

getPortletMode

public PortletMode getPortletMode()
Specified by:
getPortletMode in interface PortletRequest

setWindowState

public void setWindowState(WindowState windowState)

getWindowState

public WindowState getWindowState()
Specified by:
getWindowState in interface PortletRequest

setPreferences

public void setPreferences(PortletPreferences preferences)

getPreferences

public PortletPreferences getPreferences()
Specified by:
getPreferences in interface PortletRequest

setSession

public void setSession(PortletSession session)

getPortletSession

public PortletSession getPortletSession()
Specified by:
getPortletSession in interface PortletRequest

getPortletSession

public PortletSession getPortletSession(boolean create)
Specified by:
getPortletSession in interface PortletRequest

setProperty

public void setProperty(String key,
                        String value)
Set a single value for the specified property.

If there are already one or more values registered for the given property key, they will be replaced.


addProperty

public void addProperty(String key,
                        String value)
Add a single value for the specified property.

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.


getProperty

public String getProperty(String key)
Specified by:
getProperty in interface PortletRequest

getProperties

public Enumeration getProperties(String key)
Specified by:
getProperties in interface PortletRequest

getPropertyNames

public Enumeration getPropertyNames()
Specified by:
getPropertyNames in interface PortletRequest

getPortalContext

public PortalContext getPortalContext()
Specified by:
getPortalContext in interface PortletRequest

setAuthType

public void setAuthType(String authType)

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface PortletRequest

setContextPath

public void setContextPath(String contextPath)

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface PortletRequest

setRemoteUser

public void setRemoteUser(String remoteUser)

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in interface PortletRequest

setUserPrincipal

public void setUserPrincipal(Principal userPrincipal)

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface PortletRequest

addUserRole

public void addUserRole(String role)

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in interface PortletRequest

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface PortletRequest

getAttributeNames

public Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface PortletRequest

setParameters

public void setParameters(Map parameters)

setParameter

public void setParameter(String key,
                         String value)

setParameter

public void setParameter(String key,
                         String[] values)

addParameter

public void addParameter(String name,
                         String value)

addParameter

public void addParameter(String name,
                         String[] values)

getParameter

public String getParameter(String name)
Specified by:
getParameter in interface PortletRequest

getParameterNames

public Enumeration getParameterNames()
Specified by:
getParameterNames in interface PortletRequest

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface PortletRequest

getParameterMap

public Map getParameterMap()
Specified by:
getParameterMap in interface PortletRequest

setSecure

public void setSecure(boolean secure)

isSecure

public boolean isSecure()
Specified by:
isSecure in interface PortletRequest

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface PortletRequest

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface PortletRequest

getRequestedSessionId

public String getRequestedSessionId()
Specified by:
getRequestedSessionId in interface PortletRequest

setRequestedSessionIdValid

public void setRequestedSessionIdValid(boolean requestedSessionIdValid)

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Specified by:
isRequestedSessionIdValid in interface PortletRequest

addResponseContentType

public void addResponseContentType(String responseContentType)

addPreferredResponseContentType

public void addPreferredResponseContentType(String responseContentType)

getResponseContentType

public String getResponseContentType()
Specified by:
getResponseContentType in interface PortletRequest

getResponseContentTypes

public Enumeration getResponseContentTypes()
Specified by:
getResponseContentTypes in interface PortletRequest

addLocale

public void addLocale(Locale locale)

addPreferredLocale

public void addPreferredLocale(Locale locale)

getLocale

public Locale getLocale()
Specified by:
getLocale in interface PortletRequest

getLocales

public Enumeration getLocales()
Specified by:
getLocales in interface PortletRequest

setScheme

public void setScheme(String scheme)

getScheme

public String getScheme()
Specified by:
getScheme in interface PortletRequest

setServerName

public void setServerName(String serverName)

getServerName

public String getServerName()
Specified by:
getServerName in interface PortletRequest

setServerPort

public void setServerPort(int serverPort)

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface PortletRequest

The Spring Framework

Copyright © 2002-2007 The Spring Framework.