Interface TranslationServiceFactory

All Known Implementing Classes:
AbstractTranslationServiceFactory

@ConsumerType public interface TranslationServiceFactory
The TranslationServiceFactory is responsible for creating TranslationService objects for a specific connector. It also registers the connector with the TranslationManager using a unique identifier ("Name").
  • Field Details

    • PROPERTY_TRANSLATION_FACTORY

      static final String PROPERTY_TRANSLATION_FACTORY
      Unique name of the service property indicating the particular implementation this factory provides, e.g. microsoft.
      See Also:
  • Method Details

    • createTranslationService

      @Deprecated TranslationService createTranslationService(TranslationConstants.TranslationMethod translationMethod, String cloudConfigPath) throws TranslationException
      Deprecated.
      since 2.4.0, use createTranslationService(TranslationMethod, String, Resource) instead. Creates a new TranslationService object specific to this Factory.
      Parameters:
      translationMethod - Specify which type of Translation service to create based on Translation Method
      cloudConfigPath - The path to cloud config file.
      Returns:
      A TranslationService instance for the given factory.
      Throws:
      TranslationException - the translation exception
    • createTranslationService

      default TranslationService createTranslationService(TranslationConstants.TranslationMethod translationMethod, String cloudConfigPath, Resource resource) throws TranslationException
      Creates a new TranslationService object specific to this Factory.
      Parameters:
      translationMethod - Specify which type of Translation service to create based on Translation Method
      cloudConfigPath - The path to cloud config file.
      resource - Context resource to fetch configuration for
      Returns:
      A TranslationService instance for the given factory.
      Throws:
      TranslationException - the translation exception
    • getSupportedTranslationMethods

      List<TranslationConstants.TranslationMethod> getSupportedTranslationMethods()
      Get the supported translation methods.
      Returns:
      List of Translation method of the service property indicating the particular translation method this factory provides, e.g. machine translation or human translation.
    • getServiceFactoryName

      String getServiceFactoryName()
      Gets the service factory name.
      Returns:
      Name of the service property indicating the particular implementation this factory provides, e.g. adobe.
    • getServiceCloudConfigClass

      Class<?> getServiceCloudConfigClass()
      Gets the service Cloud Config Class.
      Returns:
      Class of the service Cloud Config. This class name will be used to determine the cloud config for the Translation service.