Search in sources :

Example 16 with NotFoundException

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

Example 17 with NotFoundException

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

Example 18 with NotFoundException

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

Example 19 with NotFoundException

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

Example 20 with NotFoundException

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