public class ExternalItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem> extends AbstractExternalProvider implements ItemListItemProvider<P>
Constructor and Description |
---|
ExternalItemListItemProvider(org.springframework.web.reactive.function.client.WebClient webClient,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
com.broadleafcommerce.common.extension.TypeFactory typeFactory,
ExternalCartProperties properties) |
Modifier and Type | Method and Description |
---|---|
List<P> |
createItems(String listId,
@NonNull Collection<P> items,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Creates items within a specific list.
|
void |
deleteItems(String listId,
@NonNull Collection<String> itemIds,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Deletes items within a specific list
|
protected org.springframework.web.util.UriComponentsBuilder |
getBaseUri(String listId)
Gets the base URI common to all requests this provider will make.
|
org.springframework.data.domain.Page<P> |
getItemPage(String listId,
org.springframework.data.domain.Pageable pageable,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Gets a page of items belonging to a specific item list.
|
List<P> |
getItems(String listId,
@NonNull Collection<String> itemIds,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Gets specific items of a list by their IDs.
|
protected org.springframework.core.ParameterizedTypeReference<List<P>> |
getListType()
Gets the type reference for a list of item list items.
|
protected ExternalCartProperties |
getProperties() |
List<P> |
replaceItems(String listId,
@NonNull Collection<P> items,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Replaces items within a specific list.
|
List<P> |
updateItems(String listId,
@NonNull Collection<P> items,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Updates items within a specific list.
|
executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, pageableToParams, uriVars
public ExternalItemListItemProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCartProperties properties)
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)
ItemListItemProvider
getItemPage
in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
listId
- the ID of the item list to get items frompageable
- the details of the page of items to includecontext
- the context of the requestpublic List<P> getItems(String listId, @NonNull @NonNull Collection<String> itemIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListItemProvider
getItems
in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
listId
- the ID of the item list to get items fromitemIds
- the IDs of the items to getcontext
- the context of the requestpublic List<P> createItems(String listId, @NonNull @NonNull Collection<P> items, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListItemProvider
createItems
in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
listId
- the ID of the item list to create items initems
- the items to createcontext
- the context of the requestpublic List<P> replaceItems(String listId, @NonNull @NonNull Collection<P> items, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListItemProvider
replaceItems
in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
listId
- the ID of the item list to replace items initems
- the items to replace and their corresponding data (item ID included)context
- the context of the requestpublic List<P> updateItems(String listId, @NonNull @NonNull Collection<P> items, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListItemProvider
updateItems
in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
listId
- the ID of the item list to update items initems
- the items to update and their corresponding data (item ID included)context
- the context of the requestpublic void deleteItems(String listId, @NonNull @NonNull Collection<String> itemIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListItemProvider
deleteItems
in interface ItemListItemProvider<P extends com.broadleafcommerce.cart.client.domain.ItemListItem>
listId
- the ID of the item list to delete items fromitemIds
- the IDs of the items to deletecontext
- the context of the requestprotected org.springframework.web.util.UriComponentsBuilder getBaseUri(String listId)
protected org.springframework.core.ParameterizedTypeReference<List<P>> getListType()
protected ExternalCartProperties getProperties()
Copyright © 2021. All rights reserved.