Class CloudVisionAutoConfiguration


@AutoConfiguration @EnableConfigurationProperties(CloudVisionProperties.class) @ConditionalOnClass(CloudVisionTemplate.class) @ConditionalOnProperty(value="", matchIfMissing=true) public class CloudVisionAutoConfiguration extends Object
Provides Spring Beans for using Cloud Vision API.
  • Constructor Details

  • Method Details

    • imageAnnotatorClient

      @Bean @ConditionalOnMissingBean public imageAnnotatorClient() throws IOException
      Configure the Cloud Vision API client ImageAnnotatorClient. The spring-cloud-gcp-starter autowires a CredentialsProvider object that provides the GCP credentials, required to authenticate and authorize Vision API calls.

      Cloud Vision API client implements AutoCloseable, which is automatically honored by Spring bean lifecycle.

      Most of the Google Cloud API clients are thread-safe heavy objects. I.e., it's better to produce a singleton and re-using the client object for multiple requests.

      a Cloud Vision API client
      IOException - if an exception occurs creating the ImageAnnotatorClient
    • cloudVisionTemplate

      @Bean @ConditionalOnMissingBean public CloudVisionTemplate cloudVisionTemplate( imageAnnotatorClient)
    • cloudVisionExecutor

      @Bean @ConditionalOnMissingBean(name="cloudVisionExecutor") public Executor cloudVisionExecutor()