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 Detail

      • PROPERTY_TRANSLATION_FACTORY

        static final java.lang.String PROPERTY_TRANSLATION_FACTORY
        Unique name of the service property indicating the particular implementation this factory provides, e.g. microsoft.
        See Also:
        Constant Field Values
    • Method Detail

      • createTranslationService

        default TranslationService createTranslationService​(TranslationConstants.TranslationMethod translationMethod,
                                                            java.lang.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

        java.util.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

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

        java.lang.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.