use of com.sequenceiq.cloudbreak.api.model.imagecatalog.StackDetailsJson in project cloudbreak by hortonworks.
the class ImagesToImagesResponseJsonConverter method getDefaultStackInfos.
private List<StackDetailsJson> getDefaultStackInfos(Iterable<? extends StackInfo> defaultStackInfos) {
List<StackDetailsJson> result = new ArrayList<>();
for (StackInfo info : defaultStackInfos) {
StackDetailsJson json = new StackDetailsJson();
StackRepoDetailsJson repoJson = new StackRepoDetailsJson();
Map<String, String> stackRepo = info.getRepo().getStack();
if (stackRepo != null) {
repoJson.setStack(stackRepo);
}
Map<String, String> utilRepo = info.getRepo().getUtil();
if (utilRepo != null) {
repoJson.setUtil(utilRepo);
}
Map<String, String> knoxRepo = info.getRepo().getKnox();
if (knoxRepo != null) {
repoJson.setKnox(knoxRepo);
}
json.setRepo(repoJson);
json.setVersion(info.getVersion());
result.add(json);
}
return result;
}
use of com.sequenceiq.cloudbreak.api.model.imagecatalog.StackDetailsJson in project cloudbreak by hortonworks.
the class ImagesToImagesResponseJsonConverter method getBaseImageResponses.
private List<BaseImageResponse> getBaseImageResponses(Images source) {
List<StackDetailsJson> defaultHdpStacks = getDefaultStackInfos(defaultHDPEntries.getEntries().values());
List<StackDetailsJson> defaultHdfStacks = getDefaultStackInfos(defaultHDFEntries.getEntries().values());
List<BaseImageResponse> baseImages = source.getBaseImages().stream().filter(i -> defaultAmbariRepoService.getDefault(i.getOsType()) != null).map(i -> {
BaseImageResponse imgJson = new BaseImageResponse();
copyImageFieldsToJson(i, imgJson);
imgJson.setHdpStacks(defaultHdpStacks);
imgJson.setHdfStacks(defaultHdfStacks);
imgJson.setVersion(defaultAmbariRepoService.getVersion());
AmbariRepo ambariRepo = defaultAmbariRepoService.getDefault(i.getOsType());
Map<String, String> repoJson = new HashMap<>();
repoJson.put("baseurl", ambariRepo.getBaseUrl());
repoJson.put("gpgkey", ambariRepo.getGpgKeyUrl());
imgJson.setRepo(repoJson);
return imgJson;
}).collect(Collectors.toList());
return baseImages;
}
use of com.sequenceiq.cloudbreak.api.model.imagecatalog.StackDetailsJson in project cloudbreak by hortonworks.
the class ImagesToImagesResponseJsonConverter method convertStackDetailsToJson.
private StackDetailsJson convertStackDetailsToJson(StackDetails stackDetails) {
StackDetailsJson json = new StackDetailsJson();
json.setVersion(stackDetails.getVersion());
json.setRepo(convertStackRepoDetailsToJson(stackDetails.getRepo()));
return json;
}
Aggregations