use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class RecipeService method delete.
public void delete(String name, IdentityUser user) {
Recipe recipe = recipeRepository.findByNameInAccount(name, user.getAccount());
if (recipe == null) {
throw new NotFoundException(String.format("Recipe '%s' not found.", name));
}
delete(recipe);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class RecipeService method get.
public Recipe get(Long id) {
Recipe recipe = recipeRepository.findOne(id);
if (recipe == null) {
throw new NotFoundException(String.format("Recipe '%s' not found", id));
}
authorizationService.hasReadPermission(recipe);
return recipe;
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class ProxyConfigService method delete.
public void delete(Long id, IdentityUser user) {
ProxyConfig proxyConfig = proxyConfigRepository.findByIdAndAccount(id, user.getAccount());
if (proxyConfig == null) {
throw new NotFoundException(String.format("Proxy configuration '%s' not found.", id));
}
authorizationService.hasWritePermission(proxyConfig);
delete(proxyConfig);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class ProxyConfigService method get.
public ProxyConfig get(Long id) {
ProxyConfig proxyConfig = proxyConfigRepository.findOne(id);
if (proxyConfig == null) {
throw new NotFoundException(String.format("Proxy configuration '%s' not found.", id));
}
authorizationService.hasReadPermission(proxyConfig);
return proxyConfig;
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class ProxyConfigService method delete.
public void delete(String name, IdentityUser user) {
ProxyConfig proxyConfig = proxyConfigRepository.findByNameBasedOnAccount(name, user.getAccount(), user.getUserId());
if (proxyConfig == null) {
throw new NotFoundException(String.format("Proxy configuration '%s' not found.", name));
}
authorizationService.hasWritePermission(proxyConfig);
delete(proxyConfig);
}
Aggregations