use of cz.metacentrum.perun.core.api.exceptions.ExtSourceAlreadyRemovedException in project perun by CESNET.
the class ExtSourcesManagerImpl method deleteExtSource.
public void deleteExtSource(PerunSession sess, ExtSource extSource) throws InternalErrorException, ExtSourceAlreadyRemovedException {
try {
// Delete associated attributes
jdbc.update("delete from ext_sources_attributes where ext_sources_id=?", extSource.getId());
// Delete the external source
int numAffected = jdbc.update("delete from ext_sources where id=?", extSource.getId());
if (numAffected == 0)
throw new ExtSourceAlreadyRemovedException("ExtSource: " + extSource);
} catch (RuntimeException e) {
throw new InternalErrorException(e);
}
}
Aggregations