aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorayalaben <ayala.benzvi@amdocs.com>2018-06-06 14:23:36 +0300
committerOren Kleks <orenkle@amdocs.com>2018-06-07 05:55:55 +0000
commit51105af1cf133035ecdd11ac11fbe90e129b1c3e (patch)
tree38e977f6ccb1ce1359015b6a73d6dbd477c699f4
parentcd0672f83bef9965fe3f109e43d78c65d321544b (diff)
Bugfix - update vsp item
Change-Id: I71f096fe14355f8137d67c6d374d91db2d5b3ac9 Issue-ID: SDC-1403 Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
-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/services/VendorSoftwareProductsImpl.java20
1 files changed, 20 insertions, 0 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/services/VendorSoftwareProductsImpl.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/services/VendorSoftwareProductsImpl.java
index 71e188851e..d801f7821d 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/services/VendorSoftwareProductsImpl.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/services/VendorSoftwareProductsImpl.java
@@ -16,6 +16,7 @@
package org.openecomp.sdcrests.vsp.rest.services;
+import java.util.Date;
import org.apache.commons.collections4.MapUtils;
import org.openecomp.core.dao.UniqueValueDaoFactory;
import org.openecomp.core.util.UniqueValueUtil;
@@ -273,6 +274,8 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
vendorSoftwareProductManager.updateVsp(vspDetails);
+ updateVspItem(vspId,vspDescriptionDto);
+
return Response.ok().build();
}
@@ -505,6 +508,23 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
return Response.ok(results).build();
}
+
+ private void updateVspItem(String vspId, VspDescriptionDto vspDescriptionDto) {
+ Item retrievedItem = itemManager.get(vspId);
+ Item item = new MapVspDescriptionDtoToItem().applyMapping(vspDescriptionDto, Item.class);
+ item.setId(vspId);
+ item.setType(retrievedItem.getType());
+ item.setOwner(retrievedItem.getOwner());
+ item.setStatus(retrievedItem.getStatus());
+ item.setVersionStatusCounters(retrievedItem.getVersionStatusCounters());
+ item.setCreationTime(retrievedItem.getCreationTime());
+ item.setModificationTime(new Date());
+ item.addProperty(VspItemProperty.ONBOARDING_METHOD,
+ retrievedItem.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
+
+ itemManager.update(item);
+ }
+
private Optional<ValidationResponse> submit(String vspId, Version version, String message,
String user) throws IOException {