aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib
diff options
context:
space:
mode:
authorKartik Hegde <kh00735564@techmahindra.com>2022-11-12 14:29:11 +0530
committerKartik Hegde <kh00735564@techmahindra.com>2022-12-21 12:04:30 +0000
commitcf04a1a714ef4a1df973929dc750232b4d67d7b4 (patch)
treeedd2e6e5074ba58efb98663a1ea1851208895fff /openecomp-be/lib
parentf995db01ee95606b6cded82822a73435ebc190c8 (diff)
Multitenancy in SDC
Issue-ID: SDC-4215 Change-Id: Ie24ba38acc9f1998d4a7e722e8f98456dab9201d Signed-off-by: Kartik Hegde <kh00735564@techmahindra.com>
Diffstat (limited to 'openecomp-be/lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java9
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java1
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java1
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java4
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java1
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java1
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java9
7 files changed, 23 insertions, 3 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
index f6e155b0a2..9b9ae13af7 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
@@ -25,9 +25,13 @@ import com.datastax.driver.mapping.annotations.Frozen;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
import java.util.Objects;
+import lombok.Getter;
+import lombok.Setter;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+@Getter
+@Setter
@Table(keyspace = "dox", name = "vendor_license_model")
public class VendorLicenseModelEntity implements VersionableEntity {
@@ -42,6 +46,7 @@ public class VendorLicenseModelEntity implements VersionableEntity {
private String vendorName;
private String description;
private String oldVersion;
+ private String tenant;
@Column(name = "icon")
private String iconRef;
@Computed("writetime(vendor_name)")
@@ -123,7 +128,7 @@ public class VendorLicenseModelEntity implements VersionableEntity {
@Override
public int hashCode() {
- return Objects.hash(id, version, vendorName, description, iconRef);
+ return Objects.hash(id, version, vendorName, description, iconRef, tenant);
}
@Override
@@ -136,6 +141,6 @@ public class VendorLicenseModelEntity implements VersionableEntity {
}
VendorLicenseModelEntity that = (VendorLicenseModelEntity) obj;
return Objects.equals(id, that.id) && Objects.equals(version, that.version) && Objects.equals(vendorName, that.vendorName) && Objects
- .equals(description, that.description) && Objects.equals(iconRef, that.iconRef);
+ .equals(description, that.description) && Objects.equals(iconRef, that.iconRef) && Objects.equals(tenant, that.tenant);
}
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
index 86c1bd1895..20d8e3a084 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
@@ -30,6 +30,7 @@ public final class VendorSoftwareProductConstants {
public final class UniqueValues {
public static final String VENDOR_SOFTWARE_PRODUCT_NAME = "Vendor Software Product name";
+ public static final String TENANT = "tenant";
public static final String PROCESS_NAME = "Process name";
public static final String NETWORK_NAME = "Network name";
public static final String COMPONENT_NAME = "ComponentData name";
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
index 01d1f0b72a..b0744a9797 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
@@ -50,6 +50,7 @@ public class VspDetails implements VersionableEntity {
private List<String> featureGroups;
private String onboardingMethod;
private List<String> modelIdList;
+ private String tenant;
public VspDetails(String id, Version version) {
this.id = id;
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
index 6e17679e4c..fe174b89df 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
@@ -203,6 +203,9 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP
info.addProperty(InfoPropertyName.SUB_CATEGORY.getValue(), vspDetails.getSubCategory());
info.addProperty(InfoPropertyName.VENDOR_ID.getValue(), vspDetails.getVendorId());
info.addProperty(InfoPropertyName.VENDOR_NAME.getValue(), vspDetails.getVendorName());
+ if(vspDetails.getTenant() !=null) {
+ info.addProperty(InfoPropertyName.TENANT.getValue(), vspDetails.getTenant());
+ }
if (vspDetails.getVlmVersion() != null) {
info.addProperty(InfoPropertyName.VENDOR_VERSION.getValue(), vspDetails.getVlmVersion().getId());
}
@@ -226,6 +229,7 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP
SUB_CATEGORY("subCategory"),
VENDOR_ID("vendorId"),
VENDOR_NAME("vendorName"),
+ TENANT("tenant"),
VENDOR_VERSION("vendorVersion"),
LICENSE_TYPE("licenseType"),
LICENSE_AGREEMENT("licenseAgreement"),
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java
index 016c80ad0c..365dbb68e2 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java
@@ -67,6 +67,7 @@ public class ElementToVSPGeneralConvertor extends ElementConvertor<VspDetails> {
vspDetails.setSubCategory(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.SUB_CATEGORY.getValue()));
vspDetails.setVendorId(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.VENDOR_ID.getValue()));
vspDetails.setVendorName(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.VENDOR_NAME.getValue()));
+ vspDetails.setTenant(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.TENANT.getValue()));
if (info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.VENDOR_VERSION.getValue()) != null) {
vspDetails
.setVlmVersion(new Version(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.VENDOR_VERSION.getValue())));
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java
index 62d21676f2..bbaf4945ea 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java
@@ -33,6 +33,7 @@ public class Item {
private String type;
private String name;
private String owner;
+ private String tenant;
private ItemStatus status;
private String description;
private Map<String, Object> properties = new HashMap<>();
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java
index e2e7b1cc1e..868faf4582 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java
@@ -102,6 +102,9 @@ public class ItemZusammenDaoImpl implements ItemDao {
case ITEM_OWNER:
item.setOwner((String) propertyValue);
break;
+ case TENANT:
+ item.setTenant((String) propertyValue);
+ break;
case ITEM_STATUS:
item.setStatus(ItemStatus.valueOf((String) propertyValue));
break;
@@ -121,6 +124,9 @@ public class ItemZusammenDaoImpl implements ItemDao {
info.setDescription(item.getDescription());
info.addProperty(ItemInfoProperty.ITEM_TYPE.getName(), item.getType());
info.addProperty(ItemInfoProperty.ITEM_OWNER.getName(), item.getOwner());
+ if (item.getTenant() != null) {
+ info.addProperty(ItemInfoProperty.TENANT.getName(), item.getTenant());
+ }
if (item.getStatus() != null) {
info.addProperty(ItemInfoProperty.ITEM_STATUS.getName(), item.getStatus());
}
@@ -135,7 +141,8 @@ public class ItemZusammenDaoImpl implements ItemDao {
ITEM_TYPE("item_type"),
ITEM_VERSIONS_STATUSES("item_versions_statuses"),
ITEM_OWNER("Owner"),
- ITEM_STATUS("status");
+ ITEM_STATUS("status"),
+ TENANT("Tenant");
private final String name;