diff options
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/services')
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 { |