Search in sources :

Example 36 with NotFoundException

use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.

the class SecurityGroupService method delete.

public void delete(String name, IdentityUser user) {
    LOGGER.info("Deleting SecurityGroup with name: {}", name);
    SecurityGroup securityGroup = groupRepository.findByNameInAccount(name, user.getAccount());
    if (securityGroup == null) {
        throw new NotFoundException(String.format("SecurityGroup '%s' not found.", name));
    }
    delete(securityGroup);
}
Also used : NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException) SecurityGroup(com.sequenceiq.cloudbreak.domain.SecurityGroup)

Example 37 with NotFoundException

use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.

the class RdsConfigService method delete.

public void delete(Long id, IdentityUser user) {
    RDSConfig rdsConfig = rdsConfigRepository.findByIdInAccount(id, user.getAccount());
    if (rdsConfig == null) {
        throw new NotFoundException(String.format("RDS configuration '%s' not found.", id));
    }
    delete(rdsConfig);
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

Example 38 with NotFoundException

use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.

the class RdsConfigService method delete.

public void delete(String name, IdentityUser user) {
    RDSConfig rdsConfig = rdsConfigRepository.findByNameBasedOnAccount(name, user.getAccount(), user.getUserId());
    if (rdsConfig == null) {
        throw new NotFoundException(String.format("RDS configuration '%s' not found.", name));
    }
    delete(rdsConfig);
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

Example 39 with NotFoundException

use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.

the class ProxyConfigService method getPrivateProxyConfig.

public ProxyConfig getPrivateProxyConfig(String name, IdentityUser user) {
    ProxyConfig proxyConfig = proxyConfigRepository.findByNameAndOwner(name, user.getUserId());
    if (proxyConfig == null) {
        throw new NotFoundException(String.format("Proxy configuration '%s' not found.", name));
    }
    authorizationService.hasReadPermission(proxyConfig);
    return proxyConfig;
}
Also used : NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Example 40 with NotFoundException

use of com.sequenceiq.cloudbreak.controller.NotFoundException in project cloudbreak by hortonworks.

the class ProxyConfigService method getPublicProxyConfig.

public ProxyConfig getPublicProxyConfig(String name, IdentityUser user) {
    ProxyConfig proxyConfig = proxyConfigRepository.findByNameAndAccount(name, user.getAccount());
    if (proxyConfig == null) {
        throw new NotFoundException(String.format("Proxy configuration '%s' not found.", name));
    }
    authorizationService.hasReadPermission(proxyConfig);
    return proxyConfig;
}
Also used : NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Aggregations

NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)50 CloudbreakImageNotFoundException (com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException)9 Stack (com.sequenceiq.cloudbreak.domain.Stack)8 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)5 ProxyConfig (com.sequenceiq.cloudbreak.domain.ProxyConfig)5 ClusterTemplate (com.sequenceiq.cloudbreak.domain.ClusterTemplate)4 ConstraintTemplate (com.sequenceiq.cloudbreak.domain.ConstraintTemplate)4 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)4 Template (com.sequenceiq.cloudbreak.domain.Template)4 LdapConfig (com.sequenceiq.cloudbreak.domain.LdapConfig)3 AmbariClient (com.sequenceiq.ambari.client.AmbariClient)2 AutoscaleStackResponse (com.sequenceiq.cloudbreak.api.model.AutoscaleStackResponse)2 StackResponse (com.sequenceiq.cloudbreak.api.model.StackResponse)2 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)2 InstanceMetaData (com.sequenceiq.cloudbreak.domain.InstanceMetaData)2 Recipe (com.sequenceiq.cloudbreak.domain.Recipe)2 SecurityGroup (com.sequenceiq.cloudbreak.domain.SecurityGroup)2 CertificateResponse (com.sequenceiq.cloudbreak.api.model.CertificateResponse)1 HttpClientConfig (com.sequenceiq.cloudbreak.client.HttpClientConfig)1 CloudConnectorException (com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException)1