From 22b57cf9313f0b21a1dca090088b811eec8cca6a Mon Sep 17 00:00:00 2001 From: Dmitry Puzikov Date: Tue, 14 Jan 2020 15:01:20 +0100 Subject: Implement policy element convertion during onboarding VSP Implement absent policy convertion. Add test data for policies section convertion and explicit test for checking if policies been converted. Change-Id: I7d431a22922e1f9da0fbf0de4654995c3da42fcb Issue-ID: SDC-2727 Signed-off-by: Dmitry Puzikov --- .../converter/ServiceTemplateReaderService.java | 22 ++++--- .../core/converter/datatypes/Constants.java | 73 +++++++++++----------- 2 files changed, 49 insertions(+), 46 deletions(-) (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org') 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 index 3b861e425d..8a97957be9 100644 --- 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 @@ -26,23 +26,25 @@ import java.util.Map; public interface ServiceTemplateReaderService { - Map readServiceTemplate(byte[] serivceTemplateContent); + Map readServiceTemplate(byte[] serivceTemplateContent); - Object getMetadata(); + Object getMetadata(); - Object getToscaVersion(); + Object getToscaVersion(); - Map getNodeTypes(); + Map getNodeTypes(); - Object getTopologyTemplate(); + Object getTopologyTemplate(); - Map getNodeTemplates(); + Map getNodeTemplates(); - Map getInputs(); + Map getInputs(); - Map getOutputs(); + Map getOutputs(); - Map getSubstitutionMappings(); + Map getSubstitutionMappings(); - List getImports(); + List getImports(); + + Map getPolicies(); } 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 index 90ce3f6f6b..18e6a49aa5 100644 --- 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 @@ -19,44 +19,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 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 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 POLICIES = "policies"; - public static final String openecompHeatIndex = "openecomp_heat_index"; - public static final String ONAP_INDEX = "onap_index"; - public static final String globalSubstitution = "GlobalSubstitutionTypes"; + public static final String openecompHeatIndex = "openecomp_heat_index"; + public static final String ONAP_INDEX = "onap_index"; + public static final String globalSubstitution = "GlobalSubstitutionTypes"; - public static final String externalFilesFolder = "External" + File.separator; + public static final String externalFilesFolder = "External" + File.separator; } -- cgit 1.2.3-korg