From b62880bebaafab43294739bb2c867f271d760db1 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 6 Nov 2018 11:09:55 -0500 Subject: Replace logic for subinterface_indicator ingestion Changes made: Replace ingestion logic for VFC_TO_NETWORK_ROLE_MAPPING.subinterface_indicator with alternate logic suggested by ASDC. Change-Id: Ied21e9361091c3fe4c05c6d9a2ee35c6491a7e10 Issue-ID: CCSDK-630 Signed-off-by: lalena.aria --- .../onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'ueb-listener/src/main') diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java index 5977e2888..db5004309 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java @@ -24,6 +24,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; @@ -113,9 +114,17 @@ public class SdncVFCModel extends SdncBaseModel { SdncBaseModel.addParameter("network_role", networkRole, commonParams); // can not be null SdncBaseModel.addParameter("network_role_tag", nullCheck(propsMap.get("network_role_tag")), commonParams); SdncBaseModel.addParameter("extcp_subnetpool_id", nullCheck(propsMap.get("subnetpoolid")), commonParams); - String subinterfaceIndicator = nullCheck(propsMap.get("subinterface_indicator")); - if (!subinterfaceIndicator.isEmpty()) { - SdncBaseModel.addParameter("subinterface_indicator", subinterfaceIndicator.contains("true") ? "Y" : "N", commonParams); // boolean Y|N + + // Loop thru all CPs using getNodeTemplateChildren and match the network_role on the CP with network_role from + // getCpPropertiesFromVfcAsObject output, then get subinterface_indicator for this CP + List cpNodesList = sdcCsarHelper.getNodeTemplateChildren(vfcNode); + for (NodeTemplate cpNode : cpNodesList){ + String cpNetworkRole = extractValue(cpNode, "network_role"); + + if (cpNetworkRole == networkRole) { + String subinterfaceIndicator = extractBooleanValue (cpNode, "subinterface_indicator"); + addParameter("subinterface_indicator", subinterfaceIndicator, commonParams); + } } // Extract IP Version specific parameters -- cgit 1.2.3-korg