Search in sources :

Example 1 with DestinationsRemovedFromAllServices

use of cz.metacentrum.perun.audit.events.ServicesManagerEvents.DestinationsRemovedFromAllServices in project perun by CESNET.

the class ServicesManagerBlImpl method removeAllDestinations.

@Override
public void removeAllDestinations(PerunSession perunSession, Facility facility) {
    List<Destination> destinations = getDestinations(perunSession, facility);
    getServicesManagerImpl().removeAllDestinations(perunSession, facility);
    // remove destinations from destination table if they are not used anymore
    for (Destination destination : destinations) {
        try {
            this.deleteDestination(perunSession, destination);
        } catch (RelationExistsException | DestinationAlreadyRemovedException ex) {
        // destination is used by some services and facilities or it is already removed, skip the destination
        }
    }
    getPerunBl().getAuditer().log(perunSession, new DestinationsRemovedFromAllServices(facility));
}
Also used : FreeDenialServiceOnDestination(cz.metacentrum.perun.audit.events.GeneralServiceManagerEvents.FreeDenialServiceOnDestination) BanServiceOnDestination(cz.metacentrum.perun.audit.events.GeneralServiceManagerEvents.BanServiceOnDestination) RichDestination(cz.metacentrum.perun.core.api.RichDestination) Destination(cz.metacentrum.perun.core.api.Destination) FreeAllDenialsOnDestination(cz.metacentrum.perun.audit.events.GeneralServiceManagerEvents.FreeAllDenialsOnDestination) DestinationsRemovedFromAllServices(cz.metacentrum.perun.audit.events.ServicesManagerEvents.DestinationsRemovedFromAllServices) RelationExistsException(cz.metacentrum.perun.core.api.exceptions.RelationExistsException) DestinationAlreadyRemovedException(cz.metacentrum.perun.core.api.exceptions.DestinationAlreadyRemovedException)

Aggregations

BanServiceOnDestination (cz.metacentrum.perun.audit.events.GeneralServiceManagerEvents.BanServiceOnDestination)1 FreeAllDenialsOnDestination (cz.metacentrum.perun.audit.events.GeneralServiceManagerEvents.FreeAllDenialsOnDestination)1 FreeDenialServiceOnDestination (cz.metacentrum.perun.audit.events.GeneralServiceManagerEvents.FreeDenialServiceOnDestination)1 DestinationsRemovedFromAllServices (cz.metacentrum.perun.audit.events.ServicesManagerEvents.DestinationsRemovedFromAllServices)1 Destination (cz.metacentrum.perun.core.api.Destination)1 RichDestination (cz.metacentrum.perun.core.api.RichDestination)1 DestinationAlreadyRemovedException (cz.metacentrum.perun.core.api.exceptions.DestinationAlreadyRemovedException)1 RelationExistsException (cz.metacentrum.perun.core.api.exceptions.RelationExistsException)1