Class DefaultCartActionAuditService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.cart.service.DefaultCartActionAuditService<P>
- All Implemented Interfaces:
CartActionAuditService<P>,com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
public class DefaultCartActionAuditService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>
extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
implements CartActionAuditService<P>
- Author:
- Sunny Yu
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCartActionAuditService(CartActionAuditRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptioncloneToCart(@NonNull CloneCartActionAuditRequest cloneCartActionAuditRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Clones theCartActionAuditsfrom one cart to another.protected CartActionAuditRepository<com.broadleafcommerce.data.tracking.core.Trackable>protected CartActionAuditRequestValidator<P>protected CartService<com.broadleafcommerce.cart.client.domain.Cart>protected com.broadleafcommerce.common.extension.TypeFactoryreadAllByIdIn(@NonNull Collection<String> cartActionAuditIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all cart action audits for the given IDs.org.springframework.data.domain.Page<P>readByCartId(String cartId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all cart action audits for the given cart id.replace(String id, P businessInstance, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) voidsetCartActionAuditRequestValidator(CartActionAuditRequestValidator<P> cartActionAuditRequestValidator) voidsetCartService(CartService<com.broadleafcommerce.cart.client.domain.Cart> cartService) voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) update(String id, P businessInstance, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, 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
createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replaceAll, replaceAllAllowingPartialSuccess, updateAll, updateAllAllowingPartialSuccess, updateSort
-
Constructor Details
-
DefaultCartActionAuditService
public DefaultCartActionAuditService(CartActionAuditRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
-
-
Method Details
-
update
public P update(String id, P businessInstance, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
updatein interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>- Overrides:
updatein classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>
-
replace
public P replace(String id, P businessInstance, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
replacein interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>- Overrides:
replacein classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>
-
create
public P create(P businessInstance, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
createin interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>- Overrides:
createin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>
-
readByCartId
public org.springframework.data.domain.Page<P> readByCartId(String cartId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartActionAuditServiceReads all cart action audits for the given cart id.- Specified by:
readByCartIdin interfaceCartActionAuditService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>- Parameters:
cartId- the ID of the cart whose audits need to be accessedpage- the requested page of results from the databasecontextInfo- Context information used to discriminate the correct version of an entity by context id when multiple versions may be available across sandboxes, catalogs and applications.- Returns:
- all cart action audits for the given cart id
-
readAllByIdIn
public List<P> readAllByIdIn(@NonNull @NonNull Collection<String> cartActionAuditIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartActionAuditServiceReads all cart action audits for the given IDs.- Specified by:
readAllByIdInin interfaceCartActionAuditService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>- Parameters:
cartActionAuditIds- the IDs of the cart action audits to retrievecontextInfo- Context information used to discriminate the correct version of an entity by context ID when multiple versions may be available across sandboxes, catalogs and applications.- Returns:
- all cart action audits for the given IDs.
-
cloneToCart
public CloneCartActionAuditResponse cloneToCart(@NonNull @NonNull CloneCartActionAuditRequest cloneCartActionAuditRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartActionAuditServiceClones theCartActionAuditsfrom one cart to another.This is typically used for preserving the quote history when cloning an
DefaultQuoteStatuses.EXPIREDquote into a new one.- Specified by:
cloneToCartin interfaceCartActionAuditService<P extends com.broadleafcommerce.cart.client.domain.CartActionAudit>- Parameters:
cloneCartActionAuditRequest- TheCloneCartActionAuditRequestcontextInfo- Context information around sandbox and multitenant state.- Returns:
- The
CloneCartActionAuditResponseregarding the result of the clone
-
getCartActionAuditRepository
protected CartActionAuditRepository<com.broadleafcommerce.data.tracking.core.Trackable> getCartActionAuditRepository() -
getCartActionAuditRequestValidator
-
setCartActionAuditRequestValidator
@Autowired public void setCartActionAuditRequestValidator(CartActionAuditRequestValidator<P> cartActionAuditRequestValidator) -
getCartService
-
setCartService
@Autowired public void setCartService(CartService<com.broadleafcommerce.cart.client.domain.Cart> cartService) -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-