use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class StackService method getStackRequestByName.
public StackV2Request getStackRequestByName(String name, IdentityUser identityUser) {
Stack stack = stackRepository.findByNameInAccountWithLists(name, identityUser.getAccount());
if (stack == null) {
throw new NotFoundException(String.format(STACK_NOT_FOUND_EXCEPTION_FORMAT_TEXT, name));
}
authorizationService.hasReadPermission(stack);
return conversionService.convert(stack, StackV2Request.class);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class ClusterTemplateService method delete.
public void delete(Long id, IdentityUser user) {
ClusterTemplate clusterTemplate = clusterTemplateRepository.findByIdInAccount(id, user.getAccount());
if (clusterTemplate == null) {
throw new NotFoundException(String.format("ClusterTemplate '%s' not found.", id));
}
delete(clusterTemplate);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class ClusterTemplateService method delete.
public void delete(String name, IdentityUser user) {
ClusterTemplate clusterTemplate = clusterTemplateRepository.findByNameInAccount(name, user.getAccount(), user.getUserId());
if (clusterTemplate == null) {
throw new NotFoundException(String.format("ClusterTemplate '%s' not found.", name));
}
delete(clusterTemplate);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class ConstraintTemplateService method delete.
public void delete(Long id, IdentityUser user) {
ConstraintTemplate constraintTemplate = constraintTemplateRepository.findByIdInAccount(id, user.getAccount());
if (constraintTemplate == null) {
throw new NotFoundException(String.format(CONSTRAINT_NOT_FOUND_MSG, id));
}
delete(constraintTemplate);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class LdapConfigService method get.
public LdapConfig get(Long id) {
LdapConfig ldapConfig = ldapConfigRepository.findOne(id);
if (ldapConfig == null) {
throw new NotFoundException(String.format("LdapConfig '%s' not found", id));
}
authorizationService.hasReadPermission(ldapConfig);
return ldapConfig;
}
Aggregations