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

    Constructors
    Constructor
    Description
    DefaultItemListItemService(ItemListItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deleteAll(Collection<P> items, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Deletes a given collection of items.
    void
    deleteAll(Set<String> itemIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Deletes a given collection of items.
    void
    deleteAllByListIds(Collection<String> listIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Deletes all items that belong to multiple item lists
    protected 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, 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
  • 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: ItemListItemService
      Find items belonging to a specific list.
      Specified by:
      readByItemListId in interface ItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
      Parameters:
      itemListId - the ID of the owning item list
      contextInfo - the request context information
      page - 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: ItemListItemService
      Finds item counts per item list.
      Specified by:
      readCountsByItemListIds in interface ItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
      Parameters:
      itemListIds - the IDs of the owning item lists
      contextInfo - 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: ItemListItemService
      Deletes a given collection of items.
      Specified by:
      deleteAll in interface ItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
      Parameters:
      itemIds - the IDs of items to delete
      context - the request context information
    • deleteAll

      public void deleteAll(Collection<P> items, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListItemService
      Deletes a given collection of items.
      Specified by:
      deleteAll in interface ItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
      Parameters:
      items - the items to delete
      context - the request context information
    • deleteAllByListIds

      public void deleteAllByListIds(Collection<String> listIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListItemService
      Deletes all items that belong to multiple item lists
      Specified by:
      deleteAllByListIds in interface ItemListItemService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
      Parameters:
      listIds - list of item list ids
      context - the request context information
    • getRepository

      protected ItemListItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>