use of cz.metacentrum.perun.audit.events.ServicesManagerEvents.DestinationRemovedFromService 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