Interface GuestTokenProvider
- All Known Implementing Classes:
ExternalGuestTokenProvider
public interface GuestTokenProvider
Provider for storing
GuestToken
.- Author:
- Nick Crum (ncrum)
-
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.cart.client.domain.GuestToken
createGuestToken
(com.broadleafcommerce.cart.client.domain.GuestToken guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates the providedGuestToken
and returns the result.boolean
deleteGuestToken
(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes the guest token for the provided cart ID, if it exists.Optional<com.broadleafcommerce.cart.client.domain.GuestToken>
retrieveGuestToken
(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theGuestToken
for the provided cart ID, if it exists.
-
Method Details
-
retrieveGuestToken
Optional<com.broadleafcommerce.cart.client.domain.GuestToken> retrieveGuestToken(String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theGuestToken
for the provided cart ID, if it exists.- Parameters:
cartId
- the cart IDcontextInfo
- the context info- Returns:
- an optional of the guest token, or empty
-
createGuestToken
com.broadleafcommerce.cart.client.domain.GuestToken createGuestToken(com.broadleafcommerce.cart.client.domain.GuestToken guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates the providedGuestToken
and returns the result.- Parameters:
guestToken
- the guest token to createcontextInfo
- the context info- Returns:
- the created guest token
-
deleteGuestToken
boolean deleteGuestToken(String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes the guest token for the provided cart ID, if it exists.- Parameters:
cartId
- the cart IDcontextInfo
- the context info- Returns:
- whether or not a token was deleted
-