Class ThresholdCacheTranslationOverrideStrategy
java.lang.Object
org.broadleafcommerce.common.i18n.service.ThresholdCacheTranslationOverrideStrategy
- All Implemented Interfaces:
TranslationOverrideStrategy
,org.springframework.core.Ordered
@Component("blThresholdCacheTranslationOverrideStrategy")
@Lazy
public class ThresholdCacheTranslationOverrideStrategy
extends Object
implements TranslationOverrideStrategy
Default
TranslationOverrideStrategy
. Should run last and will always return a result. Primarily supports multitenant
scenarios with the following characteristics:
- Small to medium template translation catalog
- Small to medium number of standard site overrides
- Small or large quantity of individual standard sites
TranslationSupport.getThresholdForFullCache()
and TranslationSupport.getTemplateThresholdForFullCache()
for more information on these properties and how to set their values.- Author:
- Jeff Fischer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TranslationDao
protected StatisticsService
protected TranslationSupport
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
buildSingleItemResponse
(LocalePair response, Translation translation) getLocaleBasedOverride
(String property, TranslatedEntity entityType, String entityId, String localeCode, String localeCountryCode, String basicCacheKey) Retrieve the standard site override translation, if applicablegetLocaleBasedTemplateValue
(String templateCacheKey, String property, TranslatedEntity entityType, String entityId, String localeCode, String localeCountryCode, String specificPropertyKey, String generalPropertyKey) Retrieve the template level translation, if applicableint
getOrder()
boolean
validateTemplateProcessing
(String standardCacheKey, String templateCacheKey) Whether or not a template version should be searched for.
-
Field Details
-
statisticsService
-
dao
-
translationSupport
-
-
Constructor Details
-
ThresholdCacheTranslationOverrideStrategy
public ThresholdCacheTranslationOverrideStrategy()
-
-
Method Details
-
getLocaleBasedOverride
public LocalePair getLocaleBasedOverride(String property, TranslatedEntity entityType, String entityId, String localeCode, String localeCountryCode, String basicCacheKey) Description copied from interface:TranslationOverrideStrategy
Retrieve the standard site override translation, if applicable- Specified by:
getLocaleBasedOverride
in interfaceTranslationOverrideStrategy
- Returns:
-
getLocaleBasedTemplateValue
public LocalePair getLocaleBasedTemplateValue(String templateCacheKey, String property, TranslatedEntity entityType, String entityId, String localeCode, String localeCountryCode, String specificPropertyKey, String generalPropertyKey) Description copied from interface:TranslationOverrideStrategy
Retrieve the template level translation, if applicable- Specified by:
getLocaleBasedTemplateValue
in interfaceTranslationOverrideStrategy
- Returns:
-
validateTemplateProcessing
Description copied from interface:TranslationOverrideStrategy
Whether or not a template version should be searched for. If false, then the system will return null for the translation, should an override not be found.- Specified by:
validateTemplateProcessing
in interfaceTranslationOverrideStrategy
- Returns:
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
buildSingleItemResponse
-