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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultMarketingMessageService(MarketingMessageRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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 on MarketingMessage.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

  • Constructor Details

    • DefaultMarketingMessageService

      public DefaultMarketingMessageService(MarketingMessageRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(PromotionCacheInvalidationEvent event)
      Specified by:
      onApplicationEvent in interface org.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 interface MarketingMessageService<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 interface MarketingMessageService<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 on MarketingMessage.activeEndDate. This method will return messages with a null end date that may be part of an expired offer.
      Specified by:
      readAllNonExpired in interface MarketingMessageService<P extends MarketingMessage>
      Returns:
    • getRepositoryDomain

      public String getRepositoryDomain()
      Specified by:
      getRepositoryDomain in interface MarketingMessageService<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 class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends MarketingMessage>