diff options
author | andre.schmid <andre.schmid@est.tech> | 2021-07-29 10:14:19 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2021-08-17 08:12:35 +0000 |
commit | 6e75dd1bfd8c1a4625c9c61a60883d28ca88fff7 (patch) | |
tree | a489c38d90b399e7c446e082c977aa3d4974ba94 /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib | |
parent | 855a434b4f6555aa43091cdaeef14a33e418458d (diff) |
Handle VSP package upload for multi-model
Change-Id: Iceca3f160eaeb1a6431fc3c5bbab92847e95ae4d
Issue-ID: SDC-3667
Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
3 files changed, 11 insertions, 5 deletions
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/PackageInfo.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/PackageInfo.java index 9c751a239d..ce918b9915 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/PackageInfo.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/PackageInfo.java @@ -23,6 +23,7 @@ import com.datastax.driver.mapping.annotations.Column; import com.datastax.driver.mapping.annotations.PartitionKey; import com.datastax.driver.mapping.annotations.Table; import java.nio.ByteBuffer; +import java.util.Set; import lombok.Data; import lombok.NoArgsConstructor; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; @@ -38,6 +39,8 @@ public class PackageInfo { private String vspId; @PartitionKey(value = 1) private String version; + @Column(name = "version_id") + private String versionId; @Column(name = "display_name") private String displayName; @Column(name = "vsp_name") @@ -59,9 +62,12 @@ public class PackageInfo { private ByteBuffer translatedFile; @Column(name = "resource_type") private String resourceType = ResourceTypeEnum.VF.name(); + @Column(name = "models") + private Set<String> models; - public PackageInfo(String packageId, Version version) { + public PackageInfo(final String packageId, final Version version) { this.vspId = packageId; this.version = version.getName(); + this.versionId = version.getId(); } } 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/PackageInfoDaoImpl.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/PackageInfoDaoImpl.java index 591af3c8b9..f8b75496e5 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/PackageInfoDaoImpl.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/PackageInfoDaoImpl.java @@ -76,8 +76,8 @@ public class PackageInfoDaoImpl extends CassandraBaseDao<PackageInfo> implements @Accessor interface PackageInfoAccessor { - @Query("SELECT vsp_id,version,display_name,vsp_name,vsp_description,vendor_name,category" - + " ,sub_category, vendor_release,package_checksum,package_type, resource_type FROM package_details") + @Query("SELECT vsp_id, version, version_id, display_name, vsp_name, vsp_description, vendor_name, category" + + " , sub_category, vendor_release, package_checksum, package_type, resource_type, models FROM package_details") Result<PackageInfo> listInfo(); } } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java index 1118260a16..4929668753 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java @@ -87,8 +87,8 @@ public class ServiceModelDaoFactoryTest { zusammenAdaptor); zusammenAdaptor.setItemVersion(itemVersionmock); - ToscaServiceModel model = getToscaServiceModel(); - serviceModelDaoZusammen.storeServiceModel(vspId, version, model); + ToscaServiceModel toscaServiceModel = getToscaServiceModel(); + serviceModelDaoZusammen.storeServiceModel(vspId, version, toscaServiceModel); } @Test |