@Component(value="blAdvancedOfferPromotionMessageGenerator") public class AdvancedOfferPromotionMessageGeneratorImpl extends Object implements AdvancedOfferPromotionMessageGenerator
PromotionMessages from Offers
that are targeting the given Product.| Modifier and Type | Field and Description |
|---|---|
protected org.broadleafcommerce.profile.core.service.CustomerService |
customerService |
protected int |
messageDefaultCacheSeconds |
static long |
MILLISECONDS_PER_SECOND |
protected net.sf.ehcache.Cache |
promotionMessageCache |
protected AdvancedOfferPromotionMessageService |
promotionMessageService |
| Constructor and Description |
|---|
AdvancedOfferPromotionMessageGeneratorImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMessagesToCache(org.broadleafcommerce.core.catalog.domain.Product product,
Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> promotionMessages) |
protected String |
buildKey(org.broadleafcommerce.core.catalog.domain.Product product)
Products can vary by site.
|
void |
clearPromotionMessageCache()
Evicts all PromotionMessage maps from the cache
|
protected Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> |
filterMessageDTOsByCustomerRules(Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> promotionMessageDTOMap) |
List<String> |
generatePromotionMessages(org.broadleafcommerce.core.order.domain.OrderItem orderItem) |
Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> |
generatePromotionMessages(org.broadleafcommerce.core.catalog.domain.Product product) |
protected Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> |
getMessagesFromCache(org.broadleafcommerce.core.catalog.domain.Product product) |
protected net.sf.ehcache.Cache |
getPromotionMessageCache() |
protected int |
getSecondsToClosestEndDate(Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> promotionMessageMap) |
protected boolean |
isProductionRequest() |
void |
removeCacheElement(org.broadleafcommerce.core.catalog.domain.Product product)
Evicts the given PromotionMessage map from the cache
|
public static final long MILLISECONDS_PER_SECOND
protected net.sf.ehcache.Cache promotionMessageCache
protected AdvancedOfferPromotionMessageService promotionMessageService
protected org.broadleafcommerce.profile.core.service.CustomerService customerService
@Value(value="${promotion.message.default.cache.seconds:600}")
protected int messageDefaultCacheSeconds
public AdvancedOfferPromotionMessageGeneratorImpl()
public List<String> generatePromotionMessages(org.broadleafcommerce.core.order.domain.OrderItem orderItem)
generatePromotionMessages in interface org.broadleafcommerce.core.promotionMessage.service.PromotionMessageGeneratorpublic Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> generatePromotionMessages(org.broadleafcommerce.core.catalog.domain.Product product)
generatePromotionMessages in interface org.broadleafcommerce.core.promotionMessage.service.PromotionMessageGeneratorprotected Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> filterMessageDTOsByCustomerRules(Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> promotionMessageDTOMap)
protected void addMessagesToCache(org.broadleafcommerce.core.catalog.domain.Product product,
Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> promotionMessages)
protected int getSecondsToClosestEndDate(Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> promotionMessageMap)
protected Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> getMessagesFromCache(org.broadleafcommerce.core.catalog.domain.Product product)
public void clearPromotionMessageCache()
AdvancedOfferPromotionMessageGeneratorclearPromotionMessageCache in interface AdvancedOfferPromotionMessageGeneratorpublic void removeCacheElement(org.broadleafcommerce.core.catalog.domain.Product product)
AdvancedOfferPromotionMessageGeneratorremoveCacheElement in interface AdvancedOfferPromotionMessageGeneratorprotected String buildKey(org.broadleafcommerce.core.catalog.domain.Product product)
product - protected net.sf.ehcache.Cache getPromotionMessageCache()
protected boolean isProductionRequest()
Copyright © 2020. All rights reserved.