aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-model-lib
diff options
context:
space:
mode:
authorAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
committerAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
commitb8e2faf476202b6ffe61bc3a9a37df1304881d40 (patch)
treef78b8c0517d8e16c5ae610bf8b49f68ea8a312a1 /openecomp-be/lib/openecomp-sdc-model-lib
parent75aacbbe1acf78fa53378f07f0a8c7769449a17e (diff)
[SDC] Onboarding 1710 rebase.
Change-Id: If3b6b81d221fde13908f1e8160db6f7d9433c535 Signed-off-by: Avi Ziv <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-model-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml.versionsBackup51
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml6
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml.versionsBackup56
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java2
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml10
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml.versionsBackup49
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java23
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/pom.xml.versionsBackup44
8 files changed, 234 insertions, 7 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml.versionsBackup b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml.versionsBackup
new file mode 100644
index 0000000000..eba0f207e4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml.versionsBackup
@@ -0,0 +1,51 @@
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>openecomp-sdc-model-api</name>
+ <artifactId>openecomp-sdc-model-api</artifactId>
+
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-tosca-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml
index c63a0d0606..3bc4f9b64b 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml
@@ -21,6 +21,12 @@
<version>${logback.version}</version>
</dependency>
<dependency>
+ <groupId>org.openecomp.sdc.common</groupId>
+ <artifactId>openecomp-tosca-datatype</artifactId>
+ <version>${openecomp.sdc.common.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.openecomp.sdc.core</groupId>
<artifactId>openecomp-utilities-lib</artifactId>
<version>${project.version}</version>
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml.versionsBackup b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml.versionsBackup
new file mode 100644
index 0000000000..d62437122a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml.versionsBackup
@@ -0,0 +1,56 @@
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>openecomp-sdc-model-core</name>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+
+
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java
index 6863e04991..e774eb6b1d 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java
@@ -30,7 +30,7 @@ import org.openecomp.core.utilities.file.FileUtils;
import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
import org.openecomp.sdc.tosca.datatypes.model.Import;
import org.openecomp.sdc.tosca.datatypes.model.Old1610ServiceTemplate;
-import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
import org.openecomp.sdc.versioning.dao.VersionableDao;
import org.openecomp.sdc.versioning.dao.types.Version;
import sun.misc.IOUtils;
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml
index a3b1e0db9f..30c4bde443 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml
@@ -16,6 +16,11 @@
<dependencies>
<dependency>
+ <groupId>org.openecomp.sdc.common</groupId>
+ <artifactId>openecomp-tosca-datatype</artifactId>
+ <version>${openecomp.sdc.common.version}</version>
+ </dependency>
+ <dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
@@ -46,5 +51,10 @@
<scope>test</scope>
<version>${mockito.all.version}</version>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.5</version>
+ </dependency>
</dependencies>
</project>
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml.versionsBackup b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml.versionsBackup
new file mode 100644
index 0000000000..b8db689bd5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml.versionsBackup
@@ -0,0 +1,49 @@
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>openecomp-sdc-model-impl</name>
+ <artifactId>openecomp-sdc-model-impl</artifactId>
+
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+
+
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java
index 530ad44574..575ba856a7 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java
@@ -9,6 +9,7 @@ import com.amdocs.zusammen.datatypes.item.Action;
import com.amdocs.zusammen.datatypes.item.ElementContext;
import com.amdocs.zusammen.datatypes.item.Info;
import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import org.apache.commons.io.IOUtils;
import org.openecomp.core.model.dao.ServiceModelDao;
import org.openecomp.core.model.types.ServiceElement;
import org.openecomp.core.utilities.file.FileContentHandler;
@@ -18,13 +19,15 @@ import org.openecomp.sdc.logging.api.Logger;
import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
-import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.dao.types.VersionStatus;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.util.Collection;
import java.util.Map;
+import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
@@ -89,7 +92,6 @@ public class ServiceModelDaoZusammenImpl
return elements.stream().collect(Collectors.toMap(
element -> element.getInfo().getName(),
this::elementToServiceTemplate));
-
/*elements.stream().forEach(element ->serviceTemplateMap.put(element.getInfo().getName(),
elementToServiceTemplate(element)));
return serviceTemplateMap;*/
@@ -127,8 +129,10 @@ public class ServiceModelDaoZusammenImpl
ZusammenElement artifactsElement =
buildStructuralElement(StructureElement.Artifacts.name(), Action.UPDATE);
- serviceModel.getArtifactFiles().getFiles().entrySet().forEach(entry -> artifactsElement
- .addSubElement(buildArtifactElement(entry.getKey(), entry.getValue(), Action.CREATE)));
+ if (Objects.nonNull(serviceModel.getArtifactFiles())) {
+ serviceModel.getArtifactFiles().getFiles().entrySet().forEach(entry -> artifactsElement
+ .addSubElement(buildArtifactElement(entry.getKey(), entry.getValue(), Action.CREATE)));
+ }
ZusammenElement serviceModelElement = buildStructuralElement(name, Action.UPDATE);
serviceModelElement.getInfo()
@@ -175,8 +179,15 @@ public class ServiceModelDaoZusammenImpl
return artifactElement;
}
- private ServiceTemplate elementToServiceTemplate(Element element) {
- return new ToscaExtensionYamlUtil().yamlToObject(element.getData(), ServiceTemplate.class);
+ private ServiceTemplate elementToServiceTemplate(Element element){
+
+ try {
+ String yamlContent = IOUtils.toString(element.getData());
+ return new ToscaExtensionYamlUtil().
+ yamlToObject(yamlContent, ServiceTemplate.class);
+ }catch (Exception e){
+ return null;
+ }
}
private Element buildServiceTemplateElement(String name, ServiceTemplate serviceTemplate,
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml.versionsBackup b/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml.versionsBackup
new file mode 100644
index 0000000000..d49cbd7069
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml.versionsBackup
@@ -0,0 +1,44 @@
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>openecomp-sdc-model-lib</name>
+ <artifactId>openecomp-sdc-model-lib</artifactId>
+
+ <packaging>pom</packaging>
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <modules>
+ <module>openecomp-sdc-model-api</module>
+ <module>openecomp-sdc-model-core</module>
+ <module>openecomp-sdc-model-impl</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency-->
+ </dependencies>
+</project> \ No newline at end of file