Class DefaultOfferSummaryService<P extends OfferAuditSummary>
java.lang.Object
com.broadleafcommerce.promotion.offer.service.DefaultOfferSummaryService<P>
- All Implemented Interfaces:
- OfferSummaryService<P>
public class DefaultOfferSummaryService<P extends OfferAuditSummary>
extends Object
implements OfferSummaryService<P>
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultOfferSummaryService(OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected PconvertFromPersistentDomain(com.broadleafcommerce.data.tracking.core.Trackable domain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) createOrUpdateAndIncrement(String offerId, javax.money.MonetaryAmount totalSavings, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Create an instance ofOfferAuditSummary, or atomically update an existing one.voidPerform a delete operation on the entity identified by the context id.protected com.broadleafcommerce.data.tracking.core.service.CrudEntityHelperprotected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManagerprotected OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable>readAll(com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read a list of narrowed instances in the form of the business instance.org.springframework.data.domain.Page<P>readAll(org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read a page of narrowed instances in the form of the business instance.readAll(org.springframework.data.domain.Sort sort, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read a list of narrowed instances in the form of the business instance.readAllByContextId(Iterable<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieve all business instances based on a list of context ids.readAllByOfferIds(Set<String> offerIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve allOfferAuditSummaryrecords that relate to the provided offer IDs.readByContextId(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read a single instance of an entity in the form of a business domain.readByOfferId(String offerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theOfferAuditSummaryrecord for the provided offer ID.voidsetMapper(com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager mapper) 
- 
Constructor Details- 
DefaultOfferSummaryServicepublic DefaultOfferSummaryService(OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) 
 
- 
- 
Method Details- 
readByContextIdpublic P readByContextId(@NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferSummaryServiceRead a single instance of an entity in the form of a business domain.- Specified by:
- readByContextIdin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- id- The context id for the entity. This is the id by which the business recognizes the item.
- context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
- Returns:
- The narrowed entity instance in the form of a business instance
 
- 
readAllByContextIdpublic Iterable<P> readAllByContextId(@NonNull Iterable<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferSummaryServiceRetrieve all business instances based on a list of context ids.- Specified by:
- readAllByContextIdin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- ids- A list of context ids for the entitys. This is the id by which the business recognizes the item.
- context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
- Returns:
- The narrowed iterable collection of data in the form of business instances
 
- 
readAllpublic org.springframework.data.domain.Page<P> readAll(@NonNull org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferSummaryServiceRead a page of narrowed instances in the form of the business instance.- Specified by:
- readAllin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- pageable- The current page information
- context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
- Returns:
- The narrowed page of data in the form of business instances
 
- 
readAllpublic List<P> readAll(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferSummaryServiceRead a list of narrowed instances in the form of the business instance.- Specified by:
- readAllin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
- Returns:
- The narrowed list of data in the form of business instances
 
- 
readAllpublic List<P> readAll(@NonNull org.springframework.data.domain.Sort sort, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferSummaryServiceRead a list of narrowed instances in the form of the business instance. Also apply the given sort.- Specified by:
- readAllin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- sort- The sort to be performed on the results
- context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
- Returns:
- The narrowed list of sorted data in the form of business instances
 
- 
createOrUpdateAndIncrementpublic P createOrUpdateAndIncrement(String offerId, @Nullable javax.money.MonetaryAmount totalSavings, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferSummaryServiceCreate an instance ofOfferAuditSummary, or atomically update an existing one. This flow also will not end up creating duplicate summaries for the same offer.- Specified by:
- createOrUpdateAndIncrementin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- offerId- The id of the related offer
- totalSavings- The total savings applied to record for this offer
- context- Any tenant related information for the request context
- Returns:
- The created or updated summary
 
- 
deletepublic void delete(@NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferSummaryServicePerform a delete operation on the entity identified by the context id. This could result in an archival, or a raw delete, depending on the result of processing throughDomainMapper.deleteMap(Object, ContextInfo).- Specified by:
- deletein interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- id- The context id for the entity. This is the id by which the business recognizes the item.
- context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
 
- 
readByOfferId@Nullable public P readByOfferId(String offerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferSummaryServiceRetrieve theOfferAuditSummaryrecord for the provided offer ID.- Specified by:
- readByOfferIdin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- offerId- the offer ID to find summary record for
- contextInfo- the context to perform the operation in
- Returns:
- the OfferAuditSummaryrecord that relates to the provided offer ID
 
- 
readAllByOfferIdspublic List<P> readAllByOfferIds(@NonNull Set<String> offerIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferSummaryServiceRetrieve allOfferAuditSummaryrecords that relate to the provided offer IDs.- Specified by:
- readAllByOfferIdsin interface- OfferSummaryService<P extends OfferAuditSummary>
- Parameters:
- offerIds- the list of offer IDs to find summary records for
- contextInfo- the context to perform the operation in
- Returns:
- the OfferAuditSummaryrecords that relate to the provided offer IDs
 
- 
convertFromPersistentDomainprotected P convertFromPersistentDomain(com.broadleafcommerce.data.tracking.core.Trackable domain, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
- 
getRepository@NonNull protected OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
- 
getMapperprotected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager getMapper()
- 
setMapper@Autowired public void setMapper(@Nullable com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager mapper) 
- 
getHelper@NonNull protected com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper getHelper()
 
-