Package org.openwms.common.transport
Interface TransportUnitService
- All Known Implementing Classes:
TransportUnitServiceImpl
public interface TransportUnitService
A TransportService offers functionality to create, read, update and delete
TransportUnits. Additionally it defines useful methods regarding the general
handling with TransportUnits.- Author:
- Heiko Scherrer
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an error to aTransportUnit.@NotNull TransportUnitchangeTarget(@NotNull Barcode barcode, @NotBlank String targetLocationId) Change the target of theTransportUnitidentified with itsbarcodeto the Location identified by thetargetLocationId.@NotNull TransportUnitcreate(@NotBlank String transportUnitBK, @NotBlank String transportUnitType, @NotBlank String actualLocation, Boolean strict) @NotNull TransportUnitcreate(@NotBlank String transportUnitBK, @NotNull TransportUnitType transportUnitType, @NotNull LocationPK actualLocation, Boolean strict) @NotNull TransportUnitvoidDelete aTransportUnitafter requesting all parties for removal.voiddeleteTransportUnits(@NotNull List<TransportUnit> transportUnits) Delete already persistedTransportUnits from the persistent storage.@NotNull List<TransportUnit> findAll()Find and return all existingTransportUnits.@NotNull TransportUnitfindByBarcode(@NotBlank String transportUnitBK) Find and return aTransportUnitby it'stransportUnitBK.@NotNull List<TransportUnit> findByBarcodes(@NotEmpty List<Barcode> barcodes) Find and return allTransportUnits identified by their particularBarcode.@NotNull TransportUnitfindByPKey(@NotBlank String pKey) Find and return aTransportUnitidentified by the givenpKey.@NotNull List<TransportUnit> findOnLocation(@NotBlank String actualLocation) Find and return allTransportUnits that are located on theLocationidentified by the givenactualLocation.@NotNull TransportUnitmoveTransportUnit(@NotNull Barcode barcode, @NotBlank String targetLocation) Move aTransportUnitidentified by itsBarcodeto theLocationidentified by the giventargetLocationPK.voidChange the state of aTransportUnit.voidTrigger a synchronization of TransportUnits.@NotNull TransportUnitupdate(@NotNull Barcode barcode, @Valid @NotNull TransportUnit tu) Take the TransportUnittuand try to update it as-is in the persistent storage.
-
Method Details
-
create
@NotNull @NotNull TransportUnit create(@NotBlank @NotBlank String transportUnitBK, @NotNull @NotNull TransportUnitType transportUnitType, @NotNull @NotNull LocationPK actualLocation, Boolean strict) Create a newTransportUnitwith the typeTransportUnitTypeplaced on an initialLocation. The newTransportUnithas the givenBarcodeas identifier.- Parameters:
transportUnitBK- The business identifier of the TransportUnittransportUnitType- The type of the TransportUnitactualLocation- The Location where the TransportUnit is placed onstrict- Whether the implementation shall throw an exception when a TransportUnit already exists (true) or not (false- Returns:
- The newly created instance
-
create
@NotNull @NotNull TransportUnit create(@NotBlank @NotBlank String transportUnitBK, @NotBlank @NotBlank String transportUnitType, @NotBlank @NotBlank String actualLocation, Boolean strict) Create a newTransportUnitwith theTransportUnitTypeplaced on the givenactualLocation. The newTransportUnithas the givenBarcodeas identifier.- Parameters:
transportUnitBK- The business identifier of the TransportUnit, must not be nulltransportUnitType- The type of the TransportUnit, must not be nullactualLocation- The Location where the TransportUnit is placed on, must not be nullstrict- Whether the implementation shall throw an exception when a TransportUnit already exists (true) or not (false- Returns:
- The newly created instance
- Throws:
org.ameba.exception.ServiceLayerException- when invalid parameters
-
createNew
@NotNull @NotNull TransportUnit createNew(@NotBlank @NotBlank String transportUnitType, @NotBlank @NotBlank String actualLocation) Create a newTransportUnitwith theTransportUnitTypeplaced on the givenactualLocation. The newTransportUnithas aBarcodegenerated by the system.- Parameters:
transportUnitType- The type of the TransportUnit, must not be nullactualLocation- The Location where the TransportUnit is placed on, must not be null- Returns:
- The newly created instance
- Throws:
org.ameba.exception.ServiceLayerException- when invalid parameters
-
update
@NotNull @NotNull TransportUnit update(@NotNull @NotNull Barcode barcode, @Valid @NotNull @Valid @NotNull TransportUnit tu) Take the TransportUnittuand try to update it as-is in the persistent storage.The implementation does not require any further checks. Assume that it tries to detach the entity class with the persistence context and save the given state.
- Parameters:
barcode- The business identifier of the TransportUnittu- The TransportUnit instance to save- Returns:
- The updated instance
-
moveTransportUnit
@NotNull @NotNull TransportUnit moveTransportUnit(@NotNull @NotNull Barcode barcode, @NotBlank @NotBlank String targetLocation) Move aTransportUnitidentified by itsBarcodeto theLocationidentified by the giventargetLocationPK.- Parameters:
barcode- The business identifier of the TransportUnittargetLocation- Unique identifier of the target Location, either the LocationID, ERPCode or PLCCode- Returns:
- The moved instance
-
changeTarget
@NotNull @NotNull TransportUnit changeTarget(@NotNull @NotNull Barcode barcode, @NotBlank @NotBlank String targetLocationId) Change the target of theTransportUnitidentified with itsbarcodeto the Location identified by thetargetLocationId.- Parameters:
barcode- The business identifier of the TransportUnittargetLocationId- The LocationPK or null to reset the current target
-
deleteTransportUnits
Delete already persistedTransportUnits from the persistent storage. It is not allowed in every case to delete aTransportUnit, potentially an activeTransportOrdercould exist or Inventory is still linked with one of thetransportUnits.- Parameters:
transportUnits- A collection ofTransportUnits to delete
-
delete
Delete aTransportUnitafter requesting all parties for removal.- Parameters:
pKey- The persistent key
-
findByBarcode
Find and return aTransportUnitby it'stransportUnitBK.- Parameters:
transportUnitBK- The business identifier of the TransportUnit- Returns:
- The TransportUnit
- Throws:
org.ameba.exception.NotFoundException- may throw if not found
-
findByBarcodes
Find and return allTransportUnits identified by their particularBarcode.- Parameters:
barcodes- A list of business identifiers of the TransportUnits- Returns:
- A List of TransportUnits or an empty List, never null
-
findOnLocation
Find and return allTransportUnits that are located on theLocationidentified by the givenactualLocation.- Parameters:
actualLocation- The Location where the TransportUnits are placed on- Returns:
- All TransportUnits or an empty List, never null
-
findByPKey
Find and return aTransportUnitidentified by the givenpKey.- Parameters:
pKey- The persistent key- Returns:
- The instance, never null
- Throws:
org.ameba.exception.NotFoundException- may throw if not found
-
addError
Add an error to aTransportUnit.- Parameters:
transportUnitBK- The business identifier of the TransportUniterrorCode- The errorCode bitmap
-
findAll
Find and return all existingTransportUnits.- Returns:
- a List of all existing or an empty List but never null
-
setState
Change the state of aTransportUnit.- Parameters:
transportUnitBK- The business identifier of the TransportUnitstate- The desired state- Throws:
StateChangeException- if change is not allowed
-
synchronizeTransportUnits
void synchronizeTransportUnits()Trigger a synchronization of TransportUnits.
-