Class DefaultLocalizationService

java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.i18n.impl.DefaultLocalizationService
All Implemented Interfaces:
InvalidationListener, LocalizationService, 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:
  • Constructor Details

    • DefaultLocalizationService

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

    • getLocaleByString

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

      protected 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 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(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 Locale getCurrentDataLocale()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getCurrentDataLocale in interface LocalizationService
    • getDataLocale

      public Locale getDataLocale(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 String getDataLanguageIsoCode(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 Locale[] getAllLocales(Locale loc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getAllLocales in interface LocalizationService
    • getFallbackLocales

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

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

      public PK getMatchingPkForDataLocale(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(Locale loc, boolean throwError)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSupportedDataLocales

      public Set<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 Map<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 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:
      Exception
      See Also:
      • InitializingBean.afterPropertiesSet()
    • keyInvalidated

      public void keyInvalidated(Object[] key, int invalidationType, InvalidationTarget target, RemoteInvalidationSource remoteSrc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      keyInvalidated in interface InvalidationListener