From 707adfa57f63b49519badddbf72e411485269c37 Mon Sep 17 00:00:00 2001 From: ojasdubey Date: Tue, 27 Mar 2018 17:03:51 +0530 Subject: VLAN tagging - Support Pattern 1C2 1. Pattern 1C2 vlan tagging code 2. Count property handling 3. Added tests and updated existing test data Change-Id: Idef33b142d415e1c0a9663497eed621f35c2393b Issue-ID: SDC-1174 Signed-off-by: ojasdubey --- .../org/openecomp/sdc/tosca/services/DataModelUtil.java | 14 ++++++++++++++ .../org/openecomp/sdc/tosca/services/ToscaConstants.java | 1 + 2 files changed, 15 insertions(+) (limited to 'openecomp-be/lib/openecomp-tosca-lib') diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java index 39240ebe05..c66a5ba13b 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -1025,6 +1025,20 @@ public class DataModelUtil { .getProperties(); } + public static void addNodeTemplateProperty(NodeTemplate nodeTemplate, + String propertyKey, + Object propertyValue) { + if (Objects.isNull(nodeTemplate)) { + return; + } + + if(MapUtils.isEmpty(nodeTemplate.getProperties())) { + nodeTemplate.setProperties(new HashMap<>()); + } + + nodeTemplate.getProperties().put(propertyKey, propertyValue); + } + /** * Gets substitution mappings in a service template. * diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java index 5d4b7dfa00..af0d236b11 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java @@ -55,6 +55,7 @@ public class ToscaConstants { public static final String SERVICE_TEMPLATE_FILTER_PROPERTY_NAME = "service_template_filter"; public static final String SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME = "substitute_service_template"; + public static final String SERVICE_TEMPLATE_FILTER_COUNT = "service_template_filter_count"; public static final String COUNT_PROPERTY_NAME = "count"; public static final String MANDATORY_PROPERTY_NAME = "mandatory"; public static final String INDEX_VALUE_PROPERTY_NAME = "index_value"; -- cgit 1.2.3-korg