Interface RemoteContentRendererRequestHandler
-
public interface RemoteContentRendererRequestHandlerInterface for OSGi service implementations capable of processing requests sent to a remote content rendering endpoint
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancanHandle(SlingHttpServletRequest servletRequest)Should the currentRemoteContentRendererRequestHandlerimplementation be used to process the requestorg.apache.http.client.methods.HttpUriRequestgetRequest(SlingHttpServletRequest servletRequest, ComponentExporter componentExporter)Returns the request object that can be executed by aHttpClientimplementationorg.apache.http.client.config.RequestConfiggetRequestConfig(SlingHttpServletRequest servletRequest)Returns the configuration that will be used to execute the remote requestjava.lang.StringgetResponseMessage(org.apache.http.client.methods.CloseableHttpResponse httpResponse)Returns the potentially processed response from the remote content rendering endpointdefault java.lang.Class<? extends ComponentExporter>[]getSlingModelAdapterClasses()Returns the list of classes that the Sling Model Exporter should try to adapt the request to
-
-
-
Method Detail
-
canHandle
boolean canHandle(@Nonnull SlingHttpServletRequest servletRequest)Should the currentRemoteContentRendererRequestHandlerimplementation be used to process the request- Parameters:
servletRequest- The AEM internal servlet request- Returns:
- true if the Handler can process the request
-
getRequestConfig
@Nullable org.apache.http.client.config.RequestConfig getRequestConfig(@Nonnull SlingHttpServletRequest servletRequest)Returns the configuration that will be used to execute the remote request- Parameters:
servletRequest- The AEM internal servlet request- Returns:
- The
RequestConfigconfiguration object
-
getRequest
@Nonnull org.apache.http.client.methods.HttpUriRequest getRequest(@Nonnull SlingHttpServletRequest servletRequest, @Nonnull ComponentExporter componentExporter) throws RemoteContentRenderingExceptionReturns the request object that can be executed by aHttpClientimplementation- Parameters:
servletRequest- The AEM internal servlet requestcomponentExporter- The data model to be serialized and sent to the remote endpoint- Returns:
- An implementation of
HttpUriRequest - Throws:
RemoteContentRenderingException- exception due to an invalid servlet request
-
getResponseMessage
@Nonnull java.lang.String getResponseMessage(@Nonnull org.apache.http.client.methods.CloseableHttpResponse httpResponse) throws java.io.IOExceptionReturns the potentially processed response from the remote content rendering endpoint- Parameters:
httpResponse- Response to the request sent to the remote endpoint- Returns:
- The processed response text to be injected in servlets SlingHttpServletResponse
- Throws:
java.io.IOException- exception when reading from theCloseableHttpResponse
-
getSlingModelAdapterClasses
@Nonnull default java.lang.Class<? extends ComponentExporter>[] getSlingModelAdapterClasses()
Returns the list of classes that the Sling Model Exporter should try to adapt the request to- Returns:
- The list of classes
-
-