Package org.openwms.common.location.impl
Class LocationGroupServiceImpl
java.lang.Object
org.openwms.common.location.impl.LocationGroupServiceImpl
- All Implemented Interfaces:
LocationGroupService
A LocationGroupServiceImpl is a Spring managed transactional Service that operates on
LocationGroup
entities and spans the
tx boundary.- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final AccountService
private final org.springframework.context.ApplicationContext
private final LocationRemovalManager
private static final org.slf4j.Logger
private final LocationGroupRepository
private final org.ameba.i18n.Translator
-
Constructor Summary
ConstructorDescriptionLocationGroupServiceImpl
(org.springframework.context.ApplicationContext ctx, org.ameba.i18n.Translator translator, LocationGroupRepository repository, AccountService accountService, LocationRemovalManager locationRemovalManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeGroupState
(@NotBlank String pKey, @NotNull LocationGroupState stateIn, @NotNull LocationGroupState stateOut) Change the infeed and outfeed state of aLocationGroup
.void
changeGroupStates
(@NotBlank String name, Optional<LocationGroupState> stateIn, Optional<LocationGroupState> stateOut) Change the infeed and outfeed state of aLocationGroup
.void
changeOperationMode
(@NotBlank String name, @NotBlank String mode) Change the operation mode of aLocationGroup
.@NotNull LocationGroup
create
(@NotNull @Valid LocationGroupVO vo) Creates a newLocationGroup
based on the providedLocationGroupVO
representation.private LocationGroup
void
Delete aLocationGroup
with all attached sub-groups andLocation
s.private void
delete
(LocationGroup locationGroup) private void
deleteOnlyGroups
(LocationGroup locationGroup) @NotNull List
<LocationGroup> findAll()
Find and return allLocationGroup
s.findByName
(@NotBlank String name) Find and return aLocationGroup
identified by its uniquename
.@NotNull LocationGroup
findByNameOrThrow
(@NotBlank String name) Find and return aLocationGroup
identified by its uniquename
.private LocationGroup
@NotNull List
<LocationGroup> findByNames
(@NotEmpty List<String> locationGroupNames) Find and return allLocationGroup
s with the givenlocationGroupNames
.private LocationGroup
findInternalByPKey
(String pKey) getLocationKeys
(LocationGroup locationGroup) @NotNull LocationGroup
update
(@NotBlank String pKey, @NotNull LocationGroupVO locationGroupVO) Updates a LocationGroup based on the provided persisted key andLocationGroupVO
representation.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ctx
private final org.springframework.context.ApplicationContext ctx -
translator
private final org.ameba.i18n.Translator translator -
repository
-
accountService
-
locationRemovalManager
-
-
Constructor Details
-
LocationGroupServiceImpl
LocationGroupServiceImpl(org.springframework.context.ApplicationContext ctx, org.ameba.i18n.Translator translator, LocationGroupRepository repository, AccountService accountService, LocationRemovalManager locationRemovalManager)
-
-
Method Details
-
create
@Measured @NotNull public @NotNull LocationGroup create(@NotNull @Validated(Create.class) @Valid @NotNull @Valid LocationGroupVO vo) Creates a newLocationGroup
based on the providedLocationGroupVO
representation.- Specified by:
create
in interfaceLocationGroupService
- Parameters:
vo
- TheLocationGroupVO
containing the information for the new LocationGroup- Returns:
- The created LocationGroup
-
createLocationGroup
-
changeGroupState
@Measured public void changeGroupState(@NotBlank @NotBlank String pKey, @NotNull @NotNull LocationGroupState stateIn, @NotNull @NotNull LocationGroupState stateOut) Change the infeed and outfeed state of aLocationGroup
.- Specified by:
changeGroupState
in interfaceLocationGroupService
- Parameters:
pKey
- The persisted key of the LocationGroup to changestateIn
- The new infeed statestateOut
- The new outfeed state
-
changeGroupStates
@Measured public void changeGroupStates(@NotBlank @NotBlank String name, Optional<LocationGroupState> stateIn, Optional<LocationGroupState> stateOut) Change the infeed and outfeed state of aLocationGroup
.- Specified by:
changeGroupStates
in interfaceLocationGroupService
- Parameters:
name
- The name of the LocationGroup to changestateIn
- The new infeed statestateOut
- The new outfeed state
-
changeOperationMode
@Measured public void changeOperationMode(@NotBlank @NotBlank String name, @NotBlank @NotBlank String mode) Change the operation mode of aLocationGroup
.- Specified by:
changeOperationMode
in interfaceLocationGroupService
- Parameters:
name
- The name of the LocationGroup to changemode
- The new operation mode to set- See Also:
-
findByName
Find and return aLocationGroup
identified by its uniquename
.- Specified by:
findByName
in interfaceLocationGroupService
- Parameters:
name
- The name to search for- Returns:
- The optional LocationGroup instance
-
findByNameOrThrow
Find and return aLocationGroup
identified by its uniquename
.- Specified by:
findByNameOrThrow
in interfaceLocationGroupService
- Parameters:
name
- The name to search for- Returns:
- The LocationGroup, never null
-
findByNameOrThrowInternal
-
findAll
Find and return allLocationGroup
s.- Specified by:
findAll
in interfaceLocationGroupService
- Returns:
- All existing instances or an empty List, never null
-
findByNames
@Measured @NotNull public @NotNull List<LocationGroup> findByNames(@NotEmpty @NotEmpty List<String> locationGroupNames) Find and return allLocationGroup
s with the givenlocationGroupNames
.- Specified by:
findByNames
in interfaceLocationGroupService
- Parameters:
locationGroupNames
- The names of the LocationGroups to search for- Returns:
- Always a list instance, never null
-
delete
Delete aLocationGroup
with all attached sub-groups andLocation
s.- Specified by:
delete
in interfaceLocationGroupService
- Parameters:
pKey
- The persisted key of the LocationGroup to change
-
getLocationKeys
-
delete
-
deleteOnlyGroups
-
update
@Measured @NotNull public @NotNull LocationGroup update(@NotBlank @NotBlank String pKey, @NotNull @NotNull LocationGroupVO locationGroupVO) Updates a LocationGroup based on the provided persisted key andLocationGroupVO
representation.- Specified by:
update
in interfaceLocationGroupService
- Parameters:
pKey
- The persisted key of the LocationGroup to update (must not be blank)locationGroupVO
- The updated information for the LocationGroup (must not be null)- Returns:
- The updated LocationGroup
-
findInternalByPKey
-