summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest
diff options
context:
space:
mode:
authorJerzySzachniewicz <jerzy.szachniewicz@nokia.com>2021-02-12 13:53:13 +0100
committerChristophe Closset <christophe.closset@intl.att.com>2021-02-17 15:43:47 +0000
commitf2c0a4118c3c0b6360b639622766543bd754b59c (patch)
tree19e8aa82bc11dd1be0d487dde833cbaa33d69cfd /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest
parent7f418398a37283d68c0fc934e0e4a91f529fe466 (diff)
Creation of Vendor Licensing Model is an optional step in VSP onboarding
Issue-ID: SDC-3471 Signed-off-by: JerzySzachniewicz <jerzy.szachniewicz@nokia.com> Change-Id: Icb98d0832c49939e200ece77f4ca26744cb82222
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java8
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java8
2 files changed, 13 insertions, 3 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
index 634bd90d20..3ab2667821 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
@@ -20,6 +20,7 @@
package org.openecomp.sdcrests.vsp.rest.mapping;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.LicenseType;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
import org.openecomp.sdc.versioning.dao.types.Version;
@@ -38,12 +39,15 @@ public class MapVspDescriptionDtoToVspDetails extends MappingBase<VspDescription
target.setVendorName(source.getVendorName());
target.setVendorId(source.getVendorId());
- if (source.getLicensingVersion() != null) {
+ if (source.getLicensingVersion() != null && source.getLicenseType() != LicenseType.EXTERNAL) {
target.setVlmVersion(new Version(source.getLicensingVersion()));
}
+ if (source.getLicenseType() != null) {
+ target.setLicenseType(source.getLicenseType().name());
+ }
LicensingData licensingData = source.getLicensingData();
- if (licensingData != null) {
+ if (licensingData != null && source.getLicenseType() != LicenseType.EXTERNAL) {
target.setLicenseAgreement(licensingData.getLicenseAgreement());
target.setFeatureGroups(licensingData.getFeatureGroups());
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
index 6e659cbb54..1ba5d1355c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
@@ -20,6 +20,8 @@
package org.openecomp.sdcrests.vsp.rest.mapping;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.LicenseType;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
import org.openecomp.sdcrests.mapping.MappingBase;
@@ -40,7 +42,11 @@ public class MapVspDetailsToDto extends MappingBase<VspDetails, VspDetailsDto> {
target.setVendorName(source.getVendorName());
target.setLicensingVersion(
source.getVlmVersion() == null ? null : source.getVlmVersion().getId());
-
+ if (StringUtils.isNotBlank(source.getLicenseType())) {
+ target.setLicenseType(LicenseType.valueOf(source.getLicenseType()));
+ } else if (StringUtils.isNotBlank(target.getLicensingVersion())){
+ target.setLicenseType(LicenseType.INTERNAL);
+ }
if (source.getLicenseAgreement() != null || source.getFeatureGroups() != null) {
LicensingData licensingData = new LicensingData();
licensingData.setLicenseAgreement(source.getLicenseAgreement());