Class DefaultStockValidator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void validate​(java.lang.String baseSiteId, java.lang.String productCode, java.lang.Long entryNumber)
      Validates the online product stock availability for the given site and entry number.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultStockValidator

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

      • validate

        public void validate​(java.lang.String baseSiteId,
                             java.lang.String productCode,
                             java.lang.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