Class LocationServiceImpl

java.lang.Object
org.openwms.common.location.impl.LocationServiceImpl
All Implemented Interfaces:
LocationService

@Validated @TxService class LocationServiceImpl extends Object implements LocationService
A LocationServiceImpl is a Spring managed transactional Service that operates on Location entities and spans the tx boundary.
Author:
Heiko Scherrer
  • Field Details

  • Constructor Details

  • Method Details

    • create

      @Measured @NotNull public @NotNull Location create(@NotNull @Valid @NotNull @Valid Location location)
      Create a new non-existing Location.
      Specified by:
      create in interface LocationService
      Parameters:
      location - The representation with the mandatory data to create the Location
      Returns:
      The created instance
    • findByPKey

      @Measured @NotNull public @NotNull Location findByPKey(@NotBlank @NotBlank String pKey)
      Find and return a Location.
      Specified by:
      findByPKey in interface LocationService
      Parameters:
      pKey - The persistent key
      Returns:
      The instance
    • findInternal

      private Location findInternal(String pKey)
    • findByLocationPk

      @Measured @Transactional(readOnly=true) public Optional<Location> findByLocationPk(@NotNull @NotNull LocationPK locationId)
      Find and return a Location.
      Specified by:
      findByLocationPk in interface LocationService
      Parameters:
      locationId - The business key of the Location to search for as String
      Returns:
      The Location instance
    • findByLocationPkOrThrow

      private Location findByLocationPkOrThrow(LocationPK locationId)
    • findByPlcCode

      @Measured @Transactional(readOnly=true) public Optional<Location> findByPlcCode(@NotBlank @NotBlank String plcCode)
      Find and return a Location.
      Specified by:
      findByPlcCode in interface LocationService
      Parameters:
      plcCode - The PLC Code of the Location to search for
      Returns:
      The Location instance
    • findByLocationId

      @Measured public Optional<Location> findByLocationId(@NotBlank @NotBlank String locationId)
      Find and return a Location.
      Specified by:
      findByLocationId in interface LocationService
      Parameters:
      locationId - The business key of the Location to search for as String
      Returns:
      The Location instance
    • findByLocationIdInternal

      private Optional<Location> findByLocationIdInternal(String locationId)
    • findByLocationIdOrThrow

      @Measured @NotNull public @NotNull Location findByLocationIdOrThrow(@NotBlank @NotBlank String locationId)
      Find and return a Location.
      Specified by:
      findByLocationIdOrThrow in interface LocationService
      Parameters:
      locationId - The business key of the Location to search for as String
      Returns:
      The Location instance
    • findAllOf

      @Measured @NotNull public @NotNull List<Location> findAllOf(@NotEmpty @NotEmpty List<String> locationGroupNames)
      Find and return all Locations that belong to a LocationGroup.
      Specified by:
      findAllOf in interface LocationService
      Parameters:
      locationGroupNames - The identifying names of the LocationGroups to search Locations for
      Returns:
      The LocationGroup instances or an empty list, never null
    • changeState

      @Measured public void changeState(@NotBlank @NotBlank String pKey, @NotNull @NotNull ErrorCodeVO errorCode)
      Change the infeed and outfeed state of a Location in respect of the according LocationGroup.
      Specified by:
      changeState in interface LocationService
      Parameters:
      pKey - The persistent key identifier of the Location to change
      errorCode - Contains the error bitmap to encode the state
    • changeStateInternal

      private void changeStateInternal(Location location, ErrorCodeVO errorCode)
    • changeState

      @Measured public void changeState(@NotNull @NotNull LocationPK locationId, @NotNull @NotNull ErrorCodeVO errorCode)
      Change the infeed and outfeed state of a Location in respect of the according LocationGroup.
      Specified by:
      changeState in interface LocationService
      Parameters:
      locationId - The business key identifier of the Location to change
      errorCode - Contains the error bitmap to encode the state
    • findLocations

      @Measured @NotNull public @NotNull List<Location> findLocations(@NotNull @NotNull LocationPK locationPK)
      Find and return all Locations that match the locationIds whereas the attributes of the LocationPK may include SQL wildcard operators, like '%', '_'.
      Specified by:
      findLocations in interface LocationService
      Parameters:
      locationPK - The business keys of the Locations to search for as Strings
      Returns:
      The Location instances or an empty list, never null
    • findByErpCode

      @Measured public Optional<Location> findByErpCode(@NotBlank @NotBlank String erpCode)
      Find and return a Location.
      Specified by:
      findByErpCode in interface LocationService
      Parameters:
      erpCode - The ERP Code of the Location to search for
      Returns:
      The Location instance
    • save

      @Measured @NotNull public @NotNull Location save(@NotNull @NotNull Location location)
      Modify and update an existing Location.
      Specified by:
      save in interface LocationService
      Parameters:
      location - Modified instance
      Returns:
      Saved instance