Class DefaultLocalizationService

  • All Implemented Interfaces:
    InvalidationListener, LocalizationService, java.io.Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

    @Deprecated(since="ages",
                forRemoval=true)
    public class DefaultLocalizationService
    extends AbstractService
    implements LocalizationService, InvalidationListener
    Deprecated, for removal: This API element is subject to removal in a future version.
    since ages
    Default implementation of the localization service.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultLocalizationService()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invoked by a BeanFactory after it has set all bean properties supplied.
      java.util.Locale[] getAllLocales​(java.util.Locale loc)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.util.Locale getCurrentDataLocale()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.util.Locale getCurrentLocale()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.String getDataLanguageIsoCode​(java.util.Locale locale)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.util.Locale getDataLocale​(java.util.Locale loc)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.util.Locale[] getFallbackLocales​(java.util.Locale loc)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      protected java.util.Locale getLocaleByLanguage​(Language lang)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the (cached) Locale by the given Language.
      java.util.Locale getLocaleByString​(java.lang.String isoCodes)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      protected java.util.Locale[] getLocaleMatchKey​(java.util.Locale requested)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      PK getMatchingPkForDataLocale​(java.util.Locale locale)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns proper language PK for matching locale.
      java.util.Set<java.util.Locale> getSupportedDataLocales()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      protected java.util.Map<java.util.Locale,​DefaultLocalizationService.DataLocale> getSupportedLocales()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Each hybris Language is encapsulates into a DefaultLocalizationService.DataLocale and is put with the corresponding Locale into the map.
      boolean isLocalizationFallbackEnabled()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void keyInvalidated​(java.lang.Object[] key, int invalidationType, InvalidationTarget target, RemoteInvalidationSource remoteSrc)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      protected DefaultLocalizationService.DataLocale matchDataLocale​(java.util.Locale loc, boolean throwError)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setCurrentLocale​(java.util.Locale loc)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setLocalizationFallbackEnabled​(boolean enabled)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      • Methods inherited from class java.lang.Object

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

      • DefaultLocalizationService

        public DefaultLocalizationService()
        Deprecated, for removal: This API element is subject to removal in a future version.
    • Method Detail

      • getLocaleByString

        public java.util.Locale getLocaleByString​(java.lang.String isoCodes)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getLocaleByString in interface LocalizationService
      • getLocaleByLanguage

        protected java.util.Locale getLocaleByLanguage​(Language lang)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns the (cached) Locale by the given Language.
        Parameters:
        lang - the language
        Returns:
        the Locale
      • getCurrentLocale

        public java.util.Locale getCurrentLocale()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getCurrentLocale in interface LocalizationService
        Returns:
        from the current JaloSession the attached Locale.
      • setCurrentLocale

        public void setCurrentLocale​(java.util.Locale loc)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        setCurrentLocale in interface LocalizationService
        Parameters:
        loc - the new session locale
      • getCurrentDataLocale

        public java.util.Locale getCurrentDataLocale()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getCurrentDataLocale in interface LocalizationService
      • getDataLocale

        public java.util.Locale getDataLocale​(java.util.Locale loc)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getDataLocale in interface LocalizationService
        Parameters:
        loc - the locale to match
      • getDataLanguageIsoCode

        public java.lang.String getDataLanguageIsoCode​(java.util.Locale locale)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getDataLanguageIsoCode in interface LocalizationService
        Parameters:
        locale - the locale to get data language code for
      • getAllLocales

        public java.util.Locale[] getAllLocales​(java.util.Locale loc)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getAllLocales in interface LocalizationService
      • getFallbackLocales

        public java.util.Locale[] getFallbackLocales​(java.util.Locale loc)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getFallbackLocales in interface LocalizationService
      • getLocaleMatchKey

        protected java.util.Locale[] getLocaleMatchKey​(java.util.Locale requested)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getMatchingPkForDataLocale

        public PK getMatchingPkForDataLocale​(java.util.Locale locale)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: LocalizationService
        Returns proper language PK for matching locale.
        Specified by:
        getMatchingPkForDataLocale in interface LocalizationService
        Parameters:
        locale - the locale to get data language code for
        Returns:
        language pk
      • matchDataLocale

        protected DefaultLocalizationService.DataLocale matchDataLocale​(java.util.Locale loc,
                                                                        boolean throwError)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getSupportedDataLocales

        public java.util.Set<java.util.Locale> getSupportedDataLocales()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getSupportedDataLocales in interface LocalizationService
        Returns:
        a Set of Locales for the current system.
      • getSupportedLocales

        protected java.util.Map<java.util.Locale,​DefaultLocalizationService.DataLocale> getSupportedLocales()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Each hybris Language is encapsulates into a DefaultLocalizationService.DataLocale and is put with the corresponding Locale into the map. Additionally each of those items are cached.

        We added to JaloTypeCacheUnit unit additional unique value for a current user, nevertheless changes of the supported locales list for a one user in scope of different tenants , still might cause problems (see HOR-893). Note also the memory impact - for a every user there will be separate cache of supported locales created.

        Returns:
        a map where Locale are mapped to DefaultLocalizationService.DataLocale
      • isLocalizationFallbackEnabled

        public boolean isLocalizationFallbackEnabled()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        isLocalizationFallbackEnabled in interface LocalizationService
        Returns:
        true if in the current JaloSession the localization fallback is enabled.
      • setLocalizationFallbackEnabled

        public void setLocalizationFallbackEnabled​(boolean enabled)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        setLocalizationFallbackEnabled in interface LocalizationService
        Parameters:
        enabled - if true the localization fallback will be enabled.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: AbstractService
        Invoked by a BeanFactory after it has set all bean properties supplied. Overwrite this method for adding/implementing additional code into the service. Important note: Please call always super.afterPropertiesSet() before or the java serialization won't work.
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Overrides:
        afterPropertiesSet in class AbstractService
        Throws:
        java.lang.Exception
        See Also:
        InitializingBean.afterPropertiesSet()