Class ExternalCartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.cartoperation.service.provider.external.ExternalCartNoteProvider<P>
- All Implemented Interfaces:
CartNoteProvider<P>
public class ExternalCartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
extends AbstractExternalProvider
implements CartNoteProvider<P>
-
Field Summary
Fields inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND
-
Constructor Summary
ConstructorDescriptionExternalCartNoteProvider
(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCartProperties properties) -
Method Summary
Modifier and TypeMethodDescriptioncreateCartNote
(P cartNote, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Create a new cart note.void
deleteCartNote
(@NonNull String cartId, @NonNull String cartNoteId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes the cart note.getCartIdVariables
(@NonNull String cartId) protected String
getCartNotesUrlForCart
(@NonNull String cartId) protected String
protected org.springframework.core.ParameterizedTypeReference<P>
getType()
Gets the type reference for CartNote.replaceCartNote
(@NonNull String cartId, @NonNull String cartNoteId, P cartNote, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Replaces the cart note.retrieveCartNoteById
(@NonNull String cartId, @NonNull String cartNoteId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves a cart note by its id.org.springframework.data.domain.Page<P>
retrieveCartNotesByCartId
(@NonNull String cartId, boolean cartLevelOnly, @NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves all cart notes based on the given cart id and filter.Methods inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
buildNotFoundException, executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, isEntityNotFound, pageableToParams, uriVars
-
Constructor Details
-
ExternalCartNoteProvider
public ExternalCartNoteProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCartProperties properties)
-
-
Method Details
-
createCartNote
public P createCartNote(@NonNull P cartNote, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartNoteProvider
Create a new cart note.- Specified by:
createCartNote
in interfaceCartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
- Parameters:
cartNote
- the cart note to createcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the created cart note.
-
retrieveCartNoteById
public P retrieveCartNoteById(@NonNull @NonNull String cartId, @NonNull @NonNull String cartNoteId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartNoteProvider
Retrieves a cart note by its id.- Specified by:
retrieveCartNoteById
in interfaceCartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
- Parameters:
cartId
- the id of the cart that this note belongs tocartNoteId
- the cart note idcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the retrieved cart note with the given id
-
retrieveCartNotesByCartId
public org.springframework.data.domain.Page<P> retrieveCartNotesByCartId(@NonNull @NonNull String cartId, boolean cartLevelOnly, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartNoteProvider
Retrieves all cart notes based on the given cart id and filter.- Specified by:
retrieveCartNotesByCartId
in interfaceCartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
- Parameters:
cartId
- the id of the cart to find the notes forcartLevelOnly
- whether to retrieve cart-level notes onlyfilters
- the filters to applypageable
- the requested page of resultscontextInfo
- context information around sandbox and multitenant state.- Returns:
- the cart notes based on the given cart id and filter
-
replaceCartNote
public P replaceCartNote(@NonNull @NonNull String cartId, @NonNull @NonNull String cartNoteId, @NonNull P cartNote, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartNoteProvider
Replaces the cart note.- Specified by:
replaceCartNote
in interfaceCartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
- Parameters:
cartId
- the id of the cart that this note belongs tocartNoteId
- the id of the cart note that is being replacedcartNote
- the cart note payloadcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the updated cart note
-
deleteCartNote
public void deleteCartNote(@NonNull @NonNull String cartId, @NonNull @NonNull String cartNoteId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartNoteProvider
Deletes the cart note.- Specified by:
deleteCartNote
in interfaceCartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
- Parameters:
cartId
- the id of the cart that this note belongs tocartNoteId
- the id of the cart note that is being deletedcontextInfo
- context information around sandbox and multitenant state.
-
getCartNotesUrlForCart
-
getCartIdVariables
-
getType
Gets the type reference for CartNote.- Returns:
- type reference for CartNote
-
getServiceClient
-