Class DefaultStockValidator

java.lang.Object
de.hybris.platform.ycommercewebservices.validator.DefaultStockSystemValidator
de.hybris.platform.ycommercewebservices.validator.DefaultStockValidator
All Implemented Interfaces:
StockSystemValidator, StockValidator

public class DefaultStockValidator extends DefaultStockSystemValidator implements StockValidator
Implementation of online stock validator that validates online product stock availability for the given site and entry number
  • Constructor Details

    • DefaultStockValidator

      public DefaultStockValidator(CommerceStockFacade commerceStockFacade)
      Creates an instance of the validator
      Parameters:
      commerceStockFacade - Commerce stock facade to be used in the validation
  • Method Details

    • validate

      public void validate(String baseSiteId, String productCode, Long entryNumber)
      Validates the online product stock availability for the given site and entry number.

      Throws StockSystemException in case stock system is unavailable.

      Throws LowStockException in case entry stock is insufficient, includes information about entry number as an error subject. Throws ProductLowStockException in case product stock is insufficient.

      Specified by:
      validate in interface StockValidator
      Parameters:
      baseSiteId - Id of base site
      productCode - Code of the product
      entryNumber - Number of entry in the cart