Interface ProxyService
-
- All Known Implementing Classes:
DefaultProxyService
public interface ProxyServiceClass that implements some util methods to use the proxy engine.
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
rewriteURL
java.lang.String rewriteURL(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId) throws java.net.MalformedURLExceptionRewrites a URL to be used for the proxy.- 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
-
rewriteURL
java.lang.String rewriteURL(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, boolean editable) throws java.net.MalformedURLExceptionRewrites a URL to be used for the proxy.- 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
java.lang.String rewriteURL(java.lang.String url, boolean embeddable) throws java.net.MalformedURLExceptionRewrites a URL to be used for the proxy.- 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
-
getNextRandomNamespace
java.lang.String getNextRandomNamespace()
Generates a random namespace.- Returns:
- the random namespace string
-
extractNamespace
java.lang.String extractNamespace(javax.servlet.http.HttpServletRequest request)
Extracts the namespace from the client request.- Parameters:
request- the request to get namespace from- Returns:
- the extracted namespace
-
getExtraHeaders
java.util.Map<java.lang.String,java.lang.String> getExtraHeaders()
Returns the extra headers configured for the application.- Returns:
- the extra headers as map
-
proxy
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 ProxyExceptionProxies content.- 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
-
-