public class ExternalItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList> extends AbstractExternalProvider implements ItemListProvider<P>
Constructor and Description |
---|
ExternalItemListProvider(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 |
---|---|
P |
create(P itemList,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Creates an item list.
|
void |
delete(@NonNull Set<String> listIds,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Deletes multiple item lists by IDs.
|
void |
delete(@NonNull String listId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Deletes an item list by ID.
|
protected org.springframework.web.util.UriComponentsBuilder |
getBaseUri()
Gets the base URI common to all requests this provider will make.
|
protected org.springframework.core.ParameterizedTypeReference<ResponsePageGenerator<P>> |
getListType()
Gets the type reference for a list of item lists.
|
protected ExternalCartProperties |
getProperties() |
protected org.springframework.core.ParameterizedTypeReference<P> |
getType()
Gets the type reference for item lists.
|
P |
readById(@NonNull String listId,
boolean hydrate,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads a specific item list by its ID and optionally hydrates the items.
|
P |
readById(@NonNull String listId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads a specific item list by its ID.
|
org.springframework.data.domain.Page<P> |
readByIds(@NonNull Set<String> listIds,
cz.jirutka.rsql.parser.ast.Node filters,
org.springframework.data.domain.Pageable page,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads specific item lists by their IDs.
|
P |
replace(P itemList,
@NonNull String id,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Replaces an item list.
|
P |
update(P itemList,
@NonNull String id,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Updates an item list.
|
executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, pageableToParams, uriVars
public ExternalItemListProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCartProperties properties)
public P readById(@NonNull @NonNull String listId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
readById
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
listId
- the ID of the item list to retrievecontext
- the context of the requestpublic P readById(@NonNull @NonNull String listId, boolean hydrate, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
readById
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
listId
- the ID of the item list to retrievehydrate
- if true, causes the items to by hydratedcontext
- the context of the requestpublic org.springframework.data.domain.Page<P> readByIds(@NonNull @NonNull Set<String> listIds, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
readByIds
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
listIds
- the IDs of the item lists to retrievefilters
- additional filters to apply in the query.page
- the requested page of results from the databasecontext
- the context of the requestpublic P create(@NonNull P itemList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
create
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
itemList
- the item list to createcontext
- the context of the requestpublic P replace(@NonNull P itemList, @NonNull @NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
replace
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
itemList
- the item list to replace withid
- the ID of the item listcontext
- the context of the requestpublic P update(@NonNull P itemList, @NonNull @NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
update
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
itemList
- the item list to update withid
- the ID of the item listcontext
- the context of the requestpublic void delete(@NonNull @NonNull String listId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
delete
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
listId
- the ID of the item list to deletecontext
- the context of the requestpublic void delete(@NonNull @NonNull Set<String> listIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
ItemListProvider
delete
in interface ItemListProvider<P extends com.broadleafcommerce.cart.client.domain.ItemList>
listIds
- the list of IDs of the item lists to deletecontext
- the context of the requestprotected org.springframework.web.util.UriComponentsBuilder getBaseUri()
protected org.springframework.core.ParameterizedTypeReference<P> getType()
protected org.springframework.core.ParameterizedTypeReference<ResponsePageGenerator<P>> getListType()
protected ExternalCartProperties getProperties()
Copyright © 2021. All rights reserved.