Class DefaultPriceDataUsageDetailService<P extends PriceDataUsageDetail>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.pricing.service.DefaultPriceDataUsageDetailService<P>
- Type Parameters:
 P- a class that is/extendsPriceDataUsageDetail
- All Implemented Interfaces:
 com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>,PriceDataUsageDetailService<P>
public class DefaultPriceDataUsageDetailService<P extends PriceDataUsageDetail>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements PriceDataUsageDetailService<P>
Default implementation of 
PriceDataUsageDetailService.- Author:
 - karanjariwala
 
- 
Constructor Summary
ConstructorsConstructorDescriptionDefaultPriceDataUsageDetailService(PriceDataUsageDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveAllByIds(@NonNull List<String> contextIds, @NonNull String archivalReason, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Archives all thePriceDataUsageDetailwhose ids are given in the contextIds list.protected org.springframework.data.domain.Page<P>convertFromDomain(org.springframework.data.domain.Page<com.broadleafcommerce.data.tracking.core.Trackable> trackables, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected @NonNull PriceDataUsageDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable>voidmarkRevertibleAllByIds(@NonNull List<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible=true for all thePriceDataUsageDetailwhose ids are given in the contextIds list.intpurgeOutdatedPriceDataUsageDetails(@NonNull Duration outdatedPriceDataUsageDetailTimeout, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes allPriceDataUsageDetailswithPriceDataUsageDetail.getUsageDate()before theoutdatedPriceDataUsageDetailTimeout.org.springframework.data.domain.Page<P>readAllByPriceDataIdIn(@NonNull Collection<String> priceDataIds, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) org.springframework.data.domain.Page<P>readAllByTransactionReferenceTypeAndTransactionReferenceId(@NonNull String transactionReferenceType, @NonNull String transactionReferenceId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads aPageofPriceDataUsageDetailbased on the transactionReferenceType and transactionReferenceId.org.springframework.data.domain.Page<P>readAllRevertibleOlderThan(Instant usageDate, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Fetches a page ofPriceDataUsageDetailthat are "revertible"(revertible=true) and before the specified datevoidupdateRevertibleByReferenceId(String transactionReferenceType, String transactionReferenceId, Boolean revertible, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible for thePriceDataUsageDetailthat matches criteriaMethods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAllMethods 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, updateSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, updateSortMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll 
- 
Constructor Details
- 
DefaultPriceDataUsageDetailService
public DefaultPriceDataUsageDetailService(PriceDataUsageDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)  
 - 
 - 
Method Details
- 
readAllByTransactionReferenceTypeAndTransactionReferenceId
public org.springframework.data.domain.Page<P> readAllByTransactionReferenceTypeAndTransactionReferenceId(@NonNull @NonNull String transactionReferenceType, @NonNull @NonNull String transactionReferenceId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PriceDataUsageDetailServiceReads aPageofPriceDataUsageDetailbased on the transactionReferenceType and transactionReferenceId.- Specified by:
 readAllByTransactionReferenceTypeAndTransactionReferenceIdin interfacePriceDataUsageDetailService<P extends PriceDataUsageDetail>- Parameters:
 transactionReferenceType- the referenceType of the transaction (e.g. CART)transactionReferenceId- the referenceId of the transaction (e.g. cartId)page- the pagecontextInfo- the context info- Returns:
 - Page of 
PriceDataUsageDetail 
 - 
archiveAllByIds
public void archiveAllByIds(@NonNull @NonNull List<String> contextIds, @NonNull @NonNull String archivalReason, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PriceDataUsageDetailServiceArchives all thePriceDataUsageDetailwhose ids are given in the contextIds list.- Specified by:
 archiveAllByIdsin interfacePriceDataUsageDetailService<P extends PriceDataUsageDetail>- Parameters:
 contextIds- the ids to deletearchivalReason- the reason for archivalcontextInfo- the context info- See Also:
 
 - 
markRevertibleAllByIds
public void markRevertibleAllByIds(@NonNull @NonNull List<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PriceDataUsageDetailServiceSets revertible=true for all thePriceDataUsageDetailwhose ids are given in the contextIds list.- Specified by:
 markRevertibleAllByIdsin interfacePriceDataUsageDetailService<P extends PriceDataUsageDetail>- Parameters:
 contextIds- the ids to markcontextInfo- the context info
 - 
updateRevertibleByReferenceId
public void updateRevertibleByReferenceId(String transactionReferenceType, String transactionReferenceId, Boolean revertible, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PriceDataUsageDetailServiceSets revertible for thePriceDataUsageDetailthat matches criteria- Specified by:
 updateRevertibleByReferenceIdin interfacePriceDataUsageDetailService<P extends PriceDataUsageDetail>- Parameters:
 transactionReferenceType- the transactionReferenceType to restrict querytransactionReferenceId- the transactionReferenceId to restrict queryrevertible- the value of revertible to setcontextInfo- the context info
 - 
readAllByPriceDataIdIn
public org.springframework.data.domain.Page<P> readAllByPriceDataIdIn(@NonNull @NonNull Collection<String> priceDataIds, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PriceDataUsageDetailService- Specified by:
 readAllByPriceDataIdInin interfacePriceDataUsageDetailService<P extends PriceDataUsageDetail>- Parameters:
 priceDataIds- the id of thePriceDatapage- the pagecontextInfo- the context info- Returns:
 - Page of 
PriceDataUsageDetail 
 - 
purgeOutdatedPriceDataUsageDetails
public int purgeOutdatedPriceDataUsageDetails(@NonNull @NonNull Duration outdatedPriceDataUsageDetailTimeout, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PriceDataUsageDetailServiceDeletes allPriceDataUsageDetailswithPriceDataUsageDetail.getUsageDate()before theoutdatedPriceDataUsageDetailTimeout.Used for cleanup of obsolete data
- Specified by:
 purgeOutdatedPriceDataUsageDetailsin interfacePriceDataUsageDetailService<P extends PriceDataUsageDetail>- Parameters:
 outdatedPriceDataUsageDetailTimeout- the duration before which the data is to be clearedcontextInfo- the context info- Returns:
 - the number of rows deleted
 
 - 
readAllRevertibleOlderThan
public org.springframework.data.domain.Page<P> readAllRevertibleOlderThan(Instant usageDate, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PriceDataUsageDetailServiceFetches a page ofPriceDataUsageDetailthat are "revertible"(revertible=true) and before the specified date- Specified by:
 readAllRevertibleOlderThanin interfacePriceDataUsageDetailService<P extends PriceDataUsageDetail>- Parameters:
 usageDate- - the date(instant) before usageDatepageable- - page infocontextInfo- - the context info- Returns:
 - the page of 
PriceDataUsageDetail 
 - 
convertFromDomain
protected org.springframework.data.domain.Page<P> convertFromDomain(org.springframework.data.domain.Page<com.broadleafcommerce.data.tracking.core.Trackable> trackables, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)  - 
getRepository
@NonNull protected @NonNull PriceDataUsageDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()- Overrides:
 getRepositoryin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends PriceDataUsageDetail>
 
 -