Interface LoadUnitService

All Known Implementing Classes:
LoadUnitServiceImpl

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

    • create

      LoadUnit create(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String position, @NotBlank @NotBlank String loadUnitType)
      Create a new LoadUnit with the given position on a TransportUnit.
      Parameters:
      transportUnitBK - The TransportUnit's business key
      position - The position on the TransportUnit
      loadUnitType - The LoadUnitType to assign the LoadUnit to
      Returns:
      The newly created instance
    • divide

      void divide(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitType, int parts)
      Divide a TransportUnit identified by its business key into a number of parts.
      Parameters:
      transportUnitBK - The business key of the TransportUnit to divide
      loadUnitType - The type of that the LoadUnits are created
      parts - The number of parts
    • load

      void load(@NotBlank @NotBlank String pKey, @NotNull @Valid @NotNull @Valid ProductVO product)
      Load a LoadUnit with the given Product.
      Parameters:
      pKey - The synthetic persistent key of the LoadUnit
      product - The Product to load
    • find

      Optional<List<LoadUnit>> find(@NotBlank @NotBlank String transportUnitBK)
      Find and return all LoadUnits on a TransportUnit.
      Parameters:
      transportUnitBK - The business key of the TransportUnit
      Returns:
      The LoadUnit instance
    • findOptional

      Optional<LoadUnit> findOptional(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition)
      Find and return a particular LoadUnit on a TransportUnit at the loadUnitPosition.
      Parameters:
      transportUnitBK - The business key of the TransportUnit
      loadUnitPosition - The position of the LoadUnit on top of the TransportUnit
      Returns:
      The LoadUnit instance
    • find

      LoadUnit find(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition)
      Find and return a particular LoadUnit on a TransportUnit at the loadUnitPosition.
      Parameters:
      transportUnitBK - The business key of the TransportUnit
      loadUnitPosition - The position of the LoadUnit on top of the TransportUnit
      Returns:
      The LoadUnit instance
    • save

      LoadUnit save(@NotNull @Valid @NotNull @Valid LoadUnit loadUnit)
      Save an already existing and modified instance of a LoadUnit.
      Parameters:
      loadUnit - The modified LoadUnit to save
      Returns:
      The saved instance
    • findByPKey

      LoadUnit findByPKey(@NotBlank @NotBlank String pKey)
      Find and return a LoadUnit.
      Parameters:
      pKey - The persistent key
      Returns:
      The instance
      Throws:
      org.ameba.exception.NotFoundException - in case it does not exist
    • findOrThrow

      LoadUnit findOrThrow(@NotNull @NotNull Long pk)
      Find and return a LoadUnit.
      Parameters:
      pk - The primary key
      Returns:
      The instance
      Throws:
      org.ameba.exception.NotFoundException - in case it does not exist
    • isLoadUnitEmpty

      boolean isLoadUnitEmpty(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String loadUnitPosition)
      Checks whether the LoadUnit is empty.
      Parameters:
      transportUnitBK - The identifying business key of the TransportUnit the LoadUnit is placed on
      loadUnitPosition - The identifying position within that TransportUnit
      Returns:
      true if empty