use of com.sequenceiq.cloudbreak.domain.ClusterTemplate in project cloudbreak by hortonworks.
the class ClusterTemplateController method getPublic.
@Override
public ClusterTemplateResponse getPublic(String name) {
IdentityUser user = authenticatedUserService.getCbUser();
ClusterTemplate clusterTemplate = clusterTemplateService.getPublicClusterTemplate(name, user);
return conversionService.convert(clusterTemplate, ClusterTemplateResponse.class);
}
use of com.sequenceiq.cloudbreak.domain.ClusterTemplate in project cloudbreak by hortonworks.
the class ClusterTemplateController method getPublics.
@Override
public Set<ClusterTemplateResponse> getPublics() {
IdentityUser user = authenticatedUserService.getCbUser();
Set<ClusterTemplate> clusterTemplates = clusterTemplateService.retrieveAccountClusterTemplates(user);
return toJsonList(clusterTemplates);
}
use of com.sequenceiq.cloudbreak.domain.ClusterTemplate in project cloudbreak by hortonworks.
the class ClusterTemplateController method getPrivates.
@Override
public Set<ClusterTemplateResponse> getPrivates() {
IdentityUser user = authenticatedUserService.getCbUser();
Set<ClusterTemplate> clusterTemplates = clusterTemplateService.retrievePrivateClusterTemplates(user);
return toJsonList(clusterTemplates);
}
use of com.sequenceiq.cloudbreak.domain.ClusterTemplate 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);
}
use of com.sequenceiq.cloudbreak.domain.ClusterTemplate 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);
}
Aggregations