Class LocationRemovalManagerImpl

java.lang.Object
org.openwms.common.location.impl.LocationRemovalManagerImpl
All Implemented Interfaces:
LocationRemovalManager

@TxService class LocationRemovalManagerImpl extends Object implements LocationRemovalManager
A LocationRemovalManagerImpl.
Author:
Heiko Scherrer
  • 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

      private final LocationRepository repository
    • registrationService

      private final RegistrationService 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

      @Measured public void tryDelete(@NotBlank @NotBlank String pKey)
      Try to delete a Location.
      Specified by:
      tryDelete in interface LocationRemovalManager
      Parameters:
      pKey - The persistent key of the Location to be deleted.
    • deleteAll

      @Measured public void deleteAll(@NotNull @NotNull Collection<Location> locations)
      Delete Locations.
      Specified by:
      deleteAll in interface LocationRemovalManager
      Parameters:
      locations - The Locations to be deleted.
    • deleteInternal

      private void deleteInternal(Location location)
    • verifyNoTransportUnitsOn

      private void verifyNoTransportUnitsOn(Location location)
    • verifyNoTransportUnitsOn

      private void verifyNoTransportUnitsOn(Collection<String> pKeys)
    • deleteLocation

      private void deleteLocation(Location location)
    • allowedToDelete

      @Measured public boolean allowedToDelete(@NotNull @NotNull Collection<String> pKeys)
      Checks if the Locations with the given pKeys are allowed to be deleted. At first the implementation checks if any TransportUnit is booked onto one of the Locations and as second all parties of interest are asked if deletion in the current moment is okay for them, too.
      Specified by:
      allowedToDelete in interface LocationRemovalManager
      Parameters:
      pKeys - The persistent keys of the Locations to be checked.
      Returns:
      true if the Locations are allowed to be deleted, otherwise false.
    • markForDeletion

      @Measured public void markForDeletion(@NotNull @NotNull Collection<String> pKeys)
      Mark Locations for upcoming deletion. Call interesing parties to mark the Locations for deletion.
      Specified by:
      markForDeletion in interface LocationRemovalManager
      Parameters:
      pKeys - The persistent keys of the Locations to be marked for deletion.
    • askForRemoval

      private void askForRemoval(ReplicaRegistry srv, Collection<String> pKeys)
    • removeLocation

      private void removeLocation(ReplicaRegistry srv, Collection<String> pKeys)