Class ExternalItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>

    • Constructor Detail

      • ExternalItemListItemProvider

        public ExternalItemListItemProvider​(org.springframework.web.reactive.function.client.WebClient webClient,
                                            com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                            com.broadleafcommerce.common.extension.TypeFactory typeFactory,
                                            ExternalCartProperties properties)
    • Method Detail

      • getItemPage

        public org.springframework.data.domain.Page<P> getItemPage​(String listId,
                                                                   @Nullable
                                                                   org.springframework.data.domain.Pageable pageable,
                                                                   @Nullable
                                                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: ItemListItemProvider
        Gets a page of items belonging to a specific item list.
        Specified by:
        getItemPage in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
        Parameters:
        listId - the ID of the item list to get items from
        pageable - the details of the page of items to include
        context - the context of the request
        Returns:
        a page of items
      • getItems

        public List<P> getItems​(String listId,
                                @NonNull
                                @NonNull Collection<String> itemIds,
                                @Nullable
                                com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: ItemListItemProvider
        Gets specific items of a list by their IDs.
        Specified by:
        getItems in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
        Parameters:
        listId - the ID of the item list to get items from
        itemIds - the IDs of the items to get
        context - the context of the request
        Returns:
        a list of items
      • createItems

        public List<P> createItems​(String listId,
                                   @NonNull
                                   @NonNull Collection<P> items,
                                   @Nullable
                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: ItemListItemProvider
        Creates items within a specific list.
        Specified by:
        createItems in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
        Parameters:
        listId - the ID of the item list to create items in
        items - the items to create
        context - the context of the request
        Returns:
        a list of the created items
      • replaceItems

        public List<P> replaceItems​(String listId,
                                    @NonNull
                                    @NonNull Collection<P> items,
                                    @Nullable
                                    com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: ItemListItemProvider
        Replaces items within a specific list.
        Specified by:
        replaceItems in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
        Parameters:
        listId - the ID of the item list to replace items in
        items - the items to replace and their corresponding data (item ID included)
        context - the context of the request
        Returns:
        a list of the replaced items
      • updateItems

        public List<P> updateItems​(String listId,
                                   @NonNull
                                   @NonNull Collection<P> items,
                                   @Nullable
                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: ItemListItemProvider
        Updates items within a specific list.
        Specified by:
        updateItems in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
        Parameters:
        listId - the ID of the item list to update items in
        items - the items to update and their corresponding data (item ID included)
        context - the context of the request
        Returns:
        a list of the updated items
      • deleteItems

        public void deleteItems​(String listId,
                                @NonNull
                                @NonNull Collection<String> itemIds,
                                @Nullable
                                com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: ItemListItemProvider
        Deletes items within a specific list
        Specified by:
        deleteItems in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
        Parameters:
        listId - the ID of the item list to delete items from
        itemIds - the IDs of the items to delete
        context - the context of the request
      • getBaseUri

        protected org.springframework.web.util.UriComponentsBuilder getBaseUri​(String listId)
        Gets the base URI common to all requests this provider will make.
        Returns:
        a URI components builder with the base URI set up
      • getListType

        protected org.springframework.core.ParameterizedTypeReference<List<P>> getListType()
        Gets the type reference for a list of item list items.
        Returns:
        type reference for a list of item list items
      • getPageType

        protected org.springframework.core.ParameterizedTypeReference<ResponsePageGenerator<P>> getPageType()
        Gets the type reference for a page generator of item list items.
        Returns:
        type reference for a page generator of item list items
      • getServiceClient

        protected String getServiceClient()