Search in sources :

Example 1 with DestinationsRemovedFromService

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

the class ServicesManagerBlImpl method removeAllDestinations.

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

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 DestinationsRemovedFromService (cz.metacentrum.perun.audit.events.ServicesManagerEvents.DestinationsRemovedFromService)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