From: Sandeep Shah Date: Thu, 13 Jun 2019 10:50:38 +0000 (-0500) Subject: Bug fixes/mods to dmaap-listener for SDNR OOF PCI X-Git-Tag: 0.5.0~9^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=9b5c8a76bf6a75d5d82df56a1db0a09651596f82;p=ccsdk%2Fsli%2Fnorthbound.git Bug fixes/mods to dmaap-listener for SDNR OOF PCI Bug fixes to support payload with escape characters and modifications to velocity template map files to point to correct SDNC end point Issue-ID: CCSDK-1399 Signed-off-by: SandeepLinux Change-Id: I38a0a3f19379ea20b7055e9581318f54b93dca6d --- diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/OofPciPocDmaapConsumers.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/OofPciPocDmaapConsumers.java index 2e6ae742..7037d884 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/OofPciPocDmaapConsumers.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/OofPciPocDmaapConsumers.java @@ -65,6 +65,9 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { private static final String BODY = "body"; private static final String INPUT = "input"; + private static final String EMPTY = ""; + private static final String ESCAPE_SEQUENCE_QUOTES = "\""; + private static final String GENERIC_NEIGHBOR_CONFIGURATION_INPUT = "generic-neighbor-configuration-input."; private static final String GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE = GENERIC_NEIGHBOR_CONFIGURATION_INPUT.concat("neighbor-list-in-use"); private static final String MODIFY_CONFIG_ANR = "ModifyConfigANR"; @@ -162,15 +165,15 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { if(nbrListInUse.isArray()) { for(JsonNode lteCell:nbrListInUse) { sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"plmnid") - .put(STRING_VALUE, lteCell.get("PLMNID"))); + .put(STRING_VALUE, lteCell.get("PLMNID").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"cid") - .put(STRING_VALUE, lteCell.get("CID"))); + .put(STRING_VALUE, lteCell.get("CID").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"phy-cell-id") - .put(STRING_VALUE, lteCell.get("PhyCellID"))); + .put(STRING_VALUE, lteCell.get("PhyCellID").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"pnf-name") - .put(STRING_VALUE, lteCell.get("PNFName"))); + .put(STRING_VALUE, lteCell.get("PNFName").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"blacklisted") - .put(STRING_VALUE, lteCell.get("Blacklisted"))); + .put(STRING_VALUE, lteCell.get("Blacklisted").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); entryCount++; } @@ -219,13 +222,13 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { if(configurations.isArray()) { for(JsonNode dataNode:configurations) { sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, PHYSICAL_CELL_ID_INPUT_FAP_SERVICE+"["+entryCount+"]."+ALIAS) - .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get(ALIAS))); + .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get(ALIAS).toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, PHYSICAL_CELL_ID_INPUT_FAP_SERVICE+"["+entryCount+"]."+"cid") - .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get("CellConfig").get("LTE").get("RAN").get("Common").get("CellIdentity"))); + .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get("CellConfig").get("LTE").get("RAN").get("Common").get("CellIdentity").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, PHYSICAL_CELL_ID_INPUT_FAP_SERVICE+"["+entryCount+"]."+"phy-cell-id-in-use") - .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get(X0005b9Lte).get("phyCellIdInUse"))); + .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get(X0005b9Lte).get("phyCellIdInUse").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, PHYSICAL_CELL_ID_INPUT_FAP_SERVICE+"["+entryCount+"]."+"pnf-name") - .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get(X0005b9Lte).get("pnfName"))); + .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get(X0005b9Lte).get("pnfName").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); entryCount++; } diff --git a/dmaap-listener/src/main/resources/anr-changes-from-policy-to-sdnr.map b/dmaap-listener/src/main/resources/anr-changes-from-policy-to-sdnr.map index e7c45b25..5cd2b837 100644 --- a/dmaap-listener/src/main/resources/anr-changes-from-policy-to-sdnr.map +++ b/dmaap-listener/src/main/resources/anr-changes-from-policy-to-sdnr.map @@ -1,5 +1,5 @@ # SDN-C URL -SDNC.endpoint => oofpcipoc-api:generic-neighbour-configuration +SDNC.endpoint => SLI-API:execute-graph -# Field mapping +# Field mapping SDNC.template => anr-pci-changes-from-policy-to-sdnr.vt diff --git a/dmaap-listener/src/main/resources/pci-changes-from-policy-to-sdnr.map b/dmaap-listener/src/main/resources/pci-changes-from-policy-to-sdnr.map index 44c34a4d..5cd2b837 100644 --- a/dmaap-listener/src/main/resources/pci-changes-from-policy-to-sdnr.map +++ b/dmaap-listener/src/main/resources/pci-changes-from-policy-to-sdnr.map @@ -1,5 +1,5 @@ # SDN-C URL -SDNC.endpoint => oofpcipoc-api:configuration-phy-cell-id +SDNC.endpoint => SLI-API:execute-graph -# Field mapping +# Field mapping SDNC.template => anr-pci-changes-from-policy-to-sdnr.vt