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 Summary
Constructors Constructor Description ExternalGuestTokenProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCartProperties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.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.protected Map<String,Object>
getCartIdVariables(String cartId)
protected String
getGuestTokenUrlForCart(String cartId)
protected ExternalCartProperties
getProperties()
protected String
getServiceClient()
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
executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, pageableToParams, uriVars
-
-
-
-
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 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
-
getServiceClient
protected String getServiceClient()
-
getProperties
protected ExternalCartProperties getProperties()
-
-