Class ThresholdCacheInternationalMessageOverrideStrategy
java.lang.Object
com.broadleafcommerce.i18n.enterprise.config.service.ThresholdCacheInternationalMessageOverrideStrategy
- All Implemented Interfaces:
InternationalMessageOverrideStrategy,org.springframework.core.Ordered
@Component("blThresholdCacheInternationalMessageOverrideStrategy")
@Lazy
public class ThresholdCacheInternationalMessageOverrideStrategy
extends Object
implements InternationalMessageOverrideStrategy
Default
InternationalMessageOverrideStrategy. Should run last and will always return a result. Primarily supports multitenant
scenarios with the following characteristics:
- Small to medium template message catalog
- Small to medium number of standard site overrides
- Small or large quantity of individual standard sites
InternationalMessageSupport.getThresholdForFullCache() and InternationalMessageSupport.getTemplateThresholdForFullCache()
for more information on these properties and how to set their values.- Author:
- Jeff Fischer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InternationalMessageDaoprotected InternationalMessageSupportFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildSingleItemResponse(org.broadleafcommerce.common.i18n.service.LocalePair response, InternationalMessage message) org.broadleafcommerce.common.i18n.service.LocalePairgetLocaleBasedOverride(String propertyName, Locale locale, String basicCacheKey) Retrieve the standard site override message, if applicableorg.broadleafcommerce.common.i18n.service.LocalePairgetLocaleBasedTemplateValue(String templateCacheKey, String propertyName, String localeCode, String localeCountryCode, String specificPropertyKey, String generalPropertyKey) Retrieve the template level message, if applicableintgetOrder()booleanvalidateTemplateProcessing(String standardCacheKey, String templateCacheKey) Whether or not a template version should be searched for.
-
Field Details
-
dao
-
internationalMessageSupport
-
-
Constructor Details
-
ThresholdCacheInternationalMessageOverrideStrategy
public ThresholdCacheInternationalMessageOverrideStrategy()
-
-
Method Details
-
getLocaleBasedOverride
public org.broadleafcommerce.common.i18n.service.LocalePair getLocaleBasedOverride(String propertyName, Locale locale, String basicCacheKey) Description copied from interface:InternationalMessageOverrideStrategyRetrieve the standard site override message, if applicable- Specified by:
getLocaleBasedOverridein interfaceInternationalMessageOverrideStrategy- Returns:
-
getLocaleBasedTemplateValue
public org.broadleafcommerce.common.i18n.service.LocalePair getLocaleBasedTemplateValue(String templateCacheKey, String propertyName, String localeCode, String localeCountryCode, String specificPropertyKey, String generalPropertyKey) Description copied from interface:InternationalMessageOverrideStrategyRetrieve the template level message, if applicable- Specified by:
getLocaleBasedTemplateValuein interfaceInternationalMessageOverrideStrategy- Returns:
-
validateTemplateProcessing
Description copied from interface:InternationalMessageOverrideStrategyWhether or not a template version should be searched for. If false, then the system will return null for the message, should an override not be found.- Specified by:
validateTemplateProcessingin interfaceInternationalMessageOverrideStrategy- Returns:
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
buildSingleItemResponse
protected void buildSingleItemResponse(org.broadleafcommerce.common.i18n.service.LocalePair response, InternationalMessage message)
-