use of com.sequenceiq.cloudbreak.cloud.model.catalog.Images 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;
}
Aggregations