Class DefaultCampaignService<P extends Campaign>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.promotion.offer.service.DefaultCampaignService<P>
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>, CampaignService<P>

public class DefaultCampaignService<P extends Campaign> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements CampaignService<P>
Author:
Chad Harchar (charchar)
  • Field Summary

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

    Constructors
    Constructor
    Description
    DefaultCampaignService(CampaignRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<P>
    convertFromDomain(List<com.broadleafcommerce.data.tracking.core.Trackable> campaigns, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    boolean
    existsById(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns whether the campaign with the given id exists in the data store
    boolean
    existsByIdAndActive(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns whether the campaign with the given id exists and is active in the data store.
    protected List<P>
    findByContextIds(Iterable<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected com.broadleafcommerce.common.extension.cache.CacheStateManager
     
    protected CampaignRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
    readActiveCampaignsByContextIds(Iterable<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    readAllByContextIdInOrExternalIdIn(Iterable<String> contextIds, Iterable<String> externalIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    org.springframework.data.domain.Page<P>
    readAllByName(String name, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    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

    • DefaultCampaignService

      public DefaultCampaignService(CampaignRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser)
  • Method Details

    • readAllByName

      @NonNull public org.springframework.data.domain.Page<P> readAllByName(@NonNull String name, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      readAllByName in interface CampaignService<P extends Campaign>
    • readActiveCampaignsByContextIds

      @NonNull public List<P> readActiveCampaignsByContextIds(Iterable<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      readActiveCampaignsByContextIds in interface CampaignService<P extends Campaign>
    • findByContextIds

      protected List<P> findByContextIds(Iterable<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • existsById

      public boolean existsById(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CampaignService
      Returns whether the campaign with the given id exists in the data store
      Specified by:
      existsById in interface CampaignService<P extends Campaign>
      Parameters:
      id - the id of the campaign to find
      contextInfo - context information surrounding sandboxing and multi tenant state
      Returns:
      whether the campaign with the given id exists in the data store
    • existsByIdAndActive

      public boolean existsByIdAndActive(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CampaignService
      Returns whether the campaign with the given id exists and is active in the data store.
      Specified by:
      existsByIdAndActive in interface CampaignService<P extends Campaign>
      Parameters:
      id - the id of the campaign to find
      contextInfo - context information surrounding sandboxing and multi tenant state
      Returns:
      whether the campaign with the given id exists and is active in the data store
    • readAllByContextIdInOrExternalIdIn

      public List<P> readAllByContextIdInOrExternalIdIn(Iterable<String> contextIds, Iterable<String> externalIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      readAllByContextIdInOrExternalIdIn in interface CampaignService<P extends Campaign>
    • convertFromDomain

      protected List<P> convertFromDomain(List<com.broadleafcommerce.data.tracking.core.Trackable> campaigns, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • getRepository

      @NonNull protected CampaignRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends Campaign>
    • getCacheStateManager

      @Nullable protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager()
    • setCacheStateManager

      @Autowired(required=false) public void setCacheStateManager(com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)