Class ClarityClientConfiguration

java.lang.Object
org.cruk.clarity.api.spring.ClarityClientConfiguration
Direct Known Subclasses:
ClarityClientSearchConfiguration

@Configuration @EnableAspectJAutoProxy(proxyTargetClass=false) @ComponentScan(basePackages={"org.cruk.clarity.api.automation.impl","org.cruk.clarity.api.debugging","org.cruk.clarity.api.filestore","org.cruk.clarity.api.http","org.cruk.clarity.api.impl","org.cruk.clarity.api.jaxb"}, excludeFilters=) public class ClarityClientConfiguration extends Object
Main Spring configuration for the Clarity Client.
  • Constructor Details

    • ClarityClientConfiguration

      public ClarityClientConfiguration()
      Constructor with just the standard packages.
    • ClarityClientConfiguration

      protected ClarityClientConfiguration(Class<?>... additionalPackageClasses)
      Constructor allowing additional package classes to be given for the JAXB context. These classes have their package added to the context, not just the class itself.
      Parameters:
      additionalPackageClasses - The classes representing the packages to add to the JAXB context.
  • Method Details

    • setTimeoutOnUploader

      @PostConstruct public void setTimeoutOnUploader()
      Set the timeout on the SFTP file uploader to the same as the HTTP connection timeout.
    • clarityHttpClient

      @Bean public HttpClient clarityHttpClient()
      Clarity HTTP client.
      Returns:
      The HTTP client for the Clarity client.
    • clarityClientHttpRequestFactory

      @Bean public AuthenticatingClientHttpRequestFactory clarityClientHttpRequestFactory()
      HTTP client request factory.
      Returns:
      A request factory for the Clarity client.
    • clarityJaxbMarshaller

      @Bean public Marshaller clarityJaxbMarshaller()
      JAXB marshaller.
      Returns:
      A Marshaller view on the JAXB context.
    • clarityJaxbUnmarshaller

      @Bean public Unmarshaller clarityJaxbUnmarshaller()
      JAXB unmarshaller.
      Returns:
      An Unmarshaller view on the JAXB context.
    • clarityJaxbClasses

      @Bean public List<Class<?>> clarityJaxbClasses()
      Access to the list of classes managed by the Clarity client JAXB context.
      Returns:
      A list of classes.
    • clarityExceptionErrorHandler

      @Bean public ResponseErrorHandler clarityExceptionErrorHandler()
      Clarity client response handler.
      Returns:
      A response handler for Clarity calls.
    • createRestTemplate

      protected RestTemplate createRestTemplate()
      Helper method to create REST templates based on the JAXB context and HTTP client request factory.
      Returns:
      An initialised RestTemplate.
    • clarityRestTemplate

      @Bean public RestOperations clarityRestTemplate()
      REST template for the main Clarity client.
      Returns:
      A REST template for talking to Clarity.
    • clarityFileUploadTemplate

      @Bean public RestOperations clarityFileUploadTemplate()
      REST template for HTTP file uploads.
      Returns:
      A REST template for uploading files to Clarity.