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>
  • 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 interface CartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
      Parameters:
      cartNote - the cart note to create
      contextInfo - 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 interface CartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
      Parameters:
      cartId - the id of the cart that this note belongs to
      cartNoteId - the cart note id
      contextInfo - 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 interface CartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
      Parameters:
      cartId - the id of the cart to find the notes for
      cartLevelOnly - whether to retrieve cart-level notes only
      filters - the filters to apply
      pageable - the requested page of results
      contextInfo - 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 interface CartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
      Parameters:
      cartId - the id of the cart that this note belongs to
      cartNoteId - the id of the cart note that is being replaced
      cartNote - the cart note payload
      contextInfo - 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 interface CartNoteProvider<P extends com.broadleafcommerce.cart.client.domain.CartNote>
      Parameters:
      cartId - the id of the cart that this note belongs to
      cartNoteId - the id of the cart note that is being deleted
      contextInfo - context information around sandbox and multitenant state.
    • getCartNotesUrlForCart

      protected String getCartNotesUrlForCart(@NonNull @NonNull String cartId)
    • getCartIdVariables

      protected Map<String,Object> getCartIdVariables(@NonNull @NonNull String cartId)
    • getType

      protected org.springframework.core.ParameterizedTypeReference<P> getType()
      Gets the type reference for CartNote.
      Returns:
      type reference for CartNote
    • getServiceClient

      protected String getServiceClient()