diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp')
2 files changed, 19 insertions, 14 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java index 9655434e74..78ab818927 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java @@ -1,5 +1,6 @@ /* * Copyright © 2016-2018 European Support Limited + * Modifications Copyright (C) 2021 Nordix Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +27,8 @@ import com.amdocs.zusammen.datatypes.item.Info; import java.io.ByteArrayInputStream; import java.util.Collection; import java.util.stream.Collectors; +import lombok.AllArgsConstructor; +import lombok.Getter; import org.openecomp.core.zusammen.api.ZusammenAdaptor; import org.openecomp.sdc.datatypes.model.ElementType; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; @@ -189,7 +192,7 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP return questionnaireElement; } - private void addVspDetailsToInfo(Info info, VspDetails vspDetails) { + private void addVspDetailsToInfo(final Info info, final VspDetails vspDetails) { info.addProperty(InfoPropertyName.NAME.getValue(), vspDetails.getName()); info.addProperty(InfoPropertyName.DESCRIPTION.getValue(), vspDetails.getDescription()); info.addProperty(InfoPropertyName.ICON.getValue(), vspDetails.getIcon()); @@ -204,8 +207,13 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP info.addProperty(InfoPropertyName.LICENSE_AGREEMENT.getValue(), vspDetails.getLicenseAgreement()); info.addProperty(InfoPropertyName.FEATURE_GROUPS.getValue(), vspDetails.getFeatureGroups()); info.addProperty(InfoPropertyName.ON_BOARDING_METHOD.getValue(), vspDetails.getOnboardingMethod()); + if (!vspDetails.getModelIdList().isEmpty()) { + info.addProperty(InfoPropertyName.MODELS.getValue(), vspDetails.getModelIdList()); + } } + @AllArgsConstructor + @Getter public enum InfoPropertyName { // @formatter:off NAME("name"), @@ -219,17 +227,11 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP LICENSE_TYPE("licenseType"), LICENSE_AGREEMENT("licenseAgreement"), FEATURE_GROUPS("featureGroups"), - ON_BOARDING_METHOD("onboardingMethod"); + ON_BOARDING_METHOD("onboardingMethod"), + MODELS("models"); // @formatter:on - private String value; - - InfoPropertyName(String value) { - this.value = value; - } + private final String value; - public String getValue() { - return value; - } } } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java index 8234eeeaf1..016c80ad0c 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java @@ -3,6 +3,7 @@ * SDC * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,10 +26,11 @@ import com.amdocs.zusammen.datatypes.item.Info; import com.amdocs.zusammen.datatypes.item.Item; import org.openecomp.convertor.ElementConvertor; import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.VendorSoftwareProductInfoDaoZusammenImpl; +import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import org.openecomp.sdc.versioning.dao.types.Version; -public class ElementToVSPGeneralConvertor extends ElementConvertor { +public class ElementToVSPGeneralConvertor extends ElementConvertor<VspDetails> { @Override public VspDetails convert(Element element) { @@ -43,7 +45,7 @@ public class ElementToVSPGeneralConvertor extends ElementConvertor { if (item == null) { return null; } - VspDetails vspDetails = mapInfoToVspDetails(item.getInfo()); + var vspDetails = mapInfoToVspDetails(item.getInfo()); vspDetails.setId(item.getId().getValue()); return vspDetails; } @@ -56,8 +58,8 @@ public class ElementToVSPGeneralConvertor extends ElementConvertor { return mapInfoToVspDetails(elementInfo.getInfo()); } - private VspDetails mapInfoToVspDetails(Info info) { - VspDetails vspDetails = new VspDetails(); + private VspDetails mapInfoToVspDetails(final Info info) { + final var vspDetails = new VspDetails(); vspDetails.setName(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.NAME.getValue())); vspDetails.setDescription(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.DESCRIPTION.getValue())); vspDetails.setIcon(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.ICON.getValue())); @@ -73,6 +75,7 @@ public class ElementToVSPGeneralConvertor extends ElementConvertor { vspDetails.setLicenseAgreement(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.LICENSE_AGREEMENT.getValue())); vspDetails.setFeatureGroups(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.FEATURE_GROUPS.getValue())); vspDetails.setOnboardingMethod(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.ON_BOARDING_METHOD.getValue())); + vspDetails.setModelIdList(info.getProperty(InfoPropertyName.MODELS.getValue())); return vspDetails; } } |