Package org.lockss.ws
Class RestTemplateConfig
java.lang.Object
org.lockss.ws.RestTemplateConfig
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe configuration key for the connection timeout.protected org.springframework.core.env.Environmentstatic final StringThe configuration key for the read timeout.static final StringResponse body size threshold key.static final StringKey for path to temporary directory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LongProvides the configured connection timeout in milliseconds.protected LongProvides the configured read timeout in milliseconds.protected intprotected Fileprotected org.springframework.web.client.RestTemplateProvides the customized template used by Spring for synchronous client-side HTTP access.
-
Field Details
-
env
@Autowired protected org.springframework.core.env.Environment env -
CONNECTION_TIMEOUT_KEY
The configuration key for the connection timeout.- See Also:
-
READ_TIMEOUT_KEY
The configuration key for the read timeout.- See Also:
-
SIZE_THRESHOLD_KEY
Response body size threshold key.- See Also:
-
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
Provides the configured connection timeout in milliseconds.- Returns:
- a Long with the configured connection timeout in milliseconds.
-
getReadTimeout
Provides the configured read timeout in milliseconds.- Returns:
- a Long with the configured read timeout in milliseconds.
-
getSizeThreshold
protected int getSizeThreshold() -
getTmpDir
-