Class QuoteCommerceCartMetadataUpdateValidationHook
- java.lang.Object
-
- de.hybris.platform.commerceservices.order.hook.impl.QuoteCommerceCartMetadataUpdateValidationHook
-
- All Implemented Interfaces:
CommerceCartMetadataUpdateMethodHook
public class QuoteCommerceCartMetadataUpdateValidationHook extends java.lang.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 Constructor Description QuoteCommerceCartMetadataUpdateValidationHook()
-
Method Summary
-
-
-
Method Detail
-
beforeMetadataUpdate
public void beforeMetadataUpdate(CommerceCartMetadataParameter parameter)
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:
java.lang.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
protected void validateExpirationTime(java.util.Date expirationTime)
-
afterMetadataUpdate
public void afterMetadataUpdate(CommerceCartMetadataParameter parameter)
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
protected QuoteActionValidationStrategy getQuoteActionValidationStrategy()
-
setQuoteActionValidationStrategy
public void setQuoteActionValidationStrategy(QuoteActionValidationStrategy quoteActionValidationStrategy)
-
getQuoteUserIdentificationStrategy
protected QuoteUserIdentificationStrategy getQuoteUserIdentificationStrategy()
-
setQuoteUserIdentificationStrategy
public void setQuoteUserIdentificationStrategy(QuoteUserIdentificationStrategy quoteUserIdentificationStrategy)
-
getQuoteUserTypeIdentificationStrategy
protected QuoteUserTypeIdentificationStrategy getQuoteUserTypeIdentificationStrategy()
-
setQuoteUserTypeIdentificationStrategy
public void setQuoteUserTypeIdentificationStrategy(QuoteUserTypeIdentificationStrategy quoteUserTypeIdentificationStrategy)
-
getTimeService
protected TimeService getTimeService()
-
setTimeService
public void setTimeService(TimeService timeService)
-
-