use of cz.metacentrum.perun.core.api.exceptions.DestinationAlreadyRemovedException 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));
}
use of cz.metacentrum.perun.core.api.exceptions.DestinationAlreadyRemovedException 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));
}
use of cz.metacentrum.perun.core.api.exceptions.DestinationAlreadyRemovedException in project perun by CESNET.
the class ServicesManagerBlImpl method removeDestination.
@Override
public void removeDestination(PerunSession sess, Service service, Facility facility, Destination destination) throws DestinationAlreadyRemovedException {
if (!getServicesManagerImpl().destinationExists(sess, destination)) {
try {
// Try to get the destination without id
destination = getServicesManagerImpl().getDestination(sess, destination.getDestination(), destination.getType());
} catch (DestinationNotExistsException ex) {
throw new DestinationAlreadyRemovedException(destination);
}
}
getServicesManagerImpl().removeDestination(sess, service, facility, destination);
// remove destination from destination table if it is not used anymore
try {
this.deleteDestination(sess, destination);
} catch (RelationExistsException ex) {
// destination is used by some services and facilities, dont delete it
}
getPerunBl().getAuditer().log(sess, new DestinationRemovedFromService(destination, service, facility));
}
Aggregations