diff options
author | lalena.aria <lalena.aria@att.com> | 2018-11-06 11:09:55 -0500 |
---|---|---|
committer | lalena.aria <lalena.aria@att.com> | 2018-11-06 11:10:36 -0500 |
commit | b62880bebaafab43294739bb2c867f271d760db1 (patch) | |
tree | 92f73f771da3617da2901bdd36dba5f6c00c227e | |
parent | f5238afed0d9b0e3a01af5d71b3471bed6953c42 (diff) |
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 <lalena.aria@att.com>
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java | 15 |
1 files changed, 12 insertions, 3 deletions
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<NodeTemplate> 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 |