use of com.sequenceiq.cloudbreak.api.model.CustomContainerResponse in project cloudbreak by hortonworks.
the class ClusterToClusterResponseConverter method convertContainerConfig.
private void convertContainerConfig(Cluster source, ClusterResponse clusterResponse) {
Json customContainerDefinition = source.getCustomContainerDefinition();
if (customContainerDefinition != null && StringUtils.isNoneEmpty(customContainerDefinition.getValue())) {
try {
Map<String, String> map = customContainerDefinition.get(Map.class);
Map<String, String> result = new HashMap<>();
for (Entry<String, String> stringStringEntry : map.entrySet()) {
result.put(stringStringEntry.getKey(), stringStringEntry.getValue());
}
clusterResponse.setCustomContainers(new CustomContainerResponse(result));
} catch (IOException e) {
LOGGER.error("Failed to add customContainerDefinition to response", e);
throw new CloudbreakApiException("Failed to add customContainerDefinition to response", e);
}
}
}
Aggregations