Search in sources :

Example 21 with NotFoundException

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);
}
Also used : LdapConfig(com.sequenceiq.cloudbreak.domain.LdapConfig) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

Example 22 with NotFoundException

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;
}
Also used : LdapConfig(com.sequenceiq.cloudbreak.domain.LdapConfig) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

Example 23 with NotFoundException

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);
}
Also used : Network(com.sequenceiq.cloudbreak.domain.Network) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

Example 24 with NotFoundException

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;
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

Example 25 with NotFoundException

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;
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

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