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)
-
Field Summary
Fields inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND
-
Constructor Summary
ConstructorDescriptionExternalGuestTokenProvider
(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 TypeMethodDescriptioncom.broadleafcommerce.cart.client.domain.GuestToken
createGuestToken
(@NonNull com.broadleafcommerce.cart.client.domain.GuestToken guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates the providedGuestToken
and returns the result.boolean
deleteGuestToken
(@NonNull String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes the guest token for the provided cart ID, if it exists.getCartIdVariables
(String cartId) protected String
getGuestTokenUrlForCart
(String cartId) protected ExternalCartProperties
protected String
Optional<com.broadleafcommerce.cart.client.domain.GuestToken>
retrieveGuestToken
(@NonNull String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theGuestToken
for the provided cart ID, if it exists.Methods inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
buildNotFoundException, executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, isEntityNotFound, pageableToParams, uriVars
-
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 theGuestToken
for the provided cart ID, if it exists.- Specified by:
retrieveGuestToken
in interfaceGuestTokenProvider
- Parameters:
cartId
- the cart IDcontextInfo
- 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 providedGuestToken
and returns the result.- Specified by:
createGuestToken
in interfaceGuestTokenProvider
- Parameters:
guestToken
- the guest token to createcontextInfo
- 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 interfaceGuestTokenProvider
- Parameters:
cartId
- the cart IDcontextInfo
- the context info- Returns:
- whether or not a token was deleted
-
getGuestTokenUrlForCart
-
getCartIdVariables
-
getServiceClient
-
getProperties
-