Interface ProductService

All Known Implementing Classes:
ProductServiceImpl

public interface ProductService
A ProductService.
Author:
Heiko Scherrer
  • Method Details

    • create

      @NotNull @NotNull Product create(@Valid @NotNull @Valid @NotNull Product product)
      Create a single Product.
      Parameters:
      product - The Product to create
    • createAll

      void createAll(@NotNull @NotNull List<Product> products)
      Create a given list of Products.
      Parameters:
      products - The list of Products to create
    • findAll

      @NotNull @NotNull List<Product> findAll()
      Find and return all existing Products.
      Returns:
      As list but never null
    • findBy

      Product findBy(@NotBlank @NotBlank String pKey)
      Find an existing Product by its synthetic technical key.
      Parameters:
      pKey - The persistent key
      Returns:
      The Product instance
      Throws:
      org.ameba.exception.NotFoundException - if not found
    • findBySKUorThrow

      Product findBySKUorThrow(@NotBlank @NotBlank String sku)
      Find and return an Product identified by its given sku.
      Parameters:
      sku - The product SKU
      Returns:
      The product instance
      Throws:
      org.ameba.exception.NotFoundException - In case the Product does not exist
    • findByLabelOrSKUOrThrow

      Product findByLabelOrSKUOrThrow(@NotBlank @NotBlank String bk)
      Find and return an Product identified by its given bk.
      Parameters:
      bk - The product SKU or the label
      Returns:
      The product instance
      Throws:
      org.ameba.exception.NotFoundException - In case the Product does not exist
    • findBySKU

      Optional<Product> findBySKU(@NotBlank @NotBlank String sku)
      Find and return an Product identified by its given sku.
      Parameters:
      sku - The product SKU
      Returns:
      The product instance
    • findBySKUandUOM

      Optional<Product> findBySKUandUOM(@NotBlank @NotBlank String sku, @NotBlank @NotBlank String uom)
      Find and return an Product identified by its given sku and uom.
      Parameters:
      sku - The product SKU
      uom - The product UOM
      Returns:
      The product instance
    • update

      @NotNull @NotNull Product update(@NotNull @NotNull Product entity)
      Update an existing Product.
      Parameters:
      entity - The instance to update
      Returns:
      The updated instance