Class ApisAutoConfiguration
java.lang.Object
com.netflix.genie.web.spring.autoconfigure.apis.ApisAutoConfiguration
@Configuration
@EnableConfigurationProperties({HttpProperties.class,RetryProperties.class})
public class ApisAutoConfiguration
extends Object
Configuration for external API tier.
- Since:
- 3.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer
Customizer forObjectMapper
used by controllers.org.springframework.web.filter.CharacterEncodingFilter
Character encoding filter that forces content-type in response to be UTF-8.Get the directory writer to use.org.springframework.web.client.RestTemplate
genieRestTemplate
(HttpProperties httpProperties, org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder) Get RestTemplate for calling between Genie nodes.org.springframework.retry.support.RetryTemplate
genieRetryTemplate
(RetryProperties retryProperties) Get RetryTemplate.org.springframework.core.io.Resource
jobsDir
(org.springframework.core.io.ResourceLoader resourceLoader, JobsProperties jobsProperties) Get the jobs dir as a Spring Resource.org.springframework.core.io.ResourceLoader
Get a resource loader.
-
Constructor Details
-
ApisAutoConfiguration
public ApisAutoConfiguration()
-
-
Method Details
-
resourceLoader
@Bean @ConditionalOnMissingBean(org.springframework.core.io.ResourceLoader.class) public org.springframework.core.io.ResourceLoader resourceLoader()Get a resource loader.- Returns:
- a DefaultResourceLoader
-
genieRestTemplate
@Bean @ConditionalOnMissingBean(name="genieRestTemplate") public org.springframework.web.client.RestTemplate genieRestTemplate(HttpProperties httpProperties, org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder) Get RestTemplate for calling between Genie nodes.- Parameters:
httpProperties
- The properties related to Genie's HTTP client configurationrestTemplateBuilder
- The Spring REST template builder to use- Returns:
- The rest template to use
-
genieRetryTemplate
@Bean @ConditionalOnMissingBean(name="genieRetryTemplate") public org.springframework.retry.support.RetryTemplate genieRetryTemplate(RetryProperties retryProperties) Get RetryTemplate.- Parameters:
retryProperties
- The http retry properties to use- Returns:
- The retry template to use
-
directoryWriter
@Bean @ConditionalOnMissingBean(DirectoryWriter.class) public DefaultDirectoryWriter directoryWriter()Get the directory writer to use.- Returns:
- A default directory writer
-
jobsDir
@Bean @ConditionalOnMissingBean(name="jobsDir", value=org.springframework.core.io.Resource.class) public org.springframework.core.io.Resource jobsDir(org.springframework.core.io.ResourceLoader resourceLoader, JobsProperties jobsProperties) throws IOException Get the jobs dir as a Spring Resource. Will create if it doesn't exist.- Parameters:
resourceLoader
- The resource loader to usejobsProperties
- The jobs properties to use- Returns:
- The job dir as a resource
- Throws:
IOException
- on error reading or creating the directory
-
characterEncodingFilter
@Bean public org.springframework.web.filter.CharacterEncodingFilter characterEncodingFilter()Character encoding filter that forces content-type in response to be UTF-8.- Returns:
- The encoding filter
-
apisObjectMapperCustomizer
@Bean public org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer apisObjectMapperCustomizer()Customizer forObjectMapper
used by controllers.- Returns:
- an
Jackson2ObjectMapperBuilderCustomizer
-