Interface LocationApi


@FeignClient(name="common-service", dismiss404=true, qualifiers="locationApi") public interface LocationApi
A LocationApi defines the public REST API to manage Locations. It is a Feign remote stub that can be used by client application.
Author:
Heiko Scherrer
  • Method Details

    • createLocation

      @PostMapping(value="/v1/locations", produces="application/vnd.openwms.common.location-v1+json") @CacheEvict(cacheNames="locations", allEntries=true) LocationVO createLocation(@RequestBody LocationVO location)
      Create a new Location.
      Parameters:
      location - The representation of the Location to create
      Returns:
      The created instance
    • updateLocation

      @PutMapping(value="/v1/locations", produces="application/vnd.openwms.common.location-v1+json") @CacheEvict(cacheNames="locations", allEntries=true) LocationVO updateLocation(@RequestBody LocationVO location)
      Save a modified Location.
      Parameters:
      location - The representation of the modified Location to save
      Returns:
      The updated and saved instance
    • findByPKey

      @GetMapping(value="/v1/locations/{pKey}", produces="application/vnd.openwms.common.location-opt-v1+json") @Cacheable("locations") Optional<LocationVO> findByPKey(@PathVariable("pKey") String pKey)
      Find and return a Location.
      Parameters:
      pKey - The persistent key
      Returns:
      The instance
    • findAll

      @GetMapping(value="/v1/location-types", produces="application/vnd.openwms.common.location-v1+json") @Cacheable("locations") List<LocationTypeVO> findAll()
      Find and return all LocationTypes.
      Returns:
      Never null
    • findById

      @GetMapping(value="/v1/locations", params="locationId", produces="application/vnd.openwms.common.location-opt-v1+json") @Cacheable("locations") Optional<LocationVO> findById(@RequestParam("locationId") String locationId)
      Find and return a Location.
      Parameters:
      locationId - The business key of the Location
      Returns:
      Never null
      Throws:
      IllegalArgumentException - in case the given locationPK is invalid
    • findByPlcCode

      @GetMapping(value="/v1/locations", params="plcCode", produces="application/vnd.openwms.common.location-opt-v1+json") @Cacheable("locations") Optional<LocationVO> findByPlcCode(@RequestParam("plcCode") String plcCode)
      Find and return a Location representation by the given plcCode.
      Parameters:
      plcCode - The PLC code
      Returns:
      Never null
    • findByErpCode

      @GetMapping(value="/v1/locations", params="erpCode", produces="application/vnd.openwms.common.location-opt-v1+json") @Cacheable("locations") Optional<LocationVO> findByErpCode(@RequestParam("erpCode") String erpCode)
      Find and return a Location representation by the given erpCode.
      Parameters:
      erpCode - The ERP code
      Returns:
      Never null
    • findForLocationGroups

      @GetMapping(value="/v1/locations", params="locationGroupNames", produces="application/vnd.openwms.common.location-v1+json") @Cacheable("locations") List<LocationVO> findForLocationGroups(@RequestParam("locationGroupNames") List<String> locationGroupNames)
      Find and return all Locations that belong to one or more LocationGroups identified by their locationGroupNames.
      Parameters:
      locationGroupNames - A list of LocationGroup names
      Returns:
      All Location instances or an empty list
    • changeState

      @PatchMapping(value="/v1/location/{pKey}", params="op=change-state") @CacheEvict(cacheNames="locations", allEntries=true) void changeState(@PathVariable(name="pKey") String pKey, @RequestParam(name="op") String op, @RequestBody ErrorCodeVO errorCode)
      Change the state of a Location.
      Parameters:
      pKey - The persistent key of the Location
      errorCode - The decoded state
    • changeState

      @PatchMapping(value="/v1/location", params={"locationId","op=change-state"}) @CacheEvict(cacheNames="locations", allEntries=true) void changeState(@RequestParam(name="locationId") String locationId, @RequestBody ErrorCodeVO errorCode)
      Change the state of a Location.
      Parameters:
      locationId - The business key of the Location
      errorCode - The decoded state
    • changeState

      @PostMapping(path="/v1/locations", params={"erpCode","type!=PERMANENT_LOCK","mode"}) @CacheEvict(cacheNames="locations", allEntries=true) void changeState(@RequestParam("erpCode") String erpCode, @RequestParam("type") LockType type, @RequestParam("mode") LockMode mode, @RequestParam(value="plcState",required=false) Integer plcState)
      Change the current mode a Location, identified by erpCode.
      Parameters:
      erpCode - The ERP code of the Location
      type - The type of lock to apply to the Location
      mode - The mode to apply to the Locations lock
    • findByCoordinate

      @GetMapping(value="/v1/locations", params={"area","aisle","x","y","z"}, produces="application/vnd.openwms.common.location-v1+json") @Cacheable("locations") List<LocationVO> findByCoordinate(@RequestParam(value="area",required=false) String area, @RequestParam(value="aisle",required=false) String aisle, @RequestParam(value="x",required=false) String x, @RequestParam(value="y",required=false) String y, @RequestParam(value="z",required=false) String z)
      Find and return all Locations that match the given criteria expressed by area/aisle/x/y/z. Supported wildcards in coordinates: %,_.
      Parameters:
      area - The Area to search for
      aisle - The Aisle to search for
      x - The X to search for or
      y - The Y to search for or
      z - The Z to search for or
      Returns:
      All Location instances or an empty list