|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jetspeed.mockobjects.request.MockRequestContext
public class MockRequestContext
MockRequestContext
| Field Summary |
|---|
| Fields inherited from interface org.apache.jetspeed.request.RequestContext |
|---|
REQUEST_PORTALENV |
| Constructor Summary | |
|---|---|
MockRequestContext()
|
|
MockRequestContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
|
MockRequestContext(java.lang.String path)
|
|
| Method Summary | |
|---|---|
void |
clearThreadContext()
Clears the request context from the current thread |
boolean |
ensureThreadContext()
The RequestContext itself is kept in a ThreadLocal, calling this method from another (parallel) thread ensures its ThreadLocal instance will be synchronized with this instance as well. |
PortletWindow |
getActionWindow()
Get the target Action Window |
java.lang.Object |
getAttribute(java.lang.String key)
Get a request attribute associated with this single request. |
CapabilityMap |
getCapabilityMap()
Get the Capability Map |
java.lang.String |
getCharacterEncoding()
get the character encoding |
javax.servlet.ServletConfig |
getConfig()
Gets the HTTP Servlet Config |
PortletWindow |
getCurrentPortletWindow()
|
PortletWindow |
getInstantlyCreatedPortletWindow(java.lang.String windowId,
java.lang.String portletUniqueName)
|
java.util.Locale |
getLocale()
Gets the locale associated with this request. |
java.lang.String |
getMediaType()
get the Media Type |
java.util.List<KeyValue<java.lang.String,HeadElement>> |
getMergedHeadElements()
Merges and returns the head elements contributed by portlets. |
java.lang.String |
getMimeType()
Get the mimeType for the request |
NavigationalState |
getNavigationalState()
|
java.util.Map |
getObjects()
Return a map of Jetspeed Request Context objects configured via Spring Map |
ContentPage |
getPage()
Gets the target page for this request |
java.util.Map |
getParameterMap()
Use this method to get a map of request parameters on the generalized request, decoupling request parameter manipulation from servlet API. |
java.lang.String |
getPath()
Returns any extra path information associated with the URL the client sent when it made this request. |
Pipeline |
getPipeline()
Get the current executing pipeline |
PortalURL |
getPortalURL()
Gets the Portal URL for the current request. |
PortletWindow |
getPortletWindow(ContentFragment fragment)
|
PortletWindow |
getPortletWindow(java.lang.String windowId)
|
Language |
getPreferedLanguage(PortletDefinition portlet)
getPreferedLanguage |
java.util.Map |
getProfileLocators()
Gets the profile locators for this request |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the HTTP Servlet Request. |
javax.servlet.http.HttpServletRequest |
getRequestForWindow(PortletWindow window)
|
java.lang.String |
getRequestParameter(java.lang.String key)
Use this method to get a request parameter on the generalized request, decoupling request parameter manipulation from servlet API. |
javax.servlet.http.HttpServletResponse |
getResponse()
Gets the HTTP Servlet Response. |
javax.servlet.http.HttpServletResponse |
getResponseForWindow(PortletWindow window)
|
java.lang.Object |
getSessionAttribute(java.lang.String key)
Gets an attribute from the session. |
javax.security.auth.Subject |
getSubject()
Gets the subject associated with the authorized entity. |
java.util.Map |
getUserInfoMap(java.lang.String appName)
Returns the user info map of user attributes for a given portlet application. |
java.security.Principal |
getUserPrincipal()
Gets the Jetspeed primary user principal associated with the authorized entity. |
ContentPage |
locatePage(Profiler profiler,
PageLayoutComponent pageLayoutComponent,
java.lang.String nonProfiledPath)
Locates a specific page using the profiler and site manager location algorithms from a generalized non-profiled path to the first page matching the path |
java.lang.Throwable |
popActionFailure(PortletWindow window)
|
PortletWindow |
resolvePortletWindow(java.lang.String windowId)
|
void |
setActionFailure(PortletWindow window,
java.lang.Throwable actionFailure)
|
void |
setActionWindow(PortletWindow window)
Sets the target Portlet Window |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets an attribute into the request. |
void |
setCapabilityMap(CapabilityMap map)
Set the capabilityMap. |
void |
setCharacterEncoding(java.lang.String enc)
set character encoding |
void |
setCurrentPortletWindow(PortletWindow window)
|
void |
setLocale(java.util.Locale locale)
Sets the locale associated with this request. |
void |
setMediaType(java.lang.String mediaType)
Set the mediaType. |
void |
setMimeType(java.lang.String mimeType)
Set the Mimetype. |
void |
setObjects(java.util.Map objects)
|
void |
setPage(ContentPage page)
Sets the target page for this request |
void |
setPath(java.lang.String path)
setPath |
void |
setPipeline(Pipeline pipeline)
Set the current pipeline |
void |
setPortalURL(PortalURL url)
Sets the Portal URL for the current request. |
void |
setProfileLocators(java.util.Map locators)
Sets the target page profile locators for this request |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the HTTP Servlet Request. |
void |
setResponse(javax.servlet.http.HttpServletResponse response)
Sets the HTTP Servlet Response. |
void |
setSessionAttribute(java.lang.String key,
java.lang.Object value)
Sets an attribute into the session. |
void |
setSubject(javax.security.auth.Subject subject)
Sets the subject associated with the authorized entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockRequestContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
public MockRequestContext()
public MockRequestContext(java.lang.String path)
| Method Detail |
|---|
public java.util.Map getUserInfoMap(java.lang.String appName)
RequestContext
getUserInfoMap in interface RequestContextappName - The portlet application name.
public PortletWindow getActionWindow()
RequestContext
getActionWindow in interface RequestContextpublic CapabilityMap getCapabilityMap()
RequestContext
getCapabilityMap in interface RequestContextpublic java.lang.String getCharacterEncoding()
RequestContext
getCharacterEncoding in interface RequestContextpublic javax.servlet.ServletConfig getConfig()
RequestContext
getConfig in interface RequestContextpublic java.util.Locale getLocale()
RequestContext
getLocale in interface RequestContextpublic java.lang.String getMediaType()
RequestContext
getMediaType in interface RequestContextpublic java.lang.String getMimeType()
RequestContext
getMimeType in interface RequestContextpublic NavigationalState getNavigationalState()
public ContentPage getPage()
RequestContext
getPage in interface RequestContextpublic PortalURL getPortalURL()
RequestContext
getPortalURL in interface RequestContextnull value.public void setPortalURL(PortalURL url)
RequestContext
setPortalURL in interface RequestContextpublic java.util.Map getProfileLocators()
RequestContext
getProfileLocators in interface RequestContextpublic javax.servlet.http.HttpServletRequest getRequest()
RequestContextgetPortletRequestForWindow() before
being processed by the portlet container.
getRequest in interface RequestContextpublic javax.servlet.http.HttpServletRequest getRequestForWindow(PortletWindow window)
public javax.servlet.http.HttpServletResponse getResponse()
RequestContextgetPortletResponseForWindow() before
being processed by the portlet container.
getResponse in interface RequestContextpublic javax.servlet.http.HttpServletResponse getResponseForWindow(PortletWindow window)
public javax.security.auth.Subject getSubject()
RequestContext
getSubject in interface RequestContextpublic java.security.Principal getUserPrincipal()
RequestContext
getUserPrincipal in interface RequestContextpublic void setActionWindow(PortletWindow window)
RequestContext
setActionWindow in interface RequestContextpublic void setCapabilityMap(CapabilityMap map)
RequestContext
setCapabilityMap in interface RequestContextpublic void setCharacterEncoding(java.lang.String enc)
RequestContext
setCharacterEncoding in interface RequestContextpublic void setLocale(java.util.Locale locale)
RequestContext
setLocale in interface RequestContextpublic void setMediaType(java.lang.String mediaType)
RequestContext
setMediaType in interface RequestContextpublic void setMimeType(java.lang.String mimeType)
RequestContext
setMimeType in interface RequestContextpublic void setPage(ContentPage page)
RequestContext
setPage in interface RequestContextpage - The target pagepublic void setProfileLocators(java.util.Map locators)
RequestContext
setProfileLocators in interface RequestContextlocators - The target profile locators by locator namepublic void setSubject(javax.security.auth.Subject subject)
RequestContext
setSubject in interface RequestContextsubject - The JAAS subject on this request.public java.lang.String getRequestParameter(java.lang.String key)
RequestContext
getRequestParameter in interface RequestContextkey - The parameter unique key
public java.util.Map getParameterMap()
RequestContext
getParameterMap in interface RequestContext
public void setSessionAttribute(java.lang.String key,
java.lang.Object value)
RequestContext
setSessionAttribute in interface RequestContextkey - The key of the session attributevalue - The value of the session attributepublic java.lang.Object getSessionAttribute(java.lang.String key)
RequestContext
getSessionAttribute in interface RequestContextkey - The key of the attribute
public void setAttribute(java.lang.String key,
java.lang.Object value)
RequestContext
setAttribute in interface RequestContextkey - The key of the request attributevalue - The value of the request attributepublic java.lang.Object getAttribute(java.lang.String key)
RequestContext
getAttribute in interface RequestContextkey - The key of the request attribute
public java.lang.String getPath()
RequestContextReturns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string. This method returns null if there was no extra path information.
This method should function identically to HttpServletRequest.getPathInfo()
except for that it removes ALL portal/portlet navigational state information from the
path info string.
getPath in interface RequestContextpublic Language getPreferedLanguage(PortletDefinition portlet)
getPreferedLanguage
getPreferedLanguage in interface RequestContextportlet -
org.apache.jetspeed.request.RequestContext#getPreferedLanguage(org.apache.pluto.container.om.portlet.PortletDefinition)public void setPath(java.lang.String path)
setPath
setPath in interface RequestContextpath - RequestContext.setPath(java.lang.String)public java.lang.Throwable popActionFailure(PortletWindow window)
popActionFailure in interface RequestContext
public void setActionFailure(PortletWindow window,
java.lang.Throwable actionFailure)
setActionFailure in interface RequestContextpublic Pipeline getPipeline()
getPipeline in interface RequestContextpublic void setPipeline(Pipeline pipeline)
setPipeline in interface RequestContextpipeline - public void setRequest(javax.servlet.http.HttpServletRequest request)
RequestContextgetPortletRequestForWindow() before
being processed by the portlet container.
setRequest in interface RequestContextrequest - The request to set.public void setResponse(javax.servlet.http.HttpServletResponse response)
RequestContextgetPortletResponseForWindow() before
being processed by the portlet container.
setResponse in interface RequestContextresponse - The request to set.
public ContentPage locatePage(Profiler profiler,
PageLayoutComponent pageLayoutComponent,
java.lang.String nonProfiledPath)
RequestContext
locatePage in interface RequestContextprofiler - The profiler component to use in the searchpageLayoutComponent - The page layout component used to assemble the returned page
public java.util.Map getObjects()
RequestContext
getObjects in interface RequestContextpublic void setObjects(java.util.Map objects)
public PortletWindow getCurrentPortletWindow()
getCurrentPortletWindow in interface RequestContextpublic void setCurrentPortletWindow(PortletWindow window)
setCurrentPortletWindow in interface RequestContextpublic PortletWindow getPortletWindow(ContentFragment fragment)
getPortletWindow in interface RequestContextpublic PortletWindow getPortletWindow(java.lang.String windowId)
getPortletWindow in interface RequestContext
public PortletWindow getInstantlyCreatedPortletWindow(java.lang.String windowId,
java.lang.String portletUniqueName)
getInstantlyCreatedPortletWindow in interface RequestContextpublic PortletWindow resolvePortletWindow(java.lang.String windowId)
resolvePortletWindow in interface RequestContextpublic void clearThreadContext()
RequestContext
clearThreadContext in interface RequestContextpublic boolean ensureThreadContext()
RequestContextThis method will return true if this thread its ThreadLocal didn't yet have this RequestContext value set. In that case the calling code block, preferably in a finally statement should call clearThreadContext() to ensure the reference to this instance is removed again from its ThreadLocal instance as Thread Pool solutions might reuse threads.
ensureThreadContext in interface RequestContextpublic java.util.List<KeyValue<java.lang.String,HeadElement>> getMergedHeadElements()
RequestContext
getMergedHeadElements in interface RequestContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||