Class QuoteCommerceCartMetadataUpdateValidationHook
java.lang.Object
de.hybris.platform.commerceservices.order.hook.impl.QuoteCommerceCartMetadataUpdateValidationHook
- All Implemented Interfaces:
CommerceCartMetadataUpdateMethodHook
public class QuoteCommerceCartMetadataUpdateValidationHook
extends Object
implements CommerceCartMetadataUpdateMethodHook
Validates cart metadata attributes (i.e. name, description) for a cart created from a quote using quote specific
rules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterMetadataUpdate(CommerceCartMetadataParameter parameter) Executed after commerce cart metadata update.voidValidates cart metadata attributes (name, description, and expiration time) for a cart created from a quote using quote specific rules.protected QuoteActionValidationStrategyprotected QuoteUserIdentificationStrategyprotected QuoteUserTypeIdentificationStrategyprotected TimeServicevoidsetQuoteActionValidationStrategy(QuoteActionValidationStrategy quoteActionValidationStrategy) voidsetQuoteUserIdentificationStrategy(QuoteUserIdentificationStrategy quoteUserIdentificationStrategy) voidsetQuoteUserTypeIdentificationStrategy(QuoteUserTypeIdentificationStrategy quoteUserTypeIdentificationStrategy) voidsetTimeService(TimeService timeService) protected voidvalidateExpirationTime(Date expirationTime) protected voidvalidateParameter(CommerceCartMetadataParameter parameter, QuoteUserType quoteUserType)
-
Constructor Details
-
QuoteCommerceCartMetadataUpdateValidationHook
public QuoteCommerceCartMetadataUpdateValidationHook()
-
-
Method Details
-
beforeMetadataUpdate
Validates cart metadata attributes (name, description, and expiration time) for a cart created from a quote using quote specific rules. Updates to a cart associated with a quote can only be done for the quote states linked to Save action. A buyer cannot set or remove the expiration time for a quote. A seller cannot set name and description attributes. Also, expiration time when present must be valid as perQuoteExpirationTimeUtils.isExpirationTimeValid(Date, Date). A seller approver cannot set cart metadata attributes.- Specified by:
beforeMetadataUpdatein interfaceCommerceCartMetadataUpdateMethodHook- Parameters:
parameter- a bean holding any number of additional attributes a client may want to pass to the method- Throws:
IllegalArgumentException- if any of the attributes cannot be set by the user as per the quote rules or if the type of the user cannot be determinedIllegalQuoteStateException- if the cart is associated with a quote for which the operation cannot be performed
-
validateParameter
protected void validateParameter(CommerceCartMetadataParameter parameter, QuoteUserType quoteUserType) -
validateExpirationTime
-
afterMetadataUpdate
Description copied from interface:CommerceCartMetadataUpdateMethodHookExecuted after commerce cart metadata update.- Specified by:
afterMetadataUpdatein interfaceCommerceCartMetadataUpdateMethodHook- Parameters:
parameter- a bean holding any number of additional attributes a client may want to pass to the method
-
getQuoteActionValidationStrategy
-
setQuoteActionValidationStrategy
public void setQuoteActionValidationStrategy(QuoteActionValidationStrategy quoteActionValidationStrategy) -
getQuoteUserIdentificationStrategy
-
setQuoteUserIdentificationStrategy
public void setQuoteUserIdentificationStrategy(QuoteUserIdentificationStrategy quoteUserIdentificationStrategy) -
getQuoteUserTypeIdentificationStrategy
-
setQuoteUserTypeIdentificationStrategy
public void setQuoteUserTypeIdentificationStrategy(QuoteUserTypeIdentificationStrategy quoteUserTypeIdentificationStrategy) -
getTimeService
-
setTimeService
-