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
FieldsModifier and TypeFieldDescriptionprivate final AccountServiceprivate final org.springframework.context.ApplicationContextprivate final LocationRemovalManagerprivate static final org.slf4j.Loggerprivate final LocationGroupRepositoryprivate final org.ameba.i18n.Translator -
Constructor Summary
ConstructorsConstructorDescriptionLocationGroupServiceImpl(org.springframework.context.ApplicationContext ctx, org.ameba.i18n.Translator translator, LocationGroupRepository repository, AccountService accountService, LocationRemovalManager locationRemovalManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeGroupState(@NotBlank String pKey, @NotNull LocationGroupState stateIn, @NotNull LocationGroupState stateOut) Change the infeed and outfeed state of aLocationGroup.voidchangeGroupStates(@NotBlank String name, Optional<LocationGroupState> stateIn, Optional<LocationGroupState> stateOut) Change the infeed and outfeed state of aLocationGroup.voidchangeOperationMode(@NotBlank String name, @NotBlank String mode) Change the operation mode of aLocationGroup.@NotNull LocationGroupcreate(@NotNull @Valid LocationGroupVO vo) Creates a newLocationGroupbased on the providedLocationGroupVOrepresentation.private LocationGroupvoidDelete aLocationGroupwith all attached sub-groups andLocations.private voiddelete(LocationGroup locationGroup) private voiddeleteOnlyGroups(LocationGroup locationGroup) @NotNull List<LocationGroup> findAll()Find and return allLocationGroups.findByName(@NotBlank String name) Find and return aLocationGroupidentified by its uniquename.@NotNull LocationGroupfindByNameOrThrow(@NotBlank String name) Find and return aLocationGroupidentified by its uniquename.private LocationGroup@NotNull List<LocationGroup> findByNames(@NotEmpty List<String> locationGroupNames) Find and return allLocationGroups with the givenlocationGroupNames.private LocationGroupfindInternalByPKey(String pKey) getLocationKeys(LocationGroup locationGroup) @NotNull LocationGroupupdate(@NotBlank String pKey, @NotNull LocationGroupVO locationGroupVO) Updates a LocationGroup based on the provided persisted key andLocationGroupVOrepresentation.
-
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 newLocationGroupbased on the providedLocationGroupVOrepresentation.- Specified by:
createin interfaceLocationGroupService- Parameters:
vo- TheLocationGroupVOcontaining 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:
changeGroupStatein 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:
changeGroupStatesin 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:
changeOperationModein interfaceLocationGroupService- Parameters:
name- The name of the LocationGroup to changemode- The new operation mode to set- See Also:
-
findByName
Find and return aLocationGroupidentified by its uniquename.- Specified by:
findByNamein interfaceLocationGroupService- Parameters:
name- The name to search for- Returns:
- The optional LocationGroup instance
-
findByNameOrThrow
Find and return aLocationGroupidentified by its uniquename.- Specified by:
findByNameOrThrowin interfaceLocationGroupService- Parameters:
name- The name to search for- Returns:
- The LocationGroup, never null
-
findByNameOrThrowInternal
-
findAll
Find and return allLocationGroups.- Specified by:
findAllin 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 allLocationGroups with the givenlocationGroupNames.- Specified by:
findByNamesin interfaceLocationGroupService- Parameters:
locationGroupNames- The names of the LocationGroups to search for- Returns:
- Always a list instance, never null
-
delete
Delete aLocationGroupwith all attached sub-groups andLocations.- Specified by:
deletein 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 andLocationGroupVOrepresentation.- Specified by:
updatein 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
-