Package org.openwms.common.location
Class TargetController
java.lang.Object
org.openwms.core.http.AbstractWebController
org.openwms.common.location.TargetController
@Profile("!INMEM")
@Validated
@MeasuredRestController
class TargetController
extends org.openwms.core.http.AbstractWebController
A TargetController represents the REST API to handle the state and availability of
Target
s.- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationContext
private final LocationGroupService
private final LocationService
private final org.ameba.i18n.Translator
-
Constructor Summary
ConstructorsConstructorDescriptionTargetController
(org.ameba.i18n.Translator translator, LocationService locationService, LocationGroupService locationGroupService, org.springframework.context.ApplicationContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
changeLocation
(LockMode mode, Target target, BiConsumer<Target, ErrorCodeVO> fnc) private void
changeLocationGroupMode
(LockMode mode, LocationGroup target, BiConsumer<LocationGroup, String> fnc) private void
changeLocationGroupState
(LockMode mode, Target target, BiConsumer<Target, LocationGroupState[]> fnc) void
changeState
(String targetBK, LockType type, LockMode mode) Change the currentmode
aTarget
, identified bytargetBK
operates in.void
Lock theTarget
identified bytargetBK
.private void
raiseEvent
(String targetBK, Boolean reAllocation, LockMode mode) void
Unlock or release theTarget
identified bytargetBK
.private void
unsupportedOperation
(LockMode mode) private void
unsupportedOperation
(LockType type) Methods inherited from class org.openwms.core.http.AbstractWebController
buildNOKResponse, buildNOKResponseWithKey, buildOKResponse, buildResponse, buildResponse, getLocationForCreatedResource, getLocationURIForCreatedResource, handleBehaviorAwareException, handleBusinessRuntimeException, handleConstraintViolationException, handleException, handleHttpBusinessException, handleRemovalNotAllowedException, handleTechnicalRuntimeException, handleValidationException, illegalArgumentException, translate
-
Field Details
-
translator
private final org.ameba.i18n.Translator translator -
locationService
-
locationGroupService
-
ctx
private final org.springframework.context.ApplicationContext ctx
-
-
Constructor Details
-
TargetController
TargetController(org.ameba.i18n.Translator translator, LocationService locationService, LocationGroupService locationGroupService, org.springframework.context.ApplicationContext ctx)
-
-
Method Details
-
changeState
@PostMapping(path="/v1/targets/{targetBK}", params={"type!=PERMANENT_LOCK","mode"}) public void changeState(@PathVariable("targetBK") String targetBK, @RequestParam("type") LockType type, @RequestParam("mode") LockMode mode) Change the currentmode
aTarget
, identified bytargetBK
operates in.- Parameters:
targetBK
- The business key of the Target, can be aLocationPK
in String format or a LocationGroup nametype
- The type of lock to apply to the Targetmode
- The mode to apply to the Targets lock
-
changeLocation
-
changeLocationGroupState
private void changeLocationGroupState(LockMode mode, Target target, BiConsumer<Target, LocationGroupState[]> fnc) -
changeLocationGroupMode
private void changeLocationGroupMode(LockMode mode, LocationGroup target, BiConsumer<LocationGroup, String> fnc) -
unsupportedOperation
-
unsupportedOperation
-
lock
@PostMapping(path="/v1/targets/{targetBK}", params={"type=PERMANENT_LOCK","mode=lock"}) public void lock(@PathVariable("targetBK") String targetBK, @RequestParam(value="reallocation",required=false) Boolean reAllocation) Lock theTarget
identified bytargetBK
.- Parameters:
targetBK
- The business key of the Target, can be aLocationPK
in String format or a LocationGroup namereAllocation
- If true open outfeed orders will be re-allocated
-
release
@ResponseStatus(OK) @PostMapping(value="/v1/targets/{targetBK}", params={"type=PERMANENT_LOCK","mode=unlock"}) public void release(@PathVariable("targetBK") String targetBK) Unlock or release theTarget
identified bytargetBK
.- Parameters:
targetBK
- The business key of the Target, can be aLocationPK
in String format or a LocationGroup name
-
raiseEvent
-