Search in sources :

Example 1 with ServiceAlreadyRemovedException

use of cz.metacentrum.perun.core.api.exceptions.ServiceAlreadyRemovedException in project perun by CESNET.

the class ServicesManagerImpl method deleteService.

public void deleteService(PerunSession sess, Service service) throws InternalErrorException, ServiceAlreadyRemovedException {
    try {
        // Delete authz entries for this service
        AuthzResolverBlImpl.removeAllAuthzForService(sess, service);
        int numAffected = jdbc.update("delete from services where id=?", service.getId());
        if (numAffected == 0)
            throw new ServiceAlreadyRemovedException("Service: " + service);
    } catch (RuntimeException ex) {
        throw new InternalErrorException(ex);
    }
}
Also used : ServiceAlreadyRemovedException(cz.metacentrum.perun.core.api.exceptions.ServiceAlreadyRemovedException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException)

Aggregations

InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)1 ServiceAlreadyRemovedException (cz.metacentrum.perun.core.api.exceptions.ServiceAlreadyRemovedException)1