Class ExternalGuestTokenProvider

java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.cartoperation.service.provider.external.ExternalGuestTokenProvider
All Implemented Interfaces:
GuestTokenProvider

public class ExternalGuestTokenProvider extends AbstractExternalProvider implements GuestTokenProvider
Author:
Nick Crum (ncrum)
  • Constructor Details

    • ExternalGuestTokenProvider

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

    • retrieveGuestToken

      public Optional<com.broadleafcommerce.cart.client.domain.GuestToken> retrieveGuestToken(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: GuestTokenProvider
      Retrieve the GuestToken for the provided cart ID, if it exists.
      Specified by:
      retrieveGuestToken in interface GuestTokenProvider
      Parameters:
      cartId - the cart ID
      contextInfo - the context info
      Returns:
      an optional of the guest token, or empty
    • createGuestToken

      public com.broadleafcommerce.cart.client.domain.GuestToken createGuestToken(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.GuestToken guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: GuestTokenProvider
      Creates the provided GuestToken and returns the result.
      Specified by:
      createGuestToken in interface GuestTokenProvider
      Parameters:
      guestToken - the guest token to create
      contextInfo - the context info
      Returns:
      the created guest token
    • deleteGuestToken

      public boolean deleteGuestToken(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: GuestTokenProvider
      Deletes the guest token for the provided cart ID, if it exists.
      Specified by:
      deleteGuestToken in interface GuestTokenProvider
      Parameters:
      cartId - the cart ID
      contextInfo - the context info
      Returns:
      whether or not a token was deleted
    • getGuestTokenUrlForCart

      protected String getGuestTokenUrlForCart(String cartId)
    • getCartIdVariables

      protected Map<String,Object> getCartIdVariables(String cartId)
    • getServiceClient

      protected String getServiceClient()
    • getProperties

      protected ExternalCartProperties getProperties()