Package org.openwms.wms.location.impl
Class LocationServiceImpl
java.lang.Object
org.openwms.wms.location.impl.LocationServiceImpl
- All Implemented Interfaces:
LocationService
,LocationSynchronizer
@Validated
@TxService
class LocationServiceImpl
extends Object
implements LocationService, LocationSynchronizer
A LocationServiceImpl is a Spring managed transaction service that cares about Location management.
- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationEventPublisher
private static final org.slf4j.Logger
private final LocationMapper
private final LocationRepository
private final org.ameba.i18n.Translator
-
Constructor Summary
ConstructorsConstructorDescriptionLocationServiceImpl
(org.ameba.i18n.Translator translator, LocationMapper mapper, LocationRepository repository, org.springframework.context.ApplicationEventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeState
(@NotBlank String foreignPKey, Boolean incomingActive, Boolean outgoingActive, Integer plcState) Change the state of aLocation
.void
create
(@NotNull org.openwms.common.location.api.messages.LocationMO location) Create a newLocation
on demand.@NotNull Location
findByBK
(@NotNull LocationPK locationId) Find and return the Location identified by the business key.@NotNull Location
findByErpCode
(@NotBlank String erpCode) Find and return the Location identified by the unique erpCode.@NotNull Location
findByForeignPKey
(@NotBlank String foreignPKey) Find and return a Location identified by the persistent key.private Location
findByForeignPKeyInternal
(String foreignPKey) findOptionalByErpCode
(@NotBlank String erpCode) Find and return the Location identified by the unique erpCode.findOptionalByID
(@NotNull LocationPK locationId) Find and return the Location identified by the business key.@NotNull Location
Save aLocation
.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
translator
private final org.ameba.i18n.Translator translator -
mapper
-
repository
-
eventPublisher
private final org.springframework.context.ApplicationEventPublisher eventPublisher
-
-
Constructor Details
-
LocationServiceImpl
LocationServiceImpl(org.ameba.i18n.Translator translator, LocationMapper mapper, LocationRepository repository, org.springframework.context.ApplicationEventPublisher eventPublisher)
-
-
Method Details
-
create
@Measured public void create(@NotNull @NotNull org.openwms.common.location.api.messages.LocationMO location) Create a newLocation
on demand.- Specified by:
create
in interfaceLocationSynchronizer
- Parameters:
location
- The instance to create
-
changeState
@Measured public void changeState(@NotBlank @NotBlank String foreignPKey, Boolean incomingActive, Boolean outgoingActive, Integer plcState) Change the state of aLocation
.- Specified by:
changeState
in interfaceLocationSynchronizer
- Parameters:
foreignPKey
- The foreign persistent key of the Location instanceincomingActive
- The state for incoming or inbound goodsoutgoingActive
- The state for outgoing or outbound goodsplcState
- The PLC state of the Location
-
findByForeignPKey
@Measured @NotNull public @NotNull Location findByForeignPKey(@NotBlank @NotBlank String foreignPKey) Find and return a Location identified by the persistent key.- Specified by:
findByForeignPKey
in interfaceLocationService
- Parameters:
foreignPKey
- The foreign persistent key of the Location instance- Returns:
- The instance
-
findByForeignPKeyInternal
-
findOptionalByID
Find and return the Location identified by the business key.- Specified by:
findOptionalByID
in interfaceLocationService
- Parameters:
locationId
- The coordinate of the Location- Returns:
- The instance
-
findByBK
Find and return the Location identified by the business key.- Specified by:
findByBK
in interfaceLocationService
- Parameters:
locationId
- The coordinate of the Location- Returns:
- The instance
-
findByErpCode
Find and return the Location identified by the unique erpCode.- Specified by:
findByErpCode
in interfaceLocationService
- Parameters:
erpCode
- The unique ERP code- Returns:
- The instance
-
findOptionalByErpCode
Find and return the Location identified by the unique erpCode.- Specified by:
findOptionalByErpCode
in interfaceLocationService
- Parameters:
erpCode
- The unique ERP code- Returns:
- The instance
-
save
Save aLocation
.- Specified by:
save
in interfaceLocationService
- Parameters:
location
- The instance to save- Returns:
- The saved instance
-