Package org.lockss.ws

Class RestTemplateConfig

java.lang.Object
org.lockss.ws.RestTemplateConfig

@Configuration public class RestTemplateConfig extends Object
Configures and provides a RestTemplate bean for use within the SOAP Service's Spring context. The RestTemplate is Autowired into the SOAP Service's various service implementations through the base class BaseServiceImpl. It is used to forward SOAP calls to external REST services. RestTemplate is thread-safe.
  • Field Details

    • env

      @Autowired protected org.springframework.core.env.Environment env
    • CONNECTION_TIMEOUT_KEY

      public static final String CONNECTION_TIMEOUT_KEY
      The configuration key for the connection timeout.
      See Also:
    • READ_TIMEOUT_KEY

      public static final String READ_TIMEOUT_KEY
      The configuration key for the read timeout.
      See Also:
    • SIZE_THRESHOLD_KEY

      public static final String SIZE_THRESHOLD_KEY
      Response body size threshold key.
      See Also:
    • TMP_DIR_KEY

      public static final String TMP_DIR_KEY
      Key for path to temporary directory
      See Also:
  • Constructor Details

    • RestTemplateConfig

      public RestTemplateConfig()
  • Method Details

    • restTemplate

      @Bean protected org.springframework.web.client.RestTemplate restTemplate()
      Provides the customized template used by Spring for synchronous client-side HTTP access.
      Returns:
      a RestTemplate with the customized Spring template.
    • getConnectionTimeout

      protected Long getConnectionTimeout()
      Provides the configured connection timeout in milliseconds.
      Returns:
      a Long with the configured connection timeout in milliseconds.
    • getReadTimeout

      protected Long getReadTimeout()
      Provides the configured read timeout in milliseconds.
      Returns:
      a Long with the configured read timeout in milliseconds.
    • getSizeThreshold

      protected int getSizeThreshold()
    • getTmpDir

      protected File getTmpDir()