From ea5bf0a1c8a4e525d2cee03841b8e8f9b3563ed0 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 18 Jul 2017 20:32:15 -0400 Subject: [CCSDK-6] Populate seed code Add seed code for sli/northbound repository Update groupId to org.onap.ccsdk.sli.northbound Update to use CCSDK version of sli core Change-Id: Id3a154a53150a74f4b65060544e76f3e0cad932e Signed-off-by: Dan Timoney --- .../src/main/resources/edgeRouterStatusChange.map | 23 ++++++++++++++ dmaap-listener/src/main/resources/log4j.properties | 37 ++++++++++++++++++++++ .../src/main/resources/preferredRoute.txt | 1 + 3 files changed, 61 insertions(+) create mode 100644 dmaap-listener/src/main/resources/edgeRouterStatusChange.map create mode 100644 dmaap-listener/src/main/resources/log4j.properties create mode 100644 dmaap-listener/src/main/resources/preferredRoute.txt (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/resources/edgeRouterStatusChange.map b/dmaap-listener/src/main/resources/edgeRouterStatusChange.map new file mode 100644 index 000000000..57644bbd5 --- /dev/null +++ b/dmaap-listener/src/main/resources/edgeRouterStatusChange.map @@ -0,0 +1,23 @@ +# SDN-C URL +SDNC.endpoint => FLOWRED-API:process-edge-router-status-change + +# Field mapping +equip_id => equip_id +ptnii_equip_name => equip-name +equip_type.equip_type => equip-type +ip_addr => loopback0 +router_prov_status => prov-status +country.region => region +country_abbr => country +equip_name_code => equip-name-code +as_number => as-number +loopback1 => loopback1 +loopback2 => loopback2 +loopback3 => loopback3 +loopback40 => loopback40 +loopback65535 => loopback65535 +inms_list => inms-list +encrypted_access_flag => encrypted-access-flag +sw_name => sw-name +nmipaddr => nm-addr +function_code => function-code \ No newline at end of file diff --git a/dmaap-listener/src/main/resources/log4j.properties b/dmaap-listener/src/main/resources/log4j.properties new file mode 100644 index 000000000..ba815871b --- /dev/null +++ b/dmaap-listener/src/main/resources/log4j.properties @@ -0,0 +1,37 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 ONAP Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +log4j.rootLogger=DEBUG,CONSOLE,LOGFILE + +# CONSOLE is set to be a ConsoleAppender using a PatternLayout. +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.Threshold=ERROR +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n + +# LOGFILE is set to be a File appender using a PatternLayout. +log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender +log4j.appender.LOGFILE.File=/opt/app/dmaap-listener/logs/dmaap-listener.log +log4j.appender.LOGFILE.Append=true +log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout +log4j.appender.LOGFILE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n +log4j.appender.LOGFILE.MaxFileSize=10MB +log4j.appender.LOGFILE.MaxBackupIndex=10 diff --git a/dmaap-listener/src/main/resources/preferredRoute.txt b/dmaap-listener/src/main/resources/preferredRoute.txt new file mode 100644 index 000000000..662b0aa7d --- /dev/null +++ b/dmaap-listener/src/main/resources/preferredRoute.txt @@ -0,0 +1 @@ +preferredRouteKey=MR1 \ No newline at end of file -- cgit 1.2.3-korg From 1027b0c07b488bb5f4542bd38501f9a99da5c2cf Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 15 Aug 2017 15:18:54 -0400 Subject: Port sli/northbound to Carbon Updated sli/northbound repo to compile against OpenDaylight Carbon SR1 release Change-Id: I6aec68cf436e11f5fd5b7094eb5616536bead44f Issue-ID: CCSDK-25 Signed-off-by: Dan Timoney --- asdcApi/features/pom.xml | 2 +- asdcApi/features/src/main/resources/features.xml | 4 ++-- asdcApi/installer/pom.xml | 5 ++--- asdcApi/installer/src/assembly/assemble_installer_zip.xml | 4 ++-- asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- asdcApi/installer/src/main/resources/scripts/install-feature.sh | 4 ++-- asdcApi/model/pom.xml | 6 +++--- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- .../org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java | 4 ++-- .../java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java | 4 ++-- .../asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java | 4 ++-- .../provider/impl/rev140523/AsdcApiProviderModuleFactory.java | 4 ++-- asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/features/src/main/resources/features.xml | 4 ++-- dataChange/installer/pom.xml | 5 ++--- dataChange/installer/src/assembly/assemble_installer_zip.xml | 4 ++-- dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- dataChange/installer/src/main/resources/scripts/install-feature.sh | 4 ++-- dataChange/model/pom.xml | 6 +++--- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 7 +++---- .../main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java | 4 ++-- .../java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java | 4 ++-- .../provider/impl/rev140523/DataChangeProviderModule.java | 4 ++-- .../provider/impl/rev140523/DataChangeProviderModuleFactory.java | 4 ++-- .../provider/src/main/resources/initial/dataChange-provider.xml | 4 ++-- dmaap-listener/pom.xml | 5 +++-- dmaap-listener/src/assembly/assemble_zip.xml | 4 ++-- .../org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java | 4 ++-- .../onap/ccsdk/sli/northbound/dmaapclient/DummyDmaapConsumer.java | 4 ++-- .../ccsdk/sli/northbound/dmaapclient/InvalidMessageException.java | 4 ++-- .../onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java | 4 ++-- .../sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java | 4 ++-- .../onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java | 4 ++-- dmaap-listener/src/main/resources/log4j.properties | 4 ++-- dmaap-listener/src/main/scripts/start-dmaap-listener.sh | 4 ++-- dmaap-listener/src/main/scripts/stop-dmaap-listener.sh | 4 ++-- dmaap-listener/src/site/apt/index.apt | 4 ++-- dmaap-listener/src/site/site.xml | 4 ++-- pom.xml | 7 +++---- ueb-listener/pom.xml | 5 +++-- ueb-listener/src/assembly/assemble_zip.xml | 4 ++-- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java | 4 ++-- .../onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java | 4 ++-- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java | 4 ++-- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java | 4 ++-- ueb-listener/src/main/resources/log4j.properties | 4 ++-- ueb-listener/src/main/scripts/start-ueb-listener.sh | 4 ++-- ueb-listener/src/main/scripts/stop-ueb-listener.sh | 4 ++-- ueb-listener/src/site/apt/index.apt | 4 ++-- ueb-listener/src/site/site.xml | 4 ++-- 62 files changed, 129 insertions(+), 131 deletions(-) (limited to 'dmaap-listener/src/main/resources') diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 774d9e529..e6af34c57 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT asdcApi-features diff --git a/asdcApi/features/src/main/resources/features.xml b/asdcApi/features/src/main/resources/features.xml index f9aa81a66..9006f1b94 100644 --- a/asdcApi/features/src/main/resources/features.xml +++ b/asdcApi/features/src/main/resources/features.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index b4f32934a..32f505053 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 asdcApi org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT asdcApi-installer asdcApi - Karaf Installer diff --git a/asdcApi/installer/src/assembly/assemble_installer_zip.xml b/asdcApi/installer/src/assembly/assemble_installer_zip.xml index e278872a1..3bed4b5ef 100644 --- a/asdcApi/installer/src/assembly/assemble_installer_zip.xml +++ b/asdcApi/installer/src/assembly/assemble_installer_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml index 608200da1..5c24d73ff 100644 --- a/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/asdcApi/installer/src/main/resources/scripts/install-feature.sh b/asdcApi/installer/src/main/resources/scripts/install-feature.sh index 9a47d2225..e986764b9 100644 --- a/asdcApi/installer/src/main/resources/scripts/install-feature.sh +++ b/asdcApi/installer/src/main/resources/scripts/install-feature.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index b9f48326d..327b8627e 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -4,11 +4,11 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT bundle @@ -45,7 +45,7 @@ ${yang.file.directory} - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl ${salGeneratorPath} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index b4d538abd..9f8d906c3 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.sli.northbound sdnc-northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT pom org.onap.ccsdk.sli.northbound asdcApi - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index e8769fd7d..7b7ed4bee 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT asdcApi-provider bundle @@ -42,7 +42,7 @@ - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl ${salGeneratorPath} diff --git a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java index c6e1921b7..bd5f74a4f 100644 --- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java index 0fa90ea7e..5b268bc28 100644 --- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java index 6498f13b5..602b389cb 100644 --- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java index 0a2272d35..ddf8093fb 100644 --- a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java +++ b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java index c2d15b890..513e61cff 100644 --- a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java +++ b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml b/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml index 53f5a11d0..aefdec281 100644 --- a/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml +++ b/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 123404479..cd48d3f52 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -4,11 +4,11 @@ dataChange org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT jar diff --git a/dataChange/features/src/main/resources/features.xml b/dataChange/features/src/main/resources/features.xml index 9cc8cc57b..47cdcfd9f 100644 --- a/dataChange/features/src/main/resources/features.xml +++ b/dataChange/features/src/main/resources/features.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 63fda23ab..940144f53 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 dataChange org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT dataChange-installer dataChange - Karaf Installer diff --git a/dataChange/installer/src/assembly/assemble_installer_zip.xml b/dataChange/installer/src/assembly/assemble_installer_zip.xml index e278872a1..3bed4b5ef 100644 --- a/dataChange/installer/src/assembly/assemble_installer_zip.xml +++ b/dataChange/installer/src/assembly/assemble_installer_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml index 608200da1..5c24d73ff 100644 --- a/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dataChange/installer/src/main/resources/scripts/install-feature.sh b/dataChange/installer/src/main/resources/scripts/install-feature.sh index 9a47d2225..e986764b9 100644 --- a/dataChange/installer/src/main/resources/scripts/install-feature.sh +++ b/dataChange/installer/src/main/resources/scripts/install-feature.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 0d16ebfc0..20dddeb97 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -4,11 +4,11 @@ dataChange org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT bundle @@ -45,7 +45,7 @@ ${yang.file.directory} - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl ${salGeneratorPath} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 2e3d87494..90e22d219 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.sli.northbound sdnc-northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT pom org.onap.ccsdk.sli.northbound dataChange - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 5a7c7003d..c73c00980 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 dataChange org.onap.ccsdk.sli.northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT dataChange-provider bundle @@ -44,7 +43,7 @@ - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl ${salGeneratorPath} diff --git a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java index 81da74161..75cc0a02e 100644 --- a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java +++ b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java index 40d30a792..dcfbf6ee2 100644 --- a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java +++ b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java index f8267cf32..0655ae20a 100644 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java +++ b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java index 5852788c4..468989998 100644 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java +++ b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml index 3038201ba..2da0546aa 100644 --- a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml +++ b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 9ab23cdea..ac65c16f8 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -1,16 +1,17 @@ + 4.0.0 org.onap.ccsdk.sli.northbound jar dmaap-listener - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT DMAAP Listener DMAAP Listener org.onap.ccsdk.sli.northbound sdnc-northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT 1.1.7-SNAPSHOT diff --git a/dmaap-listener/src/assembly/assemble_zip.xml b/dmaap-listener/src/assembly/assemble_zip.xml index 15f6bf4d2..f8873ab41 100644 --- a/dmaap-listener/src/assembly/assemble_zip.xml +++ b/dmaap-listener/src/assembly/assemble_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java index b2976294b..91afe1d1a 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DummyDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DummyDmaapConsumer.java index a3bc46153..a8336342f 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DummyDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DummyDmaapConsumer.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/InvalidMessageException.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/InvalidMessageException.java index b54adaf06..cab8b901c 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/InvalidMessageException.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/InvalidMessageException.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java index f6d8ff862..c1320d6b4 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java index 0e2a32646..abd395bfb 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java index 4d16dd2a0..e31219a23 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/resources/log4j.properties b/dmaap-listener/src/main/resources/log4j.properties index ba815871b..8db00762b 100644 --- a/dmaap-listener/src/main/resources/log4j.properties +++ b/dmaap-listener/src/main/resources/log4j.properties @@ -2,8 +2,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/scripts/start-dmaap-listener.sh b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh index 5eeb62bbf..805105863 100644 --- a/dmaap-listener/src/main/scripts/start-dmaap-listener.sh +++ b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh b/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh index 42de474fb..61be1a141 100644 --- a/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh +++ b/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/site/apt/index.apt b/dmaap-listener/src/site/apt/index.apt index dd9d3ec39..370ddd4db 100644 --- a/dmaap-listener/src/site/apt/index.apt +++ b/dmaap-listener/src/site/apt/index.apt @@ -2,8 +2,8 @@ ~~ ============LICENSE_START======================================================= ~~ openECOMP : SDN-C ~~ ================================================================================ -~~ Copyright (C) 2017 ONAP Intellectual Property. All rights -~~ reserved. +~~ Copyright (C) 2017 AT&T Intellectual Property. All rights +~~ reserved. ~~ ================================================================================ ~~ Licensed under the Apache License, Version 2.0 (the "License"); ~~ you may not use this file except in compliance with the License. diff --git a/dmaap-listener/src/site/site.xml b/dmaap-listener/src/site/site.xml index 356c9c959..6b97d925e 100644 --- a/dmaap-listener/src/site/site.xml +++ b/dmaap-listener/src/site/site.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pom.xml b/pom.xml index 4d2bb2092..c0f7ac616 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,9 @@ - + org.onap.ccsdk.parent - odlparent-boron-sr3 + odlparent-carbon-sr1 0.0.1-SNAPSHOT @@ -113,7 +112,7 @@ AT&T - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index e0b96aaf4..5f8d5ca1b 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -1,16 +1,17 @@ + 4.0.0 org.onap.ccsdk.sli.northbound jar ueb-listener - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT UEB Listener UEB Listener org.onap.ccsdk.sli.northbound sdnc-northbound - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT 1.1.7-SNAPSHOT diff --git a/ueb-listener/src/assembly/assemble_zip.xml b/ueb-listener/src/assembly/assemble_zip.xml index d1f6679e1..97a229d2c 100644 --- a/ueb-listener/src/assembly/assemble_zip.xml +++ b/ueb-listener/src/assembly/assemble_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java index 3be906181..75b19cd2e 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java index d979a3206..4c08949c0 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java index 707eee7e4..1b6049278 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java index dcf668ed8..2fec84cb1 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java index 7bee801d2..821057ef3 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java index 86a4d2a25..3df27be6e 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java index fd304208c..1e6b19db0 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java index e8ffc3333..e19646e39 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java index bf0d5b823..3c561118e 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 76f015f9a..55814ac3a 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 @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java index cd79689b4..deed20cf4 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java index 7ae6c3107..3663c97c3 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/resources/log4j.properties b/ueb-listener/src/main/resources/log4j.properties index 670e48e11..f2f4ed26b 100644 --- a/ueb-listener/src/main/resources/log4j.properties +++ b/ueb-listener/src/main/resources/log4j.properties @@ -2,8 +2,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/scripts/start-ueb-listener.sh b/ueb-listener/src/main/scripts/start-ueb-listener.sh index db00726be..80ede3c8b 100644 --- a/ueb-listener/src/main/scripts/start-ueb-listener.sh +++ b/ueb-listener/src/main/scripts/start-ueb-listener.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/main/scripts/stop-ueb-listener.sh b/ueb-listener/src/main/scripts/stop-ueb-listener.sh index 2e3b4dd2b..cf110c5cc 100644 --- a/ueb-listener/src/main/scripts/stop-ueb-listener.sh +++ b/ueb-listener/src/main/scripts/stop-ueb-listener.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/site/apt/index.apt b/ueb-listener/src/site/apt/index.apt index dd9d3ec39..370ddd4db 100644 --- a/ueb-listener/src/site/apt/index.apt +++ b/ueb-listener/src/site/apt/index.apt @@ -2,8 +2,8 @@ ~~ ============LICENSE_START======================================================= ~~ openECOMP : SDN-C ~~ ================================================================================ -~~ Copyright (C) 2017 ONAP Intellectual Property. All rights -~~ reserved. +~~ Copyright (C) 2017 AT&T Intellectual Property. All rights +~~ reserved. ~~ ================================================================================ ~~ Licensed under the Apache License, Version 2.0 (the "License"); ~~ you may not use this file except in compliance with the License. diff --git a/ueb-listener/src/site/site.xml b/ueb-listener/src/site/site.xml index 356c9c959..6b97d925e 100644 --- a/ueb-listener/src/site/site.xml +++ b/ueb-listener/src/site/site.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -- cgit 1.2.3-korg From 4a8c2cb9920983f8b8af75be90f7511a59e923f5 Mon Sep 17 00:00:00 2001 From: Serban Popescu Date: Mon, 26 Mar 2018 13:36:17 +0000 Subject: Add Aai event listener Add support for Aai and Pserver incoming messages from Dmaap Change-Id: I57fedcaf6668d09189f0246571e8aaf515fc3fa0 Issue-ID: CCSDK-223 Signed-off-by: Serban Popescu --- dmaap-listener/pom.xml | 6 + dmaap-listener/src/assembly/assemble_zip.xml | 1 + .../dmaapclient/SdncAaiDmaapConsumer.java | 205 +++++++++++++++++++++ dmaap-listener/src/main/resources/pserver.map | 5 + .../src/main/resources/template-pserver.vt | 11 ++ .../dmaapclient/TestSdncPserverDmaapReceiver.java | 85 +++++++++ .../resources/dmaap-consumer-pserver.properties | 34 ++++ 7 files changed, 347 insertions(+) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java create mode 100644 dmaap-listener/src/main/resources/pserver.map create mode 100644 dmaap-listener/src/main/resources/template-pserver.vt create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java create mode 100644 dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index f6d04e247..3a75fef0b 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -20,6 +20,7 @@ 1.2.0-SNAPSHOT 2.9.0.pr1 + 1.7 true /opt/app/dmaap-listener 1.1.0-SNAPSHOT @@ -67,6 +68,11 @@ jackson-annotations ${fasterxml.jackson.version} + + org.apache.velocity + velocity + ${velocity.version} + junit junit diff --git a/dmaap-listener/src/assembly/assemble_zip.xml b/dmaap-listener/src/assembly/assemble_zip.xml index f8873ab41..632172d77 100644 --- a/dmaap-listener/src/assembly/assemble_zip.xml +++ b/dmaap-listener/src/assembly/assemble_zip.xml @@ -48,6 +48,7 @@ *.properties *.map + *.vt diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java new file mode 100644 index 000000000..4b695fcec --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java @@ -0,0 +1,205 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncAaiDmaapConsumer extends SdncDmaapConsumer { + + private static final Logger LOG = LoggerFactory.getLogger(SdncAaiDmaapConsumer.class); + private static final String SDNC_ENDPOINT = "SDNC.endpoint"; + private static final String TEMPLATE = "SDNC.template"; + private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + + private static final String AAI_EVENT = "AAI-EVENT"; + + private static final String EVENT_TYPE = "event-type"; + private static final String ENTITY_TYPE = "entity-type"; + private static final String EVENT_HEADER = "event-header"; + + private String rootDir; + + protected VelocityEngine velocityEngine; + + public SdncAaiDmaapConsumer() { + velocityEngine = new VelocityEngine(); + Properties props = new Properties(); + rootDir = System.getenv(DMAAPLISTENERROOT); + + if ((rootDir == null) || (rootDir.length() == 0)) { + rootDir = "/opt/app/dmaap-listener/lib/"; + } + else { + rootDir = rootDir + "/lib/"; + } + + props.put("file.resource.loader.path", rootDir); + velocityEngine.init(props); + } + + /* + * for testing purposes + */ + SdncAaiDmaapConsumer(Properties props) { + velocityEngine = new VelocityEngine(); + velocityEngine.init(props); + } + + protected String publish(String templatePath, String jsonString) throws IOException + { + JSONObject jsonObj = new JSONObject(jsonString); + VelocityContext context = new VelocityContext(); + for(Object key : jsonObj.keySet()) + { + context.put((String)key, jsonObj.get((String)key)); + } + + context.put("curr_time", Instant.now()); + + ObjectMapper oMapper = new ObjectMapper(); + + String rpcMsgbody = oMapper.writeValueAsString(jsonString); + context.put("full_message", rpcMsgbody); + + Writer writer = new StringWriter(); + velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); + writer.flush(); + + return writer.toString(); + } + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode aaiRootNode; + try { + aaiRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + JsonNode eventHeaderNode = aaiRootNode.get(EVENT_HEADER); + if(eventHeaderNode == null) { + LOG.info("Missing Event Header node."); + return; + } + JsonNode eventTypeNode = eventHeaderNode.get(EVENT_TYPE); + String eventType = eventTypeNode.textValue(); + + if(AAI_EVENT.equals(eventType) == false) { + LOG.info("Unknown Event Type {}", eventType); + return; + } + + JsonNode entityTypeNode = eventHeaderNode.get(ENTITY_TYPE); + String entityType = entityTypeNode.textValue(); + + String mapFilename = rootDir + entityType + ".map"; + Map fieldMap = loadMap(mapFilename); + if (fieldMap == null) { + throw new InvalidMessageException("Unable to process message - cannot load mapping file"); + } + + if (!fieldMap.containsKey(SDNC_ENDPOINT)) { + throw new InvalidMessageException("No SDNC endpoint known for message " + entityType); + } + String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); + + if (!fieldMap.containsKey(TEMPLATE)) { + throw new InvalidMessageException("No SDNC template known for message " + entityType); + } + String templateName = fieldMap.get(TEMPLATE); + + try { + String rpcMsgbody = publish(templateName, msg); + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); + + if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + sdncEndpoint, odlUser, odlPassword); + + conn.send("POST", "application/json", rpcMsgbody); + } else { + LOG.info("POST message body would be:\n" + rpcMsgbody); + } + } catch (Exception e) { + LOG.error("Unable to process message", e); + } + } + + private Map loadMap(String mapFilename) { + File mapFile = new File(mapFilename); + + if (!mapFile.canRead()) { + LOG.error(String.format("Cannot read map file (%s)", mapFilename)); + return null; + } + + Map results = new HashMap<>(); + try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { + + String curLine; + + while ((curLine = mapReader.readLine()) != null) { + curLine = curLine.trim(); + + if ((curLine.length() > 0) && (!curLine.startsWith("#")) && curLine.contains("=>")) { + String[] entry = curLine.split("=>"); + if (entry.length == 2) { + results.put(entry[0].trim(), entry[1].trim()); + } + } + } + mapReader.close(); + } catch (Exception e) { + LOG.error("Caught exception reading map " + mapFilename, e); + return null; + } + + return results; + } + +} diff --git a/dmaap-listener/src/main/resources/pserver.map b/dmaap-listener/src/main/resources/pserver.map new file mode 100644 index 000000000..8b3e463e7 --- /dev/null +++ b/dmaap-listener/src/main/resources/pserver.map @@ -0,0 +1,5 @@ +# SDN-C URL +SDNC.endpoint => config-selfservice-api:notification-callback + +# Field mapping +SDNC.template => template-pserver.vt diff --git a/dmaap-listener/src/main/resources/template-pserver.vt b/dmaap-listener/src/main/resources/template-pserver.vt new file mode 100644 index 000000000..1df659e09 --- /dev/null +++ b/dmaap-listener/src/main/resources/template-pserver.vt @@ -0,0 +1,11 @@ +{ + "input": { + "common-header": { + "request-id": "$event-header.id", + "timestamp": "$curr_time", + "originator-id": "AAI", + "api-ver": "2.00" + }, + "payload": $full_message + } +} \ No newline at end of file diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java new file mode 100644 index 000000000..db7cbd72c --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan. + * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna. + * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus. + * Vestibulum commodo. Ut rhoncus gravida arcu. + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.assertTrue; + +import java.util.Properties; + +import org.junit.Before; +import org.junit.Test; + +public class TestSdncPserverDmaapReceiver { + private static final String aaiInput = "{\r\n" + + " \"cambria.partition\": \"AAI\",\r\n" + + " \"event-header\": {\r\n" + + " \"severity\": \"NORMAL\",\r\n" + + " \"entity-type\": \"pserver\",\r\n" + + " \"top-entity-type\": \"pserver\",\r\n" + + " \"entity-link\": \"https://aai.com:8443/aai/v11/cloud-infrastructure/pservers/pserver/a3d3d3d3/\",\r\n" + + " \"event-type\": \"AAI-EVENT\",\r\n" + + " \"domain\": \"e2e\",\r\n" + + " \"action\": \"UPDATE\",\r\n" + + " \"sequence-number\": \"0\",\r\n" + + " \"id\": \"20170415000111-1234\",\r\n" + + " \"source-name\": \"testclient\",\r\n" + + " \"version\": \"v11\",\r\n" + + " \"timestamp\": \"20170415-00:01:11:979\"\r\n" + + " },\r\n" + + " \"entity\": {\r\n" + + " \"hostname\": \"host1\",\r\n" + + " \"ptnii-equip-name\": \"lat111\",\r\n" + + " \"equip-type\": \"server\",\r\n" + + " \"equip-vendor\": \"HP\",\r\n" + + " \"equip-model\": \"model1\",\r\n" + + " \"fqdn\": \"l.global.net\",\r\n" + + " \"ipv4-oam-address\": \"12.12.12.12\",\r\n" + + " \"in-maint\": false,\r\n" + + " \"resource-version\": \"11111111111\",\r\n" + + " \"purpose\": \"Gamma\",\r\n" + + " \"relationship-list\": {\r\n" + + " \"relationship\": [\r\n" + + " {\r\n" + + " \"related-to\": \"complex\",\r\n" + + " \"relationship-data\": [\r\n" + + " {\r\n" + + " \"relationship-value\": \"L1L2L3\",\r\n" + + " \"relationship-key\": \"complex.physical-location-id\"\r\n" + + " }\r\n" + + " ],\r\n" + + " \"related-link\": \"https://aai.com:8443/aai/v11/cloud-infrastructure/complexes/complex/cmpl1\"\r\n" + + " }\r\n" + + " ]\r\n" + + " },\r\n" + + " \"p-interfaces\": {\r\n" + + " \"p-interface\": []\r\n" + + " },\r\n" + + " \"lag-interfaces\": {\r\n" + + " \"lag-interface\": []\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + @Before + public void setUp() throws Exception { + } + + @Test + public void test() throws Exception { + Properties props = new Properties(); + + String rpcMsgbody = new SdncAaiDmaapConsumer(props).publish("src/main/resources/template-pserver.vt", aaiInput); + + assertTrue(rpcMsgbody.indexOf("input") != -1); + assertTrue(rpcMsgbody.indexOf("payload") != -1); + assertTrue(rpcMsgbody.indexOf("common-header") != -1); + } + + +} diff --git a/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties b/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties new file mode 100644 index 000000000..e3c4fdac8 --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties @@ -0,0 +1,34 @@ +TransportType=DME2 +Latitude =47.778998 +Longitude =-122.182883 +Version =1.0 +ServiceName =dmaap-v1.dev.dmaap.dt.saat.acsi.att.com/events +Environment =TEST +Partner = +SubContextPath =/ +Protocol =https +MethodType =GET +username =test +password =test +contenttype =application/json +authKey=ABC123 +authDate=2016-05-10T13:13:50-0700 +host=localhost:3904 +topic=ccsdk-topic +group=pserver +id=1 +timeout=20000 +limit=10000 +filter={"class":"Equals","field":"event-header.entity-type","value":"pserver"} +AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler +AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler +AFT_DME2_REQ_TRACE_ON=true +AFT_ENVIRONMENT=AFTUAT +AFT_DME2_EP_CONN_TIMEOUT=55000 +AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 +AFT_DME2_EP_READ_TIMEOUT_MS=50000 +sessionstickinessrequired=NO +DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt +sdnc.odl.user=admin +sdnc.odl.password=admin +sdnc.odl.url-base=http://localhost:8181/restconf/operations \ No newline at end of file -- cgit 1.2.3-korg From fa0fd7c1fe8dcb746cc8bdb9cc8d8e09ef10f7ad Mon Sep 17 00:00:00 2001 From: Serban Popescu Date: Wed, 28 Mar 2018 13:32:44 +0000 Subject: Add Aai event listener Add support for Aai and Pserver incoming messages from Dmaap Change-Id: I6ace2395476a1410ea3b7ffe0bebc1766d19e474 Issue-ID: CCSDK-223 Signed-off-by: Serban Popescu --- dmaap-listener/src/main/resources/generic-vnf.map | 5 ++++ .../src/main/resources/template-generic-vnf.vt | 15 ++++++++++ .../src/main/resources/template-pserver.vt | 4 +++ .../dmaapclient/TestSdncPserverDmaapReceiver.java | 20 +++++++++++-- .../dmaap-consumer-generic-vnf.properties | 34 ++++++++++++++++++++++ .../resources/dmaap-consumer-pserver.properties | 2 +- 6 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 dmaap-listener/src/main/resources/generic-vnf.map create mode 100644 dmaap-listener/src/main/resources/template-generic-vnf.vt create mode 100644 dmaap-listener/src/test/resources/dmaap-consumer-generic-vnf.properties (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/resources/generic-vnf.map b/dmaap-listener/src/main/resources/generic-vnf.map new file mode 100644 index 000000000..bc375eb28 --- /dev/null +++ b/dmaap-listener/src/main/resources/generic-vnf.map @@ -0,0 +1,5 @@ +# SDN-C URL +SDNC.endpoint => config-selfservice-api:notification-callback + +# Field mapping +SDNC.template => template-generic-vnf.vt diff --git a/dmaap-listener/src/main/resources/template-generic-vnf.vt b/dmaap-listener/src/main/resources/template-generic-vnf.vt new file mode 100644 index 000000000..c8a6b78ea --- /dev/null +++ b/dmaap-listener/src/main/resources/template-generic-vnf.vt @@ -0,0 +1,15 @@ +{ + "input": { + "common-header": { + "request-id": "$event-header.id", + "timestamp": "$curr_time", + "originator-id": "AAI", + "api-ver": "2.00" + }, + "action-identifiers": { + "action-name": "dmaap-notification", + "mode": "async" + }, + "payload": $full_message + } +} \ No newline at end of file diff --git a/dmaap-listener/src/main/resources/template-pserver.vt b/dmaap-listener/src/main/resources/template-pserver.vt index 1df659e09..c8a6b78ea 100644 --- a/dmaap-listener/src/main/resources/template-pserver.vt +++ b/dmaap-listener/src/main/resources/template-pserver.vt @@ -6,6 +6,10 @@ "originator-id": "AAI", "api-ver": "2.00" }, + "action-identifiers": { + "action-name": "dmaap-notification", + "mode": "async" + }, "payload": $full_message } } \ No newline at end of file diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java index db7cbd72c..b9b20a6cd 100644 --- a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java @@ -9,12 +9,16 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; import java.util.Properties; import org.junit.Before; import org.junit.Test; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + public class TestSdncPserverDmaapReceiver { private static final String aaiInput = "{\r\n" + " \"cambria.partition\": \"AAI\",\r\n" + @@ -75,10 +79,20 @@ public class TestSdncPserverDmaapReceiver { Properties props = new Properties(); String rpcMsgbody = new SdncAaiDmaapConsumer(props).publish("src/main/resources/template-pserver.vt", aaiInput); + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode aaiRootNode; + try { + aaiRootNode = oMapper.readTree(rpcMsgbody); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } - assertTrue(rpcMsgbody.indexOf("input") != -1); - assertTrue(rpcMsgbody.indexOf("payload") != -1); - assertTrue(rpcMsgbody.indexOf("common-header") != -1); + assertTrue(aaiRootNode.get("input").get("payload") != null); + assertTrue(aaiRootNode.get("input").get("common-header") != null); + + assertEquals(aaiRootNode.get("input").get("action-identifiers").get("action-name").textValue(), "dmaap-notification"); + assertEquals(aaiRootNode.get("input").get("action-identifiers").get("mode").textValue(), "async"); } diff --git a/dmaap-listener/src/test/resources/dmaap-consumer-generic-vnf.properties b/dmaap-listener/src/test/resources/dmaap-consumer-generic-vnf.properties new file mode 100644 index 000000000..710a7c7c9 --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-consumer-generic-vnf.properties @@ -0,0 +1,34 @@ +TransportType=DME2 +Latitude =47.778998 +Longitude =-122.182883 +Version =1.0 +ServiceName =dmaap-v1.dev.dmaap.dt.saat.acsi.att.com/events +Environment =TEST +Partner = +SubContextPath =/ +Protocol =https +MethodType =GET +username =test +password =test +contenttype =application/json +authKey=ABC123 +authDate=2016-05-10T13:13:50-0700 +host=localhost:3904 +topic=AAI-EVENT +group=vnf +id=1 +timeout=20000 +limit=10000 +filter={"class":"And","filters":[{"class":"Equals","field":"event-header.entity-type","value":"generic-vnf"},{"class":"Equals","field":"entity.vnf-type","value":"kvm-vpe"}]} +AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler +AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler +AFT_DME2_REQ_TRACE_ON=true +AFT_ENVIRONMENT=AFTUAT +AFT_DME2_EP_CONN_TIMEOUT=55000 +AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 +AFT_DME2_EP_READ_TIMEOUT_MS=50000 +sessionstickinessrequired=NO +DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt +sdnc.odl.user=admin +sdnc.odl.password=admin +sdnc.odl.url-base=http://localhost:8181/restconf/operations \ No newline at end of file diff --git a/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties b/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties index e3c4fdac8..9f5cfe71f 100644 --- a/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties +++ b/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties @@ -14,7 +14,7 @@ contenttype =application/json authKey=ABC123 authDate=2016-05-10T13:13:50-0700 host=localhost:3904 -topic=ccsdk-topic +topic=AAI-EVENT group=pserver id=1 timeout=20000 -- cgit 1.2.3-korg From d3dff0bc0832ea02f53bd952ea9c180f8df94580 Mon Sep 17 00:00:00 2001 From: Serban Popescu Date: Wed, 28 Mar 2018 16:43:24 +0000 Subject: Add Aai event listener Add support for Aai and Pserver incoming messages from Dmaap Change-Id: Ie799cb57f5c00eed70c9f6fd30825f907962a094 Issue-ID: CCSDK-226 Signed-off-by: Serban Popescu --- .../onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java | 5 ++++- dmaap-listener/src/main/resources/template-generic-vnf.vt | 6 +----- dmaap-listener/src/main/resources/template-pserver.vt | 6 +----- .../sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java | 3 --- 4 files changed, 6 insertions(+), 14 deletions(-) (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java index 4b695fcec..0e12dfa2e 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java @@ -90,6 +90,9 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumer { { context.put((String)key, jsonObj.get((String)key)); } + + String id = jsonObj.getJSONObject(EVENT_HEADER).get("id").toString(); + context.put("req_id", id); context.put("curr_time", Instant.now()); @@ -159,7 +162,7 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumer { String odlPassword = getProperty("sdnc.odl.password"); if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { - SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + sdncEndpoint, odlUser, odlPassword); + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword); conn.send("POST", "application/json", rpcMsgbody); } else { diff --git a/dmaap-listener/src/main/resources/template-generic-vnf.vt b/dmaap-listener/src/main/resources/template-generic-vnf.vt index c8a6b78ea..d57c9a0a4 100644 --- a/dmaap-listener/src/main/resources/template-generic-vnf.vt +++ b/dmaap-listener/src/main/resources/template-generic-vnf.vt @@ -1,15 +1,11 @@ { "input": { "common-header": { - "request-id": "$event-header.id", + "request-id": "$req_id", "timestamp": "$curr_time", "originator-id": "AAI", "api-ver": "2.00" }, - "action-identifiers": { - "action-name": "dmaap-notification", - "mode": "async" - }, "payload": $full_message } } \ No newline at end of file diff --git a/dmaap-listener/src/main/resources/template-pserver.vt b/dmaap-listener/src/main/resources/template-pserver.vt index c8a6b78ea..d57c9a0a4 100644 --- a/dmaap-listener/src/main/resources/template-pserver.vt +++ b/dmaap-listener/src/main/resources/template-pserver.vt @@ -1,15 +1,11 @@ { "input": { "common-header": { - "request-id": "$event-header.id", + "request-id": "$req_id", "timestamp": "$curr_time", "originator-id": "AAI", "api-ver": "2.00" }, - "action-identifiers": { - "action-name": "dmaap-notification", - "mode": "async" - }, "payload": $full_message } } \ No newline at end of file diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java index ec01df534..11201265d 100644 --- a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java @@ -9,7 +9,6 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; import java.io.File; import java.io.IOException; @@ -98,8 +97,6 @@ public class TestSdncPserverDmaapReceiver { assertTrue(aaiRootNode.get("input").get("payload") != null); assertTrue(aaiRootNode.get("input").get("common-header") != null); - assertEquals(aaiRootNode.get("input").get("action-identifiers").get("action-name").textValue(), "dmaap-notification"); - assertEquals(aaiRootNode.get("input").get("action-identifiers").get("mode").textValue(), "async"); } @Test -- cgit 1.2.3-korg From be74be10e66d9a5d127c6280f802ef173dbf17de Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Thu, 19 Jul 2018 15:11:17 +0530 Subject: Added dmaap consumer for esr-thirdparty AAI events Modified SdncAaiDmaapConsumer.java to handle AAI EVENT for esr-thirdparty-sdnc and template Change-Id: I8aaa2e649a722d8d51f0b3329c94541396fde96b Issue-ID: CCSDK-389 Signed-off-by: shashikanth.vh --- .../dmaapclient/SdncAaiDmaapConsumer.java | 154 +++++++++++++++------ .../src/main/resources/esr-thirdparty-sdnc.map | 5 + .../main/resources/template-esr-thirdparty-sdnc.vt | 100 +++++++++++++ .../dmaapclient/TestSdncEsrDmaapReceiver.java | 140 +++++++++++++++++++ .../dmaap-consumer-esrsysteminfo.properties | 34 +++++ .../src/test/resources/dmaap-listener.properties | 2 +- 6 files changed, 391 insertions(+), 44 deletions(-) create mode 100644 dmaap-listener/src/main/resources/esr-thirdparty-sdnc.map create mode 100644 dmaap-listener/src/main/resources/template-esr-thirdparty-sdnc.vt create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java create mode 100644 dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java index 2c4de7104..be2e36c1a 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java @@ -3,14 +3,14 @@ * openECOMP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,6 +33,7 @@ import java.util.Map; import java.util.Properties; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; +import org.json.JSONArray; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,66 +47,133 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { private static final String TEMPLATE = "SDNC.template"; private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + private static final String ESR_SYSTEM_INFO = "esr-system-info"; + private static final String RELATIONSHIP_LIST = "relationship-list"; + private static final String ESR_SYSTEM_INFO_LIST = "esr-system-info-list"; private static final String AAI_EVENT = "AAI-EVENT"; - + private static final String EVENT_TYPE = "event-type"; + private static final String ENTITY = "entity"; private static final String ENTITY_TYPE = "entity-type"; private static final String EVENT_HEADER = "event-header"; - + private String rootDir; protected VelocityEngine velocityEngine; - + public SdncAaiDmaapConsumer() { velocityEngine = new VelocityEngine(); - Properties props = new Properties(); + Properties props = new Properties(); rootDir = System.getenv(DMAAPLISTENERROOT); if ((rootDir == null) || (rootDir.length() == 0)) { - rootDir = "/opt/app/dmaap-listener/lib/"; + rootDir = "/opt/app/dmaap-listener/lib/"; } else { - rootDir = rootDir + "/lib/"; + rootDir = rootDir + "/lib/"; } - - props.put("file.resource.loader.path", rootDir); + + props.put("file.resource.loader.path", rootDir); velocityEngine.init(props); } - + /* * for testing purposes */ SdncAaiDmaapConsumer(Properties props) { - velocityEngine = new VelocityEngine(); + velocityEngine = new VelocityEngine(); velocityEngine.init(props); } - + protected String publish(String templatePath, String jsonString) throws IOException - { - JSONObject jsonObj = new JSONObject(jsonString); - VelocityContext context = new VelocityContext(); - for(Object key : jsonObj.keySet()) - { - context.put((String)key, jsonObj.get((String)key)); - } - - String id = jsonObj.getJSONObject(EVENT_HEADER).get("id").toString(); - context.put("req_id", id); - - context.put("curr_time", Instant.now()); - - ObjectMapper oMapper = new ObjectMapper(); - - String rpcMsgbody = oMapper.writeValueAsString(jsonString); - context.put("full_message", rpcMsgbody); - - Writer writer = new StringWriter(); - velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); - writer.flush(); - - return writer.toString(); + { + if (templatePath.contains("esr-thirdparty-sdnc")){ + return publishEsrThirdPartySdnc(templatePath, jsonString); + } else { + return publishFullMessage(templatePath, jsonString); + } + } + + private String publishFullMessage(String templatePath, String jsonString) throws IOException + { + JSONObject jsonObj = new JSONObject(jsonString); + VelocityContext context = new VelocityContext(); + for(Object key : jsonObj.keySet()) + { + context.put((String)key, jsonObj.get((String)key)); + } + + String id = jsonObj.getJSONObject(EVENT_HEADER).get("id").toString(); + context.put("req_id", id); + + context.put("curr_time", Instant.now()); + + ObjectMapper oMapper = new ObjectMapper(); + + String rpcMsgbody = oMapper.writeValueAsString(jsonString); + context.put("full_message", rpcMsgbody); + + Writer writer = new StringWriter(); + velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); + writer.flush(); + + return writer.toString(); + } + + private String publishEsrThirdPartySdnc(String templatePath, String jsonString) throws IOException + { + JSONObject jsonObj = new JSONObject(jsonString); + VelocityContext context = new VelocityContext(); + + JSONObject eventHeader = jsonObj.getJSONObject(EVENT_HEADER); + for(Object key : eventHeader.keySet()) + { + if (!key.equals("action")) { + context.put(((String)key).replaceAll("-", ""), eventHeader.get((String)key)); + } else { + String action = (String) eventHeader.get((String) key); + context.put((String)key, action.substring(0,1).toUpperCase() + + action.substring(1).toLowerCase()); + } + } + + JSONObject entityObj = jsonObj.getJSONObject(ENTITY); + for(Object key : entityObj.keySet()) + { + switch((String)key) + { + case ESR_SYSTEM_INFO_LIST : + JSONArray esrSystemInfo = entityObj.getJSONObject((String)key) + .getJSONArray(ESR_SYSTEM_INFO); + + for (int i = 0; i < esrSystemInfo.length(); i++) { + JSONObject objects = esrSystemInfo.getJSONObject(i); + + for (Object name : objects.keySet()) { + context.put(((String)name).replaceAll("-", ""), + objects.get((String)name).toString()); + } + } + break; + + case RELATIONSHIP_LIST : + //convertion not required for relationship + break; + + default : + context.put(((String)key).replaceAll("-", ""), + entityObj.get((String)key).toString()); + break; + } + } + + Writer writer = new StringWriter(); + velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); + writer.flush(); + + return writer.toString(); } - + @Override public void processMsg(String msg) throws InvalidMessageException { @@ -171,14 +239,14 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { } } - private Map loadMap(String mapFilename) { - File mapFile = new File(mapFilename); + private Map loadMap(String mapFilename) { + File mapFile = new File(mapFilename); if (!mapFile.canRead()) { LOG.error(String.format("Cannot read map file (%s)", mapFilename)); return null; } - + Map results = new HashMap<>(); try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { @@ -199,8 +267,8 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { LOG.error("Caught exception reading map " + mapFilename, e); return null; } - + return results; - } + } } diff --git a/dmaap-listener/src/main/resources/esr-thirdparty-sdnc.map b/dmaap-listener/src/main/resources/esr-thirdparty-sdnc.map new file mode 100644 index 000000000..603645ebe --- /dev/null +++ b/dmaap-listener/src/main/resources/esr-thirdparty-sdnc.map @@ -0,0 +1,5 @@ +# SDN-C URL +SDNC.endpoint => DataChange:data-change-notification + +# Field mapping +SDNC.template => template-esr-thirdparty-sdnc.vt diff --git a/dmaap-listener/src/main/resources/template-esr-thirdparty-sdnc.vt b/dmaap-listener/src/main/resources/template-esr-thirdparty-sdnc.vt new file mode 100644 index 000000000..225fce026 --- /dev/null +++ b/dmaap-listener/src/main/resources/template-esr-thirdparty-sdnc.vt @@ -0,0 +1,100 @@ +{ + "DataChange:input": { + "DataChange:aai-node-type": "$entitytype", + "DataChange:selflink": "$entitylink", + "DataChange:aai-event-id": "$id", + "DataChange:aai-event-trigger": "$action", + "DataChange:key-data": [{ + "DataChange:key-name": "thirdparty-sdnc-id", + "DataChange:key-value": "$thirdpartysdncid" + }, + { + "DataChange:key-name": "resource-version", + "DataChange:key-value": "$resourceversion" + }, + { + "DataChange:key-name": "location", + "DataChange:key-value": "$location" + }, + { + "DataChange:key-name": "product-name", + "DataChange:key-value": "$productname" + }, + { + "DataChange:key-name": "esr-system-info-id", + "DataChange:key-value": "$esrsysteminfoid" + }, + { + "DataChange:key-name": "system-type", + "DataChange:key-value": "$systemtype" + }, + { + "DataChange:key-name": "service-url", + "DataChange:key-value": "$serviceurl" + }, + { + "DataChange:key-name": "ssl-cacert", + "DataChange:key-value": "$sslcacert" + }, + { + "DataChange:key-name": "type", + "DataChange:key-value": "$type" + }, + { + "DataChange:key-name": "ssl-insecure", + "DataChange:key-value": "$sslinsecure" + }, + { + "DataChange:key-name": "system-status", + "DataChange:key-value": "$systemstatus" + }, + { + "DataChange:key-name": "version", + "DataChange:key-value": "$version" + }, + { + "DataChange:key-name": "passive", + "DataChange:key-value": "$passive" + }, + { + "DataChange:key-name": "password", + "DataChange:key-value": "$password" + }, + { + "DataChange:key-name": "protocol", + "DataChange:key-value": "$protocol" + }, + { + "DataChange:key-name": "ip-address", + "DataChange:key-value": "$ipaddress" + }, + { + "DataChange:key-name": "cloud-domain", + "DataChange:key-value": "$clouddomain" + }, + { + "DataChange:key-name": "user-name", + "DataChange:key-value": "$username" + }, + { + "DataChange:key-name": "system-name", + "DataChange:key-value": "$systemname" + }, + { + "DataChange:key-name": "port", + "DataChange:key-value": "$port" + }, + { + "DataChange:key-name": "vendor", + "DataChange:key-value": "$vendor" + }, + { + "DataChange:key-name": "remote-path", + "DataChange:key-value": "$remotepath" + }, + { + "DataChange:key-name": "default-tenant", + "DataChange:key-value": "$defaulttenant" + }] + } +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java new file mode 100644 index 000000000..623c96426 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java @@ -0,0 +1,140 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import org.apache.commons.io.FileUtils; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.Properties; + +public class TestSdncEsrDmaapReceiver { + static String aaiInput = "{\"cambria.partition\":\"AAI\",\n" + + " \"event-header\":\n" + + " {\n" + + " \"severity\":\"NORMAL\",\n" + + " \"entity-type\":\"esr-thirdparty-sdnc\",\n" + + " \"top-entity-type\":\"esr-thirdparty-sdnc\",\n" + + " \"entity-link\":\"aai/v11/external-system/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/IP-WAN-Controller-1\",\n" + + " \"event-type\":\"AAI-EVENT\",\n" + + " \"domain\":\"dev\",\n" + + " \"action\":\"UPDATE\",\n" + + " \"sequence-number\":\"0\",\n" + + " \"id\":\"bf4df797-759a-4684-a63c-393b7d40ed55\",\n" + + " \"source-name\":\"postman\",\n" + + " \"version\":\"v11\",\n" + + " \"timestamp\":\"20180104-09:57:58:721\"\n" + + " },\n" + + " \"entity\":\n" + + " {\n" + + " \"thirdparty-sdnc-id\":\"IP-WAN-Controller-1\",\n" + + " \"relationship-list\":\n" + + " {\n" + + " \"relationship\":\n" + + " [\n" + + " {\n" + + " \"related-to\":\"pnf\",\n" + + " \"relationship-data\":\n" + + " [\n" + + " {\n" + + " \"relationship-value\":\"a8098c1a-f86e-11da-bd1a-00112444be1e\",\n" + + " \"relationship-key\":\"pnf.pnf-name\"\n" + + " }\n" + + " ],\n" + + " \"related-link\":\"aai/v11/network/pnfs/pnf/a8098c1a-f86e-11da-bd1a-00112444be1e\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"resource-version\":\"1515059878654\",\n" + + " \"location\":\"Core\",\n" + + " \"product-name\":\"AC-WAN\",\n" + + " \"esr-system-info-list\":\n" + + " {\"esr-system-info\":\n" + + " [\n" + + " {\n" + + " \"esr-system-info-id\":\"IP-WAN-Controller-ESR-1\",\n" + + " \"system-type\":\"example-system-type-val-12078\",\n" + + " \"service-url\":\"https://182.2.61.24:18002\",\n" + + " \"ssl-cacert\":\"example-ssl-cacert-val-20589\",\n" + + " \"type\":\"WAN\",\n" + + " \"ssl-insecure\":true,\n" + + " \"system-status\":\"example-system-status-val-23435\",\n" + + " \"version\":\"V3R1\",\n" + + " \"passive\":true,\n" + + " \"password\":\"Admin@12345\",\n" + + " \"protocol\":\"RESTCONF\",\n" + + " \"ip-address\":\"182.2.61.24\",\n" + + " \"cloud-domain\":\"example-cloud-domain-val-76077\",\n" + + " \"user-name\":\"admin\",\n" + + " \"system-name\":\"IP-WAN-Controller\",\n" + + " \"port\":\"18002\",\n" + + " \"vendor\":\"IP-WAN\",\n" + + " \"resource-version\":\"1515059878666\",\n" + + " \"remote-path\":\"example-remotepath-val-5833\",\n" + + " \"default-tenant\":\"example-default-tenant-val-71148\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " }"; + + @Test + public void testProcessMsgInvalidEventType() throws Exception { + String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + File directory = new File("lib"); + + if (! directory.exists()){ + directory.mkdir(); + } + + File source = new File("src/main/resources"); + File dest = new File("lib/"); + try { + FileUtils.copyDirectory(source, dest); + } catch (IOException e) { + e.printStackTrace(); + } + + try { + Map env = System.getenv(); + Class cl = env.getClass(); + Field field = cl.getDeclaredField("m"); + field.setAccessible(true); + Map writableEnv = (Map) field.get(env); + writableEnv.put(DMAAPLISTENERROOT, "."); + } catch (Exception e) { + throw new IllegalStateException("Failed to set environment variable", e); + } + Properties props = new Properties(); + InputStream propStr = TestSdncEsrDmaapReceiver.class.getResourceAsStream("/dmaap-consumer-esrsysteminfo.properties"); + + props.load(propStr); + + SdncAaiDmaapConsumer consumer = new SdncAaiDmaapConsumer(); + + consumer.init(props, "src/test/resources/dmaap-consumer-esrsysteminfo.properties"); + consumer.processMsg(aaiInput); + } +} diff --git a/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties b/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties new file mode 100644 index 000000000..9f5cfe71f --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties @@ -0,0 +1,34 @@ +TransportType=DME2 +Latitude =47.778998 +Longitude =-122.182883 +Version =1.0 +ServiceName =dmaap-v1.dev.dmaap.dt.saat.acsi.att.com/events +Environment =TEST +Partner = +SubContextPath =/ +Protocol =https +MethodType =GET +username =test +password =test +contenttype =application/json +authKey=ABC123 +authDate=2016-05-10T13:13:50-0700 +host=localhost:3904 +topic=AAI-EVENT +group=pserver +id=1 +timeout=20000 +limit=10000 +filter={"class":"Equals","field":"event-header.entity-type","value":"pserver"} +AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler +AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler +AFT_DME2_REQ_TRACE_ON=true +AFT_ENVIRONMENT=AFTUAT +AFT_DME2_EP_CONN_TIMEOUT=55000 +AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 +AFT_DME2_EP_READ_TIMEOUT_MS=50000 +sessionstickinessrequired=NO +DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt +sdnc.odl.user=admin +sdnc.odl.password=admin +sdnc.odl.url-base=http://localhost:8181/restconf/operations \ No newline at end of file diff --git a/dmaap-listener/src/test/resources/dmaap-listener.properties b/dmaap-listener/src/test/resources/dmaap-listener.properties index ed180e515..defef0b43 100755 --- a/dmaap-listener/src/test/resources/dmaap-listener.properties +++ b/dmaap-listener/src/test/resources/dmaap-listener.properties @@ -1 +1 @@ -subscriptions=org.onap.ccsdk.sli.northbound.dmaapclient.DummyDmaapConsumer:dmaap-consumer-1.properties \ No newline at end of file +subscriptions=org.onap.ccsdk.sli.northbound.dmaapclient.DummyDmaapConsumer:dmaap-consumer-1.properties;org.onap.ccsdk.sli.northbound.dmaapclient.SdncAaiDmaapConsumer:dmaap-consumer-esrsysteminfo.properties \ No newline at end of file -- cgit 1.2.3-korg From b1cc7a21099f81395a51d63192c976bdc683e616 Mon Sep 17 00:00:00 2001 From: "Stilwell, David (stilwelld)" Date: Mon, 25 Mar 2019 17:01:04 +0000 Subject: Updated edgeRouterStatusChange.map Changes-made: Added additional entries to edgeRouterStatusChange.map Change-Id: I7e7c42d6a4b292b76758fd8cfccf7a091daa016e Issue-ID: CCSDK-1179 Signed-off-by: Stilwell, David (stilwelld) --- .../src/main/resources/edgeRouterStatusChange.map | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/resources/edgeRouterStatusChange.map b/dmaap-listener/src/main/resources/edgeRouterStatusChange.map index 57644bbd5..fa5ff0784 100644 --- a/dmaap-listener/src/main/resources/edgeRouterStatusChange.map +++ b/dmaap-listener/src/main/resources/edgeRouterStatusChange.map @@ -20,4 +20,25 @@ inms_list => inms-list encrypted_access_flag => encrypted-access-flag sw_name => sw-name nmipaddr => nm-addr -function_code => function-code \ No newline at end of file +function_code => function-code + +EquipmentId => equip-id +PTNIIEquipmentName => equip-name +EquipmentType => equip-type +Loopback0 => loopback0 +RouterStatus => prov-status +Region => region +CountryAbbreviation => country +EquipmentNameCode => equip-name-code +ASNumber => as-number +SoftwareName => sw-name +NetworkManagementIPAddress => nm-addr +FunctionCode => function-code +Loopback1 => loopback1 +Loopback2 => loopback2 +Loopback3 => loopback3 +Loopback40 => loopback40 +Loopback65535 => loopback65535 +InmsList => inms-list +EncryptedAccessFlag => encrypted-access-flag + -- cgit 1.2.3-korg From cd1d3ffe4a39154f6bef75108635761828907dd9 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Wed, 10 Apr 2019 21:15:13 -0500 Subject: DMAAP Listener support for SDNR OOF PCI DMAAP Consumer JAVA files and resources (.map, .vt) Change-Id: I0027d3f092afc4b89aed1cc756a62d5eb169f5c3 Issue-ID: CCSDK-1216 Signed-off-by: SandeepLinux --- .../ANRChangesFromPolicyToSDNRDmaapConsumer.java | 343 +++++++++++++++++++++ .../PciChangesFromPolicyToSDNRDmaapConsumer.java | 314 +++++++++++++++++++ .../resources/anr-changes-from-policy-to-sdnr.map | 5 + .../anr-pci-changes-from-policy-to-sndr.vt | 8 + .../resources/pci-changes-from-policy-to-sdnr.map | 5 + 5 files changed, 675 insertions(+) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/ANRChangesFromPolicyToSDNRDmaapConsumer.java create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java create mode 100644 dmaap-listener/src/main/resources/anr-changes-from-policy-to-sdnr.map create mode 100644 dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt create mode 100644 dmaap-listener/src/main/resources/pci-changes-from-policy-to-sdnr.map (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/ANRChangesFromPolicyToSDNRDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/ANRChangesFromPolicyToSDNRDmaapConsumer.java new file mode 100644 index 000000000..5bc2c6011 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/ANRChangesFromPolicyToSDNRDmaapConsumer.java @@ -0,0 +1,343 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.json.JSONArray; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class ANRChangesFromPolicyToSDNRDmaapConsumer extends SdncDmaapConsumerImpl { + + private static final Logger LOG = LoggerFactory.getLogger(ANRChangesFromPolicyToSDNRDmaapConsumer.class); + private static final String SDNC_ENDPOINT = "SDNC.endpoint"; + private static final String TEMPLATE = "SDNC.template"; + private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + + private static final String PARAMETER_NAME = "parameter-name"; + private static final String STRING_VALUE = "string-value"; + 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 EVENT_HEADER = "event-header"; + private static final String ACTION = "Action"; + private static final String PAYLOAD = "Payload"; + private static final String CONFIGURATIONS = "Configurations"; + private static final String MODIFY_CONFIG_ANR = "ModifyConfigANR"; + private static final String MAP_FILE_NAME = "anr-changes-from-policy-to-sdnr"; + private static final String DATA = "data"; + private static final String FAP_SERVICE = "FAPService"; + private static final String SLI_PARAMETERS = "sli_parameters"; + private static final String RPC_NAME = "rpc-name"; + private static final String BODY = "body"; + private static final String INPUT = "input"; + + private String rootDir; + + protected VelocityEngine velocityEngine; + + public ANRChangesFromPolicyToSDNRDmaapConsumer() { + velocityEngine = new VelocityEngine(); + Properties props = new Properties(); + rootDir = System.getenv(DMAAPLISTENERROOT); + + if ((rootDir == null) || (rootDir.length() == 0)) { + rootDir = "/opt/app/dmaap-listener/lib/"; + } + else { + rootDir = rootDir + "/lib/"; + } + + props.put("file.resource.loader.path", rootDir); + velocityEngine.init(props); + } + + /* + * for testing purposes + */ + ANRChangesFromPolicyToSDNRDmaapConsumer(Properties props) { + velocityEngine = new VelocityEngine(); + velocityEngine.init(props); + } + + protected String publish(String templatePath, String jsonString, JsonNode dataNode) throws IOException, InvalidMessageException + { + if (templatePath.contains("anr-pci-changes-from-policy-to-sdnr")){ + return publishANRChangesFromPolicyToSDNR(templatePath, dataNode); + } else { + return publishFullMessage(templatePath, jsonString); + } + } + + private String publishFullMessage(String templatePath, String jsonString) throws IOException + { + JSONObject jsonObj = new JSONObject(jsonString); + VelocityContext context = new VelocityContext(); + for(Object key : jsonObj.keySet()) + { + context.put((String)key, jsonObj.get((String)key)); + } + + String id = jsonObj.getJSONObject(EVENT_HEADER).get("id").toString(); + context.put("req_id", id); + + context.put("curr_time", Instant.now()); + + ObjectMapper oMapper = new ObjectMapper(); + + String rpcMsgbody = oMapper.writeValueAsString(jsonString); + context.put("full_message", rpcMsgbody); + + Writer writer = new StringWriter(); + velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); + writer.flush(); + + return writer.toString(); + } + + private String publishANRChangesFromPolicyToSDNR(String templatePath, JsonNode dataNode) throws IOException, InvalidMessageException + { + VelocityContext context = new VelocityContext(); + + String RPC_NAME_KEY_IN_VT = "rpc_name"; + String RPC_NAME_VALUE_IN_VT = "generic-neighbor-configuration"; + + String CELL_CONFIG = "CellConfig"; + String ALIAS_LABEL = "alias"; + String LTE = "LTE"; + String RAN = "RAN"; + String LTE_CELL = "LTECell"; + String NEIGHBOR_LIST_IN_USE = "NeighborListInUse"; + + JSONObject numberOfEntries = new JSONObject(); + JSONObject alias = new JSONObject(); + JSONArray sliParametersArray = new JSONArray(); + + String aliasValue = dataNode.get(DATA).get(FAP_SERVICE).get(ALIAS_LABEL).textValue(); + + JsonNode nbrListInUse = dataNode.get(DATA).get(FAP_SERVICE).get(CELL_CONFIG).get(LTE).get(RAN).get(NEIGHBOR_LIST_IN_USE).get(LTE_CELL); + + int entryCount = 0; + + 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"))); + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"cid") + .put(STRING_VALUE, lteCell.get("CID"))); + 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"))); + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"pnf-name") + .put(STRING_VALUE, lteCell.get("PNFName"))); + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT_NEIGHBOR_LIST_IN_USE+"["+entryCount+"]."+"blacklisted") + .put(STRING_VALUE, lteCell.get("Blacklisted"))); + + entryCount++; + } + + alias.put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT+ALIAS_LABEL); + alias.put(STRING_VALUE, aliasValue); + + numberOfEntries.put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT+"number-of-neighbor-cell-entries"); + numberOfEntries.put(STRING_VALUE, entryCount); + + sliParametersArray.put(alias); + sliParametersArray.put(numberOfEntries); + + context.put(SLI_PARAMETERS, sliParametersArray); + + context.put(RPC_NAME_KEY_IN_VT, RPC_NAME_VALUE_IN_VT); + + Writer writer = new StringWriter(); + velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); + writer.flush(); + + return writer.toString(); + + }else { + throw new InvalidMessageException("nbrListInUse is not of Type Array. Could not read neighbor list elements"); + } + + } + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode anrChangesRootNode; + try { + anrChangesRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + JsonNode rpcname = anrChangesRootNode.get(RPC_NAME); + if(rpcname == null) { + LOG.info("Missing rpc-name node."); + return; + } + + if(!MODIFY_CONFIG_ANR.toLowerCase().equals(rpcname.textValue())) { + LOG.info("Unknown rpc name {}", rpcname); + return; + } + + JsonNode body = anrChangesRootNode.get(BODY); + if(body == null) { + LOG.info("Missing body node."); + return; + } + + JsonNode input = body.get(INPUT); + if(input == null) { + LOG.info("Missing input node."); + return; + } + + JsonNode action = input.get(ACTION); + if(action == null) { + LOG.info("Missing action node."); + return; + } + + if(!MODIFY_CONFIG_ANR.equals(action.textValue())) { + LOG.info("Unknown Action {}", action); + return; + } + + JsonNode payload = input.get(PAYLOAD); + if(payload == null) { + LOG.info("Missing payload node."); + return; + } + + String payloadText = payload.asText(); + + if(!payloadText.contains(CONFIGURATIONS)) { + LOG.info("Missing configurations node."); + return; + } + + JsonNode configurationsJsonNode; + try { + configurationsJsonNode = oMapper.readTree(payloadText); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse payload value", e); + } + + String mapFilename = rootDir + MAP_FILE_NAME + ".map"; + Map fieldMap = loadMap(mapFilename); + if (fieldMap == null) { + return; + } + + if (!fieldMap.containsKey(SDNC_ENDPOINT)) { + return; + } + String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); + + if (!fieldMap.containsKey(TEMPLATE)) { + throw new InvalidMessageException("No SDNC template known for message "); + } + String templateName = fieldMap.get(TEMPLATE); + + JsonNode configurations = configurationsJsonNode.get(CONFIGURATIONS); + + if(configurations.isArray()) { + for(JsonNode dataNode:configurations) { + if(dataNode.get(DATA).get(FAP_SERVICE) == null) { + LOG.info("Could not make a rpc call. Missing fapService node for dataNode element::", dataNode.textValue()); + }else { + try { + + String rpcMsgbody = publish(templateName, msg, dataNode); + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); + + if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword); + + conn.send("POST", "application/json", rpcMsgbody); + } else { + LOG.info("POST message body would be:\n" + rpcMsgbody); + } + } catch (Exception e) { + LOG.error("Unable to process message", e); + } + } + } + }else { + throw new InvalidMessageException("Configurations is not of Type Array. Could not read configuration changes"); + } + } + + private Map loadMap(String mapFilename) { + File mapFile = new File(mapFilename); + + if (!mapFile.canRead()) { + LOG.error(String.format("Cannot read map file (%s)", mapFilename)); + return null; + } + + Map results = new HashMap<>(); + try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { + + String curLine; + + while ((curLine = mapReader.readLine()) != null) { + curLine = curLine.trim(); + + if ((curLine.length() > 0) && (!curLine.startsWith("#")) && curLine.contains("=>")) { + String[] entry = curLine.split("=>"); + if (entry.length == 2) { + results.put(entry[0].trim(), entry[1].trim()); + } + } + } + mapReader.close(); + } catch (Exception e) { + LOG.error("Caught exception reading map " + mapFilename, e); + return null; + } + + return results; + } + +} diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java new file mode 100644 index 000000000..8c44377f9 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java @@ -0,0 +1,314 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.json.JSONArray; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class PciChangesFromPolicyToSDNRDmaapConsumer extends SdncDmaapConsumerImpl { + + private static final Logger LOG = LoggerFactory.getLogger(PciChangesFromPolicyToSDNRDmaapConsumer.class); + private static final String SDNC_ENDPOINT = "SDNC.endpoint"; + private static final String TEMPLATE = "SDNC.template"; + private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + + private static final String PARAMETER_NAME = "parameter-name"; + private static final String STRING_VALUE = "string-value"; + private static final String PHYSICAL_CELL_ID_INPUT_FAP_SERVICE = "configuration-phy-cell-id-input.fap-service"; + private static final String EVENT_HEADER = "event-header"; + private static final String ACTION = "Action"; + private static final String PAYLOAD = "Payload"; + private static final String CONFIGURATIONS = "Configurations"; + private static final String MODIFY_CONFIG = "ModifyConfig"; + private static final String MAP_FILE_NAME = "pci-changes-from-policy-to-sdnr"; + private static final String DATA = "data"; + private static final String FAP_SERVICE = "FAPService"; + private static final String SLI_PARAMETERS = "sli_parameters"; + private static final String RPC_NAME = "rpc-name"; + private static final String BODY = "body"; + private static final String INPUT = "input"; + + private String rootDir; + + protected VelocityEngine velocityEngine; + + public PciChangesFromPolicyToSDNRDmaapConsumer() { + velocityEngine = new VelocityEngine(); + Properties props = new Properties(); + rootDir = System.getenv(DMAAPLISTENERROOT); + + if ((rootDir == null) || (rootDir.length() == 0)) { + rootDir = "/opt/app/dmaap-listener/lib/"; + } + else { + rootDir = rootDir + "/lib/"; + } + + props.put("file.resource.loader.path", rootDir); + velocityEngine.init(props); + } + + /* + * for testing purposes + */ + PciChangesFromPolicyToSDNRDmaapConsumer(Properties props) { + velocityEngine = new VelocityEngine(); + velocityEngine.init(props); + } + + protected String publish(String templatePath, String jsonString, JsonNode configurationsJsonNode) throws IOException, InvalidMessageException + { + if (templatePath.contains("anr-pci-changes-from-policy-to-sdnr")){ + return publishPciChangesFromPolicyToSDNR(templatePath, configurationsJsonNode); + } else { + return publishFullMessage(templatePath, jsonString); + } + } + + private String publishFullMessage(String templatePath, String jsonString) throws IOException + { + JSONObject jsonObj = new JSONObject(jsonString); + VelocityContext context = new VelocityContext(); + for(Object key : jsonObj.keySet()) + { + context.put((String)key, jsonObj.get((String)key)); + } + + String id = jsonObj.getJSONObject(EVENT_HEADER).get("id").toString(); + context.put("req_id", id); + + context.put("curr_time", Instant.now()); + + ObjectMapper oMapper = new ObjectMapper(); + + String rpcMsgbody = oMapper.writeValueAsString(jsonString); + context.put("full_message", rpcMsgbody); + + Writer writer = new StringWriter(); + velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); + writer.flush(); + + return writer.toString(); + } + + private String publishPciChangesFromPolicyToSDNR(String templatePath, JsonNode configurationsJsonNode) throws IOException, InvalidMessageException + { + String RPC_NAME_KEY_IN_VT = "rpc_name"; + String RPC_NAME_VALUE_IN_VT = "configuration-phy-cell-id"; + String ALIAS = "alias"; + String X0005b9Lte = "X0005b9Lte"; + + VelocityContext context = new VelocityContext(); + + JSONObject numberOfEntries = new JSONObject(); + JSONArray sliParametersArray = new JSONArray(); + + JsonNode configurations = configurationsJsonNode.get(CONFIGURATIONS); + + int entryCount = 0; + + 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))); + 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"))); + 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"))); + 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"))); + entryCount++; + } + + numberOfEntries.put(PARAMETER_NAME, PHYSICAL_CELL_ID_INPUT_FAP_SERVICE+"-number-of-entries"); + numberOfEntries.put(STRING_VALUE, entryCount); + + sliParametersArray.put(numberOfEntries); + + context.put(SLI_PARAMETERS, sliParametersArray); + + context.put(RPC_NAME_KEY_IN_VT, RPC_NAME_VALUE_IN_VT); + + Writer writer = new StringWriter(); + velocityEngine.mergeTemplate(templatePath, "UTF-8", context, writer); + writer.flush(); + + return writer.toString(); + + }else { + throw new InvalidMessageException("Configurations is not of Type Array. Could not read configuration changes"); + } + + } + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode pciChangesRootNode; + try { + pciChangesRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + JsonNode rpcname = pciChangesRootNode.get(RPC_NAME); + if(rpcname == null) { + LOG.info("Missing rpc-name node."); + return; + } + + if(!MODIFY_CONFIG.toLowerCase().equals(rpcname.textValue())) { + LOG.info("Unknown rpc name {}", rpcname); + return; + } + + JsonNode body = pciChangesRootNode.get(BODY); + if(body == null) { + LOG.info("Missing body node."); + return; + } + + JsonNode input = body.get(INPUT); + if(input == null) { + LOG.info("Missing input node."); + return; + } + + JsonNode action = input.get(ACTION); + if(action == null) { + LOG.info("Missing action node."); + return; + } + + if(!MODIFY_CONFIG.equals(action.textValue())) { + LOG.info("Unknown Action {}", action); + return; + } + + JsonNode payload = input.get(PAYLOAD); + if(payload == null) { + LOG.info("Missing payload node."); + return; + } + + String configurations = payload.asText(); + + if(!configurations.contains(CONFIGURATIONS)) { + LOG.info("Missing configurations node."); + return; + } + + JsonNode configurationsJsonNode; + try { + configurationsJsonNode = oMapper.readTree(configurations); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse payload value", e); + } + + String mapFilename = rootDir + MAP_FILE_NAME + ".map"; + Map fieldMap = loadMap(mapFilename); + if (fieldMap == null) { + return; + } + + if (!fieldMap.containsKey(SDNC_ENDPOINT)) { + return; + } + String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); + + if (!fieldMap.containsKey(TEMPLATE)) { + throw new InvalidMessageException("No SDNC template known for message "); + } + String templateName = fieldMap.get(TEMPLATE); + + try { + String rpcMsgbody = publish(templateName, msg, configurationsJsonNode); + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); + + if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword); + + conn.send("POST", "application/json", rpcMsgbody); + } else { + LOG.info("POST message body would be:\n" + rpcMsgbody); + } + } catch (Exception e) { + LOG.error("Unable to process message", e); + } + } + + private Map loadMap(String mapFilename) { + File mapFile = new File(mapFilename); + + if (!mapFile.canRead()) { + LOG.error(String.format("Cannot read map file (%s)", mapFilename)); + return null; + } + + Map results = new HashMap<>(); + try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { + + String curLine; + + while ((curLine = mapReader.readLine()) != null) { + curLine = curLine.trim(); + + if ((curLine.length() > 0) && (!curLine.startsWith("#")) && curLine.contains("=>")) { + String[] entry = curLine.split("=>"); + if (entry.length == 2) { + results.put(entry[0].trim(), entry[1].trim()); + } + } + } + mapReader.close(); + } catch (Exception e) { + LOG.error("Caught exception reading map " + mapFilename, e); + return null; + } + + return results; + } + +} 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 new file mode 100644 index 000000000..e7c45b253 --- /dev/null +++ b/dmaap-listener/src/main/resources/anr-changes-from-policy-to-sdnr.map @@ -0,0 +1,5 @@ +# SDN-C URL +SDNC.endpoint => oofpcipoc-api:generic-neighbour-configuration + +# Field mapping +SDNC.template => anr-pci-changes-from-policy-to-sdnr.vt diff --git a/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt b/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt new file mode 100644 index 000000000..1cdd65e9c --- /dev/null +++ b/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt @@ -0,0 +1,8 @@ +{ + "input": { + "module-name": "oofpcipoc-api", + "rpc-name": $rpc_name, + "mode": "sync", + "sli-parameter": $sli_parameters + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..44c34a4d4 --- /dev/null +++ b/dmaap-listener/src/main/resources/pci-changes-from-policy-to-sdnr.map @@ -0,0 +1,5 @@ +# SDN-C URL +SDNC.endpoint => oofpcipoc-api:configuration-phy-cell-id + +# Field mapping +SDNC.template => anr-pci-changes-from-policy-to-sdnr.vt -- cgit 1.2.3-korg From dc1ac454bb77359e466395a4a92891f7cebda2a2 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Sun, 14 Apr 2019 11:19:29 -0500 Subject: JUNIT tests for SDNR OOF PCI Dmaap Listener JUNIT test JAVA files and name change for .vt file Change-Id: I513b9abd72d4c230f57ae3f89a8fafc5f72e7cfa Issue-ID: CCSDK-1226 Signed-off-by: SandeepLinux --- .../anr-pci-changes-from-policy-to-sdnr.vt | 8 + .../anr-pci-changes-from-policy-to-sndr.vt | 8 - ...estANRChangesFromPolicyToSDNRDmaapConsumer.java | 142 ++++++++++++++++ ...estPciChangesFromPolicyToSDNRDmaapConsumer.java | 181 +++++++++++++++++++++ 4 files changed, 331 insertions(+), 8 deletions(-) create mode 100644 dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt delete mode 100644 dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestANRChangesFromPolicyToSDNRDmaapConsumer.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestPciChangesFromPolicyToSDNRDmaapConsumer.java (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt b/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt new file mode 100644 index 000000000..1ded88dc7 --- /dev/null +++ b/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt @@ -0,0 +1,8 @@ +{ + "input": { + "module-name": "oofpcipoc-api", + "rpc-name": "$rpc_name", + "mode": "sync", + "sli-parameter": $sli_parameters + } +} diff --git a/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt b/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt deleted file mode 100644 index 1cdd65e9c..000000000 --- a/dmaap-listener/src/main/resources/anr-pci-changes-from-policy-to-sndr.vt +++ /dev/null @@ -1,8 +0,0 @@ -{ - "input": { - "module-name": "oofpcipoc-api", - "rpc-name": $rpc_name, - "mode": "sync", - "sli-parameter": $sli_parameters - } -} \ No newline at end of file diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestANRChangesFromPolicyToSDNRDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestANRChangesFromPolicyToSDNRDmaapConsumer.java new file mode 100644 index 000000000..66b63a17d --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestANRChangesFromPolicyToSDNRDmaapConsumer.java @@ -0,0 +1,142 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Properties; + +import org.junit.Before; +import org.junit.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class TestANRChangesFromPolicyToSDNRDmaapConsumer { + private static final String anrChangesFromPolicyToSDNRInput = "{\n" + + " \"body\": {\n" + + " \"input\": {\n" + + " \"CommonHeader\": {\n" + + " \"TimeStamp\": \"2018-11-30T09:13:37.368Z\",\n" + + " \"APIVer\": \"1.0\",\n" + + " \"RequestID\": \"722ee65a-8afd-48df-bf57-c152ae45bacc\",\n" + + " \"SubRequestID\": \"1\",\n" + + " \"RequestTrack\": {},\n" + + " \"Flags\": {}\n" + + " },\n" + + "\"Action\": \"ModifyConfigANR\",\n" + + " \"Payload\": \"{ \\\"Configurations\\\":[ { \\\"data\\\":{ \\\"FAPService\\\":{ \\\"alias\\\":\\\"Cell1\\\", \\\"CellConfig\\\":{ \\\"LTE\\\":{ \\\"RAN\\\":{ \\\"Common\\\":{ \\\"CellIdentity\\\":\\\"1\\\" }, \\\"NeighborListInUse\\\" : { \\\"LTECellNumberOfEntries\\\" : \\\"1\\\" , \\\"LTECell\\\" : [{ \\\"PLMNID\\\" :\\\"plmnid1\\\", \\\"CID\\\":\\\"Chn0001\\\", \\\"PhyCellID\\\":\\\"3\\\", \\\"PNFName\\\":\\\"ncserver01\\\", \\\"Blacklisted\\\":\\\"false\\\"}] } } } } } } } ] }\"\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"modifyconfiganr\",\n" + + " \"correlation-id\": \"722ee65a-8afd-48df-bf57-c152ae45bacc-1\",\n" + + " \"type\": \"request\"\n" + + "}\n" + + ""; + + @Before + public void setUp() throws Exception { + } + + @Test + public void testRPCMessageBodyResponse() throws Exception { + Properties props = new Properties(); + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode anrChangesRootNode = oMapper.readTree(anrChangesFromPolicyToSDNRInput); + JsonNode body = anrChangesRootNode.get("body"); + JsonNode input = body.get("input"); + JsonNode payload = input.get("Payload"); + String payloadText = payload.asText(); + JsonNode configurationsJsonNode = oMapper.readTree(payloadText); + JsonNode configurations = configurationsJsonNode.get("Configurations"); + + for(JsonNode dataNode:configurations) { + String rpcMsgbody = new ANRChangesFromPolicyToSDNRDmaapConsumer(props).publish("src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt", anrChangesFromPolicyToSDNRInput,dataNode); + + JsonNode rootNode; + try { + rootNode = oMapper.readTree(rpcMsgbody); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + assertTrue(rootNode.get("input").get("module-name") != null); + assertTrue(rootNode.get("input").get("rpc-name") != null); + assertTrue(rootNode.get("input").get("mode") != null); + assertTrue(rootNode.get("input").get("sli-parameter") != null); + } + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullMessage() throws Exception { + ANRChangesFromPolicyToSDNRDmaapConsumer consumer = new ANRChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg(null); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgInvalidMessage() throws Exception { + ANRChangesFromPolicyToSDNRDmaapConsumer consumer = new ANRChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg("test"); + } + + @Test + public void testProcessMsgMissingActionHeader() throws Exception { + ANRChangesFromPolicyToSDNRDmaapConsumer consumer = new ANRChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg("{\n" + + " \"body\": {\n" + + " \"input\": {\n" + + " \"CommonHeader\": {\n" + + " \"TimeStamp\": \"2018-11-30T09:13:37.368Z\",\n" + + " \"APIVer\": \"1.0\",\n" + + " \"RequestID\": \"722ee65a-8afd-48df-bf57-c152ae45bacc\",\n" + + " \"SubRequestID\": \"1\",\n" + + " \"RequestTrack\": {},\n" + + " \"Flags\": {}\n" + + " },\n" + + "\"NoAction\": \"ModifyConfigANR\",\n" + + " \"Payload\": \"{ \\\"Configurations\\\":[ { \\\"data\\\":{ \\\"FAPService\\\":{ \\\"alias\\\":\\\"Cell1\\\", \\\"CellConfig\\\":{ \\\"LTE\\\":{ \\\"RAN\\\":{ \\\"Common\\\":{ \\\"CellIdentity\\\":\\\"1\\\" }, \\\"NeighborListInUse\\\" : { \\\"LTECellNumberOfEntries\\\" : \\\"1\\\" , \\\"LTECell\\\" : [{ \\\"PLMNID\\\" :\\\"plmnid1\\\", \\\"CID\\\":\\\"Chn0001\\\", \\\"PhyCellID\\\":\\\"3\\\", \\\"PNFName\\\":\\\"ncserver01\\\", \\\"Blacklisted\\\":\\\"false\\\"}] } } } } } } } ] }\"\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"modifyconfiganr\",\n" + + " \"correlation-id\": \"722ee65a-8afd-48df-bf57-c152ae45bacc-1\",\n" + + " \"type\": \"request\"\n" + + "}\n" + + ""); + } + + @Test + public void testProcessMsgInvalidPayloadConfigurations() throws Exception { + String msg = "{\n" + + " \"body\": {\n" + + " \"input\": {\n" + + " \"CommonHeader\": {\n" + + " \"TimeStamp\": \"2018-11-30T09:13:37.368Z\",\n" + + " \"APIVer\": \"1.0\",\n" + + " \"RequestID\": \"722ee65a-8afd-48df-bf57-c152ae45bacc\",\n" + + " \"SubRequestID\": \"1\",\n" + + " \"RequestTrack\": {},\n" + + " \"Flags\": {}\n" + + " },\n" + + "\"Action\": \"ModifyConfigANR\",\n" + + " \"Payload\": \"{ \\\"Configurations\\\":{ { \\\"data\\\":{ \\\"FAPService\\\":{ \\\"alias\\\":\\\"Cell1\\\", \\\"CellConfig\\\":{ \\\"LTE\\\":{ \\\"RAN\\\":{ \\\"Common\\\":{ \\\"CellIdentity\\\":\\\"1\\\" }, \\\"NeighborListInUse\\\" : { \\\"LTECellNumberOfEntries\\\" : \\\"1\\\" , \\\"LTECell\\\" : [{ \\\"PLMNID\\\" :\\\"plmnid1\\\", \\\"CID\\\":\\\"Chn0001\\\", \\\"PhyCellID\\\":\\\"3\\\", \\\"PNFName\\\":\\\"ncserver01\\\", \\\"Blacklisted\\\":\\\"false\\\"}} } } } } } } } ] }\"\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"modifyconfiganr\",\n" + + " \"correlation-id\": \"722ee65a-8afd-48df-bf57-c152ae45bacc-1\",\n" + + " \"type\": \"request\"\n" + + "}\n" + + ""; + + try { + ANRChangesFromPolicyToSDNRDmaapConsumer consumer = new ANRChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg(msg); + + } catch (final InvalidMessageException e) { + final String errorMsg = "Cannot parse payload value"; + assertEquals(errorMsg, e.getMessage()); + } + } +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestPciChangesFromPolicyToSDNRDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestPciChangesFromPolicyToSDNRDmaapConsumer.java new file mode 100644 index 000000000..a42bc48f6 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestPciChangesFromPolicyToSDNRDmaapConsumer.java @@ -0,0 +1,181 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Properties; + +import org.junit.Before; +import org.junit.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class TestPciChangesFromPolicyToSDNRDmaapConsumer { + private static final String pciChangesFromPolicyToSDNRInput = "{\n" + + " \"body\": {\n" + + " \"input\": {\n" + + " \"CommonHeader\": {\n" + + " \"TimeStamp\": \"2018-11-30T09:13:37.368Z\",\n" + + " \"APIVer\": \"1.0\",\n" + + " \"RequestID\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459\",\n" + + " \"SubRequestID\": \"1\",\n" + + " \"RequestTrack\": {},\n" + + " \"Flags\": {}\n" + + " },\n" + + " \"Action\": \"ModifyConfig\",\n" + + " \"Payload\": \"{\\\"Configurations\\\":[{\\\"data\\\":{\\\"FAPService\\\":{\\\"alias\\\":\\\"Chn0330\\\",\\\"X0005b9Lte\\\":{\\\"phyCellIdInUse\\\":6,\\\"pnfName\\\":\\\"ncserver23\\\"},\\\"CellConfig\\\":{\\\"LTE\\\":{\\\"RAN\\\":{\\\"Common\\\":{\\\"CellIdentity\\\":\\\"Chn0330\\\"}}}}}}},{\\\"data\\\":{\\\"FAPService\\\":{\\\"alias\\\":\\\"Chn0331\\\",\\\"X0005b9Lte\\\":{\\\"phyCellIdInUse\\\":7,\\\"pnfName\\\":\\\"ncserver23\\\"},\\\"CellConfig\\\":{\\\"LTE\\\":{\\\"RAN\\\":{\\\"Common\\\":{\\\"CellIdentity\\\":\\\"Chn0331\\\"}}}}}}}]}\"\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"modifyconfig\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + "}"; + + @Before + public void setUp() throws Exception { + } + + @Test + public void testRPCMessageBodyResponse() throws Exception { + Properties props = new Properties(); + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode pciChangesRootNode = oMapper.readTree(pciChangesFromPolicyToSDNRInput); + JsonNode body = pciChangesRootNode.get("body"); + JsonNode input = body.get("input"); + JsonNode payload = input.get("Payload"); + String payloadText = payload.asText(); + JsonNode configurationsJsonNode = oMapper.readTree(payloadText); + + String rpcMsgbody = new PciChangesFromPolicyToSDNRDmaapConsumer(props).publish("src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt", pciChangesFromPolicyToSDNRInput,configurationsJsonNode); + + JsonNode rootNode; + try { + rootNode = oMapper.readTree(rpcMsgbody); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + assertTrue(rootNode.get("input").get("module-name") != null); + assertTrue(rootNode.get("input").get("rpc-name") != null); + assertTrue(rootNode.get("input").get("mode") != null); + assertTrue(rootNode.get("input").get("sli-parameter") != null); + + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullMessage() throws Exception { + PciChangesFromPolicyToSDNRDmaapConsumer consumer = new PciChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg(null); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgInvalidMessage() throws Exception { + PciChangesFromPolicyToSDNRDmaapConsumer consumer = new PciChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg("test"); + } + + @Test + public void testProcessMsgMissingActionHeader() throws Exception { + PciChangesFromPolicyToSDNRDmaapConsumer consumer = new PciChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg("{\n" + + " \"body\": {\n" + + " \"input\": {\n" + + " \"CommonHeader\": {\n" + + " \"TimeStamp\": \"2018-11-30T09:13:37.368Z\",\n" + + " \"APIVer\": \"1.0\",\n" + + " \"RequestID\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459\",\n" + + " \"SubRequestID\": \"1\",\n" + + " \"RequestTrack\": {},\n" + + " \"Flags\": {}\n" + + " },\n" + + " \"RenamedAction\": \"ModifyConfig\",\n" + + " \"Payload\": {\n" + + " \"Configurations \": {\n" + + " \"data \": {\n" + + " \"FAPService \": {\n" + + " \"alias\": \"Chn0330\",\n" + + " \"X0005b9Lte\": {\n" + + " \"phyCellIdInUse\": 6,\n" + + " \"pnfName\": \"ncserver23\"\n" + + " },\n" + + " \"CellConfig\": {\n" + + " \"LTE\": {\n" + + " \"RAN\": {\n" + + " \"Common\": {\n" + + " \"CellIdentity\": \"Chn0330\"\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + "\n" + + " }\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"modifyconfig\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + "}"); + } + + @Test + public void testProcessMsgInvalidPayloadConfigurations() throws Exception { + String msg = "{\n" + + " \"body\": {\n" + + " \"input\": {\n" + + " \"CommonHeader\": {\n" + + " \"TimeStamp\": \"2018-11-30T09:13:37.368Z\",\n" + + " \"APIVer\": \"1.0\",\n" + + " \"RequestID\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459\",\n" + + " \"SubRequestID\": \"1\",\n" + + " \"RequestTrack\": {},\n" + + " \"Flags\": {}\n" + + " },\n" + + " \"Action\": \"ModifyConfig\",\n" + + " \"Payload\": {\n" + + " \"Configurations \": {\n" + + " \"data \": {\n" + + " \"FAPService \": {\n" + + " \"alias\": \"Chn0330\",\n" + + " \"X0005b9Lte\": {\n" + + " \"phyCellIdInUse\": 6,\n" + + " \"pnfName\": \"ncserver23\"\n" + + " },\n" + + " \"CellConfig\": {\n" + + " \"LTE\": {\n" + + " \"RAN\": {\n" + + " \"Common\": {\n" + + " \"CellIdentity\": \"Chn0330\"\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + "\n" + + " }\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"modifyconfig\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + "}"; + + try { + PciChangesFromPolicyToSDNRDmaapConsumer consumer = new PciChangesFromPolicyToSDNRDmaapConsumer(); + consumer.processMsg(msg); + + } catch (final InvalidMessageException e) { + final String errorMsg = "Configurations is not of Type Array. Could not read configuration changes"; + assertEquals(errorMsg, e.getMessage()); + } + } +} -- cgit 1.2.3-korg From 9b5c8a76bf6a75d5d82df56a1db0a09651596f82 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Thu, 13 Jun 2019 05:50:38 -0500 Subject: 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 --- .../dmaapclient/OofPciPocDmaapConsumers.java | 21 ++++++++++++--------- .../resources/anr-changes-from-policy-to-sdnr.map | 4 ++-- .../resources/pci-changes-from-policy-to-sdnr.map | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'dmaap-listener/src/main/resources') 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 2e6ae742b..7037d8848 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 e7c45b253..5cd2b8371 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 44c34a4d4..5cd2b8371 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 -- cgit 1.2.3-korg From b39dc2b5bc842824b6bc2b85bc4f92eedb6d454b Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Fri, 15 May 2020 10:10:57 -0400 Subject: Change log4j2 configuration Changed log4j2 configuration from using properties files to using XML, which corrected the issue we were seeing with log files being created but empty. Also updated sdc.client.version to use released version 1.4.2 instead of 1.4.2-SNAPSHOT, which no longer exists - causing a compile error. Change-Id: I7040453ccbc3b3fd246a07fa3287c7d4d331fb34 Issue-ID: SDNC-1167 Signed-off-by: Dan Timoney --- dmaap-listener/src/main/resources/log4j.properties | 37 ---------------------- dmaap-listener/src/main/resources/log4j2.xml | 26 +++++++++++++++ ueb-listener/pom.xml | 4 +-- ueb-listener/src/main/resources/log4j.properties | 37 ---------------------- ueb-listener/src/main/resources/log4j2.xml | 26 +++++++++++++++ 5 files changed, 54 insertions(+), 76 deletions(-) delete mode 100644 dmaap-listener/src/main/resources/log4j.properties create mode 100644 dmaap-listener/src/main/resources/log4j2.xml delete mode 100644 ueb-listener/src/main/resources/log4j.properties create mode 100644 ueb-listener/src/main/resources/log4j2.xml (limited to 'dmaap-listener/src/main/resources') diff --git a/dmaap-listener/src/main/resources/log4j.properties b/dmaap-listener/src/main/resources/log4j.properties deleted file mode 100644 index 8db00762b..000000000 --- a/dmaap-listener/src/main/resources/log4j.properties +++ /dev/null @@ -1,37 +0,0 @@ -### -# ============LICENSE_START======================================================= -# openECOMP : SDN-C -# ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights -# reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -### - -log4j.rootLogger=DEBUG,CONSOLE,LOGFILE - -# CONSOLE is set to be a ConsoleAppender using a PatternLayout. -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.Threshold=ERROR -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n - -# LOGFILE is set to be a File appender using a PatternLayout. -log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender -log4j.appender.LOGFILE.File=/opt/app/dmaap-listener/logs/dmaap-listener.log -log4j.appender.LOGFILE.Append=true -log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.LOGFILE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n -log4j.appender.LOGFILE.MaxFileSize=10MB -log4j.appender.LOGFILE.MaxBackupIndex=10 diff --git a/dmaap-listener/src/main/resources/log4j2.xml b/dmaap-listener/src/main/resources/log4j2.xml new file mode 100644 index 000000000..01ee93714 --- /dev/null +++ b/dmaap-listener/src/main/resources/log4j2.xml @@ -0,0 +1,26 @@ + + + + + $${env:LOGDIR:-logs} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 42546fd7b..1df9f35b2 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -24,8 +24,8 @@ ${project.version}-${build.number} ${project.version} ${project.version} - 1.4.1-SNAPSHOT - 1.6.5 + 1.4.1 + 1.6.5 diff --git a/ueb-listener/src/main/resources/log4j.properties b/ueb-listener/src/main/resources/log4j.properties deleted file mode 100644 index f2f4ed26b..000000000 --- a/ueb-listener/src/main/resources/log4j.properties +++ /dev/null @@ -1,37 +0,0 @@ -### -# ============LICENSE_START======================================================= -# openECOMP : SDN-C -# ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights -# reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -### - -log4j.rootLogger=DEBUG,CONSOLE,LOGFILE - -# CONSOLE is set to be a ConsoleAppender using a PatternLayout. -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.Threshold=ERROR -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n - -# LOGFILE is set to be a File appender using a PatternLayout. -log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender -log4j.appender.LOGFILE.File=/opt/app/ueb-listener/logs/ueb-listener.log -log4j.appender.LOGFILE.Append=true -log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.LOGFILE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n -log4j.appender.LOGFILE.MaxFileSize=10MB -log4j.appender.LOGFILE.MaxBackupIndex=10 diff --git a/ueb-listener/src/main/resources/log4j2.xml b/ueb-listener/src/main/resources/log4j2.xml new file mode 100644 index 000000000..23ab908a5 --- /dev/null +++ b/ueb-listener/src/main/resources/log4j2.xml @@ -0,0 +1,26 @@ + + + + + $${env:LOGDIR:-logs} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit 1.2.3-korg