public class PortletAnyProxyMapping extends AbstractProxyMapping
ProxyMapping implementation for a generic reverse proxy portlet.
Because a generic reverse proxy portlet may serve any remote content,
this allows matching from any local path info and any remote content URI.
And this resolves the remote target URI by reading GenericReverseProxyPortlet.REMOTE_URI_PARAM_NAME
request parameter value.
| Constructor and Description |
|---|
PortletAnyProxyMapping(javax.portlet.PortletConfig portletConfig)
Constructs a
PortletAnyProxyMapping with the given portletConfig. |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getCurrentRemoteURI()
Returns the current remote target URI by reading
GenericReverseProxyPortlet.REMOTE_URI_PARAM_NAME
request parameter value. |
protected javax.portlet.PortletConfig |
getPortletConfig()
Returns the underlying
PortletConfig. |
boolean |
matchesLocal(String localPath)
Returns true the
localPath can be mapped by this proxy mapping. |
boolean |
matchesRemote(URI remoteURI)
Returns true the
remoteURI can be mapped by this proxy mapping. |
String |
resolveLocalFromRemote(URI remoteURI)
Resolves the
remoteURI to a local request path info. |
String |
resolveRemoteFromLocal(String localPath)
Resolves the
localPath to a remote target URI. |
getAttribute, getAttributesMap, getContentRewriter, getContentRewriters, removeAttribute, setAttribute, setAttributesMap, setContentRewriterspublic PortletAnyProxyMapping(javax.portlet.PortletConfig portletConfig)
PortletAnyProxyMapping with the given portletConfig.portletConfig - public boolean matchesLocal(String localPath)
localPath can be mapped by this proxy mapping.
Otherwise, it should return false.
Always returns true.
public String resolveRemoteFromLocal(String localPath)
localPath to a remote target URI.
Returns a resolved remote URI by reading GenericReverseProxyPortlet.REMOTE_URI_PARAM_NAME request parameter value.
public boolean matchesRemote(URI remoteURI)
remoteURI can be mapped by this proxy mapping.
Otherwise, it should return false.
Always returns true.
public String resolveLocalFromRemote(URI remoteURI)
remoteURI to a local request path info.
Always returns / because no local path info can be resolved in portlet environment.
protected javax.portlet.PortletConfig getPortletConfig()
PortletConfig.protected String getCurrentRemoteURI()
GenericReverseProxyPortlet.REMOTE_URI_PARAM_NAME
request parameter value.
It reads the request parameter first. If not found, then it reads the portlet preferences. If nothing found, then it reads the portlet init parameter finally.
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.