Class DefaultItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.cart.service.DefaultItemListItemService<P>
- All Implemented Interfaces:
ItemListItemService<P>,com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
public class DefaultItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
implements ItemListItemService<P>
Default implementation of an item list service.
- Author:
- Jacob Mitash
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultItemListItemService(ItemListItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteAll(Collection<P> items, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deletes a given collection of items.voiddeleteAll(Set<String> itemIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deletes a given collection of items.voiddeleteAllByListIds(Collection<String> listIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deletes all items that belong to multiple item listsprotected ItemListItemRepository<com.broadleafcommerce.data.tracking.core.Trackable>org.springframework.data.domain.Page<P>readByItemListId(String itemListId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, org.springframework.data.domain.Pageable page) Find items belonging to a specific list.readCountsByItemListIds(Iterable<String> itemListIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds item counts per item list.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, 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, updateSort
-
Constructor Details
-
DefaultItemListItemService
public DefaultItemListItemService(ItemListItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
-
-
Method Details
-
readByItemListId
public org.springframework.data.domain.Page<P> readByItemListId(String itemListId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable org.springframework.data.domain.Pageable page) Description copied from interface:ItemListItemServiceFind items belonging to a specific list.- Specified by:
readByItemListIdin interfaceItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>- Parameters:
itemListId- the ID of the owning item listcontextInfo- the request context informationpage- the requested page of results from the database- Returns:
- a page of item lists items owned by the item list
-
readCountsByItemListIds
public Map<String,Long> readCountsByItemListIds(Iterable<String> itemListIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ItemListItemServiceFinds item counts per item list.- Specified by:
readCountsByItemListIdsin interfaceItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>- Parameters:
itemListIds- the IDs of the owning item listscontextInfo- the request context information- Returns:
- a map of item lists ids and their item counts
-
deleteAll
public void deleteAll(Set<String> itemIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ItemListItemServiceDeletes a given collection of items.- Specified by:
deleteAllin interfaceItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>- Parameters:
itemIds- the IDs of items to deletecontext- the request context information
-
deleteAll
public void deleteAll(Collection<P> items, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ItemListItemServiceDeletes a given collection of items.- Specified by:
deleteAllin interfaceItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>- Parameters:
items- the items to deletecontext- the request context information
-
deleteAllByListIds
public void deleteAllByListIds(Collection<String> listIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ItemListItemServiceDeletes all items that belong to multiple item lists- Specified by:
deleteAllByListIdsin interfaceItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>- Parameters:
listIds- list of item list idscontext- the request context information
-
getRepository
protected ItemListItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()- Overrides:
getRepositoryin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
-