Class DefaultMarketingMessageService<P extends MarketingMessage>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.promotion.offer.service.DefaultMarketingMessageService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
,MarketingMessageService<P>
,EventListener
,org.springframework.context.ApplicationListener<PromotionCacheInvalidationEvent>
public class DefaultMarketingMessageService<P extends MarketingMessage>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements MarketingMessageService<P>, org.springframework.context.ApplicationListener<PromotionCacheInvalidationEvent>
- Author:
- Nathan Moore (nathanmoore).
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultMarketingMessageService
(MarketingMessageRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.common.extension.cache.CacheStateManager
protected MarketingMessageRepository<com.broadleafcommerce.data.tracking.core.Trackable>
void
org.springframework.data.domain.Page<P>
readAllActiveByOfferIds
(Collection<String> offerIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) org.springframework.data.domain.Page<P>
readAllByOfferId
(String offerId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) readAllNonExpired
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read all messages who are not expired based onMarketingMessage.activeEndDate
.void
setCacheStateManager
(com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager) Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Field Details
-
CACHE_BY_ID
- See Also:
-
-
Constructor Details
-
DefaultMarketingMessageService
public DefaultMarketingMessageService(MarketingMessageRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
-
Method Details
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<P extends MarketingMessage>
-
readAllByOfferId
public org.springframework.data.domain.Page<P> readAllByOfferId(String offerId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
readAllByOfferId
in interfaceMarketingMessageService<P extends MarketingMessage>
-
readAllActiveByOfferIds
public org.springframework.data.domain.Page<P> readAllActiveByOfferIds(Collection<String> offerIds, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
readAllActiveByOfferIds
in interfaceMarketingMessageService<P extends MarketingMessage>
-
readAllNonExpired
public List<P> readAllNonExpired(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:MarketingMessageService
Read all messages who are not expired based onMarketingMessage.activeEndDate
. This method will return messages with a null end date that may be part of an expired offer.- Specified by:
readAllNonExpired
in interfaceMarketingMessageService<P extends MarketingMessage>
- Returns:
-
getRepositoryDomain
- Specified by:
getRepositoryDomain
in interfaceMarketingMessageService<P extends MarketingMessage>
-
getCacheStateManager
@Nullable protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager() -
setCacheStateManager
@Autowired(required=false) public void setCacheStateManager(com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager) -
getRepository
@NonNull protected MarketingMessageRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()- Overrides:
getRepository
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends MarketingMessage>
-