use of cz.metacentrum.perun.core.api.exceptions.ResourceAlreadyRemovedException in project perun by CESNET.
the class ResourcesManagerImpl method deleteResource.
@Override
public void deleteResource(PerunSession sess, Vo vo, Resource resource) throws ResourceAlreadyRemovedException {
try {
// Delete authz entries for this resource
AuthzResolverBlImpl.removeAllAuthzForResource(sess, resource);
int numAffected = jdbc.update("delete from resources where id=?", resource.getId());
if (numAffected == 0)
throw new ResourceAlreadyRemovedException("Resource: " + resource + " , Vo: " + vo);
} catch (RuntimeException e) {
throw new InternalErrorException(e);
}
}
Aggregations