Class ProductService


  • public class ProductService
    extends Object
    • Constructor Detail

      • ProductService

        public ProductService​(BaseDTO dto)
    • Method Detail

      • getAllComponentTranslation

        public List<Map> getAllComponentTranslation()
        Retrieves translated messages of all components of a product in the requested locale (See the dto object).
        Returns:
        translated messages of all components of a product locale specified in the dto object
      • getComponents

        public List<String> getComponents()
        Retrieves the list of components of a product. It recursively applies data source fallback mechanism in case of failure.
        Returns:
        list of components of the product specified in the dto object
      • getCachedSupportedLocales

        public Set<String> getCachedSupportedLocales()
        Retrieves the combined set of cached supported locales from all data sources. It also refreshes/populates the cache if expired/not yet cached in a separate thread.
        Returns:
        The combined set of supported locales from all data sources found in cache. An empty set if cache is empty or not yet populated.
      • getCachedSupportedLocales

        public Set<String> getCachedSupportedLocales​(DataSourceEnum dataSource)
        Retrieves the cached set of locales that are supported in the given data source.
        Parameters:
        dataSource - The data source
        Returns:
        The data from the cache as is, or an empty Set if not in cache.
      • getSupportedLocales

        public Set<String> getSupportedLocales​(DataSourceEnum dataSource)
        Retrieves the set of locales that are supported in the given data source. It will trigger a cache populate or refresh as necessary before returning.
        Parameters:
        dataSource - The data source
        Returns:
        The set of locales supported in the given data source. An empty set if fetch fails.