Package org.openwms.common.location.impl
Class LocationServiceImpl
java.lang.Object
org.openwms.common.location.impl.LocationServiceImpl
- All Implemented Interfaces:
LocationService
A LocationServiceImpl is a Spring managed transactional Service that operates on
Location entities and spans the tx boundary.- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationContextprivate final LocationMapperprivate static final org.slf4j.Loggerprivate final LocationRepositoryprivate final ErrorCodeTransformers.LocationStateInprivate final ErrorCodeTransformers.LocationStateOutprivate final org.ameba.i18n.Translator -
Constructor Summary
ConstructorsConstructorDescriptionLocationServiceImpl(org.ameba.i18n.Translator translator, LocationMapper locationMapper, LocationRepository repository, ErrorCodeTransformers.LocationStateIn stateInTransformer, ErrorCodeTransformers.LocationStateOut stateOutTransformer, org.springframework.context.ApplicationContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeState(@NotBlank String pKey, @NotNull ErrorCodeVO errorCode) Change the infeed and outfeed state of aLocationin respect of the accordingLocationGroup.voidchangeState(@NotNull LocationPK locationId, @NotNull ErrorCodeVO errorCode) Change the infeed and outfeed state of aLocationin respect of the accordingLocationGroup.private voidchangeStateInternal(Location location, ErrorCodeVO errorCode) @NotNull LocationCreate a new non-existingLocation.Find and return all Locations that belong to aLocationGroup.findByErpCode(@NotBlank String erpCode) Find and return aLocation.findByLocationId(@NotBlank String locationId) Find and return aLocation.findByLocationIdInternal(String locationId) @NotNull LocationfindByLocationIdOrThrow(@NotBlank String locationId) Find and return aLocation.findByLocationPk(@NotNull LocationPK locationId) Find and return aLocation.private LocationfindByLocationPkOrThrow(LocationPK locationId) @NotNull LocationfindByPKey(@NotBlank String pKey) Find and return aLocation.findByPlcCode(@NotBlank String plcCode) Find and return aLocation.private LocationfindInternal(String pKey) findLocations(@NotNull LocationPK locationPK) Find and return allLocations that match thelocationIdswhereas the attributes of theLocationPKmay include SQL wildcard operators, like '%', '_'.@NotNull LocationModify and update an existingLocation.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
translator
private final org.ameba.i18n.Translator translator -
locationMapper
-
repository
-
stateInTransformer
-
stateOutTransformer
-
ctx
private final org.springframework.context.ApplicationContext ctx
-
-
Constructor Details
-
LocationServiceImpl
LocationServiceImpl(org.ameba.i18n.Translator translator, LocationMapper locationMapper, LocationRepository repository, ErrorCodeTransformers.LocationStateIn stateInTransformer, ErrorCodeTransformers.LocationStateOut stateOutTransformer, org.springframework.context.ApplicationContext ctx)
-
-
Method Details
-
create
@Measured @NotNull public @NotNull Location create(@NotNull @Valid @NotNull @Valid Location location) Create a new non-existingLocation.- Specified by:
createin interfaceLocationService- Parameters:
location- The representation with the mandatory data to create the Location- Returns:
- The created instance
-
findByPKey
Find and return aLocation.- Specified by:
findByPKeyin interfaceLocationService- Parameters:
pKey- The persistent key- Returns:
- The instance
-
findInternal
-
findByLocationPk
@Measured @Transactional(readOnly=true) public Optional<Location> findByLocationPk(@NotNull @NotNull LocationPK locationId) Find and return aLocation.- Specified by:
findByLocationPkin interfaceLocationService- Parameters:
locationId- The business key of the Location to search for as String- Returns:
- The Location instance
-
findByLocationPkOrThrow
-
findByPlcCode
@Measured @Transactional(readOnly=true) public Optional<Location> findByPlcCode(@NotBlank @NotBlank String plcCode) Find and return aLocation.- Specified by:
findByPlcCodein interfaceLocationService- Parameters:
plcCode- The PLC Code of the Location to search for- Returns:
- The Location instance
-
findByLocationId
Find and return aLocation.- Specified by:
findByLocationIdin interfaceLocationService- Parameters:
locationId- The business key of the Location to search for as String- Returns:
- The Location instance
-
findByLocationIdInternal
-
findByLocationIdOrThrow
@Measured @NotNull public @NotNull Location findByLocationIdOrThrow(@NotBlank @NotBlank String locationId) Find and return aLocation.- Specified by:
findByLocationIdOrThrowin interfaceLocationService- 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 aLocationGroup.- Specified by:
findAllOfin interfaceLocationService- 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 aLocationin respect of the accordingLocationGroup.- Specified by:
changeStatein interfaceLocationService- Parameters:
pKey- The persistent key identifier of the Location to changeerrorCode- Contains the error bitmap to encode the state
-
changeStateInternal
-
changeState
@Measured public void changeState(@NotNull @NotNull LocationPK locationId, @NotNull @NotNull ErrorCodeVO errorCode) Change the infeed and outfeed state of aLocationin respect of the accordingLocationGroup.- Specified by:
changeStatein interfaceLocationService- Parameters:
locationId- The business key identifier of the Location to changeerrorCode- Contains the error bitmap to encode the state
-
findLocations
@Measured @NotNull public @NotNull List<Location> findLocations(@NotNull @NotNull LocationPK locationPK) Find and return allLocations that match thelocationIdswhereas the attributes of theLocationPKmay include SQL wildcard operators, like '%', '_'.- Specified by:
findLocationsin interfaceLocationService- Parameters:
locationPK- The business keys of the Locations to search for as Strings- Returns:
- The Location instances or an empty list, never null
-
findByErpCode
Find and return aLocation.- Specified by:
findByErpCodein interfaceLocationService- Parameters:
erpCode- The ERP Code of the Location to search for- Returns:
- The Location instance
-
save
Modify and update an existingLocation.- Specified by:
savein interfaceLocationService- Parameters:
location- Modified instance- Returns:
- Saved instance
-