Class ProductService


  • public class ProductService
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.util.Map> getAllComponentTranslation()
      Retrieves translated messages of all components of a product in the requested locale (See the dto object).
      java.util.Set<java.lang.String> getCachedSupportedLocales()
      Retrieves the combined set of cached supported locales from all data sources.
      java.util.Set<java.lang.String> getCachedSupportedLocales​(DataSourceEnum dataSource)
      Retrieves the cached set of locales that are supported in the given data source.
      java.util.List<java.lang.String> getComponents()
      Retrieves the list of components of a product.
      java.util.Set<java.lang.String> getSupportedLocales​(DataSourceEnum dataSource)
      Retrieves the set of locales that are supported in the given data source.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProductService

        public ProductService​(BaseDTO dto)
    • Method Detail

      • getAllComponentTranslation

        public java.util.List<java.util.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 java.util.List<java.lang.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 java.util.Set<java.lang.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 java.util.Set<java.lang.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 java.util.Set<java.lang.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.