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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description L
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.DeleteItemListResponse
deleteItemLists(Set<String> listIds, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Deletes multiple item lists by IDL
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>
getItemService()
protected ItemListProvider<L>
getListProvider()
protected ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule>
getSecurityService()
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
L
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.L
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.
-
-
-
Constructor Detail
-
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 Detail
-
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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
customerRef
- the reference to the customer of which to get item lists forfilters
- additional filters to apply in the query.pageable
- the page information being requestedcontext
- 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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
listId
- the ID of the item listcustomerRef
- the reference to the customer retrieving the listcontext
- 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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
itemList
- The item list to createcustomerRef
- the reference to the customer to create the item list forcontext
- the context of the request- Returns:
- the created item list
-
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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
listId
- the ID of the item list to replacereplaceRequest
- the replacement data to apply to the item listcustomerRef
- the reference to the customer modifying the listcontext
- 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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
listId
- the ID of the item list to replaceupdateRequest
- the update data to apply to the item listcustomerRef
- the reference to the customer modifying the listcontext
- 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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
listId
- the ID of the item list to deletecustomerRef
- the reference to the customer deleting the listcontext
- 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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
listIds
- the list IDs of the item lists to deletecustomerRef
- the reference to the customer deleting the listcontext
- 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 interfaceItemListManagementService<L extends com.broadleafcommerce.cart.client.domain.ItemList>
- Parameters:
shareRequest
- the request body describing who and how to share the list withcustomerRef
- the reference to the customer who initiated the sharing requestcontext
- 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()
-
-