Class ProductServiceImpl

java.lang.Object
org.openwms.wms.inventory.impl.ProductServiceImpl
All Implemented Interfaces:
ProductService

@Validated @TxService class ProductServiceImpl extends Object implements ProductService
A ProductServiceImpl.
Author:
Heiko Scherrer
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • translator

      private final org.ameba.i18n.Translator translator
    • productMapper

      private final ProductMapper productMapper
    • productRepository

      private final ProductRepository productRepository
    • uomRelationRepository

      private final UomRelationRepository uomRelationRepository
    • publisher

      private final org.springframework.context.ApplicationEventPublisher publisher
  • Constructor Details

    • ProductServiceImpl

      ProductServiceImpl(org.ameba.i18n.Translator translator, ProductMapper productMapper, ProductRepository productRepository, UomRelationRepository uomRelationRepository, org.springframework.context.ApplicationEventPublisher publisher)
  • Method Details

    • getProductRepository

      protected ProductRepository getProductRepository()
    • create

      @Measured @NotNull public @NotNull Product create(@Valid @NotNull @Valid @NotNull Product product)
      Create a single Product.
      Specified by:
      create in interface ProductService
      Parameters:
      product - The Product to create
    • createInternal

      private Product createInternal(Product product)
    • createAll

      @Measured public void createAll(@NotNull @NotNull List<Product> products)
      Create a given list of Products.
      Specified by:
      createAll in interface ProductService
      Parameters:
      products - The list of Products to create
    • findAll

      @Measured @NotNull public @NotNull List<Product> findAll()
      Find and return all existing Products.
      Specified by:
      findAll in interface ProductService
      Returns:
      As list but never null
    • findBy

      @Measured public Product findBy(@NotBlank @NotBlank String pKey)
      Find an existing Product by its synthetic technical key.
      Specified by:
      findBy in interface ProductService
      Parameters:
      pKey - The persistent key
      Returns:
      The Product instance
    • findByInternal

      private Product findByInternal(String pKey)
    • findBySKUorThrow

      @Measured @Transactional(readOnly=true) public Product findBySKUorThrow(@NotBlank @NotBlank String sku)
      Find and return an Product identified by its given sku.
      Specified by:
      findBySKUorThrow in interface ProductService
      Parameters:
      sku - The product SKU
      Returns:
      The product instance
    • findByLabelOrSKUOrThrow

      @Measured @Transactional(readOnly=true) public Product findByLabelOrSKUOrThrow(@NotBlank @NotBlank String bk)
      Find and return an Product identified by its given bk.
      Specified by:
      findByLabelOrSKUOrThrow in interface ProductService
      Parameters:
      bk - The product SKU or the label
      Returns:
      The product instance
    • findBySKU

      @Measured @Transactional(readOnly=true) public Optional<Product> findBySKU(@NotBlank @NotBlank String sku)
      Find and return an Product identified by its given sku.
      Specified by:
      findBySKU in interface ProductService
      Parameters:
      sku - The product SKU
      Returns:
      The product instance
    • findBySKUandUOM

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

      @Measured @NotNull public @NotNull Product update(@NotNull @NotNull Product entity)
      Update an existing Product.
      Specified by:
      update in interface ProductService
      Parameters:
      entity - The instance to update
      Returns:
      The updated instance