Interface ItemListAccessRuleService<P extends com.broadleafcommerce.cart.client.domain.ItemListAccessRule>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
- All Known Implementing Classes:
DefaultItemListAccessRuleService
public interface ItemListAccessRuleService<P extends com.broadleafcommerce.cart.client.domain.ItemListAccessRule>
extends com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
Service for managing item list access rules.
- Author:
- Jacob Mitash
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteAllByListIds
(Collection<String> listIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deletes all access rules that belong to multiple item listscom.broadleafcommerce.cart.client.domain.ItemListAccessResponse
filterItemListIdsByRoles
(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @NonNull Set<String> roles, @NonNull Set<String> listIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Filters item list IDs based on whether the customer has a specified role for them or not.org.springframework.data.domain.Page<P>
findAllByCustomer
(com.broadleafcommerce.order.common.domain.CustomerRef customerRef, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find all access rules for a specific customer.org.springframework.data.domain.Page<P>
findAllByItemListId
(String itemListId, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds all access rules for a specific item list.findByItemListIdAndCustomer
(String itemListId, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds an access rule for a given list and customer.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
-
Method Details
-
findAllByCustomer
org.springframework.data.domain.Page<P> findAllByCustomer(com.broadleafcommerce.order.common.domain.CustomerRef customerRef, org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find all access rules for a specific customer.- Parameters:
customerRef
- a reference to the customer to find rules forpageable
- the requested paged of access rulescontext
- the context of the request- Returns:
- a page of access rules
-
findByItemListIdAndCustomer
P findByItemListIdAndCustomer(String itemListId, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds an access rule for a given list and customer.- Parameters:
itemListId
- the ID of the item list to find access rules forcustomerRef
- a reference to the customer to find rules forcontext
- the context of the request- Returns:
- the access rule for the given list and customer
- Throws:
com.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- when no relevant access rule could be found
-
filterItemListIdsByRoles
com.broadleafcommerce.cart.client.domain.ItemListAccessResponse filterItemListIdsByRoles(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @NonNull @NonNull Set<String> roles, @NonNull @NonNull Set<String> listIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Filters item list IDs based on whether the customer has a specified role for them or not.- Parameters:
customerRef
- a reference to the customer to find rules forroles
- the roles to check access forlistIds
- list of list item ids to checkcontext
- the context of the request- Returns:
- a access response with accessible and inaccessible list item ids for the request
-
findAllByItemListId
org.springframework.data.domain.Page<P> findAllByItemListId(String itemListId, org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds all access rules for a specific item list.- Parameters:
itemListId
- the ID of the item list to find access rules forpageable
- the requested paged of access rulescontext
- the context of the request- Returns:
- a page of access rules for the given item list
-
deleteAllByListIds
void deleteAllByListIds(Collection<String> listIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deletes all access rules that belong to multiple item lists- Parameters:
listIds
- list of item list idscontext
- the request context information
-