Class BackOfficeRequestHelper

java.lang.Object
org.ametys.site.BackOfficeRequestHelper

public final class BackOfficeRequestHelper extends Object
Helper class that builds the request the front-office makes to the back-office to query a page or a resource.
  • Method Details

    • getHttpClient

      Build a HttpClient object parametrized
      Returns:
      The httpclient object
      Throws:
      ServiceUnavailableException - If the server is in maintenance
    • switchOnMaintenanceIfNeeded

      public static void switchOnMaintenanceIfNeeded(org.apache.http.HttpResponse cmsResponse)
      When the response is a 503 code from the BO, we may switch to maintenance mode if the BO is really in maintenance mode
      Parameters:
      cmsResponse - The BO response
    • getRequest

      public static HttpUriRequest getRequest(Map objectModel, String page, BackOfficeRequestProxyExtensionPoint requestProxyExtensionPoint) throws IOException
      Build a HttpClient request object that will be sent to the back-office to query the page.
      Parameters:
      objectModel - the current object model.
      page - the wanted page path.
      requestProxyExtensionPoint - The extension point for adding request headers in BO request
      Returns:
      the HttpClient request, to be sent to the back-office.
      Throws:
      IOException - if an error occurs building the request.