Search in sources :

Example 11 with ClusterTemplate

use of com.sequenceiq.cloudbreak.domain.ClusterTemplate in project cloudbreak by hortonworks.

the class ClusterTemplateService method get.

public ClusterTemplate get(Long id) {
    ClusterTemplate clusterTemplate = clusterTemplateRepository.findOne(id);
    if (clusterTemplate == null) {
        throw new NotFoundException(String.format("ClusterTemplate '%s' not found.", id));
    }
    authorizationService.hasReadPermission(clusterTemplate);
    return clusterTemplate;
}
Also used : ClusterTemplate(com.sequenceiq.cloudbreak.domain.ClusterTemplate) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException)

Aggregations

ClusterTemplate (com.sequenceiq.cloudbreak.domain.ClusterTemplate)11 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)4 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)4 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 Json (com.sequenceiq.cloudbreak.domain.json.Json)1 Transactional (javax.transaction.Transactional)1 DataIntegrityViolationException (org.springframework.dao.DataIntegrityViolationException)1