diff options
Diffstat (limited to 'openecomp-be/tools/migration')
7 files changed, 35 insertions, 25 deletions
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/pom.xml b/openecomp-be/tools/migration/1702_to_1707_zusammen/pom.xml index 1f281c950b..47808dbc3a 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/pom.xml +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/pom.xml @@ -47,12 +47,12 @@ <dependency> <groupId>com.amdocs.zusammen.plugin</groupId> <artifactId>zusammen-state-store-cassandra-plugin</artifactId> - <version>0.0.1</version> + <version>${zusammen.version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> - <version>RELEASE</version> + <version>${hibernate.validator.version}</version> </dependency> <dependency> <groupId>org.openecomp.sdc</groupId> diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java index c43cf32001..e0f3e016fe 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java @@ -49,7 +49,7 @@ import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.MibEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; @@ -266,7 +266,7 @@ public class MigrationMain { private static void convertMibs(SessionContext context, CassandraElementRepository cassandraElementRepository) { MibCassandraLoader cassandraLoader = new MibCassandraLoader(); - Collection<MibEntity> mibs = cassandraLoader.list(); + Collection<ComponentMonitoringUploadEntity> mibs = cassandraLoader.list(); mibs.stream().filter(mibEntity -> needMigration(mibEntity.getVspId(), mibEntity.getVersion())) .forEach (mibEntity -> { diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/EntitlementPoolConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/EntitlementPoolConvertor.java index 4c667f6708..c8037cecf4 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/EntitlementPoolConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/EntitlementPoolConvertor.java @@ -84,7 +84,6 @@ public class EntitlementPoolConvertor { info.addProperty("EntitlementTime", entitlementPool.getTime()); info.addProperty("manufacturerReferenceNumber", entitlementPool.getManufacturerReferenceNumber()); - return info; } diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/FeatureGroupConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/FeatureGroupConvertor.java index dd3fbe0485..eac5ce64ea 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/FeatureGroupConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/FeatureGroupConvertor.java @@ -90,6 +90,8 @@ public class FeatureGroupConvertor { info.setName(featureGroup.getName()); info.setDescription(featureGroup.getDescription()); info.addProperty("partNumber", featureGroup.getPartNumber()); + info.addProperty("manufacturerReferenceNumber", featureGroup.getManufacturerReferenceNumber()); + return info; } diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/MibConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/MibConvertor.java index 88b9dce95f..f145e51f02 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/MibConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/MibConvertor.java @@ -8,9 +8,8 @@ import org.openecomp.core.migration.MigrationMain; import org.openecomp.core.migration.store.ElementHandler; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementType; import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.MibEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity; import java.util.HashSet; import java.util.List; @@ -22,45 +21,57 @@ public class MibConvertor { private static Set<String> compMibLoaded = new HashSet<>(); - public static CollaborationElement[] convertMibToElement(MibEntity mibEntity) { + public static CollaborationElement[] convertMibToElement( + ComponentMonitoringUploadEntity componentMonitoringUploadEntity) { CollaborationElement[] elements; - List<String> mibNamespace = getMibNamespace(mibEntity); + List<String> mibNamespace = getMibNamespace(componentMonitoringUploadEntity); int index = 0; - String mibsEntityId = StructureElement.Mibs.name() + "_" + mibEntity.getComponentId(); + String mibsEntityId = + StructureElement.Mibs.name() + "_" + componentMonitoringUploadEntity.getComponentId(); if (compMibLoaded.contains(mibsEntityId)) { elements = new CollaborationElement[1]; } else { compMibLoaded.add(mibsEntityId); elements = new CollaborationElement[2]; elements[index++] = ElementHandler.getElementEntity( - mibEntity.getVspId(), mibEntity.getVersion().toString(), mibsEntityId, mibNamespace, + componentMonitoringUploadEntity.getVspId(), + componentMonitoringUploadEntity.getVersion().toString(), mibsEntityId, mibNamespace, ElementHandler.getStructuralElementInfo(StructureElement.Mibs.name()), null, null, null); } mibNamespace.add(mibsEntityId); elements[index] = ElementHandler.getElementEntity( - mibEntity.getVspId(), mibEntity.getVersion().toString(), mibEntity.getId(), mibNamespace, - getMibInfo(mibEntity), null, null, mibEntity.getArtifact().array()); + componentMonitoringUploadEntity.getVspId(), + componentMonitoringUploadEntity.getVersion().toString(), componentMonitoringUploadEntity + .getId(), mibNamespace, + getMibInfo(componentMonitoringUploadEntity), null, null, componentMonitoringUploadEntity + .getArtifact().array()); return elements; } - private static Info getMibInfo(MibEntity mibEntity) { + private static Info getMibInfo( + ComponentMonitoringUploadEntity componentMonitoringUploadEntity) { Info info = new Info(); - info.setName(mibEntity.getType().toString()); - info.getProperties().put("name", mibEntity.getArtifactName()); + info.setName(componentMonitoringUploadEntity.getType().toString()); + info.getProperties().put("name", componentMonitoringUploadEntity.getArtifactName()); return info; } - private static List<String> getMibNamespace(MibEntity mibEntity) { - return ElementHandler.getElementPath(StructureElement.Components.name(), mibEntity + private static List<String> getMibNamespace( + ComponentMonitoringUploadEntity componentMonitoringUploadEntity) { + return ElementHandler + .getElementPath(StructureElement.Components.name(), componentMonitoringUploadEntity .getComponentId()); } - public static ElementEntityContext convertMibToElementContext(MibEntity mibEntity) { + public static ElementEntityContext convertMibToElementContext( + ComponentMonitoringUploadEntity componentMonitoringUploadEntity) { return new ElementEntityContext("GLOBAL_USER", new - ElementContext(mibEntity.getVspId(), mibEntity.getVersion().toString())); + ElementContext(componentMonitoringUploadEntity.getVspId(), + componentMonitoringUploadEntity + .getVersion().toString())); } } diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java index 3854b32366..a767246f12 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java @@ -9,9 +9,7 @@ import org.openecomp.core.model.types.ServiceTemplate; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.model.impl.zusammen.ElementType; import org.openecomp.sdc.model.impl.zusammen.StructureElement; -import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; -import java.io.ByteArrayInputStream; import java.util.HashSet; import java.util.List; import java.util.Set; diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/MibCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/MibCassandraLoader.java index fdb534df32..b93033cc72 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/MibCassandraLoader.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/MibCassandraLoader.java @@ -25,7 +25,7 @@ import com.datastax.driver.mapping.annotations.Accessor; import com.datastax.driver.mapping.annotations.Query; import org.openecomp.core.nosqldb.api.NoSqlDb; import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.MibEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity; import java.util.Collection; @@ -36,7 +36,7 @@ public class MibCassandraLoader { noSqlDb.getMappingManager().createAccessor(MibAccessor.class); - public Collection<MibEntity> list() { + public Collection<ComponentMonitoringUploadEntity> list() { return accessor.list().all(); } @@ -45,7 +45,7 @@ public class MibCassandraLoader { @Query( "select * from vsp_component_artifact") - Result<MibEntity> list(); + Result<ComponentMonitoringUploadEntity> list(); } |