Class DefaultProxyService
- java.lang.Object
-
- de.hybris.platform.xyformsservices.proxy.impl.DefaultProxyService
-
- All Implemented Interfaces:
ProxyService
public class DefaultProxyService extends java.lang.Object implements ProxyService
Default implementation for proxy service.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringEDIT_COMMANDprotected java.util.Map<java.lang.String,java.lang.String>extraHeadersprotected static java.lang.StringNEW_COMMANDprotected static java.lang.StringORBEON_PREFIXprotected static java.lang.StringORBEON_WEB_PREFIXprotected java.lang.StringorbeonAddressprotected ProxyEngineproxyEngineprotected static java.lang.StringVIEW_COMMAND
-
Constructor Summary
Constructors Constructor Description DefaultProxyService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringextractNamespace(javax.servlet.http.HttpServletRequest request)Extracts the namespace from the client request.java.util.Map<java.lang.String,java.lang.String>getExtraHeaders()Returns the extra headers configured for the application.java.lang.StringgetNextRandomNamespace()Generates a random namespace.voidproxy(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String namespace, java.lang.String url, boolean forceGetMethod, java.util.Map<java.lang.String,java.lang.String> headers)Proxies content.java.lang.StringrewriteURL(java.lang.String url, boolean embeddable)Rewrites a URL to be used for the proxy.java.lang.StringrewriteURL(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId)Rewrites a URL to be used for the proxy.java.lang.StringrewriteURL(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, boolean editable)Rewrites a URL to be used for the proxy.voidsetExtraHeaders(java.util.Map<java.lang.String,java.lang.String> extraHeaders)voidsetOrbeonAddress(java.lang.String orbeonAddress)voidsetProxyEngine(ProxyEngine proxyEngine)
-
-
-
Field Detail
-
NEW_COMMAND
protected static final java.lang.String NEW_COMMAND
- See Also:
- Constant Field Values
-
EDIT_COMMAND
protected static final java.lang.String EDIT_COMMAND
- See Also:
- Constant Field Values
-
VIEW_COMMAND
protected static final java.lang.String VIEW_COMMAND
- See Also:
- Constant Field Values
-
ORBEON_PREFIX
protected static final java.lang.String ORBEON_PREFIX
- See Also:
- Constant Field Values
-
ORBEON_WEB_PREFIX
protected static final java.lang.String ORBEON_WEB_PREFIX
- See Also:
- Constant Field Values
-
orbeonAddress
protected java.lang.String orbeonAddress
-
extraHeaders
protected java.util.Map<java.lang.String,java.lang.String> extraHeaders
-
proxyEngine
protected ProxyEngine proxyEngine
-
-
Method Detail
-
rewriteURL
public java.lang.String rewriteURL(java.lang.String url, boolean embeddable) throws java.net.MalformedURLExceptionDescription copied from interface:ProxyServiceRewrites a URL to be used for the proxy.- Specified by:
rewriteURLin interfaceProxyService- Parameters:
url- the url path to be rewrittenembeddable- the flag that specifies if the rewriter should produce a URL that produces embeddable content- Returns:
- the URL of the proxy
- Throws:
java.net.MalformedURLException- if result URL is invalid
-
rewriteURL
public java.lang.String rewriteURL(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, boolean editable) throws java.net.MalformedURLExceptionDescription copied from interface:ProxyServiceRewrites a URL to be used for the proxy.- Specified by:
rewriteURLin interfaceProxyService- Parameters:
applicationId- the application IdformId- the form IdformDataId- the form data Ideditable- the flag that specifies whether form should be editable or not- Returns:
- the URL of the proxy
- Throws:
java.net.MalformedURLException- if result URL is invalid
-
rewriteURL
public java.lang.String rewriteURL(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId) throws java.net.MalformedURLExceptionDescription copied from interface:ProxyServiceRewrites a URL to be used for the proxy.- Specified by:
rewriteURLin interfaceProxyService- Parameters:
applicationId- the application IdformId- the form IdformDataId- the form data Id- Returns:
- the URL of the proxy
- Throws:
java.net.MalformedURLException- if result URL is invalid
-
getNextRandomNamespace
public java.lang.String getNextRandomNamespace()
Description copied from interface:ProxyServiceGenerates a random namespace.- Specified by:
getNextRandomNamespacein interfaceProxyService- Returns:
- the random namespace string
-
proxy
public void proxy(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String namespace, java.lang.String url, boolean forceGetMethod, java.util.Map<java.lang.String,java.lang.String> headers) throws ProxyExceptionDescription copied from interface:ProxyServiceProxies content.- Specified by:
proxyin interfaceProxyService- Parameters:
request- theHttpServletRequestassociated to the callresponse- theHttpServletResponseassociated to the callnamespace- the namespace for HTML element's id generationurl- the url to be calledforceGetMethod- the flag for specifying if only "GET" method should be used, useful when proxying contentheaders- extra headers to be passed to the proxy service- Throws:
ProxyException- if request cannot be proxied
-
extractNamespace
public java.lang.String extractNamespace(javax.servlet.http.HttpServletRequest request)
Description copied from interface:ProxyServiceExtracts the namespace from the client request.- Specified by:
extractNamespacein interfaceProxyService- Parameters:
request- the request to get namespace from- Returns:
- the extracted namespace
-
setOrbeonAddress
public void setOrbeonAddress(java.lang.String orbeonAddress) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
getExtraHeaders
public java.util.Map<java.lang.String,java.lang.String> getExtraHeaders()
Description copied from interface:ProxyServiceReturns the extra headers configured for the application.- Specified by:
getExtraHeadersin interfaceProxyService- Returns:
- the extra headers as map
-
setExtraHeaders
public void setExtraHeaders(java.util.Map<java.lang.String,java.lang.String> extraHeaders)
-
setProxyEngine
public void setProxyEngine(ProxyEngine proxyEngine)
-
-