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 Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_TRANSLATION_FACTORY
Unique name of the service property indicating the particular implementation this factory provides, e.g.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description TranslationService
createTranslationService(TranslationConstants.TranslationMethod translationMethod, java.lang.String cloudConfigPath)
Deprecated.since 2.4.0, usecreateTranslationService(TranslationMethod, String, Resource)
instead.default TranslationService
createTranslationService(TranslationConstants.TranslationMethod translationMethod, java.lang.String cloudConfigPath, Resource resource)
Creates a new TranslationService object specific to this Factory.java.lang.Class<?>
getServiceCloudConfigClass()
Gets the service Cloud Config Class.java.lang.String
getServiceFactoryName()
Gets the service factory name.java.util.List<TranslationConstants.TranslationMethod>
getSupportedTranslationMethods()
Get the supported translation methods.
-
-
-
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
@Deprecated TranslationService createTranslationService(TranslationConstants.TranslationMethod translationMethod, java.lang.String cloudConfigPath) throws TranslationException
Deprecated.since 2.4.0, usecreateTranslationService(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 MethodcloudConfigPath
- 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, 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 MethodcloudConfigPath
- 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.
-
-