Class DefaultGuestCartTokenValidator
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.web.validator.DefaultGuestCartTokenValidator
-
- All Implemented Interfaces:
GuestCartTokenValidator
public class DefaultGuestCartTokenValidator extends Object implements GuestCartTokenValidator
- Author:
- Nick Crum (ncrum)
-
-
Constructor Summary
Constructors Constructor Description DefaultGuestCartTokenValidator(GuestCartProtectionService guestCartProtectionService, CartValidationProperties cartValidationProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CartValidationPropertiesgetCartValidationProperties()protected GuestCartProtectionServicegetGuestCartProtectionService()protected StringguestTokenRequiredMessage(String cartId)voidvalidateGuestTokenForCheckout(String cartId, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Validates the provided guest token string for the given cart ID during checkout.voidvalidateGuestTokenForOperation(String cartId, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Validates the provided guest token string for the given cart ID during a cart operation.
-
-
-
Constructor Detail
-
DefaultGuestCartTokenValidator
public DefaultGuestCartTokenValidator(GuestCartProtectionService guestCartProtectionService, CartValidationProperties cartValidationProperties)
-
-
Method Detail
-
validateGuestTokenForCheckout
public void validateGuestTokenForCheckout(String cartId, @Nullable String guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:GuestCartTokenValidatorValidates the provided guest token string for the given cart ID during checkout. This method will throw a runtime exception if the guest token is found to be invalid. Typically, this method will require the guest token to be non-null and valid.- Specified by:
validateGuestTokenForCheckoutin interfaceGuestCartTokenValidator- Parameters:
cartId- the cart IDguestToken- the guest tokencontextInfo- the context info
-
validateGuestTokenForOperation
public void validateGuestTokenForOperation(String cartId, @Nullable String guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:GuestCartTokenValidatorValidates the provided guest token string for the given cart ID during a cart operation. This method will throw a runtime exception if the guest token is found to be invalid. Typically, this method will treat a null guest token as valid.- Specified by:
validateGuestTokenForOperationin interfaceGuestCartTokenValidator- Parameters:
cartId- the cart IDguestToken- the guest tokencontextInfo- the context info
-
getGuestCartProtectionService
protected GuestCartProtectionService getGuestCartProtectionService()
-
getCartValidationProperties
protected CartValidationProperties getCartValidationProperties()
-
-