Class ExternalGuestTokenProvider

    • Constructor Detail

      • 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 Detail

      • 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)
      • getServiceClient

        protected String getServiceClient()