Class DefaultProxyService

java.lang.Object
de.hybris.platform.xyformsservices.proxy.impl.DefaultProxyService
All Implemented Interfaces:
ProxyService

public class DefaultProxyService extends Object implements ProxyService
Default implementation for proxy service.
  • Field Details

  • Constructor Details

    • DefaultProxyService

      public DefaultProxyService()
  • Method Details

    • rewriteURL

      public String rewriteURL(String url, boolean embeddable) throws MalformedURLException
      Description copied from interface: ProxyService
      Rewrites a URL to be used for the proxy.
      Specified by:
      rewriteURL in interface ProxyService
      Parameters:
      url - the url path to be rewritten
      embeddable - the flag that specifies if the rewriter should produce a URL that produces embeddable content
      Returns:
      the URL of the proxy
      Throws:
      MalformedURLException - if result URL is invalid
    • rewriteURL

      public String rewriteURL(String applicationId, String formId, String formDataId, boolean editable, boolean withEmptyData) throws MalformedURLException
      Description copied from interface: ProxyService
      Rewrites a URL to be used for the proxy.
      Specified by:
      rewriteURL in interface ProxyService
      Parameters:
      applicationId - the application Id
      formId - the form Id
      formDataId - the form data Id
      editable - the flag that specifies whether form should be editable or not
      withEmptyData - the flag that specifies whether create empty data for form via background api
      Returns:
      the URL of the proxy
      Throws:
      MalformedURLException - if result URL is invalid
    • rewriteURL

      public String rewriteURL(String applicationId, String formId, String formDataId, boolean editable) throws MalformedURLException
      Description copied from interface: ProxyService
      Rewrites a URL to be used for the proxy.
      Specified by:
      rewriteURL in interface ProxyService
      Parameters:
      applicationId - the application Id
      formId - the form Id
      formDataId - the form data Id
      editable - the flag that specifies whether form should be editable or not
      Returns:
      the URL of the proxy
      Throws:
      MalformedURLException - if result URL is invalid
    • rewriteURL

      public String rewriteURL(String applicationId, String formId, String formDataId) throws MalformedURLException
      Description copied from interface: ProxyService
      Rewrites a URL to be used for the proxy.
      Specified by:
      rewriteURL in interface ProxyService
      Parameters:
      applicationId - the application Id
      formId - the form Id
      formDataId - the form data Id
      Returns:
      the URL of the proxy
      Throws:
      MalformedURLException - if result URL is invalid
    • getNextRandomNamespace

      public String getNextRandomNamespace()
      Description copied from interface: ProxyService
      Generates a random namespace.
      Specified by:
      getNextRandomNamespace in interface ProxyService
      Returns:
      the random namespace string
    • proxy

      public void proxy(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String namespace, String url, boolean forceGetMethod, Map<String,String> headers) throws ProxyException
      Description copied from interface: ProxyService
      Proxies content.
      Specified by:
      proxy in interface ProxyService
      Parameters:
      request - the HttpServletRequest associated to the call
      response - the HttpServletResponse associated to the call
      namespace - the namespace for HTML element's id generation
      url - the url to be called
      forceGetMethod - the flag for specifying if only "GET" method should be used, useful when proxying content
      headers - extra headers to be passed to the proxy service
      Throws:
      ProxyException - if request cannot be proxied
    • extractNamespace

      public String extractNamespace(javax.servlet.http.HttpServletRequest request)
      Description copied from interface: ProxyService
      Extracts the namespace from the client request.
      Specified by:
      extractNamespace in interface ProxyService
      Parameters:
      request - the request to get namespace from
      Returns:
      the extracted namespace
    • setOrbeonAddress

      public void setOrbeonAddress(String orbeonAddress) throws MalformedURLException
      Throws:
      MalformedURLException
    • getExtraHeaders

      public Map<String,String> getExtraHeaders()
      Description copied from interface: ProxyService
      Returns the extra headers configured for the application.
      Specified by:
      getExtraHeaders in interface ProxyService
      Returns:
      the extra headers as map
    • setExtraHeaders

      public void setExtraHeaders(Map<String,String> extraHeaders)
    • setProxyEngine

      public void setProxyEngine(ProxyEngine proxyEngine)