summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src
diff options
context:
space:
mode:
authorshrek2000 <orenkle@amdocs.com>2017-09-11 15:45:37 +0300
committershrek2000 <orenkle@amdocs.com>2017-09-12 10:38:35 +0300
commitc8a540b3c234449163f6fb1899807bba951113b4 (patch)
treea8aae0dd0f6a0feb27369914e9e3fa321740e7ed /openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src
parent82d454fd3e8c9fdf66517d01a99019a379dbfdb6 (diff)
Create new VSP, onboard from TOSCA file - UI
Change-Id: I018c6d07a4b9ec7e6b1507ab37e2550865423cfe Issue-ID: SDC-230 Signed-off-by: shrek2000 <orenkle@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src')
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java24
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java12
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/api/ToscaConverterManager.java9
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java45
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java9
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java12
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/resources/factoryConfiguration.json3
7 files changed, 114 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java
new file mode 100644
index 0000000000..09c823ce7e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java
@@ -0,0 +1,24 @@
+package org.openecomp.core.converter;
+
+import java.util.Map;
+
+public interface ServiceTemplateReaderService {
+
+ Map<String, Object> readServiceTemplate(byte[] serivceTemplateContent);
+
+ Object getMetadata();
+
+ Object getToscaVersion();
+
+ Object getNodeTypes();
+
+ Object getTopologyTemplate();
+
+ Map<String, Object> getNodeTemplates();
+
+ Map<String, Object> getInputs();
+
+ Map<String, Object> getOutputs();
+
+ Map<String, Object> getSubstitutionMappings();
+}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java
new file mode 100644
index 0000000000..543d32347f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java
@@ -0,0 +1,12 @@
+package org.openecomp.core.converter;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+
+import java.io.IOException;
+
+public interface ToscaConverter {
+
+ ToscaServiceModel convert(FileContentHandler fileContentHandler)
+ throws IOException;
+}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/api/ToscaConverterManager.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/api/ToscaConverterManager.java
new file mode 100644
index 0000000000..1cf010c1b5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/api/ToscaConverterManager.java
@@ -0,0 +1,9 @@
+package org.openecomp.core.converter.api;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+
+public interface ToscaConverterManager {
+
+ ToscaServiceModel convert(String csarName, FileContentHandler fileContentHandler);
+}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java
new file mode 100644
index 0000000000..6f7e6be8af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java
@@ -0,0 +1,45 @@
+package org.openecomp.core.converter.datatypes;
+
+import java.io.File;
+
+public class Constants {
+ public static final String mainStName = "MainServiceTemplate.yaml";
+ public static final String globalStName = "GlobalSubstitutionTypesServiceTemplate.yaml";
+ public static final String manifestFileName = "MainServiceTemplate.mf";
+ public static final String definitionsDir = "Definitions/";
+ public static final String metadataFile = "TOSCA-Metadata/TOSCA.meta";
+
+
+ public static final String definitionVersion = "tosca_definitions_version";
+ private static final String DEFAULT_NAMESPACE = "tosca_default_namespace";
+ private static final String TEMPLATE_NAME = "template_name";
+ public static final String topologyTemplate = "topology_template";
+ private static final String TEMPLATE_AUTHOR = "template_author";
+ private static final String TEMPLATE_VERSION = "template_version";
+ private static final String DESCRIPTION = "description";
+ private static final String IMPORTS = "imports";
+ private static final String DSL_DEFINITIONS = "dsl_definitions";
+ public static final String nodeType = "node_type";
+ public static final String nodeTypes = "node_types";
+ private static final String RELATIONSHIP_TYPES = "relationship_types";
+ private static final String RELATIONSHIP_TEMPLATES = "relationship_templates";
+ private static final String CAPABILITY_TYPES = "capability_types";
+ private static final String ARTIFACT_TYPES = "artifact_types";
+ private static final String DATA_TYPES = "data_types";
+ private static final String INTERFACE_TYPES = "interface_types";
+ private static final String POLICY_TYPES = "policy_types";
+ private static final String GROUP_TYPES = "group_types";
+ private static final String REPOSITORIES = "repositories";
+ public static final String metadata = "metadata";
+ public static final String nodeTemplates = "node_templates";
+ public static final String inputs = "inputs";
+ public static final String outputs = "outputs";
+ public static final String substitutionMappings = "substitution_mappings";
+ public static final String capabilities = "capabilities";
+ public static final String requirements = "requirements";
+
+ public static final String openecompHeatIndex = "openecomp_heat_index";
+ public static final String globalSubstitution = "GlobalSubstitutionTypes";
+
+ public static final String externalFilesFolder = "External" + File.separator;
+}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java
new file mode 100644
index 0000000000..323bd8a5fb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java
@@ -0,0 +1,9 @@
+package org.openecomp.core.converter.datatypes;
+
+public enum CsarFileTypes {
+ mainServiceTemplate,
+ globalServiceTemplate,
+ externalFile,
+ toscaMetadata,
+ definitionsFile,;
+}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java
new file mode 100644
index 0000000000..7506759d25
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java
@@ -0,0 +1,12 @@
+package org.openecomp.core.converter.factory;
+
+import org.openecomp.core.converter.ToscaConverter;
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ToscaConverterFactory extends AbstractComponentFactory<ToscaConverter> {
+
+ public static ToscaConverterFactory getInstance(){
+ return AbstractFactory.getInstance(ToscaConverterFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..d9f4ff3cbd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+ "org.openecomp.core.converter.factory.ToscaConverterFactory" : "org.openecomp.core.impl.factory.ToscaConverterFactoryImpl"
+} \ No newline at end of file