From 5c9769c3e3a6d6675c5ec1bd450720791ef2793c Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Mon, 20 Aug 2018 01:27:45 +0300 Subject: fix merge issue restore activity log add clean up to the onboarding back end docker Issue-ID: SDC-1664 Change-Id: Ib7994ca12439bc842650c3cacddb0e4d87215390 Signed-off-by: Michael Lando --- .../vsp/rest/services/VendorSoftwareProductsImpl.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (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/VendorSoftwareProductsImpl.java') 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 14252cb893..f0fcd15939 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 @@ -19,6 +19,10 @@ package org.openecomp.sdcrests.vsp.rest.services; import org.apache.commons.collections4.MapUtils; import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.sdc.activitylog.ActivityLogManager; +import org.openecomp.sdc.activitylog.ActivityLogManagerFactory; +import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; +import org.openecomp.sdc.activitylog.dao.type.ActivityType; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.common.errors.Messages; @@ -100,6 +104,8 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { VersioningManagerFactory.getInstance().createInterface(); private final VendorSoftwareProductManager vendorSoftwareProductManager = VspManagerFactory.getInstance().createInterface(); + private final ActivityLogManager activityLogManager = + ActivityLogManagerFactory.getInstance().createInterface(); private final NotificationPropagationManager notifier = NotificationPropagationManagerFactory.getInstance().createInterface(); private final UniqueValueUtil uniqueValueUtil = new UniqueValueUtil(UniqueValueDaoFactory @@ -161,7 +167,8 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { ItemCreationDto itemCreationDto = new ItemCreationDto(); itemCreationDto.setItemId(item.getId()); itemCreationDto.setVersion(new MapVersionToDto().applyMapping(version, VersionDto.class)); - + activityLogManager.logActivity(new ActivityLogEntity(vspDetails.getId(), version, + ActivityType.Create, user, true, "", "")); return itemCreationDto; } @@ -493,12 +500,15 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { Map> compilationErrors = vendorSoftwareProductManager.compile(vspId, version); if (!validationResponse.isValid() || MapUtils.isNotEmpty(compilationErrors)) { - + activityLogManager.logActivity( + new ActivityLogEntity(vspId, version, ActivityType.Submit, user, false, + "Failed on validation before submit", "")); return Optional.of(validationResponse); } versioningManager.submit(vspId, version, message); - + activityLogManager.logActivity( + new ActivityLogEntity(vspId, version, ActivityType.Submit, user, true, "", message)); return Optional.empty(); } -- cgit 1.2.3-korg