public class DefaultProxyService extends java.lang.Object implements ProxyService
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
EDIT_COMMAND |
protected java.util.Map<java.lang.String,java.lang.String> |
extraHeaders |
protected static java.lang.String |
NEW_COMMAND |
protected static java.lang.String |
ORBEON_PREFIX |
protected java.lang.String |
orbeonAddress |
protected ProxyEngine |
proxyEngine |
protected static java.lang.String |
VIEW_COMMAND |
| Constructor and Description |
|---|
DefaultProxyService() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
extractNamespace(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.String |
getNextRandomNamespace()
Generates a random namespace.
|
void |
proxy(HttpServletRequest request,
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.String |
rewriteURL(java.lang.String url,
boolean embeddable)
Rewrites a URL to be used for the proxy.
|
java.lang.String |
rewriteURL(java.lang.String applicationId,
java.lang.String formId,
java.lang.String formDataId)
Rewrites a URL to be used for the proxy.
|
java.lang.String |
rewriteURL(java.lang.String applicationId,
java.lang.String formId,
java.lang.String formDataId,
boolean editable)
Rewrites a URL to be used for the proxy.
|
void |
setExtraHeaders(java.util.Map<java.lang.String,java.lang.String> extraHeaders) |
void |
setOrbeonAddress(java.lang.String orbeonAddress) |
void |
setProxyEngine(ProxyEngine proxyEngine) |
protected static final java.lang.String NEW_COMMAND
protected static final java.lang.String EDIT_COMMAND
protected static final java.lang.String VIEW_COMMAND
protected static final java.lang.String ORBEON_PREFIX
protected java.lang.String orbeonAddress
protected java.util.Map<java.lang.String,java.lang.String> extraHeaders
protected ProxyEngine proxyEngine
public java.lang.String rewriteURL(java.lang.String url,
boolean embeddable)
throws java.net.MalformedURLException
ProxyServicerewriteURL in interface ProxyServiceurl - the url path to be rewrittenembeddable - the flag that specifies if the rewriter should produce a URL that produces embeddable contentjava.net.MalformedURLException - if result URL is invalidpublic java.lang.String rewriteURL(java.lang.String applicationId,
java.lang.String formId,
java.lang.String formDataId,
boolean editable)
throws java.net.MalformedURLException
ProxyServicerewriteURL in interface ProxyServiceapplicationId - the application IdformId - the form IdformDataId - the form data Ideditable - the flag that specifies whether form should be editable or notjava.net.MalformedURLException - if result URL is invalidpublic java.lang.String rewriteURL(java.lang.String applicationId,
java.lang.String formId,
java.lang.String formDataId)
throws java.net.MalformedURLException
ProxyServicerewriteURL in interface ProxyServiceapplicationId - the application IdformId - the form IdformDataId - the form data Idjava.net.MalformedURLException - if result URL is invalidpublic java.lang.String getNextRandomNamespace()
ProxyServicegetNextRandomNamespace in interface ProxyServicepublic void proxy(HttpServletRequest request,
HttpServletResponse response,
java.lang.String namespace,
java.lang.String url,
boolean forceGetMethod,
java.util.Map<java.lang.String,java.lang.String> headers)
throws ProxyException
ProxyServiceproxy in interface ProxyServicerequest - the HttpServletRequest associated to the callresponse - the HttpServletResponse associated 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 serviceProxyException - if request cannot be proxiedpublic java.lang.String extractNamespace(HttpServletRequest request)
ProxyServiceextractNamespace in interface ProxyServicerequest - the request to get namespace frompublic void setOrbeonAddress(java.lang.String orbeonAddress)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic java.util.Map<java.lang.String,java.lang.String> getExtraHeaders()
ProxyServicegetExtraHeaders in interface ProxyServicepublic void setExtraHeaders(java.util.Map<java.lang.String,java.lang.String> extraHeaders)
public void setProxyEngine(ProxyEngine proxyEngine)
Copyright © 2018 SAP SE. All Rights Reserved.