Class DefaultItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>

java.lang.Object
com.broadleafcommerce.cartoperation.service.DefaultItemListManagementService<L>
All Implemented Interfaces:
ItemListManagementService<L>

public class DefaultItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList> extends Object implements ItemListManagementService<L>
Default implementation of an item list management service.
Author:
Jacob Mitash
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultItemListManagementService(com.broadleafcommerce.common.extension.TypeFactory typeFactory, ItemListProvider<L> listProvider, ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule> securityService, ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem> itemService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    changeItemListAttributes(@NonNull String listId, @NonNull Map<String,Object> attributes, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Changes the attributes of the item list without having to include all of the items in the update request.
    changeItemListName(@NonNull String listId, @NonNull String replacementName, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Changes the name of the item list without having to include all of the items in the update request
    createItemList(L itemList, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Creates an item list and handles related security access grants.
    void
    deleteItemList(@NonNull String listId, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Deletes an item list by ID.
    deleteItemLists(Set<String> listIds, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Deletes multiple item lists by ID
    getItemListById(@NonNull String listId, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Gets a specific item list by its ID.
    org.springframework.data.domain.Page<L>
    getItemListPage(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Gets a page of item lists.
    protected ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem>
     
    protected ItemListProvider<L>
     
    protected ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule>
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    replaceItemList(@NonNull String listId, L replaceRequest, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Replaces an item list after checking if operation is allowed on the list.
    void
    shareItemList(@NonNull ShareItemListRequest shareRequest, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Shares an item list with other users.
    updateItemList(@NonNull String listId, L updateRequest, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Updates an item list after checking if the operation is allowed on the list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultItemListManagementService

      public DefaultItemListManagementService(com.broadleafcommerce.common.extension.TypeFactory typeFactory, ItemListProvider<L> listProvider, ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule> securityService, ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem> itemService)
  • Method Details

    • getItemListPage

      public org.springframework.data.domain.Page<L> getItemListPage(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Gets a page of item lists.
      Specified by:
      getItemListPage in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      customerRef - the reference to the customer of which to get item lists for
      filters - additional filters to apply in the query.
      pageable - the page information being requested
      context - the context of the request
      Returns:
      a page of item lists
    • getItemListById

      public L getItemListById(@NonNull @NonNull String listId, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Gets a specific item list by its ID.
      Specified by:
      getItemListById in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      listId - the ID of the item list
      customerRef - the reference to the customer retrieving the list
      context - the context of the request
      Returns:
      the item list
    • createItemList

      public L createItemList(@NonNull L itemList, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Creates an item list and handles related security access grants.
      Specified by:
      createItemList in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      itemList - The item list to create
      customerRef - the reference to the customer to create the item list for
      context - the context of the request
      Returns:
      the created item list
    • changeItemListName

      public L changeItemListName(@NonNull @NonNull String listId, @NonNull @NonNull String replacementName, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Changes the name of the item list without having to include all of the items in the update request
      Specified by:
      changeItemListName in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      listId - the ID of the item list whose name is being changed
      replacementName - the new name for the list
      customerRef - the reference to the customer to create the item list for
      context - the context of the request
      Returns:
      the item list with an updated name value
    • changeItemListAttributes

      public L changeItemListAttributes(@NonNull @NonNull String listId, @NonNull @NonNull Map<String,Object> attributes, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Changes the attributes of the item list without having to include all of the items in the update request. Only attributes with keys specified in the request will be updated. To have an attribute removed, map the key to a null value: myKey -> null.
      Specified by:
      changeItemListAttributes in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      listId - the ID of the item list whose attributes are being added
      attributes - the new attributes for the list
      customerRef - the reference to the customer to create the item list for
      context - the context of the request
      Returns:
      the item list with an updated name value
    • replaceItemList

      public L replaceItemList(@NonNull @NonNull String listId, @NonNull L replaceRequest, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Replaces an item list after checking if operation is allowed on the list.
      Specified by:
      replaceItemList in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      listId - the ID of the item list to replace
      replaceRequest - the replacement data to apply to the item list
      customerRef - the reference to the customer modifying the list
      context - the context of the request
      Returns:
      the replaced version of the item list
    • updateItemList

      public L updateItemList(@NonNull @NonNull String listId, @NonNull L updateRequest, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Updates an item list after checking if the operation is allowed on the list.
      Specified by:
      updateItemList in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      listId - the ID of the item list to replace
      updateRequest - the update data to apply to the item list
      customerRef - the reference to the customer modifying the list
      context - the context of the request
      Returns:
      the updated version of the item list
    • deleteItemList

      public void deleteItemList(@NonNull @NonNull String listId, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Deletes an item list by ID.
      Specified by:
      deleteItemList in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      listId - the ID of the item list to delete
      customerRef - the reference to the customer deleting the list
      context - the context of the request
    • deleteItemLists

      public DeleteItemListResponse deleteItemLists(Set<String> listIds, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Deletes multiple item lists by ID
      Specified by:
      deleteItemLists in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      listIds - the list IDs of the item lists to delete
      customerRef - the reference to the customer deleting the list
      context - the context of the request
      Returns:
      a response indicating which deletions were successful
    • shareItemList

      public void shareItemList(@NonNull @NonNull ShareItemListRequest shareRequest, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ItemListManagementService
      Shares an item list with other users.
      Specified by:
      shareItemList in interface ItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
      Parameters:
      shareRequest - the request body describing who and how to share the list with
      customerRef - the reference to the customer who initiated the sharing request
      context - the context of the request
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getListProvider

      protected ItemListProvider<L> getListProvider()
    • getSecurityService

      protected ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule> getSecurityService()
    • getItemService

      protected ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem> getItemService()