summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2022-05-26 10:23:13 +0100
committerMichael Morris <michael.morris@est.tech>2022-05-31 14:27:16 +0000
commitccd6a2c2037610d13769e2759ea5653babf5cacb (patch)
tree04f7105c492a44a845e2c1531ebb911ba301fc69 /openecomp-be/backend
parentb43eb22f91ffdc1e2ba5d82b3dc1a2c4250d06e0 (diff)
Delete VSP - Ensure complete deletion of VSP from DB
Delete data from tables still containing the deleted VSP id Issue-ID: SDC-4023 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: I0b389d22ccba1b888005a5bf3f1af000867e32c1
Diffstat (limited to 'openecomp-be/backend')
-rw-r--r--openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java7
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java2
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java5
3 files changed, 11 insertions, 3 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java
index 68edb21fd8..d25ea53dc2 100644
--- a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java
@@ -82,7 +82,7 @@ public class PermissionsManagerImpl implements PermissionsManager {
new ErrorCode.ErrorCodeBuilder().withMessage(Messages.PERMISSIONS_ERROR.getErrorMessage()).withId(Messages.PERMISSIONS_ERROR.name())
.withCategory(ErrorCategory.SECURITY).build());
}
- if (permission.equals(PermissionTypes.Owner.name())) {
+ if (permission.equals(PermissionTypes.Owner.name()) && !addedUsersIds.isEmpty()) {
if (addedUsersIds.size() == 1) {
asdcItemManager.updateOwner(itemId, addedUsersIds.iterator().next());
} else {
@@ -96,12 +96,13 @@ public class PermissionsManagerImpl implements PermissionsManager {
private void sendNotifications(String itemId, String permission, Set<String> addedUsersIds, Set<String> removedUsersIds, String userName) {
Item item = asdcItemManager.get(itemId);
+ String itemName = null != item ? item.getName() : "";
addedUsersIds.forEach(affectedUser -> {
- notifyUser(userName, true, item.getName(), itemId, affectedUser, permission);
+ notifyUser(userName, true, itemName, itemId, affectedUser, permission);
subscriptionService.subscribe(affectedUser, itemId);
});
removedUsersIds.forEach(affectedUser -> {
- notifyUser(userName, false, item.getName(), itemId, affectedUser, permission);
+ notifyUser(userName, false, itemName, itemId, affectedUser, permission);
subscriptionService.unsubscribe(affectedUser, itemId);
});
}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
index 6a92dbb209..5e59e795e6 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
@@ -58,6 +58,8 @@ public interface VendorSoftwareProductManager {
PackageInfo createPackage(String vspId, Version version) throws IOException;
+ void updatePackage(PackageInfo packageInfo);
+
List<PackageInfo> listPackages(String category, String subCategory);
File getTranslatedFile(String vspId, Version version);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
index bf173a28be..234ee43f05 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
@@ -539,6 +539,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
}
@Override
+ public void updatePackage(PackageInfo packageInfo) {
+ packageInfoDao.update(packageInfo);
+ }
+
+ @Override
public PackageInfo createPackage(final String vspId, final Version version) throws IOException {
final ToscaServiceModel toscaServiceModel = enrichedServiceModelDao.getServiceModel(vspId, version);
final VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));