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
-
Constructor Summary
ConstructorDescriptionDefaultCampaignService
(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 TypeMethodDescriptionconvertFromDomain
(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 storeboolean
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.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
-
CACHE_BY_CAMPAIGNS
- See Also:
-
-
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 interfaceCampaignService<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 interfaceCampaignService<P extends Campaign>
-
findByContextIds
-
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 interfaceCampaignService<P extends Campaign>
- Parameters:
id
- the id of the campaign to findcontextInfo
- 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 interfaceCampaignService<P extends Campaign>
- Parameters:
id
- the id of the campaign to findcontextInfo
- 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 interfaceCampaignService<P extends Campaign>
-
convertFromDomain
-
getRepository
@NonNull protected CampaignRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository() -
getCacheStateManager
@Nullable protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager() -
setCacheStateManager
@Autowired(required=false) public void setCacheStateManager(com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
-