use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class LdapConfigService method delete.
public void delete(String name, IdentityUser user) {
LdapConfig ldapConfig = ldapConfigRepository.findByNameInAccount(name, user.getAccount());
if (ldapConfig == null) {
throw new NotFoundException(String.format("LdapConfig '%s' not found.", name));
}
delete(ldapConfig);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class LdapConfigService method getByName.
public LdapConfig getByName(String name, IdentityUser user) {
LdapConfig ldapConfig = ldapConfigRepository.findByNameInAccount(name, user.getAccount());
if (ldapConfig == null) {
throw new NotFoundException(String.format("LdapConfig '%s' not found", name));
}
authorizationService.hasReadPermission(ldapConfig);
return ldapConfig;
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class NetworkService method delete.
public void delete(String name, IdentityUser user) {
LOGGER.info("Deleting network with name: {}", name);
Network network = networkRepository.findByNameInAccount(name, user.getAccount());
if (network == null) {
throw new NotFoundException(String.format("Network '%s' not found.", name));
}
delete(network);
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class RdsConfigService method get.
public RDSConfig get(Long id) {
RDSConfig rdsConfig = rdsConfigRepository.findById(id);
if (rdsConfig == null) {
throw new NotFoundException(String.format("RDS configuration '%s' not found.", id));
}
authorizationService.hasReadPermission(rdsConfig);
return rdsConfig;
}
use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.
the class RdsConfigService method getByName.
public RDSConfig getByName(String name, IdentityUser user) {
RDSConfig rdsConfig = rdsConfigRepository.findOneByName(name, user.getAccount());
if (rdsConfig == null) {
throw new NotFoundException(String.format("RDS configuration '%s' not found.", name));
}
authorizationService.hasReadPermission(rdsConfig);
return rdsConfig;
}
Aggregations