- private Pair<String, String> createVendorInfoPair(Map<String, Object> otherFlavor, String resourceVendor) {
- @SuppressWarnings("unchecked")
- String vendorModel = otherFlavor.entrySet().stream() //
- .filter(entry -> "vendor_info".equals(entry.getKey()))
- .map(e -> ((Map<String, String>) e.getValue()).get(VENDOR_MODEL)) //
- .findFirst().orElse(null);
-
- applicationLogger.debug("Creating vendor info pair object for vendorModel = " + vendorModel
- + " and resourceVendor = " + resourceVendor);
-
- return new ImmutablePair<>(resourceVendor, vendorModel);
+ /**
+ * Builds the Vendor Image configurations.
+ *
+ * @param flavorMaps
+ * the collection of flavors and the properties for those flavors
+ * @param vfNodeTemplate
+ * the node template for the VF
+ *
+ * @return a stream of VendorImageConfiguration objects
+ */
+ private Stream<VendorImageConfiguration> buildVendorImageConfigurations(
+ Collection<Map<String, Map<String, String>>> flavorMaps, NodeTemplate vfNodeTemplate) {
+ String resourceVendor = vfNodeTemplate.getMetaData().getValue("resourceVendor");
+ applicationLogger.debug("Resource Vendor " + resourceVendor);
+
+ List<String> softwareVersions =
+ extractSoftwareVersions(vfNodeTemplate.getSubMappingToscaTemplate().getNodeTemplates());
+ applicationLogger.debug("Software Versions: " + softwareVersions);
+
+ return flavorMaps.stream() //
+ .map(value -> value.entrySet().stream() //
+ .filter(entry -> VENDOR_INFO.equals(entry.getKey())) //
+ .map(e -> e.getValue().get(VENDOR_MODEL)) //
+ .findFirst()) //
+ .flatMap(vendorModel -> softwareVersions.stream().map(
+ version -> new VendorImageConfiguration(vendorModel.orElse(null), resourceVendor, version)));