Package org.openwms.common.location.impl
Class LocationRemovalManagerImpl
java.lang.Object
org.openwms.common.location.impl.LocationRemovalManagerImpl
- All Implemented Interfaces:
LocationRemovalManager
A LocationRemovalManagerImpl.
- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.springframework.web.client.RestTemplate
private final org.springframework.context.ApplicationEventPublisher
private static final org.slf4j.Logger
private final RegistrationService
private final LocationRepository
private final org.ameba.i18n.Translator
-
Constructor Summary
ConstructorDescriptionLocationRemovalManagerImpl
(org.springframework.context.ApplicationEventPublisher eventPublisher, org.ameba.i18n.Translator translator, org.springframework.web.client.RestTemplate aLoadBalanced, LocationRepository repository, RegistrationService registrationService) -
Method Summary
Modifier and TypeMethodDescriptionboolean
allowedToDelete
(@NotNull Collection<String> pKeys) Checks if theLocation
s with the givenpKey
s are allowed to be deleted.private void
askForRemoval
(ReplicaRegistry srv, Collection<String> pKeys) void
deleteAll
(@NotNull Collection<Location> locations) DeleteLocation
s.private void
deleteInternal
(Location location) private void
deleteLocation
(Location location) void
markForDeletion
(@NotNull Collection<String> pKeys) MarkLocation
s for upcoming deletion.private void
removeLocation
(ReplicaRegistry srv, Collection<String> pKeys) void
Try to delete aLocation
.private void
verifyNoTransportUnitsOn
(Collection<String> pKeys) private void
verifyNoTransportUnitsOn
(Location location)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
eventPublisher
private final org.springframework.context.ApplicationEventPublisher eventPublisher -
translator
private final org.ameba.i18n.Translator translator -
aLoadBalanced
private final org.springframework.web.client.RestTemplate aLoadBalanced -
repository
-
registrationService
-
-
Constructor Details
-
LocationRemovalManagerImpl
LocationRemovalManagerImpl(org.springframework.context.ApplicationEventPublisher eventPublisher, org.ameba.i18n.Translator translator, org.springframework.web.client.RestTemplate aLoadBalanced, LocationRepository repository, RegistrationService registrationService)
-
-
Method Details
-
tryDelete
Try to delete aLocation
.- Specified by:
tryDelete
in interfaceLocationRemovalManager
- Parameters:
pKey
- The persistent key of the Location to be deleted.
-
deleteAll
DeleteLocation
s.- Specified by:
deleteAll
in interfaceLocationRemovalManager
- Parameters:
locations
- The Locations to be deleted.
-
deleteInternal
-
verifyNoTransportUnitsOn
-
verifyNoTransportUnitsOn
-
deleteLocation
-
allowedToDelete
Checks if theLocation
s with the givenpKey
s are allowed to be deleted. At first the implementation checks if anyTransportUnit
is booked onto one of theLocation
s and as second all parties of interest are asked if deletion in the current moment is okay for them, too.- Specified by:
allowedToDelete
in interfaceLocationRemovalManager
- Parameters:
pKeys
- The persistent keys of the Locations to be checked.- Returns:
- true if the Locations are allowed to be deleted, otherwise false.
-
markForDeletion
- Specified by:
markForDeletion
in interfaceLocationRemovalManager
- Parameters:
pKeys
- The persistent keys of the Locations to be marked for deletion.
-
askForRemoval
-
removeLocation
-