-- cgit 1.2.3-korg 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 --- .gitignore | 38 + LICENSE.txt | 22 + README.md | 8 + asdcApi/.gitignore | 34 + asdcApi/features/pom.xml | 138 +++ asdcApi/features/src/main/resources/features.xml | 41 + asdcApi/installer/pom.xml | 140 +++ .../src/assembly/assemble_installer_zip.xml | 59 + .../src/assembly/assemble_mvnrepo_zip.xml | 55 + .../src/main/resources/scripts/install-feature.sh | 40 + asdcApi/model/pom.xml | 81 ++ asdcApi/model/src/main/yang/ASDC-API.yang | 63 ++ asdcApi/model/src/main/yang/asdc-api-common.yang | 53 + .../model/src/main/yang/asdc-license-model.yang | 369 +++++++ asdcApi/pom.xml | 63 ++ asdcApi/provider/pom.xml | 129 +++ .../impl/rev140523/AsdcApiProviderModule.java | 57 + .../rev140523/AsdcApiProviderModuleFactory.java | 34 + .../openecomp/sdnc/asdcapi/AsdcApiProvider.java | 415 ++++++++ .../openecomp/sdnc/asdcapi/AsdcApiSliClient.java | 111 ++ .../org/openecomp/sdnc/asdcapi/AsdcApiUtil.java | 48 + .../main/resources/initial/asdcApi-provider.xml | 72 ++ .../src/main/yang/asdcApi-provider-impl.yang | 61 ++ dataChange/.gitignore | 34 + dataChange/.sonar/checkstyle.xml | 1 + dataChange/.sonar/pmd.xml | 67 ++ dataChange/README.txt | 35 + dataChange/features/pom.xml | 136 +++ .../features/src/main/resources/features.xml | 39 + dataChange/installer/pom.xml | 140 +++ .../src/assembly/assemble_installer_zip.xml | 59 + .../src/assembly/assemble_mvnrepo_zip.xml | 55 + .../src/main/resources/scripts/install-feature.sh | 40 + dataChange/model/pom.xml | 82 ++ dataChange/model/src/main/yang/DataChange.yang | 73 ++ dataChange/pom.xml | 59 + dataChange/provider/pom.xml | 137 +++ .../impl/rev140523/DataChangeProviderModule.java | 55 + .../rev140523/DataChangeProviderModuleFactory.java | 34 + .../sdnc/datachange/DataChangeClient.java | 115 ++ .../sdnc/datachange/DataChangeProvider.java | 181 ++++ .../main/resources/initial/dataChange-provider.xml | 72 ++ .../src/main/yang/DataChange-provider-impl.yang | 61 ++ dmaap-listener/.gitignore | 12 + dmaap-listener/.sonar/checkstyle.xml | 1 + dmaap-listener/.sonar/pmd.xml | 67 ++ dmaap-listener/pom.xml | 115 ++ dmaap-listener/src/assembly/assemble_zip.xml | 61 ++ .../openecomp/sdnc/dmaapclient/DmaapListener.java | 165 +++ .../sdnc/dmaapclient/DummyDmaapConsumer.java | 37 + .../sdnc/dmaapclient/InvalidMessageException.java | 37 + .../sdnc/dmaapclient/SdncDmaapConsumer.java | 146 +++ .../dmaapclient/SdncFlatJsonDmaapConsumer.java | 196 ++++ .../sdnc/dmaapclient/SdncOdlConnection.java | 159 +++ .../src/main/resources/edgeRouterStatusChange.map | 23 + dmaap-listener/src/main/resources/log4j.properties | 37 + .../src/main/resources/preferredRoute.txt | 1 + .../src/main/scripts/start-dmaap-listener.sh | 69 ++ .../src/main/scripts/stop-dmaap-listener.sh | 52 + dmaap-listener/src/site/apt/index.apt | 46 + dmaap-listener/src/site/site.xml | 31 + example-settings.xml | 163 +++ jenkins-settings.xml | 168 +++ pom.xml | 119 +++ ueb-listener/.gitignore | 12 + ueb-listener/.sonar/checkstyle.xml | 1 + ueb-listener/.sonar/pmd.xml | 67 ++ ueb-listener/pom.xml | 128 +++ ueb-listener/src/assembly/assemble_zip.xml | 63 ++ .../org/openecomp/sdnc/uebclient/SdncARModel.java | 53 + .../openecomp/sdnc/uebclient/SdncArtifactMap.java | 134 +++ .../openecomp/sdnc/uebclient/SdncBaseModel.java | 297 ++++++ .../openecomp/sdnc/uebclient/SdncNodeModel.java | 145 +++ .../sdnc/uebclient/SdncOdlConnection.java | 158 +++ .../openecomp/sdnc/uebclient/SdncServiceModel.java | 98 ++ .../openecomp/sdnc/uebclient/SdncUebCallback.java | 1125 ++++++++++++++++++++ .../openecomp/sdnc/uebclient/SdncUebClient.java | 65 ++ .../sdnc/uebclient/SdncUebConfiguration.java | 280 +++++ .../org/openecomp/sdnc/uebclient/SdncVFCModel.java | 69 ++ .../org/openecomp/sdnc/uebclient/SdncVFModel.java | 56 + .../sdnc/uebclient/SdncVFModuleModel.java | 45 + ueb-listener/src/main/resources/log4j.properties | 37 + .../src/main/resources/normalizeTagNames.xslt | 14 + ueb-listener/src/main/resources/removeNs.xslt | 16 + .../src/main/scripts/start-ueb-listener.sh | 68 ++ ueb-listener/src/main/scripts/stop-ueb-listener.sh | 56 + ueb-listener/src/site/apt/index.apt | 46 + ueb-listener/src/site/site.xml | 31 + version.properties | 14 + 89 files changed, 8389 insertions(+) create mode 100755 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100755 asdcApi/.gitignore create mode 100755 asdcApi/features/pom.xml create mode 100644 asdcApi/features/src/main/resources/features.xml create mode 100755 asdcApi/installer/pom.xml create mode 100644 asdcApi/installer/src/assembly/assemble_installer_zip.xml create mode 100644 asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 asdcApi/installer/src/main/resources/scripts/install-feature.sh create mode 100755 asdcApi/model/pom.xml create mode 100755 asdcApi/model/src/main/yang/ASDC-API.yang create mode 100755 asdcApi/model/src/main/yang/asdc-api-common.yang create mode 100755 asdcApi/model/src/main/yang/asdc-license-model.yang create mode 100755 asdcApi/pom.xml create mode 100755 asdcApi/provider/pom.xml create mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java create mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java create mode 100644 asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java create mode 100644 asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java create mode 100644 asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java create mode 100644 asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml create mode 100755 asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang create mode 100755 dataChange/.gitignore create mode 100755 dataChange/.sonar/checkstyle.xml create mode 100755 dataChange/.sonar/pmd.xml create mode 100755 dataChange/README.txt create mode 100755 dataChange/features/pom.xml create mode 100644 dataChange/features/src/main/resources/features.xml create mode 100755 dataChange/installer/pom.xml create mode 100644 dataChange/installer/src/assembly/assemble_installer_zip.xml create mode 100644 dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 dataChange/installer/src/main/resources/scripts/install-feature.sh create mode 100755 dataChange/model/pom.xml create mode 100755 dataChange/model/src/main/yang/DataChange.yang create mode 100755 dataChange/pom.xml create mode 100755 dataChange/provider/pom.xml create mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java create mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java create mode 100644 dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java create mode 100644 dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java create mode 100644 dataChange/provider/src/main/resources/initial/dataChange-provider.xml create mode 100755 dataChange/provider/src/main/yang/DataChange-provider-impl.yang create mode 100755 dmaap-listener/.gitignore create mode 100755 dmaap-listener/.sonar/checkstyle.xml create mode 100755 dmaap-listener/.sonar/pmd.xml create mode 100755 dmaap-listener/pom.xml create mode 100644 dmaap-listener/src/assembly/assemble_zip.xml create mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java create mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java create mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java create mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java create mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java create mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncOdlConnection.java 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 create mode 100644 dmaap-listener/src/main/scripts/start-dmaap-listener.sh create mode 100644 dmaap-listener/src/main/scripts/stop-dmaap-listener.sh create mode 100644 dmaap-listener/src/site/apt/index.apt create mode 100644 dmaap-listener/src/site/site.xml create mode 100644 example-settings.xml create mode 100644 jenkins-settings.xml create mode 100644 pom.xml create mode 100755 ueb-listener/.gitignore create mode 100755 ueb-listener/.sonar/checkstyle.xml create mode 100755 ueb-listener/.sonar/pmd.xml create mode 100755 ueb-listener/pom.xml create mode 100644 ueb-listener/src/assembly/assemble_zip.xml create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java create mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java create mode 100644 ueb-listener/src/main/resources/log4j.properties create mode 100755 ueb-listener/src/main/resources/normalizeTagNames.xslt create mode 100755 ueb-listener/src/main/resources/removeNs.xslt create mode 100644 ueb-listener/src/main/scripts/start-ueb-listener.sh create mode 100644 ueb-listener/src/main/scripts/stop-ueb-listener.sh create mode 100644 ueb-listener/src/site/apt/index.apt create mode 100644 ueb-listener/src/site/site.xml create mode 100644 version.properties diff --git a/.gitignore b/.gitignore new file mode 100755 index 000000000..8b49fb2aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +#####standard .git ignore entries##### + +## IDE Specific Files ## +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +.checkstyle +maven-eclipse.xml +workspace + +## Compilation Files ## +*.class +**/target +target +target-ide +MANIFEST.MF + +## Misc Ignores (OS specific etc) ## +bin/ +dist +*~ +*.ipr +*.iml +*.iws +classes +out/ +.DS_STORE +.metadata +provider/src/main/java/META-INF/ +provider/src/main/java/inventory/ + +## BlackDuck generated file +sdnc-northbound_bdio.jsonld +blackDuckHubProjectName.txt +blackDuckHubProjectVersionName.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..3ea5081a0 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,22 @@ +/* + * ============LICENSE_START========================================== + * =================================================================== + * Copyright © 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============================================ + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + * + */ diff --git a/README.md b/README.md new file mode 100644 index 000000000..64be1de02 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +This source repository contains the code for the SDN Controller northbound interface adaptors. +To compile this code: + +1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the OpenECOMP repositories and OpenDaylight repositories. See example-settings.xml for an example. + +2. To compile, run "mvn clean install". + + diff --git a/asdcApi/.gitignore b/asdcApi/.gitignore new file mode 100755 index 000000000..b73caf31e --- /dev/null +++ b/asdcApi/.gitignore @@ -0,0 +1,34 @@ +#####standard .git ignore entries##### + +## IDE Specific Files ## +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +maven-eclipse.xml +workspace + +## Compilation Files ## +*.class +**/target +target +target-ide +MANIFEST.MF + +## Misc Ignores (OS specific etc) ## +bin/ +dist +*~ +*.ipr +*.iml +*.iws +classes +out/ +.DS_STORE +.metadata + +## Folders which contain auto generated source code ## +yang-gen-config +yang-gen-sal diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml new file mode 100755 index 000000000..774d9e529 --- /dev/null +++ b/asdcApi/features/pom.xml @@ -0,0 +1,138 @@ + + + 4.0.0 + + asdcApi + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + asdcApi-features + + jar + + + + org.onap.ccsdk.sli.northbound + asdcApi-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + config + xml + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + + + + org.opendaylight.mdsal + features-mdsal + ${odl.mdsal.features.version} + features + xml + + + runtime + + + + + + + org.opendaylight.controller + opendaylight-karaf-empty + ${odl.karaf.empty.distro.version} + zip + + + + + + org.opendaylight.odlparent + features-test + test + ${odl.commons.opendaylight.version} + + + + org.opendaylight.yangtools + features-yangtools + ${odl.yangtools.version} + features + xml + runtime + + + + + + + true + src/main/resources + + + + + org.apache.maven.plugins + maven-resources-plugin + + + filter + + resources + + generate-resources + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/${features.file} + xml + features + + + + + + + + + diff --git a/asdcApi/features/src/main/resources/features.xml b/asdcApi/features/src/main/resources/features.xml new file mode 100644 index 000000000..e72e0f653 --- /dev/null +++ b/asdcApi/features/src/main/resources/features.xml @@ -0,0 +1,41 @@ + + + + + + + mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features + + + + odl-mdsal-broker + + mvn:org.openecomp.sdnc.northbound/asdcApi-model/${project.version} + mvn:org.openecomp.sdnc.northbound/asdcApi-provider/${project.version} + + sdnc-sli + mvn:org.openecomp.sdnc.northbound/asdcApi-provider/${project.version}/xml/config + + + diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml new file mode 100755 index 000000000..94008aaaf --- /dev/null +++ b/asdcApi/installer/pom.xml @@ -0,0 +1,140 @@ + + + 4.0.0 + + asdcApi + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + asdcApi-installer + asdcApi - Karaf Installer + pom + + + sdnc-asdcApi + sdnc-asdcApi + mvn:org.onap.ccsdk.sli.northbound/asdcApi-features/${project.version}/xml/features + false + + + + + + org.onap.ccsdk.sli.northbound + asdcApi-features + ${project.version} + features + xml + + + * + * + + + + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + + + + + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + false + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + false + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.openecomp.sdnc + sli-common,sli-provider,dblib-provider + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + + + diff --git a/asdcApi/installer/src/assembly/assemble_installer_zip.xml b/asdcApi/installer/src/assembly/assemble_installer_zip.xml new file mode 100644 index 000000000..e278872a1 --- /dev/null +++ b/asdcApi/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,59 @@ + + + + + + installer_zip + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + + + + diff --git a/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100644 index 000000000..608200da1 --- /dev/null +++ b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,55 @@ + + + + + + mvnrepo_zip + + zip + + + + false + + + + target/assembly/ + . + + + + + + + + ../provider/src/main/resources/initial/${feature-name}-provider.xml + ./etc/opendaylight/karaf/200-${feature-name}-provider.xml + + + + + diff --git a/asdcApi/installer/src/main/resources/scripts/install-feature.sh b/asdcApi/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 000000000..9a47d2225 --- /dev/null +++ b/asdcApi/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +### +# ============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========================================================= +### + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} +ODL_KARAF_CLIENT_OPTS=${ODL_KARAF_CLIENT_OPTS:-"-u karaf"} +INSTALLERDIR=$(dirname $0) + +REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip + +if [ -f ${REPOZIP} ] +then + unzip -d ${ODL_HOME} ${REPOZIP} +else + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 +fi + +${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:install ${features.boot} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml new file mode 100755 index 000000000..b9f48326d --- /dev/null +++ b/asdcApi/model/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + + asdcApi + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + org.onap.ccsdk.sli.northbound + asdcApi-model + 0.0.1-SNAPSHOT + bundle + + + + + + org.apache.felix + maven-bundle-plugin + true + + + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${odl.yangtools.yang.maven.plugin.version} + + + org.opendaylight.mdsal + maven-sal-api-gen-plugin + ${odl.sal.api.gen.plugin.version} + jar + + + + + + generate-sources + + + ${yang.file.directory} + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + + + + + + org.opendaylight.mdsal + yang-binding + ${odl.mdsal.yang.binding.version} + + + org.opendaylight.yangtools + yang-common + ${odl.yangtools.version} + + + org.opendaylight.mdsal.model + ietf-inet-types + ${odl.ietf-inet-types.version} + + + org.opendaylight.mdsal.model + ietf-yang-types + ${odl.ietf-yang-types.version} + + + diff --git a/asdcApi/model/src/main/yang/ASDC-API.yang b/asdcApi/model/src/main/yang/ASDC-API.yang new file mode 100755 index 000000000..401ec7da9 --- /dev/null +++ b/asdcApi/model/src/main/yang/ASDC-API.yang @@ -0,0 +1,63 @@ + +module ASDC-API { + yang-version "1"; + + namespace "org:openecomp:sdnc"; + + prefix asdc-api; + + import asdc-api-common { prefix asdc-api-common; } + + + import asdc-license-model { prefix asdc-license-model; } + + import ietf-inet-types { + prefix inet; + revision-date "2010-09-24"; + } + + organization + "OpenECOMP"; + + contact + "Dan Timoney"; + + description + "SDC Interface"; + + revision 2017-02-01 { + description "database definitions"; + } + + // Containers + container artifacts { + list artifact { + key "artifact-name artifact-version"; + + uses asdc-api-common:artifact-fields; + } + } + + + + container vf-license-model-versions { + list vf-license-model-version { + key artifact-version; + uses asdc-api-common:artifact-fields; + uses asdc-license-model:vf-license-model-grouping; + } + } + + + // RPCs + + rpc vf-license-model-update { + input { + uses asdc-api-common:artifact-fields; + uses asdc-license-model:vf-license-model-grouping; + } + output { + uses asdc-api-common:asdc-api-response; + } + } +} diff --git a/asdcApi/model/src/main/yang/asdc-api-common.yang b/asdcApi/model/src/main/yang/asdc-api-common.yang new file mode 100755 index 000000000..126368d4f --- /dev/null +++ b/asdcApi/model/src/main/yang/asdc-api-common.yang @@ -0,0 +1,53 @@ + +module asdc-api-common { + yang-version "1"; + + // Use same namespace defined for file upload in 15.12 + namespace "org:openecomp:sdnc:asdcapi:common"; + + prefix asdcapi; + + organization + "OpenECOMP"; + + contact + "Dan Timoney"; + + description + "ASDC/SDN-C API common data"; + + revision 2017-02-01 { + description "Initial release"; + } + + + + // Groupings + + grouping artifact-fields { + leaf artifact-name { + type string; + description "Name of artifact"; + } + + leaf artifact-version { + type string; + description "Version of artifact"; + } + } + + grouping asdc-api-response { + leaf asdc-api-response-code { + type string; + description "Code indicating success/failure"; + } + + leaf asdc-api-response-text { + type string; + description "Text indicating reason for failure"; + } + } + + + +} diff --git a/asdcApi/model/src/main/yang/asdc-license-model.yang b/asdcApi/model/src/main/yang/asdc-license-model.yang new file mode 100755 index 000000000..37ae869bd --- /dev/null +++ b/asdcApi/model/src/main/yang/asdc-license-model.yang @@ -0,0 +1,369 @@ +module asdc-license-model { + + namespace "http://xmlns.openecomp.org/asdc/license-model/1.0"; + prefix le; + organization "openecomp"; + contact "asdc"; + description "schema for both vendor license and VF license models"; + revision 2016-04-27 { + description "xxxx"; + reference "xxxx"; + } + + container vendor-license-model { + description "xxxx"; + leaf vendor-name { + type string{ + length "1..200"; + } + description "xxxx"; + } + uses entitlement-pools; + uses license-key-groups; + } + + grouping entitlement-pools { + description "xxxx"; + container entitlement-pool-list { + description "xxxx"; + uses entitlement-pool; + } + } + + grouping entitlement-pool { + description "xxxx"; + list entitlement-pool { + description "xxxx"; + leaf entitlement-pool-uuid { + type string; + description "xxxx"; + } + leaf name { + type string{ + length "1..120"; + } + description "xxxx"; + } + leaf description { + type string{ + length "1..1000"; + } + description "xxxx"; + } + leaf manufacturer-reference-number { + type string{ + length "1..100"; + } + description "xxxx"; + } + uses operational-scope; + uses threshold-value; + uses entitlement-metric; + leaf increments { + type string{ + length "1..120"; + } + description "xxxx"; + } + uses aggregation-function; + uses time; + } + } + + grouping operational-scope { + description "xxxx"; + container operational-scope { + description "xxxx"; + leaf value { + type enumeration { + enum "Network_Wide"{ + description "xxxx"; + } + enum "Availability_Zone"{ + description "xxxx"; + } + enum "Data_Center"{ + description "xxxx"; + } + enum "Tenant"{ + description "xxxx"; + } + enum "VM"{ + description "xxxx"; + } + enum "CPU"{ + description "xxxx"; + } + enum "Core"{ + description "xxxx"; + } + enum "Other"{ + description "xxxx"; + } + } + description "xxxx"; + } + leaf other { + type string{ + length "1..200"; + } + description "xxxx"; + } + } + } + + grouping threshold-value { + description "xxxx"; + container threshold-value { + description "xxxx"; + leaf value { + type uint32{ + range "0..9999999"; + } //TBD Change to type number + description "xxxx"; + } + leaf unit { + type enumeration { + enum "Absolute"{ + description "xxxx"; + } + enum "Percentage"{ + description "xxxx"; + } + } + description "xxxx"; + } + } + } + + grouping entitlement-metric { + description "xxxx"; + container entitlement-metric { + description "xxxx"; + leaf value { + type enumeration { + enum "Software_Instances_Count"{ + description "xxxx"; + } + enum "CPU"{ + description "xxxx"; + } + enum "Core"{ + description "xxxx"; + } + enum "Trunks"{ + description "xxxx"; + } + enum "User"{ + description "xxxx"; + } + enum "Subscribers"{ + description "xxxx"; + } + enum "Tenants"{ + description "xxxx"; + } + enum "Tokens"{ + description "xxxx"; + } + enum "Seats"{ + description "xxxx"; + } + enum "Units_TB"{ + description "xxxx"; + } + enum "Units_GB"{ + description "xxxx"; + } + enum "Units_MB"{ + description "xxxx"; + } + enum "Other"{ + description "xxxx"; + } + } + description "xxxx"; + } + leaf other { + type string{ + length "1..200"; + } + description "xxxx"; + } + } + } + + grouping aggregation-function { + description "xxxx"; + container aggregation-function { + description "xxxx"; + leaf value { + type enumeration { + enum "Peak"{ + description "xxxx"; + } + enum "Average"{ + description "xxxx"; + } + enum "Other"{ + description "xxxx"; + } + } + description "xxxx"; + } + leaf other { + type string{ + length "1..200"; + } + description "xxxx"; + } + } + } + + grouping time { + description "xxxx"; + container time { + description "xxxx"; + leaf value { + type enumeration { + enum "Hour"{ + description "xxxx"; + } + enum "Day"{ + description "xxxx"; + } + enum "Month"{ + description "xxxx"; + } + enum "Quarter"{ + description "xxxx"; + } + enum "Year"{ + description "xxxx"; + } + enum "Other"{ + description "xxxx"; + } + } + description "xxxx"; + } + leaf other { + type string{ + length "1..200"; + } + description "xxxx"; + } + } + } + + + + grouping license-key-groups { + description "xxxx"; + container license-key-group-list { + description "xxxx"; + leaf name { + type string; + description "xxxx"; + } + uses license-key-group; + } + } + + grouping license-key-group { + description "xxxx"; + list license-key-group { + description "xxxx"; + leaf license-key-group-uuid { + type string; + description "xxxx"; + } + leaf name { + type string{ + length "1..120"; + } + description "xxxx"; + } + leaf description { + type string{ + length "1..1000"; + } + description "xxxx"; + } + uses operational-scope; + leaf type { + type enumeration { + enum "Universal"{ + description "xxxx"; + } + enum "Unique"{ + description "xxxx"; + } + enum "One_Time"{ + description "xxxx"; + } + } + description "xxxx"; + } + } + } + + grouping vf-license-model-grouping { + description "xxxx"; + container vf-license-model { + description "xxxx"; + leaf vf-id { + type string{ + length "1..200"; + } + description "xxxx"; + } + leaf vendor-name { + type string{ + length "1..200"; + } + description "xxxx"; + } + uses feature-groups; + } + } + + grouping feature-groups { + description "xxxx"; + container feature-group-list { + description "xxxx"; + uses feature-group-grouping; + } + } + + grouping feature-group-grouping { + description "xxxx"; + list feature-group { + description "xxxx"; + leaf name{ + type string{ + length "1..120"; + } + description "xxxx"; + } + leaf feature-group-uuid{ + type string; + description "xxxx"; + } + leaf description { + type string{ + length "1..1000"; + } + description "xxxx"; + } + leaf att-part-number { + type string{ + length "1..100"; + } + description "xxxx"; + } + uses entitlement-pools; + uses license-key-groups; + } + } +} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml new file mode 100755 index 000000000..b4d538abd --- /dev/null +++ b/asdcApi/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + + org.onap.ccsdk.sli.northbound + sdnc-northbound + 0.0.1-SNAPSHOT + + + pom + org.onap.ccsdk.sli.northbound + asdcApi + 0.0.1-SNAPSHOT + + + asdcApi + + + + + + + org.onap.ccsdk.sli.northbound + asdcApi-features + features + xml + ${project.version} + + + + org.onap.ccsdk.sli.northbound + asdcApi-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + config + xml + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + + + + + + + + + + + model + features + provider + installer + + + diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml new file mode 100755 index 000000000..e8769fd7d --- /dev/null +++ b/asdcApi/provider/pom.xml @@ -0,0 +1,129 @@ + + + 4.0.0 + + asdcApi + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + asdcApi-provider + bundle + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.controller.config.yang.config.asdcApi_provider.impl + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${odl.yangtools.yang.maven.plugin.version} + + + config + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + + + org.opendaylight.mdsal + maven-sal-api-gen-plugin + ${odl.sal.api.gen.plugin.version} + jar + + + org.opendaylight.controller + yang-jmx-generator-plugin + ${odl.yang.jmx.generator.version} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/initial/asdcApi-provider.xml + xml + config + + + + + + + + + + + + org.onap.ccsdk.sli.northbound + asdcApi-model + ${project.version} + + + org.opendaylight.controller + config-api + ${odl.controller.config.api.version} + + + org.opendaylight.controller + sal-binding-config + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-binding-api + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-common-util + ${odl.mdsal.version} + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + + + diff --git a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java new file mode 100644 index 000000000..c9223a15c --- /dev/null +++ b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java @@ -0,0 +1,57 @@ +/*- + * ============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========================================================= + */ + +package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523; + +import org.openecomp.sdnc.asdcapi.AsdcApiProvider; + +public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModule { + public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523.AsdcApiProviderModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + + final AsdcApiProvider provider = new AsdcApiProvider(getDataBrokerDependency() + , getNotificationServiceDependency() + , getRpcRegistryDependency()); + + return new AutoCloseable() { + + @Override + public void close() throws Exception { + + provider.close(); + } + }; + } + +} diff --git a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java new file mode 100644 index 000000000..6a1d8068e --- /dev/null +++ b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ + +/* +* Generated file +* +* Generated from: yang module name: asdcApi-provider-impl yang module local name: asdcApi-provider-impl +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Wed Nov 02 03:46:08 EDT 2016 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523; +public class AsdcApiProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModuleFactory { + +} diff --git a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java new file mode 100644 index 000000000..28e59c8d7 --- /dev/null +++ b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java @@ -0,0 +1,415 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.asdcapi; + +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; +import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; +import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.http.xmlns.openecomp.org.asdc.license.model._1._0.rev160427.vf.license.model.grouping.VfLicenseModel; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.ASDCAPIService; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.Artifacts; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.ArtifactsBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInput; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInputBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateOutput; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateOutputBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelVersions; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelVersionsBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.artifacts.Artifact; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.artifacts.ArtifactBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.artifacts.ArtifactKey; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.vf.license.model.versions.VfLicenseModelVersion; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.vf.license.model.versions.VfLicenseModelVersionBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Optional; +import com.google.common.util.concurrent.CheckedFuture; +import com.google.common.util.concurrent.Futures; + +/** + * Defines a base implementation for your provider. This class extends from a helper class + * which provides storage for the most commonly used components of the MD-SAL. Additionally the + * base class provides some basic logging and initialization / clean up methods. + * + * To use this, copy and paste (overwrite) the following method into the TestApplicationProviderModule + * class which is auto generated under src/main/java in this project + * (created only once during first compilation): + * + *
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+
+         final asdcApiProvider provider = new asdcApiProvider();
+         provider.setDataBroker( getDataBrokerDependency() );
+         provider.setNotificationService( getNotificationServiceDependency() );
+         provider.setRpcRegistry( getRpcRegistryDependency() );
+         provider.initialize();
+         return new AutoCloseable() {
+
+            @Override
+            public void close() throws Exception {
+                //TODO: CLOSE ANY REGISTRATION OBJECTS CREATED USING ABOVE BROKER/NOTIFICATION
+                //SERVIE/RPC REGISTRY
+                provider.close();
+            }
+        };
+    }
+
+
+    
+ */ +public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { + + private static final String ACTIVE_VERSION = "active"; + + private final Logger log = LoggerFactory.getLogger( AsdcApiProvider.class ); + private final String appName = "asdcApi"; + + private final ExecutorService executor; + protected DataBroker dataBroker; + protected NotificationProviderService notificationService; + protected RpcProviderRegistry rpcRegistry; + + protected BindingAwareBroker.RpcRegistration rpcRegistration; + + public AsdcApiProvider(DataBroker dataBroker2, + NotificationProviderService notificationProviderService, + RpcProviderRegistry rpcProviderRegistry) { + this.log.info( "Creating provider for " + appName ); + executor = Executors.newFixedThreadPool(1); + dataBroker = dataBroker2; + notificationService = notificationProviderService; + rpcRegistry = rpcProviderRegistry; + initialize(); + } + + public void initialize(){ + log.info( "Initializing provider for " + appName ); + + + createContainers(); + + if (rpcRegistration == null) { + if (rpcRegistry != null) { + rpcRegistration = rpcRegistry.addRpcImplementation( + ASDCAPIService.class, this); + log.info("Initialization complete for " + appName); + } else { + log.warn("Error initializing " + appName + + " : rpcRegistry unset"); + } + } + } + + private void createContainers() { + + if (dataBroker != null) { + final WriteTransaction t = dataBroker.newReadWriteTransaction(); + + // Create the vf-model-license-versions and artifacts containers + t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(VfLicenseModelVersions.class), + new VfLicenseModelVersionsBuilder().build()); + + t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Artifacts.class), new ArtifactsBuilder().build()); + + + try { + CheckedFuture checkedFuture = t.submit(); + checkedFuture.get(); + log.info("Create Containers succeeded!: "); + + } catch (InterruptedException | ExecutionException e) { + log.error("Create Containers Failed: " + e); + e.printStackTrace(); + } + } else { + log.warn("createContainers : cannot find dataBroker to create containers"); + } + } + protected void initializeChild() { + //Override if you have custom initialization intelligence + } + + @Override + public void close() throws Exception { + log.info( "Closing provider for " + appName ); + executor.shutdown(); + rpcRegistration.close(); + log.info( "Successfully closed provider for " + appName ); + } + + public void setDataBroker(DataBroker dataBroker) { + this.dataBroker = dataBroker; + if( log.isDebugEnabled() ){ + log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); + } + } + + public void setNotificationService( + NotificationProviderService notificationService) { + this.notificationService = notificationService; + if( log.isDebugEnabled() ){ + log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); + } + } + + public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { + this.rpcRegistry = rpcRegistry; + + rpcRegistration = rpcRegistry.addRpcImplementation(ASDCAPIService.class, this); + + if( log.isDebugEnabled() ){ + log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); + } + } + + + protected boolean artifactVersionExists(String aName, String aVersion) { + InstanceIdentifier artifactInstanceId = + InstanceIdentifier.builder(Artifacts.class) + .child(Artifact.class, new ArtifactKey(aName, aVersion)).toInstance(); + ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); + Optional data = null; + try { + data = (Optional) readTx.read(LogicalDatastoreType.CONFIGURATION, artifactInstanceId).get(); + } catch (InterruptedException | ExecutionException e) { + log.error("Caught Exception reading MD-SAL for ["+aName+","+ aVersion+"] " ,e); + return false; + + } + + if (data.isPresent()) { + return true; + } else { + return false; + } + } + + protected void addArtifactVersion(String aName, String aVersion) { + + + try { + ArtifactBuilder aBuilder = new ArtifactBuilder(); + + aBuilder.setArtifactName(aName); + aBuilder.setArtifactVersion(aVersion); + + Artifact artifact = aBuilder.build(); + + InstanceIdentifier.InstanceIdentifierBuilder aIdBuilder = InstanceIdentifier + . builder(Artifacts.class) + .child(Artifact.class, artifact.getKey()); + + InstanceIdentifier path = aIdBuilder + .toInstance(); + + WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + + tx.merge(LogicalDatastoreType.CONFIGURATION, path, + artifact); + tx.submit().checkedGet(); + } catch (Exception e) { + log.error("Caught exception trying to add artifact entry", e); + } + + } + + + private void applyVfLicenseModelUpdate(VfLicenseModelUpdateInput input) { + + String aName = input.getArtifactName(); + String aVersion = input.getArtifactVersion(); + VfLicenseModel vfLicenseModel = input.getVfLicenseModel(); + + + // Add new version (version = artifact-version) + try { + + VfLicenseModelVersionBuilder vBuilder = new VfLicenseModelVersionBuilder(); + vBuilder.setArtifactName(aName); + vBuilder.setArtifactVersion(aVersion); + vBuilder.setVfLicenseModel(vfLicenseModel); + + VfLicenseModelVersion version = vBuilder.build(); + + InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier + . builder(VfLicenseModelVersions.class) + .child(VfLicenseModelVersion.class, version.getKey()); + + InstanceIdentifier path = versionIdBuilder + .toInstance(); + + WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + tx.merge(LogicalDatastoreType.CONFIGURATION, path, + version); + tx.submit().checkedGet(); + } catch (Exception e) { + log.error( + "Caught exception trying to save entry to MD-SAL", + e); + } + + + // Add "active" version (version = "active") + try { + + VfLicenseModelVersionBuilder vBuilder = new VfLicenseModelVersionBuilder(); + vBuilder.setArtifactName(aName); + vBuilder.setArtifactVersion(ACTIVE_VERSION); + vBuilder.setVfLicenseModel(vfLicenseModel); + + VfLicenseModelVersion version = vBuilder.build(); + InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier + . builder(VfLicenseModelVersions.class) + .child(VfLicenseModelVersion.class, version.getKey()); + + InstanceIdentifier path = versionIdBuilder + .toInstance(); + + WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + + tx.merge(LogicalDatastoreType.CONFIGURATION, path, + version); + tx.submit().checkedGet(); + } catch (Exception e) { + log.error( + "Caught exception trying to save entry to MD-SAL", + e); + } + +} + +@Override +public Future> vfLicenseModelUpdate(VfLicenseModelUpdateInput input) { + final String SVC_OPERATION = "vf-license-model-update"; + + Properties parms = new Properties(); + + log.info( SVC_OPERATION +" called." ); + + if(input == null ) { + log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + return null; + } + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(input); + input = inputBuilder.build(); + + String errorMessage = "Success"; + String errorCode = "200"; + + // If this artifact already exists, reject this update + if (artifactVersionExists(input.getArtifactName(), input.getArtifactVersion())) { + errorCode = "409"; + errorMessage = "Artifact version already exists"; + } else { + // Translate input object into SLI-consumable properties + log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); + AsdcApiUtil.toProperties(parms, input); + + + // Call directed graph + + Properties respProps = null; + + + AsdcApiSliClient sliClient = new AsdcApiSliClient(); + try + { + if (sliClient.hasGraph("ASDC-API", SVC_OPERATION , null, "sync")) + { + + try + { + respProps = sliClient.execute("ASDC-API", SVC_OPERATION, null, "sync", parms); + } + catch (Exception e) + { + log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + } + } else { + errorMessage = "No service logic active for ASDC-API: '" + SVC_OPERATION + "'"; + errorCode = "503"; + } + } + catch (Exception e) + { + errorCode = "500"; + errorMessage = e.getMessage(); + log.error("Caught exception looking for service logic", e); + } + + + if (respProps != null) + { + errorCode = respProps.getProperty("error-code"); + errorMessage = respProps.getProperty("error-message", ""); + } + } + + + if ("200".equals(errorCode)) { + log.info("ASDC update succeeded"); + + // Update config tree + applyVfLicenseModelUpdate(input); + addArtifactVersion(input.getArtifactName(), input.getArtifactVersion()); + + } else { + log.info("ASDC update failed ("+errorCode+" : "+errorMessage); + } + + // Send response + VfLicenseModelUpdateOutputBuilder respBuilder = new VfLicenseModelUpdateOutputBuilder(); + respBuilder.setAsdcApiResponseCode(errorCode); + if (errorMessage != null && errorMessage.length() > 0) { + respBuilder.setAsdcApiResponseText(errorMessage); + } + + RpcResult rpcResult; + + + rpcResult = RpcResultBuilder. status(true).withResult(respBuilder.build()).build(); + + + + return Futures.immediateFuture(rpcResult); +} + + +} diff --git a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java new file mode 100644 index 000000000..2f3a783ba --- /dev/null +++ b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java @@ -0,0 +1,111 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.asdcapi; + +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AsdcApiSliClient { + + private static final Logger LOG = LoggerFactory + .getLogger(AsdcApiSliClient.class); + + private SvcLogicService svcLogic = null; + + public AsdcApiSliClient() + { + BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); + + // Get SvcLogicService reference + ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); + if (sref != null) + { + svcLogic = (SvcLogicService) bctx.getService(sref); + } + else + { + LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); + + } + } + + public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException + { + return(svcLogic.hasGraph(module, rpc, version, mode)); + } + + + public Properties execute(String module, String rpc, String version, String mode, Properties parms) + throws SvcLogicException { + + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters passed to SLI"); + + for (Object key : parms.keySet()) { + String parmName = (String) key; + String parmValue = parms.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters returned by SLI"); + + for (Object key : respProps.keySet()) { + String parmName = (String) key; + String parmValue = respProps.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { + + if (!respProps.containsKey("error-code")) { + respProps.setProperty("error-code", "500"); + } + } else { + if (!respProps.containsKey("error-code")) { + respProps.setProperty("error-code", "200"); + } + } + + + return (respProps); + } + +} diff --git a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java new file mode 100644 index 000000000..240c939b4 --- /dev/null +++ b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java @@ -0,0 +1,48 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.asdcapi; + +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.ArtifactsBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInput; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInputBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelVersionsBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.vf.license.model.versions.VfLicenseModelVersionBuilder; + +public class AsdcApiUtil extends MdsalHelper { + + static { + + // Input objects + + VfLicenseModelUpdateInput i13 = new VfLicenseModelUpdateInputBuilder().build(); + + + // Other builders + ArtifactsBuilder b1 = new ArtifactsBuilder(); + + VfLicenseModelVersionsBuilder b14a = new VfLicenseModelVersionsBuilder(); + VfLicenseModelVersionBuilder b26a = new VfLicenseModelVersionBuilder(); + + + } +} diff --git a/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml b/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml new file mode 100644 index 000000000..ab2da905f --- /dev/null +++ b/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + prefix:asdcApi-provider-impl + + asdcApi-provider-impl + + + + binding:binding-rpc-registry + binding-rpc-broker + + + + binding:binding-async-data-broker + binding-data-broker + + + + + binding:binding-notification-service + + binding-notification-broker + + + + + + + + + + + org:openecomp:sdnc:asdcapi:provider:impl?module=asdcApi-provider-impl&revision=2014-05-23 + + + diff --git a/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang b/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang new file mode 100755 index 000000000..94ee88368 --- /dev/null +++ b/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang @@ -0,0 +1,61 @@ +module asdcApi-provider-impl { + + yang-version 1; + namespace "org:openecomp:sdnc:asdcapi:provider:impl"; + prefix "asdcApi-provider-impl"; + + import config { prefix config; revision-date 2013-04-05; } + import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } + + description + "This module contains the base YANG definitions for + asdcApi-provider impl implementation."; + + revision "2014-05-23" { + description + "Initial revision."; + } + + // This is the definition of the service implementation as a module identity. + identity asdcApi-provider-impl { + base config:module-type; + + // Specifies the prefix for generated java classes. + config:java-name-prefix AsdcApiProvider; + } + + // Augments the 'configuration' choice node under modules/module. + // We consume the three main services, RPCs, DataStore, and Notifications + augment "/config:modules/config:module/config:configuration" { + case asdcApi-provider-impl { + when "/config:modules/config:module/config:type = 'asdcApi-provider-impl'"; + + container rpc-registry { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity mdsal:binding-rpc-registry; + } + } + } + + container notification-service { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity mdsal:binding-notification-service; + } + } + } + + container data-broker { + uses config:service-ref { + refine type { + mandatory false; + config:required-identity mdsal:binding-async-data-broker; + } + } + } + } + } +} diff --git a/dataChange/.gitignore b/dataChange/.gitignore new file mode 100755 index 000000000..b73caf31e --- /dev/null +++ b/dataChange/.gitignore @@ -0,0 +1,34 @@ +#####standard .git ignore entries##### + +## IDE Specific Files ## +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +maven-eclipse.xml +workspace + +## Compilation Files ## +*.class +**/target +target +target-ide +MANIFEST.MF + +## Misc Ignores (OS specific etc) ## +bin/ +dist +*~ +*.ipr +*.iml +*.iws +classes +out/ +.DS_STORE +.metadata + +## Folders which contain auto generated source code ## +yang-gen-config +yang-gen-sal diff --git a/dataChange/.sonar/checkstyle.xml b/dataChange/.sonar/checkstyle.xml new file mode 100755 index 000000000..3fa231535 --- /dev/null +++ b/dataChange/.sonar/checkstyle.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dataChange/.sonar/pmd.xml b/dataChange/.sonar/pmd.xml new file mode 100755 index 000000000..80343b3bd --- /dev/null +++ b/dataChange/.sonar/pmd.xml @@ -0,0 +1,67 @@ + + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 2 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 5 + + + 2 + + + 3 + + + 3 + + + diff --git a/dataChange/README.txt b/dataChange/README.txt new file mode 100755 index 000000000..f9f4a2ab5 --- /dev/null +++ b/dataChange/README.txt @@ -0,0 +1,35 @@ +====================== +Introduction +====================== +You have generated an MD-SAL module using the Brocade Archetype. + +* You should be able to successfully run 'mvn clean install' on this project. +* This will produce a .zip file under the karaf.extension directory which you can deploy using +Brocade's extension deployment mechanism. + +====================== +Next Steps: +====================== +* run a 'mvn clean install' if you haven't already. This will generate some code from the yang models. +* Modify the model yang file under the model project. +* Follow the comments in the generated provider class to wire your new provider into the generated +code. +* Modify the generated provider model to respond to and handle the yang model. Depending on what +you added to your model you may need to inherit additional interfaces or make other changes to +the provider model. + +====================== +Generated Bundles: +====================== +* model + - Provides the yang model for your application. This is your primary northbound interface. +* provider + - Provides a template implementation for a provider to respond to your yang model. +* features + - Defines a karaf feature. If you add dependencies on third-party bundles then you will need to + modify the features.xml to list out the dependencies. +* karaf.extension + - Bundles all of the jars and third party dependencies (minus ODL dependencies) into a single + .zip file with the necessary configuration files to work correctly with the Brocade extension + mechanism. + diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml new file mode 100755 index 000000000..123404479 --- /dev/null +++ b/dataChange/features/pom.xml @@ -0,0 +1,136 @@ + + + 4.0.0 + + dataChange + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + org.onap.ccsdk.sli.northbound + dataChange-features + 0.0.1-SNAPSHOT + + jar + + + + org.onap.ccsdk.sli.northbound + dataChange-model + + + org.onap.ccsdk.sli.northbound + dataChange-provider + config + xml + + + org.onap.ccsdk.sli.northbound + dataChange-provider + + + + org.opendaylight.mdsal + features-mdsal + features + ${odl.mdsal.features.version} + xml + + runtime + + + + + + + org.opendaylight.controller + opendaylight-karaf-empty + ${odl.karaf.empty.distro.version} + zip + + + + + + org.opendaylight.odlparent + features-test + test + ${odl.commons.opendaylight.version} + + + + org.opendaylight.yangtools + features-yangtools + ${odl.yangtools.version} + features + xml + runtime + + + + + + + true + src/main/resources + + + + + org.apache.maven.plugins + maven-resources-plugin + + + filter + + resources + + generate-resources + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/${features.file} + xml + features + + + + + + + + + diff --git a/dataChange/features/src/main/resources/features.xml b/dataChange/features/src/main/resources/features.xml new file mode 100644 index 000000000..2b4ac946f --- /dev/null +++ b/dataChange/features/src/main/resources/features.xml @@ -0,0 +1,39 @@ + + + + + + + mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features + + + + odl-mdsal-broker + sdnc-sli + mvn:org.openecomp.sdnc.northbound/dataChange-model/${project.version} + mvn:org.openecomp.sdnc.northbound/dataChange-provider/${project.version} + mvn:org.openecomp.sdnc.northbound/dataChange-provider/${project.version}/xml/config + + + diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml new file mode 100755 index 000000000..414719e10 --- /dev/null +++ b/dataChange/installer/pom.xml @@ -0,0 +1,140 @@ + + + 4.0.0 + + dataChange + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + dataChange-installer + dataChange - Karaf Installer + pom + + + sdnc-dataChange + sdnc-dataChange + mvn:org.onap.ccsdk.sli.northbound/dataChange-features/${project.version}/xml/features + false + + + + + + org.onap.ccsdk.sli.northbound + dataChange-features + ${project.version} + features + xml + + + * + * + + + + + + org.onap.ccsdk.sli.northbound + dataChange-provider + ${project.version} + + + + + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + false + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + false + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.openecomp.sdnc + sli-common,sli-provider,dblib-provider + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + + + diff --git a/dataChange/installer/src/assembly/assemble_installer_zip.xml b/dataChange/installer/src/assembly/assemble_installer_zip.xml new file mode 100644 index 000000000..e278872a1 --- /dev/null +++ b/dataChange/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,59 @@ + + + + + + installer_zip + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + + + + diff --git a/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100644 index 000000000..608200da1 --- /dev/null +++ b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,55 @@ + + + + + + mvnrepo_zip + + zip + + + + false + + + + target/assembly/ + . + + + + + + + + ../provider/src/main/resources/initial/${feature-name}-provider.xml + ./etc/opendaylight/karaf/200-${feature-name}-provider.xml + + + + + diff --git a/dataChange/installer/src/main/resources/scripts/install-feature.sh b/dataChange/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 000000000..9a47d2225 --- /dev/null +++ b/dataChange/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +### +# ============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========================================================= +### + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} +ODL_KARAF_CLIENT_OPTS=${ODL_KARAF_CLIENT_OPTS:-"-u karaf"} +INSTALLERDIR=$(dirname $0) + +REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip + +if [ -f ${REPOZIP} ] +then + unzip -d ${ODL_HOME} ${REPOZIP} +else + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 +fi + +${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:install ${features.boot} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml new file mode 100755 index 000000000..0d16ebfc0 --- /dev/null +++ b/dataChange/model/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + + dataChange + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + org.onap.ccsdk.sli.northbound + dataChange-model + 0.0.1-SNAPSHOT + bundle + + + + + + org.apache.felix + maven-bundle-plugin + true + + + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${odl.yangtools.yang.maven.plugin.version} + + + org.opendaylight.mdsal + maven-sal-api-gen-plugin + ${odl.sal.api.gen.plugin.version} + jar + + + + + + generate-sources + + + ${yang.file.directory} + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + + + + + + + org.opendaylight.mdsal + yang-binding + ${odl.mdsal.yang.binding.version} + + + org.opendaylight.yangtools + yang-common + ${odl.yangtools.version} + + + org.opendaylight.mdsal.model + ietf-inet-types + ${odl.ietf-inet-types.version} + + + org.opendaylight.mdsal.model + ietf-yang-types + ${odl.ietf-yang-types.version} + + + diff --git a/dataChange/model/src/main/yang/DataChange.yang b/dataChange/model/src/main/yang/DataChange.yang new file mode 100755 index 000000000..3d326f7be --- /dev/null +++ b/dataChange/model/src/main/yang/DataChange.yang @@ -0,0 +1,73 @@ +module DataChange { + + yang-version 1; + + namespace "org:openecomp:sdnc:datachange"; + + prefix datachg; + + organization "AT&T, Inc."; + + contact + "Dan Timoney "; + + description + "Defines API interface for notification of data changes"; + + revision "2015-05-19" { + description + "Initial draft"; + } + + grouping data-change-request { + + leaf aai-event-id { + type string; + } + + leaf aai-node-type { + type string; + } + + leaf aai-event-trigger { + type enumeration { + enum "Update"; + enum "Delete"; + } + } + + list key-data { + key key-name; + leaf key-name { + type string; + } + leaf key-value { + type string; + } + } + + leaf selflink { + type string; + } + + } + + grouping data-change-response { + + leaf data-change-response-code { + type string; + } + } + + rpc data-change-notification { + + input { + uses data-change-request; + } + + output { + uses data-change-response; + } + } + +} diff --git a/dataChange/pom.xml b/dataChange/pom.xml new file mode 100755 index 000000000..2e3d87494 --- /dev/null +++ b/dataChange/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + + org.onap.ccsdk.sli.northbound + sdnc-northbound + 0.0.1-SNAPSHOT + + + pom + org.onap.ccsdk.sli.northbound + dataChange + 0.0.1-SNAPSHOT + + + dataChange + + + + + + + org.onap.ccsdk.sli.northbound + dataChange-features + features + xml + ${project.version} + + + + org.onap.ccsdk.sli.northbound + dataChange-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-provider + ${project.version} + config + xml + + + org.onap.ccsdk.sli.northbound + dataChange-provider + ${project.version} + + + + + + + + model + features + provider + installer + + diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml new file mode 100755 index 000000000..5a7c7003d --- /dev/null +++ b/dataChange/provider/pom.xml @@ -0,0 +1,137 @@ + + + 4.0.0 + + dataChange + org.onap.ccsdk.sli.northbound + 0.0.1-SNAPSHOT + + dataChange-provider + bundle + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.controller.config.yang.config.DataChange_provider.impl + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${odl.yangtools.yang.maven.plugin.version} + + + + config + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + + + org.opendaylight.mdsal + maven-sal-api-gen-plugin + ${odl.sal.api.gen.plugin.version} + jar + + + org.opendaylight.controller + yang-jmx-generator-plugin + ${odl.yang.jmx.generator.version} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/initial/${feature-name}-provider.xml + xml + config + + + + + + + + + + + + org.onap.ccsdk.sli.northbound + dataChange-model + + + org.opendaylight.controller + config-api + + ${odl.controller.config.api.version} + + + org.opendaylight.controller + sal-binding-config + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-binding-api + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-common-util + ${odl.mdsal.version} + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + + + junit + junit + ${junit.version} + test + + + diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java new file mode 100644 index 000000000..c3dd110a9 --- /dev/null +++ b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java @@ -0,0 +1,55 @@ +/*- + * ============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========================================================= + */ + +package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523; + +import org.openecomp.sdnc.datachange.DataChangeProvider; + +public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.AbstractDataChangeProviderModule { + public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.DataChangeProviderModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + final DataChangeProvider provider = new DataChangeProvider(getDataBrokerDependency() + , getNotificationServiceDependency() + , getRpcRegistryDependency()); + + return new AutoCloseable() { + + @Override + public void close() throws Exception { + provider.close(); + } + }; + } + +} diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java new file mode 100644 index 000000000..2f4724961 --- /dev/null +++ b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ + +/* +* Generated file +* +* Generated from: yang module name: DataChange-provider-impl yang module local name: DataChange-provider-impl +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Wed Nov 02 06:00:03 EDT 2016 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523; +public class DataChangeProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.AbstractDataChangeProviderModuleFactory { + +} diff --git a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java new file mode 100644 index 000000000..5db3eff6d --- /dev/null +++ b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java @@ -0,0 +1,115 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.datachange; + +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutputBuilder; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DataChangeClient { + + private static final Logger LOG = LoggerFactory + .getLogger(DataChangeClient.class); + + private SvcLogicService svcLogic = null; + + public DataChangeClient() + { + BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); + + // Get SvcLogicService reference + ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); + if (sref != null) + { + svcLogic = (SvcLogicService) bctx.getService(sref); + + } + else + { + LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); + + } + } + + public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException + { + return(svcLogic.hasGraph(module, rpc, version, mode)); + } + + public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData) + throws SvcLogicException { + + Properties parms = new Properties(); + + return execute(module,rpc,version, mode,serviceData,parms); + } + + public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData, Properties parms) + throws SvcLogicException { + + parms = MdsalHelper.toProperties(parms, serviceData); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters passed to SLI"); + + for (Object key : parms.keySet()) { + String parmName = (String) key; + String parmValue = parms.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters returned by SLI"); + + for (Object key : respProps.keySet()) { + String parmName = (String) key; + String parmValue = respProps.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { + return (respProps); + } + + MdsalHelper.toBuilder(respProps, serviceData); + + return (respProps); + } + +} diff --git a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java new file mode 100644 index 000000000..791da5c05 --- /dev/null +++ b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java @@ -0,0 +1,181 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.datachange; + +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationInput; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationInputBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutput; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutputBuilder; +import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeService; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.util.concurrent.Futures; + +/** + * Defines a base implementation for your provider. This class extends from a helper class + * which provides storage for the most commonly used components of the MD-SAL. Additionally the + * base class provides some basic logging and initialization / clean up methods. + * + */ +public class DataChangeProvider implements AutoCloseable, DataChangeService{ + + private final Logger log = LoggerFactory.getLogger( DataChangeProvider.class ); + private final String appName = "DataChange"; + private final ExecutorService executor; + + protected DataBroker dataBroker; + protected NotificationProviderService notificationService; + protected RpcProviderRegistry rpcRegistry; + protected BindingAwareBroker.RpcRegistration rpcRegistration; + + + public DataChangeProvider(DataBroker dataBroker2, + NotificationProviderService notificationProviderService, + RpcProviderRegistry rpcProviderRegistry) { + this.log.info( "Creating provider for " + appName ); + executor = Executors.newFixedThreadPool(1); + dataBroker = dataBroker2; + notificationService = notificationProviderService; + rpcRegistry = rpcProviderRegistry; + initialize(); + } + + public void initialize(){ + log.info( "Initializing provider for " + appName ); + rpcRegistration = rpcRegistry.addRpcImplementation(DataChangeService.class, this); + log.info( "Initialization complete for " + appName ); + } + + protected void initializeChild() { + //Override if you have custom initialization intelligence + } + + @Override + public void close() throws Exception { + log.info( "Closing provider for " + appName ); + executor.shutdown(); + rpcRegistration.close(); + log.info( "Successfully closed provider for " + appName ); + } + + public void setDataBroker(DataBroker dataBroker) { + this.dataBroker = dataBroker; + if( log.isDebugEnabled() ){ + log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); + } + } + + public void setNotificationService( + NotificationProviderService notificationService) { + this.notificationService = notificationService; + if( log.isDebugEnabled() ){ + log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); + } + } + + public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { + this.rpcRegistry = rpcRegistry; + if( log.isDebugEnabled() ){ + log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); + } + } + + @Override + public Future> dataChangeNotification( + DataChangeNotificationInput input) { + final String SVC_OPERATION = "data-change-notification"; + + Properties parms = new Properties(); + DataChangeNotificationOutputBuilder serviceDataBuilder = new DataChangeNotificationOutputBuilder(); + + log.info( SVC_OPERATION +" called." ); + + if(input == null || input.getAaiEventId() == null) { + log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + serviceDataBuilder.setDataChangeResponseCode("403"); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); + return Futures.immediateFuture(rpcResult); + } + + // add input to parms + log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); + DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder(input); + MdsalHelper.toProperties(parms, inputBuilder.build()); + + // Call SLI sync method + // Get SvcLogicService reference + + DataChangeClient svcLogicClient = new DataChangeClient(); + Properties respProps = null; + + try + { + if (svcLogicClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) + { + try + { + respProps = svcLogicClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + } + catch (Exception e) + { + log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + serviceDataBuilder.setDataChangeResponseCode("500"); + } + } else { + log.error("No service logic active for DataChange: '" + SVC_OPERATION + "'"); + serviceDataBuilder.setDataChangeResponseCode("503"); + } + } + catch (Exception e) + { + log.error("Caught exception looking for service logic", e); + serviceDataBuilder.setDataChangeResponseCode("500"); + } + + String errorCode = serviceDataBuilder.getDataChangeResponseCode(); + + if ( errorCode != null && errorCode.length() != 0 && !( errorCode.equals("0")|| errorCode.equals("200"))) { + log.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); + } else { + log.info("Returned SUCCESS for "+SVC_OPERATION+" "); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } +} diff --git a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml new file mode 100644 index 000000000..2812ca4d7 --- /dev/null +++ b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + prefix:DataChange-provider-impl + + DataChange-provider-impl + + + + binding:binding-rpc-registry + binding-rpc-broker + + + + binding:binding-async-data-broker + binding-data-broker + + + + + binding:binding-notification-service + + binding-notification-broker + + + + + + + + + + + org:openecomp:sdnc:datachange:provider:impl?module=DataChange-provider-impl&revision=2014-05-23 + + + diff --git a/dataChange/provider/src/main/yang/DataChange-provider-impl.yang b/dataChange/provider/src/main/yang/DataChange-provider-impl.yang new file mode 100755 index 000000000..fe1dab235 --- /dev/null +++ b/dataChange/provider/src/main/yang/DataChange-provider-impl.yang @@ -0,0 +1,61 @@ +module DataChange-provider-impl { + + yang-version 1; + namespace "org:openecomp:sdnc:datachange:provider:impl"; + prefix "DataChange-provider-impl"; + + import config { prefix config; revision-date 2013-04-05; } + import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } + + description + "This module contains the base YANG definitions for + DataChange-provider impl implementation."; + + revision "2014-05-23" { + description + "Initial revision."; + } + + // This is the definition of the service implementation as a module identity. + identity DataChange-provider-impl { + base config:module-type; + + // Specifies the prefix for generated java classes. + config:java-name-prefix DataChangeProvider; + } + + // Augments the 'configuration' choice node under modules/module. + // We consume the three main services, RPCs, DataStore, and Notifications + augment "/config:modules/config:module/config:configuration" { + case DataChange-provider-impl { + when "/config:modules/config:module/config:type = 'DataChange-provider-impl'"; + + container rpc-registry { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity mdsal:binding-rpc-registry; + } + } + } + + container notification-service { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity mdsal:binding-notification-service; + } + } + } + + container data-broker { + uses config:service-ref { + refine type { + mandatory false; + config:required-identity mdsal:binding-async-data-broker; + } + } + } + } + } +} diff --git a/dmaap-listener/.gitignore b/dmaap-listener/.gitignore new file mode 100755 index 000000000..1b8a6ba9d --- /dev/null +++ b/dmaap-listener/.gitignore @@ -0,0 +1,12 @@ +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +maven-eclipse.xml +*.class +target/ +MANIFEST.MF +.DS_STORE +.metadata diff --git a/dmaap-listener/.sonar/checkstyle.xml b/dmaap-listener/.sonar/checkstyle.xml new file mode 100755 index 000000000..3fa231535 --- /dev/null +++ b/dmaap-listener/.sonar/checkstyle.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dmaap-listener/.sonar/pmd.xml b/dmaap-listener/.sonar/pmd.xml new file mode 100755 index 000000000..80343b3bd --- /dev/null +++ b/dmaap-listener/.sonar/pmd.xml @@ -0,0 +1,67 @@ + + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 2 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 5 + + + 2 + + + 3 + + + 3 + + + diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml new file mode 100755 index 000000000..9ab23cdea --- /dev/null +++ b/dmaap-listener/pom.xml @@ -0,0 +1,115 @@ + + 4.0.0 + org.onap.ccsdk.sli.northbound + jar + dmaap-listener + 0.0.1-SNAPSHOT + + DMAAP Listener + DMAAP Listener + + org.onap.ccsdk.sli.northbound + sdnc-northbound + 0.0.1-SNAPSHOT + + + 1.1.7-SNAPSHOT + 2.9.0.pr1 + true + /opt/app/dmaap-listener + 0.2.12 + yyMMdd-HHmmss + ${maven.build.timestamp} + ${project.version}-${build.number} + + + + + + com.att.nsa + dmaapClient + ${dmaap.listener.version} + + + org.slf4j + slf4j-api + 1.7.10 + + + org.slf4j + slf4j-log4j12 + 1.6.1 + compile + + + log4j + log4j + 1.2.17 + + + com.fasterxml.jackson.core + jackson-core + ${fasterxml.jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${fasterxml.jackson.version} + + + junit + junit + ${junit.version} + test + + + org.onap.ccsdk.sli.core + dblib-provider + ${sdnctl.dblib.version} + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + true + + 1.7 + 1.7 + + + + + + maven-assembly-plugin + 2.6 + + + create-zip + + single + + package + + true + ${project.artifactId}.${project.version} + true + + src/assembly/assemble_zip.xml + + false + + + + + + + + + diff --git a/dmaap-listener/src/assembly/assemble_zip.xml b/dmaap-listener/src/assembly/assemble_zip.xml new file mode 100644 index 000000000..15f6bf4d2 --- /dev/null +++ b/dmaap-listener/src/assembly/assemble_zip.xml @@ -0,0 +1,61 @@ + + + + + + assemble_zip + + zip + + + false + + + + src/main/scripts + bin + + + target + lib + + *.jar + + + + src/main/resources + lib + + *.properties + *.map + + + + + + lib + true + runtime + + + diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java new file mode 100644 index 000000000..7096d83bf --- /dev/null +++ b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java @@ -0,0 +1,165 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.dmaapclient; + +import java.io.File; +import java.io.FileInputStream; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DmaapListener { + + private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + private static final Logger LOG = LoggerFactory + .getLogger(DmaapListener.class); + + public static void main(String[] args) { + + Properties properties = new Properties(); + + + String propFileName = DMAAP_LISTENER_PROPERTIES; + + if (args.length > 0) { + propFileName = args[0]; + } + + String propPath = null; + String propDir = System.getenv(SDNC_CONFIG_DIR); + + List consumers = new LinkedList(); + + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + + if (!propFileName.startsWith("/")) { + propPath = propDir + "/" + propFileName; + } + + File propFile = new File(propPath); + + if (!propFile.canRead()) { + LOG.error("Cannot read properties file "+propPath); + System.exit(1); + } + + try { + properties.load(new FileInputStream(propFile)); + } catch (Exception e) { + LOG.error("Caught exception loading properties from "+propPath, e); + System.exit(1); + } + + String subscriptionStr = properties.getProperty("subscriptions"); + + boolean threadsRunning = false; + + LOG.debug("Dmaap subscriptions : "+subscriptionStr); + + if (subscriptionStr != null) { + String[] subscriptions = subscriptionStr.split(";"); + + for (int i = 0; i < subscriptions.length; i++) { + String[] subscription = subscriptions[i].split(":"); + String consumerClassName = subscription[0]; + String propertyPath = subscription[1]; + + LOG.debug("Handling subscription [" + consumerClassName + "," + propertyPath + "]"); + + if (propertyPath == null) { + LOG.error("Invalid subscription (" + subscriptions[i] + ") property file missing"); + continue; + } + + if (!propertyPath.startsWith("/")) { + propertyPath = propDir + "/" + propertyPath; + } + + Class consumerClass = null; + + try { + consumerClass = Class.forName(consumerClassName); + } catch (Exception e) { + LOG.error("Could not find DMaap consumer class " + consumerClassName); + } + + if (consumerClass != null) { + + SdncDmaapConsumer consumer = null; + + try { + consumer = (SdncDmaapConsumer) consumerClass.newInstance(); + } catch (Exception e) { + LOG.error("Could not create consumer from class " + consumerClassName, e); + } + + if (consumer != null) { + LOG.debug("Initializing consumer " + consumerClassName + "(" + propertyPath + ")"); + consumer.init(properties, propertyPath); + + if (consumer.isReady()) { + Thread consumerThread = new Thread(consumer); + consumerThread.start(); + consumers.add(consumer); + threadsRunning = true; + LOG.info("Started consumer thread (" + consumerClassName + " : " + propertyPath + ")"); + } else { + LOG.debug("Consumer " + consumerClassName + " is not ready"); + } + } + + } + + } + } + + while (threadsRunning) { + + threadsRunning = false; + for (SdncDmaapConsumer consumer : consumers) { + if (consumer.isRunning()) { + threadsRunning = true; + } + } + + if (!threadsRunning) { + break; + } + + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + + } + } + + LOG.info("No listener threads running - exitting"); + + } +} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java new file mode 100644 index 000000000..5edc1c908 --- /dev/null +++ b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java @@ -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========================================================= + */ + +package org.openecomp.sdnc.dmaapclient; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DummyDmaapConsumer extends SdncDmaapConsumer { + + private static final Logger LOG = LoggerFactory + .getLogger(DummyDmaapConsumer.class); + + @Override + public void processMsg(String msg) { + LOG.info("Consumed message: \n"+msg); + } + +} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java new file mode 100644 index 000000000..3de5df6c2 --- /dev/null +++ b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java @@ -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========================================================= + */ + +package org.openecomp.sdnc.dmaapclient; + +public class InvalidMessageException extends Exception { + + public InvalidMessageException() { + super(); + } + + public InvalidMessageException(String msg) { + super(msg); + } + + public InvalidMessageException(String msg, Throwable t) { + super(msg, t); + } +} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java new file mode 100644 index 000000000..5b55bda5b --- /dev/null +++ b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java @@ -0,0 +1,146 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.dmaapclient; + +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.att.nsa.mr.client.MRClientFactory; +import com.att.nsa.mr.client.MRConsumer; +import com.att.nsa.mr.client.response.MRConsumerResponse; + +public abstract class SdncDmaapConsumer implements Runnable { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncDmaapConsumer.class); + + private String propertiesPath = ""; + private Properties properties = null; + MRConsumer consumer = null; + MRConsumerResponse consumerResponse = null; + boolean running = false; + boolean ready = false; + int fetchPause = 5000; // Default pause between fetchs - 5 seconds + + public boolean isReady() { + return ready; + } + + int timeout = 15000; // Default timeout - 15 seconds + + public boolean isRunning() { + return running; + } + + public SdncDmaapConsumer() { + + } + + public SdncDmaapConsumer(Properties properties, String propertiesPath) { + init(properties, propertiesPath); + } + + public String getProperty(String name) { + return(properties.getProperty(name, "")); + } + + public void init(Properties properties, String propertiesPath) { + + this.propertiesPath = propertiesPath; + + try { + + this.properties = (Properties) properties.clone(); + + this.properties.load(new FileInputStream(new File(propertiesPath))); + + String timeoutStr = properties.getProperty("timeout"); + + if ((timeoutStr != null) && (timeoutStr.length() > 0)) { + try { + timeout = Integer.parseInt(timeoutStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric value specified for timeout ("+timeoutStr+")"); + } + } + + String fetchPauseStr = properties.getProperty("fetchPause"); + if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { + try { + fetchPause = Integer.parseInt(fetchPauseStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric valud specified for fetchPause ("+fetchPauseStr+")"); + } + } + + this.consumer = MRClientFactory.createConsumer(propertiesPath); + ready = true; + } catch (Exception e) { + LOG.error("Error initializing DMaaP consumer from file "+propertiesPath, e); + } + } + + + @Override + public void run() { + if (ready) { + + running = true; + + while (running) { + + try { + boolean noData = true; + consumerResponse = consumer.fetchWithReturnConsumerResponse(timeout, -1); + for (String msg : consumerResponse.getActualMessages()) { + noData = false; + LOG.info("Received message from DMaaP:\n"+msg); + processMsg(msg); + } + + if (noData) { + if (fetchPause > 0) { + + LOG.info("No data received from fetch. Pausing "+fetchPause+" ms before retry"); + Thread.sleep(fetchPause); + } else { + + LOG.info("No data received from fetch. No fetch pause specified - retrying immediately"); + } + } + } catch (Exception e) { + LOG.error("Caught exception reading from DMaaP", e); + running = false; + } + + + } + } + + } + + abstract public void processMsg(String msg) throws InvalidMessageException; +} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java new file mode 100644 index 000000000..7e9c069ac --- /dev/null +++ b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java @@ -0,0 +1,196 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.dmaapclient; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSession; + +import org.apache.commons.codec.binary.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; + + +public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncFlatJsonDmaapConsumer.class); + + private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + private static final String SDNC_ENDPOINT = "SDNC.endpoint"; + + + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + processMsg(msg, null); + } + + public void processMsg(String msg, String mapDirName) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode instarRootNode = null; + ObjectNode sdncRootNode = null; + + String instarMsgName = null; + + try { + instarRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + Iterator> instarFields = instarRootNode.fields(); + + while (instarFields.hasNext()) { + Map.Entry entry = instarFields.next(); + + instarMsgName = entry.getKey(); + instarRootNode = entry.getValue(); + break; + } + + Map fieldMap = loadMap(instarMsgName, mapDirName); + + if (fieldMap == null) { + throw new InvalidMessageException("Unable to process message - cannot load field mappings"); + } + + if (!fieldMap.containsKey(SDNC_ENDPOINT)) { + throw new InvalidMessageException("No SDNC endpoint known for message "+instarMsgName); + } + + String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); + + sdncRootNode = oMapper.createObjectNode(); + ObjectNode inputNode = oMapper.createObjectNode(); + + + for (String fromField : fieldMap.keySet()) { + + if (!SDNC_ENDPOINT.equals(fromField)) { + JsonNode curNode = instarRootNode.get(fromField); + if (curNode != null) { + String fromValue = curNode.textValue(); + + inputNode.put(fieldMap.get(fromField), fromValue); + } + } + } + sdncRootNode.put("input", inputNode); + + try { + String rpcMsgbody = oMapper.writeValueAsString(sdncRootNode); + 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) { + + } + + } + + private Map loadMap(String msgType, String mapDirName) { + Map results = new HashMap(); + + + if (mapDirName == null) { + String rootdir = System.getenv(DMAAPLISTENERROOT); + + if ((rootdir == null) || (rootdir.length() == 0)) { + rootdir = "/opt/app/dmaap-listener"; + } + + mapDirName = rootdir + "/lib"; + + } + + String mapFilename = mapDirName + "/" + msgType + ".map"; + + File mapFile = new File(mapFilename); + + if (!mapFile.canRead()) { + LOG.error("Cannot read map file ("+mapFilename+")"); + return(null); + } + + try { + BufferedReader mapReader = new BufferedReader(new FileReader(mapFile)); + + String curLine = null; + + while ((curLine = mapReader.readLine()) != null) { + curLine = curLine.trim(); + + if ((curLine.length() > 0) && (!curLine.startsWith("#"))) { + + if (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/openecomp/sdnc/dmaapclient/SdncOdlConnection.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncOdlConnection.java new file mode 100644 index 000000000..6c6f308fb --- /dev/null +++ b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncOdlConnection.java @@ -0,0 +1,159 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.dmaapclient; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.ProtocolException; +import java.net.URL; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSession; + +import org.apache.commons.codec.binary.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class SdncOdlConnection { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncOdlConnection.class); + + private HttpURLConnection httpConn = null; + + private String url = null; + private String user = null; + private String password = null; + + private class SdncAuthenticator extends Authenticator { + + private String user; + private String passwd; + + SdncAuthenticator(String user, String passwd) { + this.user = user; + this.passwd = passwd; + } + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, passwd.toCharArray()); + } + + } + + private SdncOdlConnection() { + + } + + private SdncOdlConnection(String url, String user, String password) { + this.url = url; + this.user = user; + this.password = password; + + try { + URL sdncUrl = new URL(url); + Authenticator.setDefault(new SdncAuthenticator(user, password)); + + this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); + } catch (Exception e) { + LOG.error("Unable to create http connection", e); + } + } + + public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException + { + return (new SdncOdlConnection(url, user, password)); + } + + + + public String send(String method, String contentType, String msg) throws IOException { + + LOG.info("Sending REST " + method + " to " + url); + LOG.info("Message body:\n" + msg); + String authStr = user + ":" + password; + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + + httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); + + httpConn.setRequestMethod(method); + httpConn.setRequestProperty("Content-Type", contentType); + httpConn.setRequestProperty("Accept", contentType); + + httpConn.setDoInput(true); + httpConn.setDoOutput(true); + httpConn.setUseCaches(false); + + if (httpConn instanceof HttpsURLConnection) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); + } + + // Write message + httpConn.setRequestProperty("Content-Length", "" + msg.length()); + DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); + outStr.write(msg.getBytes()); + outStr.close(); + + // Read response + BufferedReader respRdr; + + LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); + + if (httpConn.getResponseCode() < 300) { + + respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); + } else { + respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); + } + + StringBuffer respBuff = new StringBuffer(); + + String respLn; + + while ((respLn = respRdr.readLine()) != null) { + respBuff.append(respLn + "\n"); + } + respRdr.close(); + + String respString = respBuff.toString(); + + LOG.info("Response body :\n" + respString); + + return (respString); + + } + + +} 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 diff --git a/dmaap-listener/src/main/scripts/start-dmaap-listener.sh b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh new file mode 100644 index 000000000..5eeb62bbf --- /dev/null +++ b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +### +# ============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========================================================= +### + +PROPERTY_DIR=${PROPERTY_DIR:-/opt/sdnc/data/properties} + +LISTENER=dmaap-listener + + + +PIDFILE=/tmp/.${LISTENER}-pid +UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/dmaap-listener} +JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-oracle} +JAVA_OPTS=${JAVA_OPTS:--Dhttps.protocols=TLSv1.1,TLSv1.2} +JAVA=${JAVA:-${JAVA_HOME}/bin/java} + +# Redirect output from script to $LISTENER.out +exec >> ${UEBLISTENERROOT}/logs/$LISTENER.out +exec 2>&1 + +if [ -f $PIDFILE ] +then + pid=$(cat $PIDFILE) + if [ "$pid" != "" ] + then + if kill -0 $pid + then + echo "$LISTENER already running" + exit 0 + fi + fi +fi + +if [ ! -d ${UEBLISTENERROOT}/logs ] +then + mkdir ${UEBLISTENERROOT}/logs +fi + +for file in ${UEBLISTENERROOT}/lib/*.jar +do + LISTENERCLASSPATH=$LISTENERCLASSPATH:$file +done + +${JAVA} ${JAVA_OPTS} -Dlog4j.configuration=file:${UEBLISTENERROOT}/lib/log4j.properties -cp ${LISTENERCLASSPATH} com.att.sdnctl.dmaapclient.DmaapListener & + + +echo $! > $PIDFILE + +echo "$LISTENER started!" +exit 0 diff --git a/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh b/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh new file mode 100644 index 000000000..42de474fb --- /dev/null +++ b/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +### +# ============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========================================================= +### + +PROPERTY_DIR=${PROPERTY_DIR:-/opt/sdnc/data/properties} + +LISTENER=dmaap-listener + + +PIDFILE=/tmp/.${LISTENER}-pid +UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/dmaap-listener} + +if [ -f $PIDFILE ] +then + pid=$(cat $PIDFILE) + if [ "$pid" != "" ] + then + if kill -0 $pid + then + echo "Stopping $LISTENER" + kill $pid && rm $PIDFILE + exit 0 + else + echo "$LISTENER not running" + exit 1 + fi + else + echo "$LISTENER not running" + exit 1 + fi +fi + + diff --git a/dmaap-listener/src/site/apt/index.apt b/dmaap-listener/src/site/apt/index.apt new file mode 100644 index 000000000..dd9d3ec39 --- /dev/null +++ b/dmaap-listener/src/site/apt/index.apt @@ -0,0 +1,46 @@ +~~~ +~~ ============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========================================================= +~~~ + + --- + UEB Listener + --- + + +UEB Listener + + The UEB Listener is a daemon that listens for notifications from SDC, posted to UEB (Universal Event Bus). + On receipt of an event, the UEB listener downloads any artifacts posted and examines them to determine if + the format (the outer XML tag) matches a supported format. If so, it posts the file to the ASDC-API REST + API in order to update the SDN-C database. + +File Locations + + * Root directory : /opt/app/ueb-listener + + * Log files : /opt/app/ueb-listener/logs + + * Incoming files to be processed : /opt/app/ueb-listener/spool/asdc/incoming + + * Files already processed : /opt/app/ueb-listener/spool/asdc/archive + + + + diff --git a/dmaap-listener/src/site/site.xml b/dmaap-listener/src/site/site.xml new file mode 100644 index 000000000..356c9c959 --- /dev/null +++ b/dmaap-listener/src/site/site.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/example-settings.xml b/example-settings.xml new file mode 100644 index 000000000..2e7ce6445 --- /dev/null +++ b/example-settings.xml @@ -0,0 +1,163 @@ + + + + + + + + openecomp-release + + + openecomp-release + openecomp-release + https://ecomp-nexus:8443/repository/maven-releases/ + + true + never + + + false + + + + + + openecomp-release + openecomp-release + https://ecomp-nexus:8443/repository/maven-releases/ + + true + never + + + false + + + + + + + openecomp-snapshots + + + openecomp-snapshot + openecomp-snapshot + https://ecomp-nexus:8443/repository/maven-snapshots/ + + false + + + true + + + + + + openecomp-snapshot + openecomp-snapshot + https://ecomp-nexus:8443/repository/maven-snapshots/ + + false + + + true + + + + + + opendaylight-release + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + + opendaylight-snapshots + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + + + openecomp-release + openecomp-snapshots + opendaylight-release + opendaylight-snapshots + + + + + nexus + USERNAME + PASSWORD + + + openecomp-release + USERNAME + PASSWORD + + + openecomp-snapshot + USERNAME + PASSWORD + + + diff --git a/jenkins-settings.xml b/jenkins-settings.xml new file mode 100644 index 000000000..344994f85 --- /dev/null +++ b/jenkins-settings.xml @@ -0,0 +1,168 @@ + + + + + + + + openecomp-release + + + openecomp-release + openecomp-release + https://ecomp-nexus:8443/repository/maven-releases/ + + true + never + + + false + + + + + + openecomp-release + openecomp-release + https://ecomp-nexus:8443/repository/maven-releases/ + + true + never + + + false + + + + + + + openecomp-snapshots + + + openecomp-snapshot + openecomp-snapshot + https://ecomp-nexus:8443/repository/maven-snapshots/ + + false + + + true + + + + + + openecomp-snapshot + openecomp-snapshot + https://ecomp-nexus:8443/repository/maven-snapshots/ + + false + + + true + + + + + + opendaylight-release + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + + opendaylight-snapshots + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + + + openecomp-release + openecomp-snapshots + opendaylight-release + opendaylight-snapshots + + + + + nexus + ${ecomp.nexus.user} + ${ecomp.nexus.password} + + + openecomp-release + ${ecomp.nexus.user} + ${ecomp.nexus.password} + + + openecomp-snapshot + ${ecomp.nexus.user} + ${ecomp.nexus.password} + + + sdnc-javadoc + ${ecomp.nexus.user} + ${ecomp.nexus.password} + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..4d2bb2092 --- /dev/null +++ b/pom.xml @@ -0,0 +1,119 @@ + + + + + org.onap.ccsdk.parent + odlparent-boron-sr3 + 0.0.1-SNAPSHOT + + + 4.0.0 + pom + org.onap.ccsdk.sli.northbound + sdnc-northbound + + SDN-C Northbound APIs + https://wiki.openecomp.org + The SDN-C Northbound APIs repo contains code for northbound API adaptors, typically MD-SAL applications + + + + JIRA + https://jira.openecomp.org/ + + + + + scm:git:ssh://git@${openecomp.git.host}/sdnc-northbound.git + + scm:git:ssh://${openecomp.git.host}:${openecomp.git.port}/${openecomp.git.project}/sdnc-northbound.git + ${openecomp.git.protocol}://${openecomp.git.host}/projects/${openecomp.git.project}/repos/sdnc-northbound/browse + + + + Jenkins + https://jenkins.openecomp.org/ + + + + + sdnc-javadoc + dav:https://${openecomp.nexus.host}:${openecomp.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} + + + + + blackduck + + + blackduck-scan + + + + + + com.blackducksoftware.integration + hub-maven-plugin + 1.4.0 + false + + ${project.name} + ${project.basedir} + + + + create-bdio-file + package + + createHubOutput + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.17 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + https://${openecomp.nexus.host} + ${openecomp.nexus.staging.profile-id} + ${openecomp.nexus.staging.server-id} + + + + + + + asdcApi + dataChange + dmaap-listener + ueb-listener + + + AT&T + + 0.0.1-SNAPSHOT + + + diff --git a/ueb-listener/.gitignore b/ueb-listener/.gitignore new file mode 100755 index 000000000..1b8a6ba9d --- /dev/null +++ b/ueb-listener/.gitignore @@ -0,0 +1,12 @@ +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +maven-eclipse.xml +*.class +target/ +MANIFEST.MF +.DS_STORE +.metadata diff --git a/ueb-listener/.sonar/checkstyle.xml b/ueb-listener/.sonar/checkstyle.xml new file mode 100755 index 000000000..3fa231535 --- /dev/null +++ b/ueb-listener/.sonar/checkstyle.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ueb-listener/.sonar/pmd.xml b/ueb-listener/.sonar/pmd.xml new file mode 100755 index 000000000..80343b3bd --- /dev/null +++ b/ueb-listener/.sonar/pmd.xml @@ -0,0 +1,67 @@ + + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 2 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 3 + + + 5 + + + 2 + + + 3 + + + 3 + + + diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml new file mode 100755 index 000000000..e0b96aaf4 --- /dev/null +++ b/ueb-listener/pom.xml @@ -0,0 +1,128 @@ + + 4.0.0 + org.onap.ccsdk.sli.northbound + jar + ueb-listener + 0.0.1-SNAPSHOT + + UEB Listener + UEB Listener + + org.onap.ccsdk.sli.northbound + sdnc-northbound + 0.0.1-SNAPSHOT + + + 1.1.7-SNAPSHOT + 2.9.0.pr1 + true + /opt/app/ueb-listener + yyMMdd-HHmmss + ${maven.build.timestamp} + ${project.version}-${build.number} + + + + + + org.openecomp.sdc.sdc-distribution-client + sdc-distribution-client + ${sdc.client.version} + compile + + + org.slf4j + slf4j-api + 1.7.10 + + + org.slf4j + slf4j-log4j12 + 1.6.1 + compile + + + log4j + log4j + 1.2.17 + + + com.fasterxml.jackson.core + jackson-core + ${fasterxml.jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${fasterxml.jackson.version} + + + junit + junit + ${junit.version} + test + + + org.onap.ccsdk.sli.core + dblib-provider + ${sdnctl.dblib.version} + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + true + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + true + org.openecomp.sdnc.uebclient.SdncUebClient + + + + + + + maven-assembly-plugin + 2.6 + + + create-zip + + single + + package + + true + ${project.artifactId}.${project.version} + true + + src/assembly/assemble_zip.xml + + false + + + + + + + + + diff --git a/ueb-listener/src/assembly/assemble_zip.xml b/ueb-listener/src/assembly/assemble_zip.xml new file mode 100644 index 000000000..d1f6679e1 --- /dev/null +++ b/ueb-listener/src/assembly/assemble_zip.xml @@ -0,0 +1,63 @@ + + + + + + assemble_zip + + zip + + + false + + + + src/main/bin + bin + + + target + lib + + *.jar + + + + src/main/resources + lib + + *.xslt + *.properties + + + + + + lib + true + runtime + + + diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java new file mode 100644 index 000000000..3472b443a --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java @@ -0,0 +1,53 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncARModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncARModel.class); + + public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract metadata + Metadata metadata = nodeTemplate.getMetadata(); + addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); + + // extract properties + //addParameter("role", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_ROLE)); + //addParameter("type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_TYPE)); - wrong location, get from metadata + addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); + addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); + //addParameter("depending_service", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_DEPENDINGSERVICE)); + //addParameter("service_dependency", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_SERVICEDEPENDENCY)); + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java new file mode 100644 index 000000000..4a9f02a8e --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java @@ -0,0 +1,134 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncArtifactMap { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncArtifactMap.class); + + public class SdncArtifactType { + private String tag; + private String artifactType; + private String rpc; + private int pass; + + public String getTag() { + return tag; + } + public String getArtifactType() { + return artifactType; + } + public String getRpc() { + return rpc; + } + + public int getPass() { + return pass; + } + + public String getRpcUrl(String base) { + return(base+rpc); + } + + private SdncArtifactType(String tag, String rpc, String pass) { + this.tag = tag; + this.rpc = rpc; + try { + this.pass = Integer.parseInt(pass); + } catch (Exception e) { + LOG.error("Invalid pass value for artifact map entry ("+tag+","+rpc+","+pass+")"); + } + } + } + + + + private Map mapItems = new HashMap(); + + private int NumPasses = 1; + + public int getNumPasses() { + return NumPasses; + } + + public void load(String fileName) { + + File mapFile = new File(fileName); + + if (mapFile.exists() && mapFile.canRead()) { + + BufferedReader rdr = null; + try { + + rdr = new BufferedReader(new FileReader(mapFile)); + + for (String ln ; (ln = rdr.readLine()) != null ; ) { + String[] lnFields = ln.split(","); + if (lnFields.length == 3) { + SdncArtifactType entry = new SdncArtifactType(lnFields[0], lnFields[1], lnFields[2]); + mapItems.put(entry.getTag(), entry); + if (entry.getPass() + 1 > NumPasses ) { + NumPasses = entry.getPass() + 1; + } + } + } + + + } catch (Exception e) { + LOG.error("Caught exception reading artifact map", e); + return; + } finally { + if (rdr != null) { + try { + rdr.close(); + } catch (IOException e) { + + } + } + } + } + } + + public SdncArtifactType getMapping(String tag) { + if (mapItems.containsKey(tag)) { + return(mapItems.get(tag)); + } else { + return(null); + } + } + + public static SdncArtifactMap getInstance() { + return new SdncArtifactMap(); + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java new file mode 100644 index 000000000..39c50aed0 --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java @@ -0,0 +1,297 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import java.util.HashMap; +import java.util.Map; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Group; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncBaseModel.class); + + protected String customizationUUID = null; + protected String invariantUUID = null; + protected String model_yaml = null; + protected String version = null; + + protected Map params = null; + protected ISdcCsarHelper sdcCsarHelper = null; + + public SdncBaseModel() { + + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { + + params = new HashMap(); + this.sdcCsarHelper = sdcCsarHelper; + + // extract service metadata + invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); + addParameter("invariant_uuid",invariantUUID); + addParameter("version",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + addParameter("name",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); + addParameter("description",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); + addParameter("type",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); + addParameter("category",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY)); + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + params = new HashMap(); + this.sdcCsarHelper = sdcCsarHelper; + + // extract nodeTemplate metadata + Metadata metadata = nodeTemplate.getMetadata(); + customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); + addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID)); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) { + + params = new HashMap(); + this.sdcCsarHelper = sdcCsarHelper; + + // extract group metadata + Metadata metadata = group.getMetadata(); + //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null + customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID"); + addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); + addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); + } + + protected void addParameter (String name, String value) { + if (value != null && !value.isEmpty()) { + params.put(name, "\"" + value + "\""); + } + } + + protected void addIntParameter (String name, String value) { + if (value != null && !value.isEmpty()) { + params.put(name, value); + } + } + + public static void addIntParameter (String name, String value, Map params) { + if (value != null && !value.isEmpty()) { + params.put(name, value); + } + } + + public static void addParameter (String name, String value, Map params) { + if (value != null && !value.isEmpty()) { + params.put(name, "\"" + value + "\""); + } + } + + protected String extractValue (Metadata metadata, String name) { + String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + public static String extractValue (ISdcCsarHelper sdcCsarHelper, Metadata metadata, String name) { + String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractValue (NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + public static String extractValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanValue (NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + public static String extractBooleanValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + protected String extractValue (Group group, String name) { + String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanValue (Group group, String name) { + String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + protected String extractInputDefaultValue (String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanInputDefaultValue (String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + public static String extractInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null) { + return value; + } else { + return ""; + } + } + + public static String extractBooleanInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + public static String extractSubstitutionMappingTypeName (ISdcCsarHelper sdcCsarHelper) { + String value = sdcCsarHelper.getServiceSubstitutionMappingsTypeName(); + if (value != null) { + return value; + } else { + return ""; + } + } + + public String getCustomizationUUID() { + return ("\"" + customizationUUID + "\""); + } + public String getCustomizationUUIDNoQuotes() { + return (customizationUUID); + } + public void setCustomizationUUID(String customizationUUID) { + this.customizationUUID = customizationUUID; + } + + public String getSql(String tableName, String model_yaml) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into " + tableName + " (customization_uuid, model_yaml, "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + getCustomizationUUID() + ", \"" + model_yaml + "\", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + + public static String getSql(String tableName, String keyName, String keyValue, String model_yaml, Map params) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into " + tableName + " (" + keyName + ", "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + keyValue + ", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java new file mode 100644 index 000000000..f8e5a5b8f --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java @@ -0,0 +1,145 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncNodeModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncNodeModel.class); + + private String serviceUUID = null; + private String ecompGeneratedNaming = null; + private String [] bindingUuids = null; + + // Using ASDC TOSCA Parser 17.07 + public SdncNodeModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract inputs + String ecompGeneratedNaming = extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING); + addParameter("ecomp_generated_naming",ecompGeneratedNaming); + addParameter("naming_policy", extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); + + // extract properties + addParameter("network_type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)); + addParameter("network_role", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)); + addParameter("network_scope", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)); + addParameter("network_technology", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)); + + // extract properties - network_assignments + addParameter("is_shared_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISSHAREDNETWORK)); + addParameter("is_external_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISEXTERNALNETWORK)); + + // extract properties - network_assignments - ipv4_subnet_default_assignment + String useIpv4 = extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#use_ipv4"); + addParameter("use_ipv4", useIpv4); + addParameter("ipv4_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#dhcp_enabled")); + if (useIpv4.contains("Y")) { + addParameter("ipv4_ip_version", "ipv4"); + } + addParameter("ipv4_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#cidr_mask")); + addParameter("eipam_v4_address_plan", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#ip_network_address_plan")); + + // extract properties - network_assignments - ipv6_subnet_default_assignment + String useIpv6 = extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#use_ipv6"); + addParameter("use_ipv6", useIpv6); + addParameter("ipv6_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#dhcp_enabled")); + if (useIpv6.contains("Y")) { + addParameter("ipv6_ip_version", "ipv6"); + } + addParameter("ipv6_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#cidr_mask")); + addParameter("eipam_v6_address_plan", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#ip_network_address_plan")); + + // extract properties - provider_network + addParameter("is_provider_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK)); + addParameter("physical_network_name", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_PHYSICALNETWORKNAME)); + + // extract properties - network_flows + addParameter("is_bound_to_vpn", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_ISBOUNDTOVPN)); + + // extract properties - network_flows - vpn_bindings + String vpnBindingString = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_VPNBINDING); + bindingUuids = vpnBindingString.split(","); + +} + + public String getServiceUUID() { + return serviceUUID; + } + public void setServiceUUID(String serviceUUID) { + this.serviceUUID = serviceUUID; + } + + public String getEcompGeneratedNaming() { + return ecompGeneratedNaming; + } + public void setEcompGeneratedNaming(String ecompGeneratedNaming) { + this.ecompGeneratedNaming = ecompGeneratedNaming; + if (ecompGeneratedNaming != null && !ecompGeneratedNaming.isEmpty()) { + params.put("ecomp_generated_naming", "\"" + ecompGeneratedNaming + "\""); + } + } + + public String getSql(String model_yaml) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + serviceUUID + ", " + getCustomizationUUID() + ", \"" + model_yaml + "\", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + + public String getVpnBindingsSql() { + + StringBuilder sb = new StringBuilder(); + for (int i=0; i < bindingUuids.length; i++) { + sb.append("INSERT into VPN_BINDINGS (network_customization_uuid, binding_uuid) values (" + getCustomizationUUID() + ", \"" + bindingUuids[i] + "\"); "); + } + + return sb.toString(); + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java new file mode 100644 index 000000000..4e0cffab1 --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java @@ -0,0 +1,158 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.URL; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSession; + +import org.apache.commons.codec.binary.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class SdncOdlConnection { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncOdlConnection.class); + + private HttpURLConnection httpConn = null; + + private String url = null; + private String user = null; + private String password = null; + + private class SdncAuthenticator extends Authenticator { + + private String user; + private String passwd; + + SdncAuthenticator(String user, String passwd) { + this.user = user; + this.passwd = passwd; + } + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, passwd.toCharArray()); + } + + } + + private SdncOdlConnection() { + + } + + private SdncOdlConnection(String url, String user, String password) { + this.url = url; + this.user = user; + this.password = password; + + try { + URL sdncUrl = new URL(url); + Authenticator.setDefault(new SdncAuthenticator(user, password)); + + this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); + } catch (Exception e) { + LOG.error("Unable to create http connection", e); + } + } + + public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException + { + return (new SdncOdlConnection(url, user, password)); + } + + + + public String send(String method, String contentType, String msg) throws IOException { + + LOG.info("Sending REST " + method + " to " + url); + LOG.info("Message body:\n" + msg); + String authStr = user + ":" + password; + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + + httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); + + httpConn.setRequestMethod(method); + httpConn.setRequestProperty("Content-Type", contentType); + httpConn.setRequestProperty("Accept", contentType); + + httpConn.setDoInput(true); + httpConn.setDoOutput(true); + httpConn.setUseCaches(false); + + if (httpConn instanceof HttpsURLConnection) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); + } + + // Write message + httpConn.setRequestProperty("Content-Length", "" + msg.length()); + DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); + outStr.write(msg.getBytes()); + outStr.close(); + + // Read response + BufferedReader respRdr; + + LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); + + if (httpConn.getResponseCode() < 300) { + + respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); + } else { + respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); + } + + StringBuffer respBuff = new StringBuffer(); + + String respLn; + + while ((respLn = respRdr.readLine()) != null) { + respBuff.append(respLn + "\n"); + } + respRdr.close(); + + String respString = respBuff.toString(); + + LOG.info("Response body :\n" + respString); + + return (respString); + + } + + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java new file mode 100644 index 000000000..0f645d7a3 --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java @@ -0,0 +1,98 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncServiceModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncServiceModel.class); + + private String UUID = null; + private String serviceInstanceNamePrefix = null; + private String filename = null; + + public SdncServiceModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { + + super(sdcCsarHelper, metadata); + + UUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_UUID); + + // extract service topology template input data + addParameter("ecomp_naming",extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING)); + addParameter("naming_policy",extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); + } + + public String getServiceUUID() { + return ("\"" + UUID + "\""); + } + public void setServiceUUID(String serviceUUID) { + this.UUID = serviceUUID; + } + public String getServiceInstanceNamePrefix() { + return serviceInstanceNamePrefix; + } + public void setServiceInstanceNamePrefix(String serviceInstanceNamePrefix) { + if (serviceInstanceNamePrefix != null && !serviceInstanceNamePrefix.isEmpty()) { + this.serviceInstanceNamePrefix = serviceInstanceNamePrefix; + params.put("service_instance_name_prefix", "\"" + serviceInstanceNamePrefix + "\""); + } + } + public String getFilename() { + return filename; + } + public void setFilename(String filename) { + this.filename = filename; + } + + public String getSql(String model_yaml) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into SERVICE_MODEL (service_uuid, model_yaml, filename, "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + getServiceUUID() + ", \"" + model_yaml + "\", \"" + filename + "\", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java new file mode 100644 index 000000000..496c2cef8 --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java @@ -0,0 +1,1125 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.sql.rowset.CachedRowSet; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathFactory; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.tuple.Pair; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.openecomp.sdc.api.IDistributionClient; +import org.openecomp.sdc.api.consumer.IDistributionStatusMessage; +import org.openecomp.sdc.api.consumer.INotificationCallback; +import org.openecomp.sdc.api.notification.IArtifactInfo; +import org.openecomp.sdc.api.notification.INotificationData; +import org.openecomp.sdc.api.notification.IResourceInstance; +import org.openecomp.sdc.api.results.IDistributionClientDownloadResult; +import org.openecomp.sdc.api.results.IDistributionClientResult; +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory; +import org.openecomp.sdc.toscaparser.api.Group; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.openecomp.sdc.utils.ArtifactTypeEnum; +import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.openecomp.sdc.utils.DistributionStatusEnum; +import org.openecomp.sdnc.uebclient.SdncArtifactMap.SdncArtifactType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class SdncUebCallback implements INotificationCallback { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncUebCallback.class); + + private static DBResourceManager jdbcDataSource = null; + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + + + private class SdncAuthenticator extends Authenticator { + + private final String user; + private final String passwd; + + SdncAuthenticator(String user, String passwd) { + this.user = user; + this.passwd = passwd; + } + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, passwd.toCharArray()); + } + + } + + private class DeployableArtifact { + SdncArtifactType type; + IArtifactInfo artifactInfo; + String svcName; + String resourceName; + String artifactName; + String artifactVersion; + File file; + + public String getArtifactName() { + return artifactName; + } + + + + public String getArtifactVersion() { + return artifactVersion; + } + + + public SdncArtifactType getType() { + return type; + } + + + + public IArtifactInfo getArtifactInfo() { + return artifactInfo; + } + + + public File getFile() { + return file; + } + + + + + public DeployableArtifact(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, File file) { + this.type = type; + this.artifactInfo = artifactInfo; + this.svcName = svcName; + this.resourceName = resourceName; + this.artifactName = artifactInfo.getArtifactName(); + this.artifactVersion = artifactInfo.getArtifactVersion(); + this.file = file; + } + + + public DeployableArtifact(SdncArtifactType type, String svcName, String resourceName, String artifactName, String artifactVersion, File file) { + this.type = type; + this.artifactInfo = null; + this.svcName = svcName; + this.resourceName = resourceName; + this.artifactName = artifactName; + this.artifactVersion = artifactVersion; + this.file = file; + } + + + + public String getSvcName() { + return svcName; + } + + + + public String getResourceName() { + return resourceName; + } + + } + + private final IDistributionClient client; + private final SdncUebConfiguration config; + + private LinkedList deployList[]; + + private static void setJdbcDataSource() throws IOException { + + String propPath = null; + String propDir = System.getenv(SDNC_CONFIG_DIR); + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + propPath = propDir + "/dblib.properties"; + File propFile = new File(propPath); + + if (!propFile.exists()) { + + throw new FileNotFoundException( + "Missing configuration properties file : " + + propFile); + } + + Properties props = new Properties(); + props.load(new FileInputStream(propFile)); + + try { + jdbcDataSource = DBResourceManager.create(props); + } catch(Throwable exc) { + LOG.error("", exc); + } + + if(((DBResourceManager)jdbcDataSource).isActive()){ + LOG.warn( "DBLIB: JDBC DataSource has been initialized."); + } else { + LOG.warn( "DBLIB: JDBC DataSource did not initialize successfully."); + } + } + + private static void loadArtifactMap() { + + } + + public SdncUebCallback(IDistributionClient client, SdncUebConfiguration config) { + this.client = client; + this.config = config; + + } + + @Override + public void activateCallback(INotificationData data) { + + LOG.info("Received notification : ("+data.getDistributionID()+","+data.getServiceName()+","+data.getServiceVersion()+ + ","+data.getServiceDescription() + ")"); + + String incomingDirName = config.getIncomingDir(); + String archiveDirName = config.getArchiveDir(); + + File incomingDir = null; + File archiveDir = null; + + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + + // Process service level artifacts + List artifactList = data.getServiceArtifacts(); + + if (artifactList != null) { + + incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName())); + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName())); + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + for (IArtifactInfo curArtifact : artifactList) + { + + LOG.info("Received artifact " + curArtifact.getArtifactName()); + + handleArtifact(data, data.getServiceName(), null, null, curArtifact, incomingDir, archiveDir); + } + } + + + // Process resource level artifacts + for (IResourceInstance curResource : data.getResources()) { + + LOG.info("Received resource : "+curResource.getResourceName()); + artifactList = curResource.getArtifacts(); + + if (artifactList != null) { + + incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + for (IArtifactInfo curArtifact : artifactList) + { + + LOG.info("Received artifact " + curArtifact.getArtifactName()); + + handleArtifact(data, data.getServiceName(), curResource.getResourceName(), curResource.getResourceType(), curArtifact, incomingDir, archiveDir); + } + } + } + + deployDownloadedFiles(incomingDir, archiveDir, data); + + + } + + + public void deployDownloadedFiles(File incomingDir, File archiveDir, INotificationData data) { + + if (incomingDir == null) { + incomingDir = new File(config.getIncomingDir()); + + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + } + + if (archiveDir == null) { + archiveDir = new File(config.getArchiveDir()); + + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + } + + String curFileName = ""; + try (DirectoryStream stream = Files.newDirectoryStream(incomingDir.toPath())) { + for (Path file: stream) { + curFileName = file.toString(); + handleSuccessfulDownload(null,null, null, null, file.toFile(), archiveDir); + } + } catch (Exception x) { + // IOException can never be thrown by the iteration. + // In this snippet, it can only be thrown by newDirectoryStream. + LOG.warn("Cannot process spool file "+ curFileName, x); + } + + // Deploy scheduled deployments + int numPasses = config.getMaxPasses(); + + deployList = new LinkedList[numPasses]; + + for (int i = 0 ; i < numPasses ; i++) { + deployList[i] = new LinkedList(); + } + for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) { + + if (deployList[pass] != null) { + while (! deployList[pass].isEmpty()) { + DeployableArtifact artifact = deployList[pass].pop(); + + DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_ERROR; + + + try { + + deployResult = deploySpoolFile(artifact); + } catch (Exception e) { + LOG.error("Caught exception trying to deploy file", e); + } + + + IArtifactInfo artifactInfo = artifact.getArtifactInfo(); + + if ((artifactInfo != null) && (data != null)) { + IDistributionClientResult deploymentStatus; + deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( + client, data, artifactInfo, + deployResult)); + } + + } + } + } + } + + private void handleArtifact(INotificationData data, String svcName, String resourceName, String resourceType, IArtifactInfo artifact, File incomingDir, File archiveDir) { + + // Download Artifact + IDistributionClientDownloadResult downloadResult = client + .download(artifact); + + if (downloadResult == null) { + + handleFailedDownload(data, artifact); + return; + } + + byte[] payloadBytes = downloadResult.getArtifactPayload(); + + if (payloadBytes == null) { + handleFailedDownload(data, artifact); + return; + } + + String payload = new String(payloadBytes); + + + File spoolFile = new File(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); + + boolean writeSucceeded = false; + + try { + FileWriter spoolFileWriter = new FileWriter(spoolFile); + spoolFileWriter.write(payload); + spoolFileWriter.close(); + writeSucceeded = true; + } catch (Exception e) { + LOG.error("Unable to save downloaded file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); + } + + + if (writeSucceeded && (downloadResult.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS)) { + handleSuccessfulDownload(data, svcName, resourceName, artifact, spoolFile, archiveDir); + + + } else { + handleFailedDownload(data, artifact); + } + + } + + private void handleFailedDownload(INotificationData data, + IArtifactInfo relevantArtifact) { + // Send Download Status + IDistributionClientResult sendDownloadStatus = client + .sendDownloadStatus(buildStatusMessage(client, data, + relevantArtifact, DistributionStatusEnum.DOWNLOAD_ERROR)); + } + + private void handleSuccessfulDownload(INotificationData data, String svcName, String resourceName, + IArtifactInfo artifact, File spoolFile, File archiveDir) { + + if ((data != null) && (artifact != null)) { + // Send Download Status + IDistributionClientResult sendDownloadStatus = client + .sendDownloadStatus(buildStatusMessage(client, data, artifact, DistributionStatusEnum.DOWNLOAD_OK)); + } + + // If an override file exists, read that instead of the file we just downloaded + ArtifactTypeEnum artifactEnum = ArtifactTypeEnum.YANG_XML; + + boolean toscaYamlType = false; + if (artifact != null) { + String artifactTypeString = artifact.getArtifactType(); + if (artifactTypeString.contains("TOSCA_TEMPLATE")) { + toscaYamlType = true; + } + } else { + if (spoolFile.toString().contains(".yml") || spoolFile.toString().contains(".csar")) { + toscaYamlType = true; + } + } + String overrideFileName = config.getOverrideFile(); + if ((overrideFileName != null) && (overrideFileName.length() > 0)) { + File overrideFile = new File(overrideFileName); + + if (overrideFile.exists()) { + artifactEnum = ArtifactTypeEnum.YANG_XML; + spoolFile = overrideFile; + } + + } + + if (toscaYamlType == true) { + processToscaYaml (data, svcName, resourceName, artifact, spoolFile, archiveDir); + + try { + Path source = spoolFile.toPath(); + Path targetDir = archiveDir.toPath(); + + Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); + } + + return; + } + + // Process spool file + Document spoolDoc = null; + File transformedFile = null; + + // Apply XSLTs and get Doc object + try { + if (!spoolFile.isDirectory()) { + transformedFile = applyXslts(spoolFile); + } + } catch (Exception e) { + LOG.error("Caught exception trying to parse XML file", e); + } + + if (transformedFile != null) { + try { + + try { + + DocumentBuilderFactory dbf = DocumentBuilderFactory + .newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + + spoolDoc = db.parse(transformedFile); + } catch (Exception e) { + LOG.error( + "Caught exception trying to parse transformed XML file " + + transformedFile.getAbsolutePath(), e); + } + + } catch (Exception e) { + LOG.error("Caught exception trying to deploy file", e); + } + } + + + if (spoolDoc != null) { + // Analyze file type + SdncArtifactType artifactType = analyzeFileType(artifactEnum, + spoolFile, spoolDoc); + + if (artifactType != null) { + + scheduleDeployment(artifactType, svcName, resourceName, artifact, spoolFile.getName(), transformedFile); + + } + + // SDNGC-2660 : Move file to archive directory even if it is an unrecognized type so that + // we do not keep trying and failing to process it. + try { + Path source = spoolFile.toPath(); + Path targetDir = archiveDir.toPath(); + + Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); + } + } + + + } + + + private void processToscaYaml(INotificationData data, String svcName, String resourceName, + IArtifactInfo artifact, File spoolFile, File archiveDir) { + + // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data + + // TOSCA data extraction flow 1707: + // Use ASDC dist-client to get yaml string - not yet available + String model_yaml = null; + LOG.info("Process TOSCA YAML file: "+spoolFile.toString()); + + SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); + ISdcCsarHelper sdcCsarHelper = null; + try { + sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath()); + } catch (SdcToscaParserException e) { + LOG.error("Could not create SDC TOSCA Parser ", e); + factory.close(); + return; + } + + // Ingest Service Data - 1707 + Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata(); + SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata); + serviceModel.setFilename(spoolFile.toString().substring(spoolFile.toString().lastIndexOf("/")+1)); // will be csar file name + serviceModel.setServiceInstanceNamePrefix(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).substring(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).lastIndexOf(".")+1)); + + try { + cleanUpExistingToscaServiceData(serviceModel.getServiceUUID()); + LOG.info("Call insertToscaData for SERVICE_MODEL serviceUUID = " + serviceModel.getServiceUUID()); + insertToscaData(serviceModel.getSql(model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); + factory.close(); + return; + } + + // Ingest Network (VL) Data - 1707 + //List vlNodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VL"); + List vlNodeTemplatesList = sdcCsarHelper.getServiceVlList(); + + for (NodeTemplate nodeTemplate : vlNodeTemplatesList) { + SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, nodeTemplate); + nodeModel.setServiceUUID(serviceModel.getServiceUUID()); + nodeModel.setEcompGeneratedNaming(SdncBaseModel.extractBooleanInputDefaultValue(sdcCsarHelper, SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING));//service_naming#default#ecomp_generated_naming + + try { + cleanUpExistingToscaData("NETWORK_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); + cleanUpExistingToscaData("VPN_BINDINGS", "network_customization_uuid", nodeModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for NETWORK_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); + // using ASDC dist-client use method for get yaml string + insertToscaData(nodeModel.getSql(model_yaml)); + insertToscaData(nodeModel.getVpnBindingsSql()); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); + } + } + + // Ingest Allotted Resource Data - 1707 + List arNodeTemplatesList = sdcCsarHelper.getAllottedResources(); + + for (NodeTemplate nodeTemplate : arNodeTemplatesList) { + SdncARModel nodeModel = new SdncARModel (sdcCsarHelper, nodeTemplate); + + try { + cleanUpExistingToscaData("ALLOTTED_RESOURCE_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for ALLOTTED_RESOURCE_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); + // using ASDC dist-client use method for get yaml string + insertToscaData(nodeModel.getSql("ALLOTTED_RESOURCE_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); + } + } + + // Ingest Network (VF) Data - 1707 + //List nodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VF"); + List vfNodeTemplatesList = sdcCsarHelper.getServiceVfList(); + + for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { + SdncVFModel vfNodeModel = new SdncVFModel (sdcCsarHelper, nodeTemplate); + + try { + cleanUpExistingToscaData("VF_MODEL", "customization_uuid", vfNodeModel.getCustomizationUUID()) ; + LOG.info("Call insertToscaData for VF_MODEL customizationUUID = " + vfNodeModel.getCustomizationUUID()); + insertToscaData(vfNodeModel.getSql("VF_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_MODEL table ", e); + } + + // For each VF, insert VF_MODULE_MODEL data + List vfModules = sdcCsarHelper.getVfModulesByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); + for (Group group : vfModules){ + SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, group); + + try { + cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_MODULE_MODEL customizationUUID = " + vfModuleModel.getCustomizationUUID()); + insertToscaData(vfModuleModel.getSql("VF_MODULE_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_MODULE_MODEL table ", e); + } + + // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data + // List groupMembers = sdcCsarHelper.getMembersOfGroup(group); - old version + // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. + // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING + List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); // not yet available + for (NodeTemplate vfcNode : groupMembers){ + SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); + + try { + cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING customizationUUID = " + vfModuleModel.getCustomizationUUID()); + insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + + vfModuleModel.getCustomizationUUID() + ", " + vfcModel.getCustomizationUUID() + ", \"" + vfcModel.getVmType() + "\", \"" + vfcModel.getVmCount() + "\")"); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_MODULE_TO_VFC_MAPPING table ", e); + } + + } + + } + + // For each VF, insert VFC_MODEL data + List vfcNodes = sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); + for (NodeTemplate vfcNode : vfcNodes){ + SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); + + try { + cleanUpExistingToscaData("VFC_MODEL", "customization_uuid", vfcModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VFC_MODEL customizationUUID = " + vfcModel.getCustomizationUUID()); + insertToscaData(vfcModel.getSql("VFC_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VFC_MODEL table ", e); + } + + } + + // For each VF, insert VF_TO_NETWORK_ROLE_MAPPING data + List cpNodes = sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); + for (NodeTemplate cpNode : cpNodes){ + + // Insert into VF_TO_NETWORK_ROLE_MAPPING vf_customization_uuid and network_role + String cpNetworkRole = sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, "network_role_tag"); + + try { + cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", vfNodeModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING vfCustomizationUUID = " + vfNodeModel.getCustomizationUUID()); + insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + + vfNodeModel.getCustomizationUUID() + ", \"" + cpNetworkRole + "\")"); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_TO_NETWORK_ROLE_MAPPING table ", e); + } + + // Insert VFC_TO_NETWORK_ROLE_MAPPING data + Map mappingParams = new HashMap(); + //String cpNetworkRoleTag = "\"" + sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLETAG) + "\""; + // extract network_role, network_role_tag and virtual_binding from this cpNode + SdncBaseModel.addParameter("network_role", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role"), mappingParams); + SdncBaseModel.addParameter("network_role_tag", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role_tag"), mappingParams); + String virtualBinding = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "requirements#virtualBinding") + "\""; + + // get list of cpNodes and vfcNodes with matching virtualBinding + List> matchList = sdcCsarHelper.getNodeTemplatePairsByReqName(sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), virtualBinding); + for (Pair match : matchList) { // should be 1 match? + + // extract values from the left "CP" Node + SdncBaseModel.addParameter("ipv4_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); + //SdncBaseModel.addParameter("ipv4_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); + SdncBaseModel.addParameter("ipv4_ip_version", "dummy_ipv4_vers", mappingParams); + SdncBaseModel.addParameter("ipv6_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); + //SdncBaseModel.addParameter("ipv6_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); + SdncBaseModel.addParameter("ipv6_ip_version", "dummy_ipv6_vers", mappingParams); + //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid + + // extract values from the right "VFC" Node + String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetadata(), "customization_uuid") + "\""; + SdncBaseModel.addParameter("vm_type", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_VMTYPE), mappingParams); + SdncBaseModel.addIntParameter("ipv4_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); + SdncBaseModel.addIntParameter("ipv6_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); + + try { + cleanUpExistingToscaData("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid); + LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING vfcCustomizationUUID = " + vfcCustomizationUuid); + insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid, "", mappingParams)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VFC_TO_NETWORK_ROLE_MAPPING table ", e); + } + + } + + } // CP loop + + } // VF loop + + // Close ASDC TOSCA Parser factory - we are done processing this distribution + factory.close(); + + if ((artifact != null) && (data != null)) { + LOG.info("Update to SDN-C succeeded"); + IDistributionClientResult deploymentStatus; + deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( + client, data, artifact, + DistributionStatusEnum.DEPLOY_OK)); + } + + } + + private void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException + { + + if (jdbcDataSource == null) { + setJdbcDataSource(); + } + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount != 0) { + LOG.info("cleanUpExistingToscaData: " + keyValue); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); + } + + } catch (SQLException e) { + LOG.error("Could not clean up existing " + tableName + " for " + keyValue, e); + } + + } + + + private void cleanUpExistingToscaServiceData(String serviceUUID) throws IOException + { + + if (jdbcDataSource == null) { + setJdbcDataSource(); + } + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData("SELECT * from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount != 0) { + LOG.info("cleanUpExistingToscaData: " + serviceUUID); + jdbcDataSource.writeData("DELETE from NETWORK_MODEL where service_uuid = " + serviceUUID + ";", null, null); + jdbcDataSource.writeData("DELETE from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, null); + } + + } catch (SQLException e) { + LOG.error("Could not clean up existing NETWORK_MODEL and SERVICE_MODEL for service_UUID " + serviceUUID, e); + } + + } + + + private void insertToscaData(String toscaDataString) throws IOException + { + LOG.debug("insertToscaData: " + toscaDataString); + + if (jdbcDataSource == null) { + setJdbcDataSource(); + } + try { + + jdbcDataSource.writeData(toscaDataString, null, null); + + } catch (SQLException e) { + LOG.error("Could not insert Tosca YAML data into the database ", e); + } + + } + + + private SdncArtifactType analyzeFileType(ArtifactTypeEnum artifactType, File spoolFile, Document spoolDoc) { + + if (artifactType != ArtifactTypeEnum.YANG_XML) { + LOG.error("Unexpected artifact type - expecting YANG_XML, got "+artifactType); + return (null); + } + + // Examine outer tag + + try { + + + Element root = spoolDoc.getDocumentElement(); + + String rootName = root.getTagName(); + + if (rootName.contains(":")) { + String[] rootNameElems = rootName.split(":"); + rootName = rootNameElems[rootNameElems.length - 1]; + } + + if (rootName != null) { + SdncArtifactType mapEntry = config.getMapping(rootName); + + + if (mapEntry == null) { + + LOG.error("Unexpected file contents - root tag is "+rootName); + } + return(mapEntry); + } else { + LOG.error("Cannot get root tag from file"); + return(null); + } + + } catch (Exception e) { + LOG.error("Could not parse YANG_XML file "+spoolFile.getName(), e); + return(null); + } + } + + private void scheduleDeployment(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, String spoolFileName, File spoolFile) { + + if (type.getPass() < deployList.length) { + + if (artifactInfo != null) { + LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); + + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); + } else { + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy + Date now = new Date(); + String artifactVersion = sdfDate.format(now); + LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); + String artifactName = spoolFileName; + if (artifactInfo != null) { + artifactName = artifactInfo.getArtifactName(); + } + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactName, artifactVersion, spoolFile)); + } + } else { + LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); + } + } + + + private DistributionStatusEnum deploySpoolFile(DeployableArtifact artifact) { + + DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_OK; + + StringBuffer msgBuffer = new StringBuffer(); + + + String namespace = config.getAsdcApiNamespace(); + if ((namespace == null) || (namespace.length() == 0)) { + namespace="com:att:sdnctl:asdcapi"; + } + + msgBuffer.append("\n"); + + String svcName = artifact.getSvcName(); + String resourceName = artifact.getResourceName(); + String artifactName = artifact.getArtifactName(); + + if (svcName != null) { + if (resourceName != null) { + artifactName = svcName + "/" + resourceName + "/" + artifactName; + } else { + artifactName = svcName + "/" + artifactName; + } + } + + msgBuffer.append(""+artifactName+"\n"); + msgBuffer.append(""+artifact.getArtifactVersion()+"\n"); + + + try { + BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile())); + + String curLine = rdr.readLine(); + + while (curLine != null) { + + if (!curLine.startsWith("\n"); + + + byte[] msgBytes = msgBuffer.toString().getBytes(); + + Document results = postRestXml(artifact.getType().getRpcUrl(config.getAsdcApiBaseUrl()), msgBytes); + + if (results == null) { + + deployResult = DistributionStatusEnum.DEPLOY_ERROR; + } else { + + XPathFactory xpf = XPathFactory.newInstance(); + XPath xp = xpf.newXPath(); + + String asdcApiResponseCode = "500"; + + try { + + asdcApiResponseCode = xp.evaluate("//asdc-api-response-code[position()=1]/text()", results.getDocumentElement()); + } catch (Exception e) { + LOG.error("Caught exception retrying to evaluate xpath", e); + } + + if (asdcApiResponseCode.contains("200")) { + LOG.info("Update to SDN-C succeeded"); + deployResult = DistributionStatusEnum.DEPLOY_OK; + } else { + LOG.info("Update to SDN-C failed (response code "+asdcApiResponseCode+")"); + + if (asdcApiResponseCode.contains("409")) { + deployResult = DistributionStatusEnum.ALREADY_DEPLOYED; + } else { + + deployResult = DistributionStatusEnum.DEPLOY_ERROR; + } + } + } + + + + return(deployResult); + } + + + + + + public static IDistributionStatusMessage buildStatusMessage( + final IDistributionClient client, final INotificationData data, + final IArtifactInfo relevantArtifact, + final DistributionStatusEnum status) { + IDistributionStatusMessage statusMessage = new IDistributionStatusMessage() { + + @Override + public long getTimestamp() { + long currentTimeMillis = System.currentTimeMillis(); + return currentTimeMillis; + } + + @Override + public DistributionStatusEnum getStatus() { + return status; + } + + @Override + public String getDistributionID() { + return data.getDistributionID(); + } + + @Override + public String getConsumerID() { + return client.getConfiguration().getConsumerID(); + } + + @Override + public String getArtifactURL() { + return relevantArtifact.getArtifactURL(); + } + }; + return statusMessage; + + } + + private HttpURLConnection getRestXmlConnection(String urlString, String method) throws IOException + { + URL sdncUrl = new URL(urlString); + Authenticator.setDefault(new SdncAuthenticator(config.getSdncUser(), config.getSdncPasswd())); + + HttpURLConnection conn = (HttpURLConnection) sdncUrl.openConnection(); + + String authStr = config.getSdncUser()+":"+config.getSdncPasswd(); + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + + conn.addRequestProperty("Authentication", "Basic "+encodedAuthStr); + + conn.setRequestMethod(method); + conn.setRequestProperty("Content-Type", "application/xml"); + conn.setRequestProperty("Accept", "application/xml"); + + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setUseCaches(false); + + return(conn); + + } + + private Document postRestXml(String urlString, byte[] msgBytes) { + Document response = null; + + try { + SdncOdlConnection odlConn = SdncOdlConnection.newInstance(urlString, config.getSdncUser(), config.getSdncPasswd()); + + String sdncResp = odlConn.send("POST", "application/xml", new String(msgBytes)); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + + + response = db.parse(new ByteArrayInputStream(sdncResp.getBytes())); + } catch (Exception e) { + LOG.error("Caught exception posting to ODL tier", e); + } + + return(response); + + } + + private File applyXslts(File srcFile) { + + Document doc = null; + + + File inFile = srcFile; + File outFile = null; + + String xsltPathList = config.getXsltPathList(); + + if ((xsltPathList == null) || (xsltPathList.length() == 0)) { + outFile = inFile; + } else { + + String[] xsltPaths = xsltPathList.split(","); + + for (String xsltPath : xsltPaths) { + try{ + + outFile = File.createTempFile("tmp", "xml"); + TransformerFactory factory = TransformerFactory.newInstance(); + Source xslt = new StreamSource(new File(xsltPath)); + Transformer transformer = factory.newTransformer(xslt); + Source text = new StreamSource(inFile); + + + transformer.transform(text, new StreamResult(outFile)); + + inFile = outFile; + + } catch (Exception e) { + LOG.error("Caught exception trying to apply XSLT template "+xsltPath, e); + + } + + } + } + + // After transformations, parse transformed XML + + + return(outFile); + } + + private String escapeFilename(String str) { + StringBuffer retval = new StringBuffer(); + + for (int i = 0 ; i < str.length() ; i++) { + char curchar = str.charAt(i); + if (Character.isJavaIdentifierPart(curchar)) { + retval.append(curchar); + } + } + + return(retval.toString()); + + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java new file mode 100644 index 000000000..df5dfc0a9 --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java @@ -0,0 +1,65 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import org.openecomp.sdc.api.IDistributionClient; +import org.openecomp.sdc.api.results.IDistributionClientResult; +import org.openecomp.sdc.impl.DistributionClientFactory; +import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncUebClient { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncUebConfiguration.class); + + public static void main(String[] args) { + IDistributionClient client = DistributionClientFactory + .createDistributionClient(); + + SdncUebConfiguration config = new SdncUebConfiguration(); + + SdncUebCallback cb = new SdncUebCallback(client, config); + + LOG.info("Scanning for local distribution artifacts before starting client"); + cb.deployDownloadedFiles(null, null, null); + + LOG.info("Initializing ASDC distribution client"); + + IDistributionClientResult result = client.init( + config, cb); + + LOG.info("Initialized ASDC distribution client - results = " + + result.getDistributionMessageResult()); + + if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { + LOG.info("Starting client..."); + IDistributionClientResult start = client.start(); + LOG.info("Client startup result = " + + start.getDistributionMessageResult()); + } + + + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java new file mode 100644 index 000000000..7855b5ba4 --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java @@ -0,0 +1,280 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +import org.openecomp.sdc.api.consumer.IConfiguration; +import org.openecomp.sdc.utils.ArtifactTypeEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncUebConfiguration implements IConfiguration{ + + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + private static final Logger LOG = LoggerFactory + .getLogger(SdncUebConfiguration.class); + + private String asdcAddress = null; + private String consumerGroup = null; + private String consumerID = null; + private String environmentName = null; + private String password = null; + private int pollingInterval = 30; + private int pollingTimeout = 15; + private List relevantArtifactTypes = null; + private String user = null; + + private String sdncUser = null; + private String sdncPasswd = null; + private String asdcApiBaseUrl = null; + private String asdcApiNamespace = null; + + private SdncArtifactMap artifactMap = SdncArtifactMap.getInstance(); + + public String getAsdcApiNamespace() { + return asdcApiNamespace; + } + + private String incomingDir = null; + + private String archiveDir = null; + + private String overrideFile = null; + + private boolean activateServerTLSAuth; + private String keyStorePassword; + private String keyStorePath; + + private String xsltPathList; + + public String getXsltPathList() { + return xsltPathList; + } + + public String getOverrideFile() { + return overrideFile; + } + + public SdncUebConfiguration() { + + try { + init(); + } catch (Exception e) { + LOG.error("Cannot initialize SdncUebConfiguration", e); + } + } + + public void init() throws IOException { + String propPath = null; + String propDir = System.getenv(SDNC_CONFIG_DIR); + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + propPath = propDir + "/ueb-listener.properties"; + File propFile = new File(propPath); + + + if (!propFile.exists()) { + + throw new FileNotFoundException( + "Missing configuration properties file : " + + propFile); + } + + Properties props = new Properties(); + props.load(new FileInputStream(propFile)); + + asdcAddress = props.getProperty("org.openecomp.sdnc.uebclient.asdc-address"); + consumerGroup = props.getProperty("org.openecomp.sdnc.uebclient.consumer-group"); + consumerID = props.getProperty("org.openecomp.sdnc.uebclient.consumer-id"); + environmentName = props.getProperty("org.openecomp.sdnc.uebclient.environment-name"); + password = props.getProperty("org.openecomp.sdnc.uebclient.password"); + user = props.getProperty("org.openecomp.sdnc.uebclient.user"); + + sdncUser = props.getProperty("org.openecomp.sdnc.uebclient.sdnc-user"); + sdncPasswd = props.getProperty("org.openecomp.sdnc.uebclient.sdnc-passwd"); + asdcApiBaseUrl = props.getProperty("org.openecomp.sdnc.uebclient.asdc-api-base-url"); + asdcApiNamespace = props.getProperty("org.openecomp.sdnc.uebclient.asdc-api-namespace"); + + incomingDir = props.getProperty("org.openecomp.sdnc.uebclient.spool.incoming"); + archiveDir = props.getProperty("org.openecomp.sdnc.uebclient.spool.archive"); + overrideFile = props.getProperty("org.openecomp.sdnc.uebclient.override-file"); + + String curval = props.getProperty("org.openecomp.sdnc.uebclient.polling-interval"); + if ((curval != null) && (curval.length() > 0)) { + try { + pollingInterval = Integer.parseInt(curval); + } catch (Exception e) { + LOG.warn("Illegal value for org.openecomp.sdnc.uebclient.polling-interval ("+curval+")"); + } + } + + curval = props.getProperty("org.openecomp.sdnc.uebclient.polling-timeout"); + if ((curval != null) && (curval.length() > 0)) { + try { + pollingTimeout = Integer.parseInt(curval); + } catch (Exception e) { + LOG.warn("Illegal value for org.openecomp.sdnc.uebclient.polling-timeout ("+curval+")"); + } + } + + curval = props.getProperty("org.openecomp.sdnc.uebclient.relevant-artifact-types"); + if ((curval != null) && (curval.length() > 0)) { + String[] artifactTypes = curval.split(","); + + relevantArtifactTypes = new LinkedList(); + + for (int i = 0 ; i < artifactTypes.length ; i++) { + try { + if (ArtifactTypeEnum.valueOf(artifactTypes[i]) != null) { + relevantArtifactTypes.add(artifactTypes[i]); + } else { + LOG.warn("Skipping unrecognized artifact type "+artifactTypes[i]); + } + } catch (Exception e) { + + LOG.warn("Caught exception validating artifact type "+artifactTypes[i], e); + } + + } + + } + + curval = props.getProperty("org.openecomp.sdnc.uebclient.activate-server-tls-auth", "false"); + activateServerTLSAuth = "true".equalsIgnoreCase(curval); + keyStorePath = props.getProperty("org.openecomp.sdnc.uebclient.keystore-path"); + keyStorePassword = props.getProperty("org.openecomp.sdnc.uebclient.keystore-password"); + xsltPathList = props.getProperty("org.openecomp.sdnc.uebclient.xslt-path-list"); + + + String artifactMapFile = props.getProperty("org.openecomp.sdnc.uebclient.artifact-map"); + if (artifactMapFile != null) { + artifactMap.load(artifactMapFile); + } + + } + + @Override + public String getAsdcAddress() { + return asdcAddress; + } + + @Override + public String getConsumerGroup() { + return consumerGroup; + } + + @Override + public String getConsumerID() { + return consumerID; + } + + @Override + public String getEnvironmentName() { + return environmentName; + } + + @Override + public String getPassword() { + return password; + } + + @Override + public int getPollingInterval() { + return pollingInterval; + } + + @Override + public int getPollingTimeout() { + return pollingTimeout; + } + + @Override + public List getRelevantArtifactTypes() { + return relevantArtifactTypes; + } + + @Override + public String getUser() { + return user; + } + + + public String getSdncUser() { + return sdncUser; + } + + public String getSdncPasswd() { + return sdncPasswd; + } + + public String getAsdcApiBaseUrl() { + return asdcApiBaseUrl; + } + + @Override + public boolean activateServerTLSAuth() { + return activateServerTLSAuth; + } + + @Override + public String getKeyStorePassword() { + return keyStorePassword; + } + + @Override + public String getKeyStorePath() { + return keyStorePath; + } + + public String getIncomingDir() { + return incomingDir; + } + + public String getArchiveDir() { + return archiveDir; + } + + public int getMaxPasses() { + return(artifactMap.getNumPasses()); + } + + public SdncArtifactMap.SdncArtifactType getMapping(String tag) { + return(artifactMap.getMapping(tag)); + } + + @Override + public boolean isFilterInEmptyResources() { + // TODO Auto-generated method stub + return false; + } + + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java new file mode 100644 index 000000000..67b786896 --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java @@ -0,0 +1,69 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncVFCModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFCModel.class); + + private String vmType = null; + private String vmCount = null; + + public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract properties + vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPE); + //vmCount = extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMCOUNT); - need path to vm_count + vmCount = "1"; + addParameter("vm_type", vmType); + addParameter("vm_type_tag", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG)); + addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); + addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); + addParameter("nfc_naming_code", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFCCODE)); + } + + public String getVmType() { + return vmType; + } + + public void setVmType(String vmType) { + this.vmType = vmType; + } + + public String getVmCount() { + return vmCount; + } + + public void setVmCount(String vmCount) { + this.vmCount = vmCount; + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java new file mode 100644 index 000000000..4e95e46ba --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java @@ -0,0 +1,56 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncVFModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFModel.class); + + public SdncVFModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract metadata + Metadata metadata = nodeTemplate.getMetadata(); + addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); + addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR)); + addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); + + // extract properties + addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_ECOMPGENERATEDNAMING)); + addParameter("naming_policy", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_NAMINGPOLICY)); + addParameter("nf_type", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); + addParameter("nf_role", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)); + addParameter("nf_code", extractValue( nodeTemplate, "nf_naming_code")); + addParameter("nf_function", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); + addParameter("avail_zone_max_count", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java new file mode 100644 index 000000000..86df8b2ab --- /dev/null +++ b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ + +package org.openecomp.sdnc.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Group; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncVFModuleModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFModuleModel.class); + + public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group) { + + super(sdcCsarHelper, group); + + // extract properties + addParameter("vf_module_type", extractValue(group, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); + addIntParameter("availability_zone_count", extractValue(group, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)); + addParameter("ecomp_generated_vm_assignments", extractBooleanValue(group, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS)); + } + +} diff --git a/ueb-listener/src/main/resources/log4j.properties b/ueb-listener/src/main/resources/log4j.properties new file mode 100644 index 000000000..670e48e11 --- /dev/null +++ b/ueb-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/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/normalizeTagNames.xslt b/ueb-listener/src/main/resources/normalizeTagNames.xslt new file mode 100755 index 000000000..6594ccfa0 --- /dev/null +++ b/ueb-listener/src/main/resources/normalizeTagNames.xslt @@ -0,0 +1,14 @@ + + + + + + + + + + num of software instances + + + diff --git a/ueb-listener/src/main/resources/removeNs.xslt b/ueb-listener/src/main/resources/removeNs.xslt new file mode 100755 index 000000000..7aa927b14 --- /dev/null +++ b/ueb-listener/src/main/resources/removeNs.xslt @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ueb-listener/src/main/scripts/start-ueb-listener.sh b/ueb-listener/src/main/scripts/start-ueb-listener.sh new file mode 100644 index 000000000..db00726be --- /dev/null +++ b/ueb-listener/src/main/scripts/start-ueb-listener.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +### +# ============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========================================================= +### + +PROPERTY_DIR=${PROPERTY_DIR:-/opt/sdnc/data/properties} + + +LISTENER=ueb-listener + +PIDFILE=/tmp/.${LISTENER}-pid +UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/ueb-listener} +JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-oracle} +JAVA_OPTS=${JAVA_OPTS:--Dhttps.protocols=TLSv1.1,TLSv1.2} +JAVA=${JAVA:-${JAVA_HOME}/bin/java} + +# Redirect output from script to $LISTENER.out +exec >> ${UEBLISTENERROOT}/logs/$LISTENER.out +exec 2>&1 + +if [ -f $PIDFILE ] +then + pid=$(cat $PIDFILE) + if [ "$pid" != "" ] + then + if kill -0 $pid + then + echo "$LISTENER already running" + exit 0 + fi + fi +fi + +if [ ! -d ${UEBLISTENERROOT}/logs ] +then + mkdir ${UEBLISTENERROOT}/logs +fi + +for file in ${UEBLISTENERROOT}/lib/*.jar +do + LISTENERCLASSPATH=$LISTENERCLASSPATH:$file +done + +${JAVA} ${JAVA_OPTS} -jar ${UEBLISTENERROOT}/lib/ueb-listener*.jar -Dlog4j.configuration=file:${UEBLISTENERROOT}/lib/log4j.properties -cp ${LISTENERCLASSPATH} & + + +echo $! > $PIDFILE + +echo "$LISTENER started!" +exit 0 diff --git a/ueb-listener/src/main/scripts/stop-ueb-listener.sh b/ueb-listener/src/main/scripts/stop-ueb-listener.sh new file mode 100644 index 000000000..2e3b4dd2b --- /dev/null +++ b/ueb-listener/src/main/scripts/stop-ueb-listener.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +### +# ============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========================================================= +### + +PROPERTY_DIR=${PROPERTY_DIR:-/opt/sdnc/data/properties} + +if [ -f ${PROPERTY_DIR}/dmaap-listener.properties ] +then + LISTENER=dmaap-listener +else + LISTENER=ueb-listener +fi + +PIDFILE=/tmp/.${LISTENER}-pid +UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/ueb-listener} + +if [ -f $PIDFILE ] +then + pid=$(cat $PIDFILE) + if [ "$pid" != "" ] + then + if kill -0 $pid + then + echo "Stopping $LISTENER" + kill $pid && rm $PIDFILE + exit 0 + else + echo "$LISTENER not running" + exit 1 + fi + else + echo "$LISTENER not running" + exit 1 + fi +fi + + diff --git a/ueb-listener/src/site/apt/index.apt b/ueb-listener/src/site/apt/index.apt new file mode 100644 index 000000000..dd9d3ec39 --- /dev/null +++ b/ueb-listener/src/site/apt/index.apt @@ -0,0 +1,46 @@ +~~~ +~~ ============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========================================================= +~~~ + + --- + UEB Listener + --- + + +UEB Listener + + The UEB Listener is a daemon that listens for notifications from SDC, posted to UEB (Universal Event Bus). + On receipt of an event, the UEB listener downloads any artifacts posted and examines them to determine if + the format (the outer XML tag) matches a supported format. If so, it posts the file to the ASDC-API REST + API in order to update the SDN-C database. + +File Locations + + * Root directory : /opt/app/ueb-listener + + * Log files : /opt/app/ueb-listener/logs + + * Incoming files to be processed : /opt/app/ueb-listener/spool/asdc/incoming + + * Files already processed : /opt/app/ueb-listener/spool/asdc/archive + + + + diff --git a/ueb-listener/src/site/site.xml b/ueb-listener/src/site/site.xml new file mode 100644 index 000000000..356c9c959 --- /dev/null +++ b/ueb-listener/src/site/site.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/version.properties b/version.properties new file mode 100644 index 000000000..709250395 --- /dev/null +++ b/version.properties @@ -0,0 +1,14 @@ +########################################################### +# Versioning variables +# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) +# because they are used in Jenkins, whose plug-in doesn't support + +release_name=0 +sprint_number=0 +feature_revision=1 + +base_version=${release_name}.${sprint_number}.${feature_revision} + +release_version=${base_version} +snapshot_version=${base_version}-SNAPSHOT + -- cgit 1.2.3-korg From bfaacc8a077daa48fb85e66a80e8f2904fce59a0 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Mon, 14 Aug 2017 16:06:52 -0400 Subject: Refactor asdcApi Refactor asdcApi to replace openecomp references with onap Change-Id: Ic0d61ca75219a57331ba61908fba942a1c0dce7b Issue-ID: CCSDK-25 Signed-off-by: Dan Timoney --- asdcApi/features/src/main/resources/features.xml | 8 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/src/main/yang/ASDC-API.yang | 4 +- asdcApi/model/src/main/yang/asdc-api-common.yang | 4 +- .../model/src/main/yang/asdc-license-model.yang | 4 +- .../sli/northbound/asdcapi/AsdcApiProvider.java | 415 +++++++++++++++++++++ .../sli/northbound/asdcapi/AsdcApiSliClient.java | 111 ++++++ .../ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java | 48 +++ .../impl/rev140523/AsdcApiProviderModule.java | 43 +++ .../rev140523/AsdcApiProviderModuleFactory.java | 34 ++ .../impl/rev140523/AsdcApiProviderModule.java | 57 --- .../rev140523/AsdcApiProviderModuleFactory.java | 34 -- .../openecomp/sdnc/asdcapi/AsdcApiProvider.java | 415 --------------------- .../openecomp/sdnc/asdcapi/AsdcApiSliClient.java | 111 ------ .../org/openecomp/sdnc/asdcapi/AsdcApiUtil.java | 48 --- .../main/resources/initial/asdcApi-provider.xml | 6 +- .../src/main/yang/asdcApi-provider-impl.yang | 2 +- 17 files changed, 664 insertions(+), 682 deletions(-) create mode 100644 asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java create mode 100644 asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java create mode 100644 asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java create mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java create mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java delete mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java delete mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java delete mode 100644 asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java delete mode 100644 asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java delete mode 100644 asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java diff --git a/asdcApi/features/src/main/resources/features.xml b/asdcApi/features/src/main/resources/features.xml index e72e0f653..f9aa81a66 100644 --- a/asdcApi/features/src/main/resources/features.xml +++ b/asdcApi/features/src/main/resources/features.xml @@ -9,9 +9,7 @@ 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. @@ -31,11 +29,11 @@ odl-mdsal-broker - mvn:org.openecomp.sdnc.northbound/asdcApi-model/${project.version} - mvn:org.openecomp.sdnc.northbound/asdcApi-provider/${project.version} + mvn:org.onap.ccsdk.sli.northbound/asdcApi-model/${project.version} + mvn:org.onap.ccsdk.sli.northbound/asdcApi-provider/${project.version} sdnc-sli - mvn:org.openecomp.sdnc.northbound/asdcApi-provider/${project.version}/xml/config + mvn:org.onap.ccsdk.sli.northbound/asdcApi-provider/${project.version}/xml/config diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 94008aaaf..b4f32934a 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -100,7 +100,7 @@ true false false - org.openecomp.sdnc + org.onap.ccsdk.sli.northbound sli-common,sli-provider,dblib-provider provided diff --git a/asdcApi/model/src/main/yang/ASDC-API.yang b/asdcApi/model/src/main/yang/ASDC-API.yang index 401ec7da9..00ef4522a 100755 --- a/asdcApi/model/src/main/yang/ASDC-API.yang +++ b/asdcApi/model/src/main/yang/ASDC-API.yang @@ -2,7 +2,7 @@ module ASDC-API { yang-version "1"; - namespace "org:openecomp:sdnc"; + namespace "org:onap:ccsdk"; prefix asdc-api; @@ -17,7 +17,7 @@ module ASDC-API { } organization - "OpenECOMP"; + "ONAP"; contact "Dan Timoney"; diff --git a/asdcApi/model/src/main/yang/asdc-api-common.yang b/asdcApi/model/src/main/yang/asdc-api-common.yang index 126368d4f..1531b7b30 100755 --- a/asdcApi/model/src/main/yang/asdc-api-common.yang +++ b/asdcApi/model/src/main/yang/asdc-api-common.yang @@ -3,12 +3,12 @@ module asdc-api-common { yang-version "1"; // Use same namespace defined for file upload in 15.12 - namespace "org:openecomp:sdnc:asdcapi:common"; + namespace "org:onap:ccsdk:sli:northbound:asdcapi:common"; prefix asdcapi; organization - "OpenECOMP"; + "ONAP"; contact "Dan Timoney"; diff --git a/asdcApi/model/src/main/yang/asdc-license-model.yang b/asdcApi/model/src/main/yang/asdc-license-model.yang index 37ae869bd..33f383569 100755 --- a/asdcApi/model/src/main/yang/asdc-license-model.yang +++ b/asdcApi/model/src/main/yang/asdc-license-model.yang @@ -1,8 +1,8 @@ module asdc-license-model { - namespace "http://xmlns.openecomp.org/asdc/license-model/1.0"; + namespace "http://xmlns.onap.org/asdc/license-model/1.0"; prefix le; - organization "openecomp"; + organization "onap"; contact "asdc"; description "schema for both vendor license and VF license models"; revision 2016-04-27 { 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 new file mode 100644 index 000000000..c6e1921b7 --- /dev/null +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java @@ -0,0 +1,415 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.asdcapi; + +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; +import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; +import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.http.xmlns.onap.org.asdc.license.model._1._0.rev160427.vf.license.model.grouping.VfLicenseModel; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.ASDCAPIService; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.Artifacts; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.ArtifactsBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelVersions; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelVersionsBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.artifacts.Artifact; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.artifacts.ArtifactBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.artifacts.ArtifactKey; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.vf.license.model.versions.VfLicenseModelVersion; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.vf.license.model.versions.VfLicenseModelVersionBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Optional; +import com.google.common.util.concurrent.CheckedFuture; +import com.google.common.util.concurrent.Futures; + +/** + * Defines a base implementation for your provider. This class extends from a helper class + * which provides storage for the most commonly used components of the MD-SAL. Additionally the + * base class provides some basic logging and initialization / clean up methods. + * + * To use this, copy and paste (overwrite) the following method into the TestApplicationProviderModule + * class which is auto generated under src/main/java in this project + * (created only once during first compilation): + * + *
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+
+         final asdcApiProvider provider = new asdcApiProvider();
+         provider.setDataBroker( getDataBrokerDependency() );
+         provider.setNotificationService( getNotificationServiceDependency() );
+         provider.setRpcRegistry( getRpcRegistryDependency() );
+         provider.initialize();
+         return new AutoCloseable() {
+
+            @Override
+            public void close() throws Exception {
+                //TODO: CLOSE ANY REGISTRATION OBJECTS CREATED USING ABOVE BROKER/NOTIFICATION
+                //SERVIE/RPC REGISTRY
+                provider.close();
+            }
+        };
+    }
+
+
+    
+ */ +public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { + + private static final String ACTIVE_VERSION = "active"; + + private final Logger log = LoggerFactory.getLogger( AsdcApiProvider.class ); + private final String appName = "asdcApi"; + + private final ExecutorService executor; + protected DataBroker dataBroker; + protected NotificationProviderService notificationService; + protected RpcProviderRegistry rpcRegistry; + + protected BindingAwareBroker.RpcRegistration rpcRegistration; + + public AsdcApiProvider(DataBroker dataBroker2, + NotificationProviderService notificationProviderService, + RpcProviderRegistry rpcProviderRegistry) { + this.log.info( "Creating provider for " + appName ); + executor = Executors.newFixedThreadPool(1); + dataBroker = dataBroker2; + notificationService = notificationProviderService; + rpcRegistry = rpcProviderRegistry; + initialize(); + } + + public void initialize(){ + log.info( "Initializing provider for " + appName ); + + + createContainers(); + + if (rpcRegistration == null) { + if (rpcRegistry != null) { + rpcRegistration = rpcRegistry.addRpcImplementation( + ASDCAPIService.class, this); + log.info("Initialization complete for " + appName); + } else { + log.warn("Error initializing " + appName + + " : rpcRegistry unset"); + } + } + } + + private void createContainers() { + + if (dataBroker != null) { + final WriteTransaction t = dataBroker.newReadWriteTransaction(); + + // Create the vf-model-license-versions and artifacts containers + t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(VfLicenseModelVersions.class), + new VfLicenseModelVersionsBuilder().build()); + + t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Artifacts.class), new ArtifactsBuilder().build()); + + + try { + CheckedFuture checkedFuture = t.submit(); + checkedFuture.get(); + log.info("Create Containers succeeded!: "); + + } catch (InterruptedException | ExecutionException e) { + log.error("Create Containers Failed: " + e); + e.printStackTrace(); + } + } else { + log.warn("createContainers : cannot find dataBroker to create containers"); + } + } + protected void initializeChild() { + //Override if you have custom initialization intelligence + } + + @Override + public void close() throws Exception { + log.info( "Closing provider for " + appName ); + executor.shutdown(); + rpcRegistration.close(); + log.info( "Successfully closed provider for " + appName ); + } + + public void setDataBroker(DataBroker dataBroker) { + this.dataBroker = dataBroker; + if( log.isDebugEnabled() ){ + log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); + } + } + + public void setNotificationService( + NotificationProviderService notificationService) { + this.notificationService = notificationService; + if( log.isDebugEnabled() ){ + log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); + } + } + + public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { + this.rpcRegistry = rpcRegistry; + + rpcRegistration = rpcRegistry.addRpcImplementation(ASDCAPIService.class, this); + + if( log.isDebugEnabled() ){ + log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); + } + } + + + protected boolean artifactVersionExists(String aName, String aVersion) { + InstanceIdentifier artifactInstanceId = + InstanceIdentifier.builder(Artifacts.class) + .child(Artifact.class, new ArtifactKey(aName, aVersion)).toInstance(); + ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); + Optional data = null; + try { + data = (Optional) readTx.read(LogicalDatastoreType.CONFIGURATION, artifactInstanceId).get(); + } catch (InterruptedException | ExecutionException e) { + log.error("Caught Exception reading MD-SAL for ["+aName+","+ aVersion+"] " ,e); + return false; + + } + + if (data.isPresent()) { + return true; + } else { + return false; + } + } + + protected void addArtifactVersion(String aName, String aVersion) { + + + try { + ArtifactBuilder aBuilder = new ArtifactBuilder(); + + aBuilder.setArtifactName(aName); + aBuilder.setArtifactVersion(aVersion); + + Artifact artifact = aBuilder.build(); + + InstanceIdentifier.InstanceIdentifierBuilder aIdBuilder = InstanceIdentifier + . builder(Artifacts.class) + .child(Artifact.class, artifact.getKey()); + + InstanceIdentifier path = aIdBuilder + .toInstance(); + + WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + + tx.merge(LogicalDatastoreType.CONFIGURATION, path, + artifact); + tx.submit().checkedGet(); + } catch (Exception e) { + log.error("Caught exception trying to add artifact entry", e); + } + + } + + + private void applyVfLicenseModelUpdate(VfLicenseModelUpdateInput input) { + + String aName = input.getArtifactName(); + String aVersion = input.getArtifactVersion(); + VfLicenseModel vfLicenseModel = input.getVfLicenseModel(); + + + // Add new version (version = artifact-version) + try { + + VfLicenseModelVersionBuilder vBuilder = new VfLicenseModelVersionBuilder(); + vBuilder.setArtifactName(aName); + vBuilder.setArtifactVersion(aVersion); + vBuilder.setVfLicenseModel(vfLicenseModel); + + VfLicenseModelVersion version = vBuilder.build(); + + InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier + . builder(VfLicenseModelVersions.class) + .child(VfLicenseModelVersion.class, version.getKey()); + + InstanceIdentifier path = versionIdBuilder + .toInstance(); + + WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + tx.merge(LogicalDatastoreType.CONFIGURATION, path, + version); + tx.submit().checkedGet(); + } catch (Exception e) { + log.error( + "Caught exception trying to save entry to MD-SAL", + e); + } + + + // Add "active" version (version = "active") + try { + + VfLicenseModelVersionBuilder vBuilder = new VfLicenseModelVersionBuilder(); + vBuilder.setArtifactName(aName); + vBuilder.setArtifactVersion(ACTIVE_VERSION); + vBuilder.setVfLicenseModel(vfLicenseModel); + + VfLicenseModelVersion version = vBuilder.build(); + InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier + . builder(VfLicenseModelVersions.class) + .child(VfLicenseModelVersion.class, version.getKey()); + + InstanceIdentifier path = versionIdBuilder + .toInstance(); + + WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + + tx.merge(LogicalDatastoreType.CONFIGURATION, path, + version); + tx.submit().checkedGet(); + } catch (Exception e) { + log.error( + "Caught exception trying to save entry to MD-SAL", + e); + } + +} + +@Override +public Future> vfLicenseModelUpdate(VfLicenseModelUpdateInput input) { + final String SVC_OPERATION = "vf-license-model-update"; + + Properties parms = new Properties(); + + log.info( SVC_OPERATION +" called." ); + + if(input == null ) { + log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + return null; + } + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(input); + input = inputBuilder.build(); + + String errorMessage = "Success"; + String errorCode = "200"; + + // If this artifact already exists, reject this update + if (artifactVersionExists(input.getArtifactName(), input.getArtifactVersion())) { + errorCode = "409"; + errorMessage = "Artifact version already exists"; + } else { + // Translate input object into SLI-consumable properties + log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); + AsdcApiUtil.toProperties(parms, input); + + + // Call directed graph + + Properties respProps = null; + + + AsdcApiSliClient sliClient = new AsdcApiSliClient(); + try + { + if (sliClient.hasGraph("ASDC-API", SVC_OPERATION , null, "sync")) + { + + try + { + respProps = sliClient.execute("ASDC-API", SVC_OPERATION, null, "sync", parms); + } + catch (Exception e) + { + log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + } + } else { + errorMessage = "No service logic active for ASDC-API: '" + SVC_OPERATION + "'"; + errorCode = "503"; + } + } + catch (Exception e) + { + errorCode = "500"; + errorMessage = e.getMessage(); + log.error("Caught exception looking for service logic", e); + } + + + if (respProps != null) + { + errorCode = respProps.getProperty("error-code"); + errorMessage = respProps.getProperty("error-message", ""); + } + } + + + if ("200".equals(errorCode)) { + log.info("ASDC update succeeded"); + + // Update config tree + applyVfLicenseModelUpdate(input); + addArtifactVersion(input.getArtifactName(), input.getArtifactVersion()); + + } else { + log.info("ASDC update failed ("+errorCode+" : "+errorMessage); + } + + // Send response + VfLicenseModelUpdateOutputBuilder respBuilder = new VfLicenseModelUpdateOutputBuilder(); + respBuilder.setAsdcApiResponseCode(errorCode); + if (errorMessage != null && errorMessage.length() > 0) { + respBuilder.setAsdcApiResponseText(errorMessage); + } + + RpcResult rpcResult; + + + rpcResult = RpcResultBuilder. status(true).withResult(respBuilder.build()).build(); + + + + return Futures.immediateFuture(rpcResult); +} + + +} 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 new file mode 100644 index 000000000..0fa90ea7e --- /dev/null +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java @@ -0,0 +1,111 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.asdcapi; + +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AsdcApiSliClient { + + private static final Logger LOG = LoggerFactory + .getLogger(AsdcApiSliClient.class); + + private SvcLogicService svcLogic = null; + + public AsdcApiSliClient() + { + BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); + + // Get SvcLogicService reference + ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); + if (sref != null) + { + svcLogic = (SvcLogicService) bctx.getService(sref); + } + else + { + LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); + + } + } + + public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException + { + return(svcLogic.hasGraph(module, rpc, version, mode)); + } + + + public Properties execute(String module, String rpc, String version, String mode, Properties parms) + throws SvcLogicException { + + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters passed to SLI"); + + for (Object key : parms.keySet()) { + String parmName = (String) key; + String parmValue = parms.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters returned by SLI"); + + for (Object key : respProps.keySet()) { + String parmName = (String) key; + String parmValue = respProps.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { + + if (!respProps.containsKey("error-code")) { + respProps.setProperty("error-code", "500"); + } + } else { + if (!respProps.containsKey("error-code")) { + respProps.setProperty("error-code", "200"); + } + } + + + return (respProps); + } + +} 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 new file mode 100644 index 000000000..6498f13b5 --- /dev/null +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtil.java @@ -0,0 +1,48 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.asdcapi; + +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.ArtifactsBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelVersionsBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.vf.license.model.versions.VfLicenseModelVersionBuilder; + +public class AsdcApiUtil extends MdsalHelper { + + static { + + // Input objects + + VfLicenseModelUpdateInput i13 = new VfLicenseModelUpdateInputBuilder().build(); + + + // Other builders + ArtifactsBuilder b1 = new ArtifactsBuilder(); + + VfLicenseModelVersionsBuilder b14a = new VfLicenseModelVersionsBuilder(); + VfLicenseModelVersionBuilder b26a = new VfLicenseModelVersionBuilder(); + + + } +} 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 new file mode 100644 index 000000000..0a2272d35 --- /dev/null +++ b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java @@ -0,0 +1,43 @@ +/*- + * ============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========================================================= + */ + +package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523; +public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModule { + public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AsdcApiProviderModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + // TODO:implement + throw new java.lang.UnsupportedOperationException(); + } + +} 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 new file mode 100644 index 000000000..c2d15b890 --- /dev/null +++ b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ + +/* +* Generated file +* +* Generated from: yang module name: asdcApi-provider-impl yang module local name: asdcApi-provider-impl +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Mon Aug 14 15:34:51 EDT 2017 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523; +public class AsdcApiProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModuleFactory { + +} diff --git a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java deleted file mode 100644 index c9223a15c..000000000 --- a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523; - -import org.openecomp.sdnc.asdcapi.AsdcApiProvider; - -public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModule { - public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523.AsdcApiProviderModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - - final AsdcApiProvider provider = new AsdcApiProvider(getDataBrokerDependency() - , getNotificationServiceDependency() - , getRpcRegistryDependency()); - - return new AutoCloseable() { - - @Override - public void close() throws Exception { - - provider.close(); - } - }; - } - -} diff --git a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java deleted file mode 100644 index 6a1d8068e..000000000 --- a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============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========================================================= - */ - -/* -* Generated file -* -* Generated from: yang module name: asdcApi-provider-impl yang module local name: asdcApi-provider-impl -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Wed Nov 02 03:46:08 EDT 2016 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523; -public class AsdcApiProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModuleFactory { - -} diff --git a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java deleted file mode 100644 index 28e59c8d7..000000000 --- a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiProvider.java +++ /dev/null @@ -1,415 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.asdcapi; - -import java.util.Properties; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; -import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.http.xmlns.openecomp.org.asdc.license.model._1._0.rev160427.vf.license.model.grouping.VfLicenseModel; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.ASDCAPIService; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.Artifacts; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.ArtifactsBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInput; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInputBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateOutput; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateOutputBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelVersions; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelVersionsBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.artifacts.Artifact; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.artifacts.ArtifactBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.artifacts.ArtifactKey; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.vf.license.model.versions.VfLicenseModelVersion; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.vf.license.model.versions.VfLicenseModelVersionBuilder; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.opendaylight.yangtools.yang.common.RpcResult; -import org.opendaylight.yangtools.yang.common.RpcResultBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.base.Optional; -import com.google.common.util.concurrent.CheckedFuture; -import com.google.common.util.concurrent.Futures; - -/** - * Defines a base implementation for your provider. This class extends from a helper class - * which provides storage for the most commonly used components of the MD-SAL. Additionally the - * base class provides some basic logging and initialization / clean up methods. - * - * To use this, copy and paste (overwrite) the following method into the TestApplicationProviderModule - * class which is auto generated under src/main/java in this project - * (created only once during first compilation): - * - *
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-
-         final asdcApiProvider provider = new asdcApiProvider();
-         provider.setDataBroker( getDataBrokerDependency() );
-         provider.setNotificationService( getNotificationServiceDependency() );
-         provider.setRpcRegistry( getRpcRegistryDependency() );
-         provider.initialize();
-         return new AutoCloseable() {
-
-            @Override
-            public void close() throws Exception {
-                //TODO: CLOSE ANY REGISTRATION OBJECTS CREATED USING ABOVE BROKER/NOTIFICATION
-                //SERVIE/RPC REGISTRY
-                provider.close();
-            }
-        };
-    }
-
-
-    
- */ -public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { - - private static final String ACTIVE_VERSION = "active"; - - private final Logger log = LoggerFactory.getLogger( AsdcApiProvider.class ); - private final String appName = "asdcApi"; - - private final ExecutorService executor; - protected DataBroker dataBroker; - protected NotificationProviderService notificationService; - protected RpcProviderRegistry rpcRegistry; - - protected BindingAwareBroker.RpcRegistration rpcRegistration; - - public AsdcApiProvider(DataBroker dataBroker2, - NotificationProviderService notificationProviderService, - RpcProviderRegistry rpcProviderRegistry) { - this.log.info( "Creating provider for " + appName ); - executor = Executors.newFixedThreadPool(1); - dataBroker = dataBroker2; - notificationService = notificationProviderService; - rpcRegistry = rpcProviderRegistry; - initialize(); - } - - public void initialize(){ - log.info( "Initializing provider for " + appName ); - - - createContainers(); - - if (rpcRegistration == null) { - if (rpcRegistry != null) { - rpcRegistration = rpcRegistry.addRpcImplementation( - ASDCAPIService.class, this); - log.info("Initialization complete for " + appName); - } else { - log.warn("Error initializing " + appName - + " : rpcRegistry unset"); - } - } - } - - private void createContainers() { - - if (dataBroker != null) { - final WriteTransaction t = dataBroker.newReadWriteTransaction(); - - // Create the vf-model-license-versions and artifacts containers - t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(VfLicenseModelVersions.class), - new VfLicenseModelVersionsBuilder().build()); - - t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Artifacts.class), new ArtifactsBuilder().build()); - - - try { - CheckedFuture checkedFuture = t.submit(); - checkedFuture.get(); - log.info("Create Containers succeeded!: "); - - } catch (InterruptedException | ExecutionException e) { - log.error("Create Containers Failed: " + e); - e.printStackTrace(); - } - } else { - log.warn("createContainers : cannot find dataBroker to create containers"); - } - } - protected void initializeChild() { - //Override if you have custom initialization intelligence - } - - @Override - public void close() throws Exception { - log.info( "Closing provider for " + appName ); - executor.shutdown(); - rpcRegistration.close(); - log.info( "Successfully closed provider for " + appName ); - } - - public void setDataBroker(DataBroker dataBroker) { - this.dataBroker = dataBroker; - if( log.isDebugEnabled() ){ - log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); - } - } - - public void setNotificationService( - NotificationProviderService notificationService) { - this.notificationService = notificationService; - if( log.isDebugEnabled() ){ - log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); - } - } - - public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { - this.rpcRegistry = rpcRegistry; - - rpcRegistration = rpcRegistry.addRpcImplementation(ASDCAPIService.class, this); - - if( log.isDebugEnabled() ){ - log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); - } - } - - - protected boolean artifactVersionExists(String aName, String aVersion) { - InstanceIdentifier artifactInstanceId = - InstanceIdentifier.builder(Artifacts.class) - .child(Artifact.class, new ArtifactKey(aName, aVersion)).toInstance(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); - Optional data = null; - try { - data = (Optional) readTx.read(LogicalDatastoreType.CONFIGURATION, artifactInstanceId).get(); - } catch (InterruptedException | ExecutionException e) { - log.error("Caught Exception reading MD-SAL for ["+aName+","+ aVersion+"] " ,e); - return false; - - } - - if (data.isPresent()) { - return true; - } else { - return false; - } - } - - protected void addArtifactVersion(String aName, String aVersion) { - - - try { - ArtifactBuilder aBuilder = new ArtifactBuilder(); - - aBuilder.setArtifactName(aName); - aBuilder.setArtifactVersion(aVersion); - - Artifact artifact = aBuilder.build(); - - InstanceIdentifier.InstanceIdentifierBuilder aIdBuilder = InstanceIdentifier - . builder(Artifacts.class) - .child(Artifact.class, artifact.getKey()); - - InstanceIdentifier path = aIdBuilder - .toInstance(); - - WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); - - tx.merge(LogicalDatastoreType.CONFIGURATION, path, - artifact); - tx.submit().checkedGet(); - } catch (Exception e) { - log.error("Caught exception trying to add artifact entry", e); - } - - } - - - private void applyVfLicenseModelUpdate(VfLicenseModelUpdateInput input) { - - String aName = input.getArtifactName(); - String aVersion = input.getArtifactVersion(); - VfLicenseModel vfLicenseModel = input.getVfLicenseModel(); - - - // Add new version (version = artifact-version) - try { - - VfLicenseModelVersionBuilder vBuilder = new VfLicenseModelVersionBuilder(); - vBuilder.setArtifactName(aName); - vBuilder.setArtifactVersion(aVersion); - vBuilder.setVfLicenseModel(vfLicenseModel); - - VfLicenseModelVersion version = vBuilder.build(); - - InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier - . builder(VfLicenseModelVersions.class) - .child(VfLicenseModelVersion.class, version.getKey()); - - InstanceIdentifier path = versionIdBuilder - .toInstance(); - - WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); - tx.merge(LogicalDatastoreType.CONFIGURATION, path, - version); - tx.submit().checkedGet(); - } catch (Exception e) { - log.error( - "Caught exception trying to save entry to MD-SAL", - e); - } - - - // Add "active" version (version = "active") - try { - - VfLicenseModelVersionBuilder vBuilder = new VfLicenseModelVersionBuilder(); - vBuilder.setArtifactName(aName); - vBuilder.setArtifactVersion(ACTIVE_VERSION); - vBuilder.setVfLicenseModel(vfLicenseModel); - - VfLicenseModelVersion version = vBuilder.build(); - InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier - . builder(VfLicenseModelVersions.class) - .child(VfLicenseModelVersion.class, version.getKey()); - - InstanceIdentifier path = versionIdBuilder - .toInstance(); - - WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); - - tx.merge(LogicalDatastoreType.CONFIGURATION, path, - version); - tx.submit().checkedGet(); - } catch (Exception e) { - log.error( - "Caught exception trying to save entry to MD-SAL", - e); - } - -} - -@Override -public Future> vfLicenseModelUpdate(VfLicenseModelUpdateInput input) { - final String SVC_OPERATION = "vf-license-model-update"; - - Properties parms = new Properties(); - - log.info( SVC_OPERATION +" called." ); - - if(input == null ) { - log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); - return null; - } - - VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(input); - input = inputBuilder.build(); - - String errorMessage = "Success"; - String errorCode = "200"; - - // If this artifact already exists, reject this update - if (artifactVersionExists(input.getArtifactName(), input.getArtifactVersion())) { - errorCode = "409"; - errorMessage = "Artifact version already exists"; - } else { - // Translate input object into SLI-consumable properties - log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); - AsdcApiUtil.toProperties(parms, input); - - - // Call directed graph - - Properties respProps = null; - - - AsdcApiSliClient sliClient = new AsdcApiSliClient(); - try - { - if (sliClient.hasGraph("ASDC-API", SVC_OPERATION , null, "sync")) - { - - try - { - respProps = sliClient.execute("ASDC-API", SVC_OPERATION, null, "sync", parms); - } - catch (Exception e) - { - log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); - } - } else { - errorMessage = "No service logic active for ASDC-API: '" + SVC_OPERATION + "'"; - errorCode = "503"; - } - } - catch (Exception e) - { - errorCode = "500"; - errorMessage = e.getMessage(); - log.error("Caught exception looking for service logic", e); - } - - - if (respProps != null) - { - errorCode = respProps.getProperty("error-code"); - errorMessage = respProps.getProperty("error-message", ""); - } - } - - - if ("200".equals(errorCode)) { - log.info("ASDC update succeeded"); - - // Update config tree - applyVfLicenseModelUpdate(input); - addArtifactVersion(input.getArtifactName(), input.getArtifactVersion()); - - } else { - log.info("ASDC update failed ("+errorCode+" : "+errorMessage); - } - - // Send response - VfLicenseModelUpdateOutputBuilder respBuilder = new VfLicenseModelUpdateOutputBuilder(); - respBuilder.setAsdcApiResponseCode(errorCode); - if (errorMessage != null && errorMessage.length() > 0) { - respBuilder.setAsdcApiResponseText(errorMessage); - } - - RpcResult rpcResult; - - - rpcResult = RpcResultBuilder. status(true).withResult(respBuilder.build()).build(); - - - - return Futures.immediateFuture(rpcResult); -} - - -} diff --git a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java deleted file mode 100644 index 2f3a783ba..000000000 --- a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiSliClient.java +++ /dev/null @@ -1,111 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.asdcapi; - -import java.util.Properties; - -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AsdcApiSliClient { - - private static final Logger LOG = LoggerFactory - .getLogger(AsdcApiSliClient.class); - - private SvcLogicService svcLogic = null; - - public AsdcApiSliClient() - { - BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); - - // Get SvcLogicService reference - ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); - if (sref != null) - { - svcLogic = (SvcLogicService) bctx.getService(sref); - } - else - { - LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); - - } - } - - public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException - { - return(svcLogic.hasGraph(module, rpc, version, mode)); - } - - - public Properties execute(String module, String rpc, String version, String mode, Properties parms) - throws SvcLogicException { - - - if (LOG.isDebugEnabled()) - { - LOG.debug("Parameters passed to SLI"); - - for (Object key : parms.keySet()) { - String parmName = (String) key; - String parmValue = parms.getProperty(parmName); - - LOG.debug(parmName+" = "+parmValue); - - } - } - - Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); - - if (LOG.isDebugEnabled()) - { - LOG.debug("Parameters returned by SLI"); - - for (Object key : respProps.keySet()) { - String parmName = (String) key; - String parmValue = respProps.getProperty(parmName); - - LOG.debug(parmName+" = "+parmValue); - - } - } - - if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "500"); - } - } else { - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "200"); - } - } - - - return (respProps); - } - -} diff --git a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java b/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java deleted file mode 100644 index 240c939b4..000000000 --- a/asdcApi/provider/src/main/java/org/openecomp/sdnc/asdcapi/AsdcApiUtil.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.asdcapi; - -import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.ArtifactsBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInput; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelUpdateInputBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.VfLicenseModelVersionsBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.rev170201.vf.license.model.versions.VfLicenseModelVersionBuilder; - -public class AsdcApiUtil extends MdsalHelper { - - static { - - // Input objects - - VfLicenseModelUpdateInput i13 = new VfLicenseModelUpdateInputBuilder().build(); - - - // Other builders - ArtifactsBuilder b1 = new ArtifactsBuilder(); - - VfLicenseModelVersionsBuilder b14a = new VfLicenseModelVersionsBuilder(); - VfLicenseModelVersionBuilder b26a = new VfLicenseModelVersionBuilder(); - - - } -} diff --git a/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml b/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml index ab2da905f..53f5a11d0 100644 --- a/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml +++ b/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml @@ -9,9 +9,7 @@ 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. @@ -29,7 +27,7 @@ - + prefix:asdcApi-provider-impl asdcApi-provider-impl @@ -66,7 +64,7 @@ our service can be resolved. Capabilities for dependencies defined above are implied which is why we do not have define a required capability for the data broker, for example. --> - org:openecomp:sdnc:asdcapi:provider:impl?module=asdcApi-provider-impl&revision=2014-05-23 + org:onap:ccsdk:sli:northbound:asdcapi:provider:impl?module=asdcApi-provider-impl&revision=2014-05-23 diff --git a/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang b/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang index 94ee88368..7a1876cc1 100755 --- a/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang +++ b/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang @@ -1,7 +1,7 @@ module asdcApi-provider-impl { yang-version 1; - namespace "org:openecomp:sdnc:asdcapi:provider:impl"; + namespace "org:onap:ccsdk:sli:northbound:asdcapi:provider:impl"; prefix "asdcApi-provider-impl"; import config { prefix config; revision-date 2013-04-05; } -- cgit 1.2.3-korg From 514aff35f5c8727ee0c0b75b2299e8e7d27b4102 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 15 Aug 2017 09:46:03 -0400 Subject: Refactor dataChange Update dataChange to replace references to openECOMP with references to ONAP Change-Id: I2d495dbc13e6dd38e0c975070969b07e796eb82f Issue-ID: CCSDK-25 Signed-off-by: Dan Timoney --- .../features/src/main/resources/features.xml | 8 +- dataChange/installer/pom.xml | 2 +- dataChange/model/src/main/yang/DataChange.yang | 2 +- .../ccsdk/sli/northbound/DataChangeClient.java | 115 +++++++++++++ .../ccsdk/sli/northbound/DataChangeProvider.java | 181 +++++++++++++++++++++ .../impl/rev140523/DataChangeProviderModule.java | 43 +++++ .../rev140523/DataChangeProviderModuleFactory.java | 34 ++++ .../impl/rev140523/DataChangeProviderModule.java | 55 ------- .../rev140523/DataChangeProviderModuleFactory.java | 34 ---- .../sdnc/datachange/DataChangeClient.java | 115 ------------- .../sdnc/datachange/DataChangeProvider.java | 181 --------------------- .../main/resources/initial/dataChange-provider.xml | 6 +- .../src/main/yang/DataChange-provider-impl.yang | 2 +- 13 files changed, 381 insertions(+), 397 deletions(-) create mode 100644 dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java create mode 100644 dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java create mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java create mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java delete mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java delete mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java delete mode 100644 dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java delete mode 100644 dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java diff --git a/dataChange/features/src/main/resources/features.xml b/dataChange/features/src/main/resources/features.xml index 2b4ac946f..9cc8cc57b 100644 --- a/dataChange/features/src/main/resources/features.xml +++ b/dataChange/features/src/main/resources/features.xml @@ -9,9 +9,7 @@ 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. @@ -31,9 +29,9 @@ odl-mdsal-broker sdnc-sli - mvn:org.openecomp.sdnc.northbound/dataChange-model/${project.version} - mvn:org.openecomp.sdnc.northbound/dataChange-provider/${project.version} - mvn:org.openecomp.sdnc.northbound/dataChange-provider/${project.version}/xml/config + mvn:org.onap.ccsdk.sli.northbound/dataChange-model/${project.version} + mvn:org.onap.ccsdk.sli.northbound/dataChange-provider/${project.version} + mvn:org.onap.ccsdk.sli.northbound/dataChange-provider/${project.version}/xml/config diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 414719e10..63fda23ab 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -100,7 +100,7 @@ true false false - org.openecomp.sdnc + org.onap.ccsdk.sli.northbound sli-common,sli-provider,dblib-provider provided diff --git a/dataChange/model/src/main/yang/DataChange.yang b/dataChange/model/src/main/yang/DataChange.yang index 3d326f7be..8f9a8e6f7 100755 --- a/dataChange/model/src/main/yang/DataChange.yang +++ b/dataChange/model/src/main/yang/DataChange.yang @@ -2,7 +2,7 @@ module DataChange { yang-version 1; - namespace "org:openecomp:sdnc:datachange"; + namespace "org:onap:ccsdk:sli:northbound:datachange"; prefix datachg; 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 new file mode 100644 index 000000000..81da74161 --- /dev/null +++ b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java @@ -0,0 +1,115 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound; + +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationOutputBuilder; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DataChangeClient { + + private static final Logger LOG = LoggerFactory + .getLogger(DataChangeClient.class); + + private SvcLogicService svcLogic = null; + + public DataChangeClient() + { + BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); + + // Get SvcLogicService reference + ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); + if (sref != null) + { + svcLogic = (SvcLogicService) bctx.getService(sref); + + } + else + { + LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); + + } + } + + public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException + { + return(svcLogic.hasGraph(module, rpc, version, mode)); + } + + public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData) + throws SvcLogicException { + + Properties parms = new Properties(); + + return execute(module,rpc,version, mode,serviceData,parms); + } + + public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData, Properties parms) + throws SvcLogicException { + + parms = MdsalHelper.toProperties(parms, serviceData); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters passed to SLI"); + + for (Object key : parms.keySet()) { + String parmName = (String) key; + String parmValue = parms.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters returned by SLI"); + + for (Object key : respProps.keySet()) { + String parmName = (String) key; + String parmValue = respProps.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { + return (respProps); + } + + MdsalHelper.toBuilder(respProps, serviceData); + + return (respProps); + } + +} 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 new file mode 100644 index 000000000..40d30a792 --- /dev/null +++ b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java @@ -0,0 +1,181 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound; + +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationInput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeService; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.util.concurrent.Futures; + +/** + * Defines a base implementation for your provider. This class extends from a helper class + * which provides storage for the most commonly used components of the MD-SAL. Additionally the + * base class provides some basic logging and initialization / clean up methods. + * + */ +public class DataChangeProvider implements AutoCloseable, DataChangeService{ + + private final Logger log = LoggerFactory.getLogger( DataChangeProvider.class ); + private final String appName = "DataChange"; + private final ExecutorService executor; + + protected DataBroker dataBroker; + protected NotificationProviderService notificationService; + protected RpcProviderRegistry rpcRegistry; + protected BindingAwareBroker.RpcRegistration rpcRegistration; + + + public DataChangeProvider(DataBroker dataBroker2, + NotificationProviderService notificationProviderService, + RpcProviderRegistry rpcProviderRegistry) { + this.log.info( "Creating provider for " + appName ); + executor = Executors.newFixedThreadPool(1); + dataBroker = dataBroker2; + notificationService = notificationProviderService; + rpcRegistry = rpcProviderRegistry; + initialize(); + } + + public void initialize(){ + log.info( "Initializing provider for " + appName ); + rpcRegistration = rpcRegistry.addRpcImplementation(DataChangeService.class, this); + log.info( "Initialization complete for " + appName ); + } + + protected void initializeChild() { + //Override if you have custom initialization intelligence + } + + @Override + public void close() throws Exception { + log.info( "Closing provider for " + appName ); + executor.shutdown(); + rpcRegistration.close(); + log.info( "Successfully closed provider for " + appName ); + } + + public void setDataBroker(DataBroker dataBroker) { + this.dataBroker = dataBroker; + if( log.isDebugEnabled() ){ + log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); + } + } + + public void setNotificationService( + NotificationProviderService notificationService) { + this.notificationService = notificationService; + if( log.isDebugEnabled() ){ + log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); + } + } + + public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { + this.rpcRegistry = rpcRegistry; + if( log.isDebugEnabled() ){ + log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); + } + } + + @Override + public Future> dataChangeNotification( + DataChangeNotificationInput input) { + final String SVC_OPERATION = "data-change-notification"; + + Properties parms = new Properties(); + DataChangeNotificationOutputBuilder serviceDataBuilder = new DataChangeNotificationOutputBuilder(); + + log.info( SVC_OPERATION +" called." ); + + if(input == null || input.getAaiEventId() == null) { + log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + serviceDataBuilder.setDataChangeResponseCode("403"); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); + return Futures.immediateFuture(rpcResult); + } + + // add input to parms + log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); + DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder(input); + MdsalHelper.toProperties(parms, inputBuilder.build()); + + // Call SLI sync method + // Get SvcLogicService reference + + DataChangeClient svcLogicClient = new DataChangeClient(); + Properties respProps = null; + + try + { + if (svcLogicClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) + { + try + { + respProps = svcLogicClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + } + catch (Exception e) + { + log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + serviceDataBuilder.setDataChangeResponseCode("500"); + } + } else { + log.error("No service logic active for DataChange: '" + SVC_OPERATION + "'"); + serviceDataBuilder.setDataChangeResponseCode("503"); + } + } + catch (Exception e) + { + log.error("Caught exception looking for service logic", e); + serviceDataBuilder.setDataChangeResponseCode("500"); + } + + String errorCode = serviceDataBuilder.getDataChangeResponseCode(); + + if ( errorCode != null && errorCode.length() != 0 && !( errorCode.equals("0")|| errorCode.equals("200"))) { + log.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); + } else { + log.info("Returned SUCCESS for "+SVC_OPERATION+" "); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } +} 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 new file mode 100644 index 000000000..f8267cf32 --- /dev/null +++ b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java @@ -0,0 +1,43 @@ +/*- + * ============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========================================================= + */ + +package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523; +public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.AbstractDataChangeProviderModule { + public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.DataChangeProviderModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + // TODO:implement + throw new java.lang.UnsupportedOperationException(); + } + +} 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 new file mode 100644 index 000000000..5852788c4 --- /dev/null +++ b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ + +/* +* Generated file +* +* Generated from: yang module name: DataChange-provider-impl yang module local name: DataChange-provider-impl +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Tue Aug 15 09:41:53 EDT 2017 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523; +public class DataChangeProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.AbstractDataChangeProviderModuleFactory { + +} diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java deleted file mode 100644 index c3dd110a9..000000000 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523; - -import org.openecomp.sdnc.datachange.DataChangeProvider; - -public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.AbstractDataChangeProviderModule { - public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.DataChangeProviderModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - final DataChangeProvider provider = new DataChangeProvider(getDataBrokerDependency() - , getNotificationServiceDependency() - , getRpcRegistryDependency()); - - return new AutoCloseable() { - - @Override - public void close() throws Exception { - provider.close(); - } - }; - } - -} diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java deleted file mode 100644 index 2f4724961..000000000 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============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========================================================= - */ - -/* -* Generated file -* -* Generated from: yang module name: DataChange-provider-impl yang module local name: DataChange-provider-impl -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Wed Nov 02 06:00:03 EDT 2016 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523; -public class DataChangeProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.AbstractDataChangeProviderModuleFactory { - -} diff --git a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java deleted file mode 100644 index 5db3eff6d..000000000 --- a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java +++ /dev/null @@ -1,115 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.datachange; - -import java.util.Properties; - -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; -import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutputBuilder; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DataChangeClient { - - private static final Logger LOG = LoggerFactory - .getLogger(DataChangeClient.class); - - private SvcLogicService svcLogic = null; - - public DataChangeClient() - { - BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); - - // Get SvcLogicService reference - ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); - if (sref != null) - { - svcLogic = (SvcLogicService) bctx.getService(sref); - - } - else - { - LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); - - } - } - - public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException - { - return(svcLogic.hasGraph(module, rpc, version, mode)); - } - - public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData) - throws SvcLogicException { - - Properties parms = new Properties(); - - return execute(module,rpc,version, mode,serviceData,parms); - } - - public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData, Properties parms) - throws SvcLogicException { - - parms = MdsalHelper.toProperties(parms, serviceData); - - if (LOG.isDebugEnabled()) - { - LOG.debug("Parameters passed to SLI"); - - for (Object key : parms.keySet()) { - String parmName = (String) key; - String parmValue = parms.getProperty(parmName); - - LOG.debug(parmName+" = "+parmValue); - - } - } - - Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); - - if (LOG.isDebugEnabled()) - { - LOG.debug("Parameters returned by SLI"); - - for (Object key : respProps.keySet()) { - String parmName = (String) key; - String parmValue = respProps.getProperty(parmName); - - LOG.debug(parmName+" = "+parmValue); - - } - } - if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - return (respProps); - } - - MdsalHelper.toBuilder(respProps, serviceData); - - return (respProps); - } - -} diff --git a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java deleted file mode 100644 index 791da5c05..000000000 --- a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java +++ /dev/null @@ -1,181 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.datachange; - -import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationInput; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationInputBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutput; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutputBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeService; -import org.opendaylight.yangtools.yang.common.RpcResult; -import org.opendaylight.yangtools.yang.common.RpcResultBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.util.concurrent.Futures; - -/** - * Defines a base implementation for your provider. This class extends from a helper class - * which provides storage for the most commonly used components of the MD-SAL. Additionally the - * base class provides some basic logging and initialization / clean up methods. - * - */ -public class DataChangeProvider implements AutoCloseable, DataChangeService{ - - private final Logger log = LoggerFactory.getLogger( DataChangeProvider.class ); - private final String appName = "DataChange"; - private final ExecutorService executor; - - protected DataBroker dataBroker; - protected NotificationProviderService notificationService; - protected RpcProviderRegistry rpcRegistry; - protected BindingAwareBroker.RpcRegistration rpcRegistration; - - - public DataChangeProvider(DataBroker dataBroker2, - NotificationProviderService notificationProviderService, - RpcProviderRegistry rpcProviderRegistry) { - this.log.info( "Creating provider for " + appName ); - executor = Executors.newFixedThreadPool(1); - dataBroker = dataBroker2; - notificationService = notificationProviderService; - rpcRegistry = rpcProviderRegistry; - initialize(); - } - - public void initialize(){ - log.info( "Initializing provider for " + appName ); - rpcRegistration = rpcRegistry.addRpcImplementation(DataChangeService.class, this); - log.info( "Initialization complete for " + appName ); - } - - protected void initializeChild() { - //Override if you have custom initialization intelligence - } - - @Override - public void close() throws Exception { - log.info( "Closing provider for " + appName ); - executor.shutdown(); - rpcRegistration.close(); - log.info( "Successfully closed provider for " + appName ); - } - - public void setDataBroker(DataBroker dataBroker) { - this.dataBroker = dataBroker; - if( log.isDebugEnabled() ){ - log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); - } - } - - public void setNotificationService( - NotificationProviderService notificationService) { - this.notificationService = notificationService; - if( log.isDebugEnabled() ){ - log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); - } - } - - public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { - this.rpcRegistry = rpcRegistry; - if( log.isDebugEnabled() ){ - log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); - } - } - - @Override - public Future> dataChangeNotification( - DataChangeNotificationInput input) { - final String SVC_OPERATION = "data-change-notification"; - - Properties parms = new Properties(); - DataChangeNotificationOutputBuilder serviceDataBuilder = new DataChangeNotificationOutputBuilder(); - - log.info( SVC_OPERATION +" called." ); - - if(input == null || input.getAaiEventId() == null) { - log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); - serviceDataBuilder.setDataChangeResponseCode("403"); - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); - return Futures.immediateFuture(rpcResult); - } - - // add input to parms - log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); - DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder(input); - MdsalHelper.toProperties(parms, inputBuilder.build()); - - // Call SLI sync method - // Get SvcLogicService reference - - DataChangeClient svcLogicClient = new DataChangeClient(); - Properties respProps = null; - - try - { - if (svcLogicClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) - { - try - { - respProps = svcLogicClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); - } - catch (Exception e) - { - log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); - serviceDataBuilder.setDataChangeResponseCode("500"); - } - } else { - log.error("No service logic active for DataChange: '" + SVC_OPERATION + "'"); - serviceDataBuilder.setDataChangeResponseCode("503"); - } - } - catch (Exception e) - { - log.error("Caught exception looking for service logic", e); - serviceDataBuilder.setDataChangeResponseCode("500"); - } - - String errorCode = serviceDataBuilder.getDataChangeResponseCode(); - - if ( errorCode != null && errorCode.length() != 0 && !( errorCode.equals("0")|| errorCode.equals("200"))) { - log.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); - } else { - log.info("Returned SUCCESS for "+SVC_OPERATION+" "); - } - - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); - // return error - return Futures.immediateFuture(rpcResult); - } -} diff --git a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml index 2812ca4d7..3038201ba 100644 --- a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml +++ b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml @@ -9,9 +9,7 @@ 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. @@ -29,7 +27,7 @@ - + prefix:DataChange-provider-impl DataChange-provider-impl @@ -66,7 +64,7 @@ our service can be resolved. Capabilities for dependencies defined above are implied which is why we do not have define a required capability for the data broker, for example. --> - org:openecomp:sdnc:datachange:provider:impl?module=DataChange-provider-impl&revision=2014-05-23 + org:onap:ccsdk:sli:northbound:datachange:provider:impl?module=DataChange-provider-impl&revision=2014-05-23 diff --git a/dataChange/provider/src/main/yang/DataChange-provider-impl.yang b/dataChange/provider/src/main/yang/DataChange-provider-impl.yang index fe1dab235..2913273de 100755 --- a/dataChange/provider/src/main/yang/DataChange-provider-impl.yang +++ b/dataChange/provider/src/main/yang/DataChange-provider-impl.yang @@ -1,7 +1,7 @@ module DataChange-provider-impl { yang-version 1; - namespace "org:openecomp:sdnc:datachange:provider:impl"; + namespace "org:onap:ccsdk:sli:northbound:datachange:provider:impl"; prefix "DataChange-provider-impl"; import config { prefix config; revision-date 2013-04-05; } -- cgit 1.2.3-korg From 41df62392ed3d1775c29b7cc1feb161108026c39 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 15 Aug 2017 14:10:37 -0400 Subject: Refactor rest of sli/northbound Update remainder of sli/northbound to replace references to openECOMP with references to ONAP Change-Id: I2c321c9ec3f3138f3b7377ce1e0a8ff7e8f29bcc Issue-ID: CCSDK-25 Signed-off-by: Dan Timoney --- .../sli/northbound/dmaapclient/DmaapListener.java | 165 +++ .../northbound/dmaapclient/DummyDmaapConsumer.java | 37 + .../dmaapclient/InvalidMessageException.java | 37 + .../northbound/dmaapclient/SdncDmaapConsumer.java | 146 +++ .../dmaapclient/SdncFlatJsonDmaapConsumer.java | 196 ++++ .../northbound/dmaapclient/SdncOdlConnection.java | 159 +++ .../openecomp/sdnc/dmaapclient/DmaapListener.java | 165 --- .../sdnc/dmaapclient/DummyDmaapConsumer.java | 37 - .../sdnc/dmaapclient/InvalidMessageException.java | 37 - .../sdnc/dmaapclient/SdncDmaapConsumer.java | 146 --- .../dmaapclient/SdncFlatJsonDmaapConsumer.java | 196 ---- .../sdnc/dmaapclient/SdncOdlConnection.java | 159 --- example-settings.xml | 163 --- jenkins-settings.xml | 168 --- .../sli/northbound/uebclient/SdncARModel.java | 53 + .../sli/northbound/uebclient/SdncArtifactMap.java | 134 +++ .../sli/northbound/uebclient/SdncBaseModel.java | 297 ++++++ .../sli/northbound/uebclient/SdncNodeModel.java | 145 +++ .../northbound/uebclient/SdncOdlConnection.java | 158 +++ .../sli/northbound/uebclient/SdncServiceModel.java | 98 ++ .../sli/northbound/uebclient/SdncUebCallback.java | 1125 ++++++++++++++++++++ .../sli/northbound/uebclient/SdncUebClient.java | 65 ++ .../northbound/uebclient/SdncUebConfiguration.java | 280 +++++ .../sli/northbound/uebclient/SdncVFCModel.java | 69 ++ .../sli/northbound/uebclient/SdncVFModel.java | 56 + .../northbound/uebclient/SdncVFModuleModel.java | 45 + .../org/openecomp/sdnc/uebclient/SdncARModel.java | 53 - .../openecomp/sdnc/uebclient/SdncArtifactMap.java | 134 --- .../openecomp/sdnc/uebclient/SdncBaseModel.java | 297 ------ .../openecomp/sdnc/uebclient/SdncNodeModel.java | 145 --- .../sdnc/uebclient/SdncOdlConnection.java | 158 --- .../openecomp/sdnc/uebclient/SdncServiceModel.java | 98 -- .../openecomp/sdnc/uebclient/SdncUebCallback.java | 1125 -------------------- .../openecomp/sdnc/uebclient/SdncUebClient.java | 65 -- .../sdnc/uebclient/SdncUebConfiguration.java | 280 ----- .../org/openecomp/sdnc/uebclient/SdncVFCModel.java | 69 -- .../org/openecomp/sdnc/uebclient/SdncVFModel.java | 56 - .../sdnc/uebclient/SdncVFModuleModel.java | 45 - 38 files changed, 3265 insertions(+), 3596 deletions(-) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DummyDmaapConsumer.java create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/InvalidMessageException.java create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java delete mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java delete mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java delete mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java delete mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java delete mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java delete mode 100644 dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncOdlConnection.java delete mode 100644 example-settings.xml delete mode 100644 jenkins-settings.xml create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java delete mode 100644 ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java 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 new file mode 100644 index 000000000..b2976294b --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java @@ -0,0 +1,165 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import java.io.File; +import java.io.FileInputStream; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DmaapListener { + + private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + private static final Logger LOG = LoggerFactory + .getLogger(DmaapListener.class); + + public static void main(String[] args) { + + Properties properties = new Properties(); + + + String propFileName = DMAAP_LISTENER_PROPERTIES; + + if (args.length > 0) { + propFileName = args[0]; + } + + String propPath = null; + String propDir = System.getenv(SDNC_CONFIG_DIR); + + List consumers = new LinkedList(); + + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + + if (!propFileName.startsWith("/")) { + propPath = propDir + "/" + propFileName; + } + + File propFile = new File(propPath); + + if (!propFile.canRead()) { + LOG.error("Cannot read properties file "+propPath); + System.exit(1); + } + + try { + properties.load(new FileInputStream(propFile)); + } catch (Exception e) { + LOG.error("Caught exception loading properties from "+propPath, e); + System.exit(1); + } + + String subscriptionStr = properties.getProperty("subscriptions"); + + boolean threadsRunning = false; + + LOG.debug("Dmaap subscriptions : "+subscriptionStr); + + if (subscriptionStr != null) { + String[] subscriptions = subscriptionStr.split(";"); + + for (int i = 0; i < subscriptions.length; i++) { + String[] subscription = subscriptions[i].split(":"); + String consumerClassName = subscription[0]; + String propertyPath = subscription[1]; + + LOG.debug("Handling subscription [" + consumerClassName + "," + propertyPath + "]"); + + if (propertyPath == null) { + LOG.error("Invalid subscription (" + subscriptions[i] + ") property file missing"); + continue; + } + + if (!propertyPath.startsWith("/")) { + propertyPath = propDir + "/" + propertyPath; + } + + Class consumerClass = null; + + try { + consumerClass = Class.forName(consumerClassName); + } catch (Exception e) { + LOG.error("Could not find DMaap consumer class " + consumerClassName); + } + + if (consumerClass != null) { + + SdncDmaapConsumer consumer = null; + + try { + consumer = (SdncDmaapConsumer) consumerClass.newInstance(); + } catch (Exception e) { + LOG.error("Could not create consumer from class " + consumerClassName, e); + } + + if (consumer != null) { + LOG.debug("Initializing consumer " + consumerClassName + "(" + propertyPath + ")"); + consumer.init(properties, propertyPath); + + if (consumer.isReady()) { + Thread consumerThread = new Thread(consumer); + consumerThread.start(); + consumers.add(consumer); + threadsRunning = true; + LOG.info("Started consumer thread (" + consumerClassName + " : " + propertyPath + ")"); + } else { + LOG.debug("Consumer " + consumerClassName + " is not ready"); + } + } + + } + + } + } + + while (threadsRunning) { + + threadsRunning = false; + for (SdncDmaapConsumer consumer : consumers) { + if (consumer.isRunning()) { + threadsRunning = true; + } + } + + if (!threadsRunning) { + break; + } + + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + + } + } + + LOG.info("No listener threads running - exitting"); + + } +} 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 new file mode 100644 index 000000000..a3bc46153 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DummyDmaapConsumer.java @@ -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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DummyDmaapConsumer extends SdncDmaapConsumer { + + private static final Logger LOG = LoggerFactory + .getLogger(DummyDmaapConsumer.class); + + @Override + public void processMsg(String msg) { + LOG.info("Consumed message: \n"+msg); + } + +} 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 new file mode 100644 index 000000000..b54adaf06 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/InvalidMessageException.java @@ -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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +public class InvalidMessageException extends Exception { + + public InvalidMessageException() { + super(); + } + + public InvalidMessageException(String msg) { + super(msg); + } + + public InvalidMessageException(String msg, Throwable t) { + super(msg, t); + } +} 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 new file mode 100644 index 000000000..f6d8ff862 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java @@ -0,0 +1,146 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.att.nsa.mr.client.MRClientFactory; +import com.att.nsa.mr.client.MRConsumer; +import com.att.nsa.mr.client.response.MRConsumerResponse; + +public abstract class SdncDmaapConsumer implements Runnable { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncDmaapConsumer.class); + + private String propertiesPath = ""; + private Properties properties = null; + MRConsumer consumer = null; + MRConsumerResponse consumerResponse = null; + boolean running = false; + boolean ready = false; + int fetchPause = 5000; // Default pause between fetchs - 5 seconds + + public boolean isReady() { + return ready; + } + + int timeout = 15000; // Default timeout - 15 seconds + + public boolean isRunning() { + return running; + } + + public SdncDmaapConsumer() { + + } + + public SdncDmaapConsumer(Properties properties, String propertiesPath) { + init(properties, propertiesPath); + } + + public String getProperty(String name) { + return(properties.getProperty(name, "")); + } + + public void init(Properties properties, String propertiesPath) { + + this.propertiesPath = propertiesPath; + + try { + + this.properties = (Properties) properties.clone(); + + this.properties.load(new FileInputStream(new File(propertiesPath))); + + String timeoutStr = properties.getProperty("timeout"); + + if ((timeoutStr != null) && (timeoutStr.length() > 0)) { + try { + timeout = Integer.parseInt(timeoutStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric value specified for timeout ("+timeoutStr+")"); + } + } + + String fetchPauseStr = properties.getProperty("fetchPause"); + if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { + try { + fetchPause = Integer.parseInt(fetchPauseStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric valud specified for fetchPause ("+fetchPauseStr+")"); + } + } + + this.consumer = MRClientFactory.createConsumer(propertiesPath); + ready = true; + } catch (Exception e) { + LOG.error("Error initializing DMaaP consumer from file "+propertiesPath, e); + } + } + + + @Override + public void run() { + if (ready) { + + running = true; + + while (running) { + + try { + boolean noData = true; + consumerResponse = consumer.fetchWithReturnConsumerResponse(timeout, -1); + for (String msg : consumerResponse.getActualMessages()) { + noData = false; + LOG.info("Received message from DMaaP:\n"+msg); + processMsg(msg); + } + + if (noData) { + if (fetchPause > 0) { + + LOG.info("No data received from fetch. Pausing "+fetchPause+" ms before retry"); + Thread.sleep(fetchPause); + } else { + + LOG.info("No data received from fetch. No fetch pause specified - retrying immediately"); + } + } + } catch (Exception e) { + LOG.error("Caught exception reading from DMaaP", e); + running = false; + } + + + } + } + + } + + abstract public void processMsg(String msg) throws InvalidMessageException; +} 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 new file mode 100644 index 000000000..0e2a32646 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java @@ -0,0 +1,196 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSession; + +import org.apache.commons.codec.binary.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; + + +public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncFlatJsonDmaapConsumer.class); + + private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + private static final String SDNC_ENDPOINT = "SDNC.endpoint"; + + + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + processMsg(msg, null); + } + + public void processMsg(String msg, String mapDirName) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode instarRootNode = null; + ObjectNode sdncRootNode = null; + + String instarMsgName = null; + + try { + instarRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + Iterator> instarFields = instarRootNode.fields(); + + while (instarFields.hasNext()) { + Map.Entry entry = instarFields.next(); + + instarMsgName = entry.getKey(); + instarRootNode = entry.getValue(); + break; + } + + Map fieldMap = loadMap(instarMsgName, mapDirName); + + if (fieldMap == null) { + throw new InvalidMessageException("Unable to process message - cannot load field mappings"); + } + + if (!fieldMap.containsKey(SDNC_ENDPOINT)) { + throw new InvalidMessageException("No SDNC endpoint known for message "+instarMsgName); + } + + String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); + + sdncRootNode = oMapper.createObjectNode(); + ObjectNode inputNode = oMapper.createObjectNode(); + + + for (String fromField : fieldMap.keySet()) { + + if (!SDNC_ENDPOINT.equals(fromField)) { + JsonNode curNode = instarRootNode.get(fromField); + if (curNode != null) { + String fromValue = curNode.textValue(); + + inputNode.put(fieldMap.get(fromField), fromValue); + } + } + } + sdncRootNode.put("input", inputNode); + + try { + String rpcMsgbody = oMapper.writeValueAsString(sdncRootNode); + 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) { + + } + + } + + private Map loadMap(String msgType, String mapDirName) { + Map results = new HashMap(); + + + if (mapDirName == null) { + String rootdir = System.getenv(DMAAPLISTENERROOT); + + if ((rootdir == null) || (rootdir.length() == 0)) { + rootdir = "/opt/app/dmaap-listener"; + } + + mapDirName = rootdir + "/lib"; + + } + + String mapFilename = mapDirName + "/" + msgType + ".map"; + + File mapFile = new File(mapFilename); + + if (!mapFile.canRead()) { + LOG.error("Cannot read map file ("+mapFilename+")"); + return(null); + } + + try { + BufferedReader mapReader = new BufferedReader(new FileReader(mapFile)); + + String curLine = null; + + while ((curLine = mapReader.readLine()) != null) { + curLine = curLine.trim(); + + if ((curLine.length() > 0) && (!curLine.startsWith("#"))) { + + if (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/SdncOdlConnection.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java new file mode 100644 index 000000000..4d16dd2a0 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java @@ -0,0 +1,159 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.ProtocolException; +import java.net.URL; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSession; + +import org.apache.commons.codec.binary.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class SdncOdlConnection { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncOdlConnection.class); + + private HttpURLConnection httpConn = null; + + private String url = null; + private String user = null; + private String password = null; + + private class SdncAuthenticator extends Authenticator { + + private String user; + private String passwd; + + SdncAuthenticator(String user, String passwd) { + this.user = user; + this.passwd = passwd; + } + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, passwd.toCharArray()); + } + + } + + private SdncOdlConnection() { + + } + + private SdncOdlConnection(String url, String user, String password) { + this.url = url; + this.user = user; + this.password = password; + + try { + URL sdncUrl = new URL(url); + Authenticator.setDefault(new SdncAuthenticator(user, password)); + + this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); + } catch (Exception e) { + LOG.error("Unable to create http connection", e); + } + } + + public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException + { + return (new SdncOdlConnection(url, user, password)); + } + + + + public String send(String method, String contentType, String msg) throws IOException { + + LOG.info("Sending REST " + method + " to " + url); + LOG.info("Message body:\n" + msg); + String authStr = user + ":" + password; + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + + httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); + + httpConn.setRequestMethod(method); + httpConn.setRequestProperty("Content-Type", contentType); + httpConn.setRequestProperty("Accept", contentType); + + httpConn.setDoInput(true); + httpConn.setDoOutput(true); + httpConn.setUseCaches(false); + + if (httpConn instanceof HttpsURLConnection) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); + } + + // Write message + httpConn.setRequestProperty("Content-Length", "" + msg.length()); + DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); + outStr.write(msg.getBytes()); + outStr.close(); + + // Read response + BufferedReader respRdr; + + LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); + + if (httpConn.getResponseCode() < 300) { + + respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); + } else { + respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); + } + + StringBuffer respBuff = new StringBuffer(); + + String respLn; + + while ((respLn = respRdr.readLine()) != null) { + respBuff.append(respLn + "\n"); + } + respRdr.close(); + + String respString = respBuff.toString(); + + LOG.info("Response body :\n" + respString); + + return (respString); + + } + + +} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java deleted file mode 100644 index 7096d83bf..000000000 --- a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DmaapListener.java +++ /dev/null @@ -1,165 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.dmaapclient; - -import java.io.File; -import java.io.FileInputStream; -import java.util.LinkedList; -import java.util.List; -import java.util.Properties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DmaapListener { - - private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; - private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; - private static final Logger LOG = LoggerFactory - .getLogger(DmaapListener.class); - - public static void main(String[] args) { - - Properties properties = new Properties(); - - - String propFileName = DMAAP_LISTENER_PROPERTIES; - - if (args.length > 0) { - propFileName = args[0]; - } - - String propPath = null; - String propDir = System.getenv(SDNC_CONFIG_DIR); - - List consumers = new LinkedList(); - - if (propDir == null) { - - propDir = "/opt/sdnc/data/properties"; - } - - if (!propFileName.startsWith("/")) { - propPath = propDir + "/" + propFileName; - } - - File propFile = new File(propPath); - - if (!propFile.canRead()) { - LOG.error("Cannot read properties file "+propPath); - System.exit(1); - } - - try { - properties.load(new FileInputStream(propFile)); - } catch (Exception e) { - LOG.error("Caught exception loading properties from "+propPath, e); - System.exit(1); - } - - String subscriptionStr = properties.getProperty("subscriptions"); - - boolean threadsRunning = false; - - LOG.debug("Dmaap subscriptions : "+subscriptionStr); - - if (subscriptionStr != null) { - String[] subscriptions = subscriptionStr.split(";"); - - for (int i = 0; i < subscriptions.length; i++) { - String[] subscription = subscriptions[i].split(":"); - String consumerClassName = subscription[0]; - String propertyPath = subscription[1]; - - LOG.debug("Handling subscription [" + consumerClassName + "," + propertyPath + "]"); - - if (propertyPath == null) { - LOG.error("Invalid subscription (" + subscriptions[i] + ") property file missing"); - continue; - } - - if (!propertyPath.startsWith("/")) { - propertyPath = propDir + "/" + propertyPath; - } - - Class consumerClass = null; - - try { - consumerClass = Class.forName(consumerClassName); - } catch (Exception e) { - LOG.error("Could not find DMaap consumer class " + consumerClassName); - } - - if (consumerClass != null) { - - SdncDmaapConsumer consumer = null; - - try { - consumer = (SdncDmaapConsumer) consumerClass.newInstance(); - } catch (Exception e) { - LOG.error("Could not create consumer from class " + consumerClassName, e); - } - - if (consumer != null) { - LOG.debug("Initializing consumer " + consumerClassName + "(" + propertyPath + ")"); - consumer.init(properties, propertyPath); - - if (consumer.isReady()) { - Thread consumerThread = new Thread(consumer); - consumerThread.start(); - consumers.add(consumer); - threadsRunning = true; - LOG.info("Started consumer thread (" + consumerClassName + " : " + propertyPath + ")"); - } else { - LOG.debug("Consumer " + consumerClassName + " is not ready"); - } - } - - } - - } - } - - while (threadsRunning) { - - threadsRunning = false; - for (SdncDmaapConsumer consumer : consumers) { - if (consumer.isRunning()) { - threadsRunning = true; - } - } - - if (!threadsRunning) { - break; - } - - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - - } - } - - LOG.info("No listener threads running - exitting"); - - } -} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java deleted file mode 100644 index 5edc1c908..000000000 --- a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/DummyDmaapConsumer.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.dmaapclient; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DummyDmaapConsumer extends SdncDmaapConsumer { - - private static final Logger LOG = LoggerFactory - .getLogger(DummyDmaapConsumer.class); - - @Override - public void processMsg(String msg) { - LOG.info("Consumed message: \n"+msg); - } - -} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java deleted file mode 100644 index 3de5df6c2..000000000 --- a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/InvalidMessageException.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.dmaapclient; - -public class InvalidMessageException extends Exception { - - public InvalidMessageException() { - super(); - } - - public InvalidMessageException(String msg) { - super(msg); - } - - public InvalidMessageException(String msg, Throwable t) { - super(msg, t); - } -} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java deleted file mode 100644 index 5b55bda5b..000000000 --- a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncDmaapConsumer.java +++ /dev/null @@ -1,146 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.dmaapclient; - -import java.io.File; -import java.io.FileInputStream; -import java.util.Properties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.att.nsa.mr.client.MRClientFactory; -import com.att.nsa.mr.client.MRConsumer; -import com.att.nsa.mr.client.response.MRConsumerResponse; - -public abstract class SdncDmaapConsumer implements Runnable { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncDmaapConsumer.class); - - private String propertiesPath = ""; - private Properties properties = null; - MRConsumer consumer = null; - MRConsumerResponse consumerResponse = null; - boolean running = false; - boolean ready = false; - int fetchPause = 5000; // Default pause between fetchs - 5 seconds - - public boolean isReady() { - return ready; - } - - int timeout = 15000; // Default timeout - 15 seconds - - public boolean isRunning() { - return running; - } - - public SdncDmaapConsumer() { - - } - - public SdncDmaapConsumer(Properties properties, String propertiesPath) { - init(properties, propertiesPath); - } - - public String getProperty(String name) { - return(properties.getProperty(name, "")); - } - - public void init(Properties properties, String propertiesPath) { - - this.propertiesPath = propertiesPath; - - try { - - this.properties = (Properties) properties.clone(); - - this.properties.load(new FileInputStream(new File(propertiesPath))); - - String timeoutStr = properties.getProperty("timeout"); - - if ((timeoutStr != null) && (timeoutStr.length() > 0)) { - try { - timeout = Integer.parseInt(timeoutStr); - } catch (NumberFormatException e) { - LOG.error("Non-numeric value specified for timeout ("+timeoutStr+")"); - } - } - - String fetchPauseStr = properties.getProperty("fetchPause"); - if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { - try { - fetchPause = Integer.parseInt(fetchPauseStr); - } catch (NumberFormatException e) { - LOG.error("Non-numeric valud specified for fetchPause ("+fetchPauseStr+")"); - } - } - - this.consumer = MRClientFactory.createConsumer(propertiesPath); - ready = true; - } catch (Exception e) { - LOG.error("Error initializing DMaaP consumer from file "+propertiesPath, e); - } - } - - - @Override - public void run() { - if (ready) { - - running = true; - - while (running) { - - try { - boolean noData = true; - consumerResponse = consumer.fetchWithReturnConsumerResponse(timeout, -1); - for (String msg : consumerResponse.getActualMessages()) { - noData = false; - LOG.info("Received message from DMaaP:\n"+msg); - processMsg(msg); - } - - if (noData) { - if (fetchPause > 0) { - - LOG.info("No data received from fetch. Pausing "+fetchPause+" ms before retry"); - Thread.sleep(fetchPause); - } else { - - LOG.info("No data received from fetch. No fetch pause specified - retrying immediately"); - } - } - } catch (Exception e) { - LOG.error("Caught exception reading from DMaaP", e); - running = false; - } - - - } - } - - } - - abstract public void processMsg(String msg) throws InvalidMessageException; -} diff --git a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java deleted file mode 100644 index 7e9c069ac..000000000 --- a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncFlatJsonDmaapConsumer.java +++ /dev/null @@ -1,196 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.dmaapclient; - -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.Authenticator; -import java.net.HttpURLConnection; -import java.net.PasswordAuthentication; -import java.net.URL; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSession; - -import org.apache.commons.codec.binary.Base64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - - -public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncFlatJsonDmaapConsumer.class); - - private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; - private static final String SDNC_ENDPOINT = "SDNC.endpoint"; - - - - @Override - public void processMsg(String msg) throws InvalidMessageException { - - processMsg(msg, null); - } - - public void processMsg(String msg, String mapDirName) throws InvalidMessageException { - - if (msg == null) { - throw new InvalidMessageException("Null message"); - } - - ObjectMapper oMapper = new ObjectMapper(); - JsonNode instarRootNode = null; - ObjectNode sdncRootNode = null; - - String instarMsgName = null; - - try { - instarRootNode = oMapper.readTree(msg); - } catch (Exception e) { - throw new InvalidMessageException("Cannot parse json object", e); - } - - Iterator> instarFields = instarRootNode.fields(); - - while (instarFields.hasNext()) { - Map.Entry entry = instarFields.next(); - - instarMsgName = entry.getKey(); - instarRootNode = entry.getValue(); - break; - } - - Map fieldMap = loadMap(instarMsgName, mapDirName); - - if (fieldMap == null) { - throw new InvalidMessageException("Unable to process message - cannot load field mappings"); - } - - if (!fieldMap.containsKey(SDNC_ENDPOINT)) { - throw new InvalidMessageException("No SDNC endpoint known for message "+instarMsgName); - } - - String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); - - sdncRootNode = oMapper.createObjectNode(); - ObjectNode inputNode = oMapper.createObjectNode(); - - - for (String fromField : fieldMap.keySet()) { - - if (!SDNC_ENDPOINT.equals(fromField)) { - JsonNode curNode = instarRootNode.get(fromField); - if (curNode != null) { - String fromValue = curNode.textValue(); - - inputNode.put(fieldMap.get(fromField), fromValue); - } - } - } - sdncRootNode.put("input", inputNode); - - try { - String rpcMsgbody = oMapper.writeValueAsString(sdncRootNode); - 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) { - - } - - } - - private Map loadMap(String msgType, String mapDirName) { - Map results = new HashMap(); - - - if (mapDirName == null) { - String rootdir = System.getenv(DMAAPLISTENERROOT); - - if ((rootdir == null) || (rootdir.length() == 0)) { - rootdir = "/opt/app/dmaap-listener"; - } - - mapDirName = rootdir + "/lib"; - - } - - String mapFilename = mapDirName + "/" + msgType + ".map"; - - File mapFile = new File(mapFilename); - - if (!mapFile.canRead()) { - LOG.error("Cannot read map file ("+mapFilename+")"); - return(null); - } - - try { - BufferedReader mapReader = new BufferedReader(new FileReader(mapFile)); - - String curLine = null; - - while ((curLine = mapReader.readLine()) != null) { - curLine = curLine.trim(); - - if ((curLine.length() > 0) && (!curLine.startsWith("#"))) { - - if (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/openecomp/sdnc/dmaapclient/SdncOdlConnection.java b/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncOdlConnection.java deleted file mode 100644 index 6c6f308fb..000000000 --- a/dmaap-listener/src/main/java/org/openecomp/sdnc/dmaapclient/SdncOdlConnection.java +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.dmaapclient; - -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.Authenticator; -import java.net.HttpURLConnection; -import java.net.PasswordAuthentication; -import java.net.ProtocolException; -import java.net.URL; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSession; - -import org.apache.commons.codec.binary.Base64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class SdncOdlConnection { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncOdlConnection.class); - - private HttpURLConnection httpConn = null; - - private String url = null; - private String user = null; - private String password = null; - - private class SdncAuthenticator extends Authenticator { - - private String user; - private String passwd; - - SdncAuthenticator(String user, String passwd) { - this.user = user; - this.passwd = passwd; - } - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(user, passwd.toCharArray()); - } - - } - - private SdncOdlConnection() { - - } - - private SdncOdlConnection(String url, String user, String password) { - this.url = url; - this.user = user; - this.password = password; - - try { - URL sdncUrl = new URL(url); - Authenticator.setDefault(new SdncAuthenticator(user, password)); - - this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); - } catch (Exception e) { - LOG.error("Unable to create http connection", e); - } - } - - public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException - { - return (new SdncOdlConnection(url, user, password)); - } - - - - public String send(String method, String contentType, String msg) throws IOException { - - LOG.info("Sending REST " + method + " to " + url); - LOG.info("Message body:\n" + msg); - String authStr = user + ":" + password; - String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); - - httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); - - httpConn.setRequestMethod(method); - httpConn.setRequestProperty("Content-Type", contentType); - httpConn.setRequestProperty("Accept", contentType); - - httpConn.setDoInput(true); - httpConn.setDoOutput(true); - httpConn.setUseCaches(false); - - if (httpConn instanceof HttpsURLConnection) { - HostnameVerifier hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); - } - - // Write message - httpConn.setRequestProperty("Content-Length", "" + msg.length()); - DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); - outStr.write(msg.getBytes()); - outStr.close(); - - // Read response - BufferedReader respRdr; - - LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); - - if (httpConn.getResponseCode() < 300) { - - respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); - } else { - respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); - } - - StringBuffer respBuff = new StringBuffer(); - - String respLn; - - while ((respLn = respRdr.readLine()) != null) { - respBuff.append(respLn + "\n"); - } - respRdr.close(); - - String respString = respBuff.toString(); - - LOG.info("Response body :\n" + respString); - - return (respString); - - } - - -} diff --git a/example-settings.xml b/example-settings.xml deleted file mode 100644 index 2e7ce6445..000000000 --- a/example-settings.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - openecomp-release - - - openecomp-release - openecomp-release - https://ecomp-nexus:8443/repository/maven-releases/ - - true - never - - - false - - - - - - openecomp-release - openecomp-release - https://ecomp-nexus:8443/repository/maven-releases/ - - true - never - - - false - - - - - - - openecomp-snapshots - - - openecomp-snapshot - openecomp-snapshot - https://ecomp-nexus:8443/repository/maven-snapshots/ - - false - - - true - - - - - - openecomp-snapshot - openecomp-snapshot - https://ecomp-nexus:8443/repository/maven-snapshots/ - - false - - - true - - - - - - opendaylight-release - - - opendaylight-mirror - opendaylight-mirror - https://nexus.opendaylight.org/content/repositories/public/ - - true - never - - - false - - - - - - opendaylight-mirror - opendaylight-mirror - https://nexus.opendaylight.org/content/repositories/public/ - - true - never - - - false - - - - - - - opendaylight-snapshots - - - opendaylight-snapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - opendaylight-snapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - - - openecomp-release - openecomp-snapshots - opendaylight-release - opendaylight-snapshots - - - - - nexus - USERNAME - PASSWORD - - - openecomp-release - USERNAME - PASSWORD - - - openecomp-snapshot - USERNAME - PASSWORD - - - diff --git a/jenkins-settings.xml b/jenkins-settings.xml deleted file mode 100644 index 344994f85..000000000 --- a/jenkins-settings.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - openecomp-release - - - openecomp-release - openecomp-release - https://ecomp-nexus:8443/repository/maven-releases/ - - true - never - - - false - - - - - - openecomp-release - openecomp-release - https://ecomp-nexus:8443/repository/maven-releases/ - - true - never - - - false - - - - - - - openecomp-snapshots - - - openecomp-snapshot - openecomp-snapshot - https://ecomp-nexus:8443/repository/maven-snapshots/ - - false - - - true - - - - - - openecomp-snapshot - openecomp-snapshot - https://ecomp-nexus:8443/repository/maven-snapshots/ - - false - - - true - - - - - - opendaylight-release - - - opendaylight-mirror - opendaylight-mirror - https://nexus.opendaylight.org/content/repositories/public/ - - true - never - - - false - - - - - - opendaylight-mirror - opendaylight-mirror - https://nexus.opendaylight.org/content/repositories/public/ - - true - never - - - false - - - - - - - opendaylight-snapshots - - - opendaylight-snapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - opendaylight-snapshot - opendaylight-snapshot - https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ - - false - - - true - - - - - - - - openecomp-release - openecomp-snapshots - opendaylight-release - opendaylight-snapshots - - - - - nexus - ${ecomp.nexus.user} - ${ecomp.nexus.password} - - - openecomp-release - ${ecomp.nexus.user} - ${ecomp.nexus.password} - - - openecomp-snapshot - ${ecomp.nexus.user} - ${ecomp.nexus.password} - - - sdnc-javadoc - ${ecomp.nexus.user} - ${ecomp.nexus.password} - - - 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 new file mode 100644 index 000000000..3be906181 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java @@ -0,0 +1,53 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncARModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncARModel.class); + + public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract metadata + Metadata metadata = nodeTemplate.getMetadata(); + addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); + + // extract properties + //addParameter("role", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_ROLE)); + //addParameter("type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_TYPE)); - wrong location, get from metadata + addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); + addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); + //addParameter("depending_service", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_DEPENDINGSERVICE)); + //addParameter("service_dependency", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_SERVICEDEPENDENCY)); + } + +} 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 new file mode 100644 index 000000000..d979a3206 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java @@ -0,0 +1,134 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncArtifactMap { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncArtifactMap.class); + + public class SdncArtifactType { + private String tag; + private String artifactType; + private String rpc; + private int pass; + + public String getTag() { + return tag; + } + public String getArtifactType() { + return artifactType; + } + public String getRpc() { + return rpc; + } + + public int getPass() { + return pass; + } + + public String getRpcUrl(String base) { + return(base+rpc); + } + + private SdncArtifactType(String tag, String rpc, String pass) { + this.tag = tag; + this.rpc = rpc; + try { + this.pass = Integer.parseInt(pass); + } catch (Exception e) { + LOG.error("Invalid pass value for artifact map entry ("+tag+","+rpc+","+pass+")"); + } + } + } + + + + private Map mapItems = new HashMap(); + + private int NumPasses = 1; + + public int getNumPasses() { + return NumPasses; + } + + public void load(String fileName) { + + File mapFile = new File(fileName); + + if (mapFile.exists() && mapFile.canRead()) { + + BufferedReader rdr = null; + try { + + rdr = new BufferedReader(new FileReader(mapFile)); + + for (String ln ; (ln = rdr.readLine()) != null ; ) { + String[] lnFields = ln.split(","); + if (lnFields.length == 3) { + SdncArtifactType entry = new SdncArtifactType(lnFields[0], lnFields[1], lnFields[2]); + mapItems.put(entry.getTag(), entry); + if (entry.getPass() + 1 > NumPasses ) { + NumPasses = entry.getPass() + 1; + } + } + } + + + } catch (Exception e) { + LOG.error("Caught exception reading artifact map", e); + return; + } finally { + if (rdr != null) { + try { + rdr.close(); + } catch (IOException e) { + + } + } + } + } + } + + public SdncArtifactType getMapping(String tag) { + if (mapItems.containsKey(tag)) { + return(mapItems.get(tag)); + } else { + return(null); + } + } + + public static SdncArtifactMap getInstance() { + return new SdncArtifactMap(); + } + +} 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 new file mode 100644 index 000000000..707eee7e4 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java @@ -0,0 +1,297 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import java.util.HashMap; +import java.util.Map; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Group; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncBaseModel.class); + + protected String customizationUUID = null; + protected String invariantUUID = null; + protected String model_yaml = null; + protected String version = null; + + protected Map params = null; + protected ISdcCsarHelper sdcCsarHelper = null; + + public SdncBaseModel() { + + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { + + params = new HashMap(); + this.sdcCsarHelper = sdcCsarHelper; + + // extract service metadata + invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); + addParameter("invariant_uuid",invariantUUID); + addParameter("version",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + addParameter("name",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); + addParameter("description",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); + addParameter("type",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); + addParameter("category",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY)); + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + params = new HashMap(); + this.sdcCsarHelper = sdcCsarHelper; + + // extract nodeTemplate metadata + Metadata metadata = nodeTemplate.getMetadata(); + customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); + addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID)); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) { + + params = new HashMap(); + this.sdcCsarHelper = sdcCsarHelper; + + // extract group metadata + Metadata metadata = group.getMetadata(); + //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null + customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID"); + addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); + addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); + } + + protected void addParameter (String name, String value) { + if (value != null && !value.isEmpty()) { + params.put(name, "\"" + value + "\""); + } + } + + protected void addIntParameter (String name, String value) { + if (value != null && !value.isEmpty()) { + params.put(name, value); + } + } + + public static void addIntParameter (String name, String value, Map params) { + if (value != null && !value.isEmpty()) { + params.put(name, value); + } + } + + public static void addParameter (String name, String value, Map params) { + if (value != null && !value.isEmpty()) { + params.put(name, "\"" + value + "\""); + } + } + + protected String extractValue (Metadata metadata, String name) { + String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + public static String extractValue (ISdcCsarHelper sdcCsarHelper, Metadata metadata, String name) { + String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractValue (NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + public static String extractValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanValue (NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + public static String extractBooleanValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + protected String extractValue (Group group, String name) { + String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanValue (Group group, String name) { + String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + protected String extractInputDefaultValue (String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanInputDefaultValue (String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + public static String extractInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null) { + return value; + } else { + return ""; + } + } + + public static String extractBooleanInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { + String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + public static String extractSubstitutionMappingTypeName (ISdcCsarHelper sdcCsarHelper) { + String value = sdcCsarHelper.getServiceSubstitutionMappingsTypeName(); + if (value != null) { + return value; + } else { + return ""; + } + } + + public String getCustomizationUUID() { + return ("\"" + customizationUUID + "\""); + } + public String getCustomizationUUIDNoQuotes() { + return (customizationUUID); + } + public void setCustomizationUUID(String customizationUUID) { + this.customizationUUID = customizationUUID; + } + + public String getSql(String tableName, String model_yaml) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into " + tableName + " (customization_uuid, model_yaml, "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + getCustomizationUUID() + ", \"" + model_yaml + "\", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + + public static String getSql(String tableName, String keyName, String keyValue, String model_yaml, Map params) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into " + tableName + " (" + keyName + ", "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + keyValue + ", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + +} 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 new file mode 100644 index 000000000..dcf668ed8 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java @@ -0,0 +1,145 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncNodeModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncNodeModel.class); + + private String serviceUUID = null; + private String ecompGeneratedNaming = null; + private String [] bindingUuids = null; + + // Using ASDC TOSCA Parser 17.07 + public SdncNodeModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract inputs + String ecompGeneratedNaming = extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING); + addParameter("ecomp_generated_naming",ecompGeneratedNaming); + addParameter("naming_policy", extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); + + // extract properties + addParameter("network_type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)); + addParameter("network_role", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)); + addParameter("network_scope", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)); + addParameter("network_technology", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)); + + // extract properties - network_assignments + addParameter("is_shared_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISSHAREDNETWORK)); + addParameter("is_external_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISEXTERNALNETWORK)); + + // extract properties - network_assignments - ipv4_subnet_default_assignment + String useIpv4 = extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#use_ipv4"); + addParameter("use_ipv4", useIpv4); + addParameter("ipv4_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#dhcp_enabled")); + if (useIpv4.contains("Y")) { + addParameter("ipv4_ip_version", "ipv4"); + } + addParameter("ipv4_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#cidr_mask")); + addParameter("eipam_v4_address_plan", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#ip_network_address_plan")); + + // extract properties - network_assignments - ipv6_subnet_default_assignment + String useIpv6 = extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#use_ipv6"); + addParameter("use_ipv6", useIpv6); + addParameter("ipv6_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#dhcp_enabled")); + if (useIpv6.contains("Y")) { + addParameter("ipv6_ip_version", "ipv6"); + } + addParameter("ipv6_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#cidr_mask")); + addParameter("eipam_v6_address_plan", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#ip_network_address_plan")); + + // extract properties - provider_network + addParameter("is_provider_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK)); + addParameter("physical_network_name", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_PHYSICALNETWORKNAME)); + + // extract properties - network_flows + addParameter("is_bound_to_vpn", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_ISBOUNDTOVPN)); + + // extract properties - network_flows - vpn_bindings + String vpnBindingString = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_VPNBINDING); + bindingUuids = vpnBindingString.split(","); + +} + + public String getServiceUUID() { + return serviceUUID; + } + public void setServiceUUID(String serviceUUID) { + this.serviceUUID = serviceUUID; + } + + public String getEcompGeneratedNaming() { + return ecompGeneratedNaming; + } + public void setEcompGeneratedNaming(String ecompGeneratedNaming) { + this.ecompGeneratedNaming = ecompGeneratedNaming; + if (ecompGeneratedNaming != null && !ecompGeneratedNaming.isEmpty()) { + params.put("ecomp_generated_naming", "\"" + ecompGeneratedNaming + "\""); + } + } + + public String getSql(String model_yaml) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + serviceUUID + ", " + getCustomizationUUID() + ", \"" + model_yaml + "\", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + + public String getVpnBindingsSql() { + + StringBuilder sb = new StringBuilder(); + for (int i=0; i < bindingUuids.length; i++) { + sb.append("INSERT into VPN_BINDINGS (network_customization_uuid, binding_uuid) values (" + getCustomizationUUID() + ", \"" + bindingUuids[i] + "\"); "); + } + + return sb.toString(); + } + +} 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 new file mode 100644 index 000000000..7bee801d2 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java @@ -0,0 +1,158 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.URL; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSession; + +import org.apache.commons.codec.binary.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class SdncOdlConnection { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncOdlConnection.class); + + private HttpURLConnection httpConn = null; + + private String url = null; + private String user = null; + private String password = null; + + private class SdncAuthenticator extends Authenticator { + + private String user; + private String passwd; + + SdncAuthenticator(String user, String passwd) { + this.user = user; + this.passwd = passwd; + } + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, passwd.toCharArray()); + } + + } + + private SdncOdlConnection() { + + } + + private SdncOdlConnection(String url, String user, String password) { + this.url = url; + this.user = user; + this.password = password; + + try { + URL sdncUrl = new URL(url); + Authenticator.setDefault(new SdncAuthenticator(user, password)); + + this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); + } catch (Exception e) { + LOG.error("Unable to create http connection", e); + } + } + + public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException + { + return (new SdncOdlConnection(url, user, password)); + } + + + + public String send(String method, String contentType, String msg) throws IOException { + + LOG.info("Sending REST " + method + " to " + url); + LOG.info("Message body:\n" + msg); + String authStr = user + ":" + password; + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + + httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); + + httpConn.setRequestMethod(method); + httpConn.setRequestProperty("Content-Type", contentType); + httpConn.setRequestProperty("Accept", contentType); + + httpConn.setDoInput(true); + httpConn.setDoOutput(true); + httpConn.setUseCaches(false); + + if (httpConn instanceof HttpsURLConnection) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); + } + + // Write message + httpConn.setRequestProperty("Content-Length", "" + msg.length()); + DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); + outStr.write(msg.getBytes()); + outStr.close(); + + // Read response + BufferedReader respRdr; + + LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); + + if (httpConn.getResponseCode() < 300) { + + respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); + } else { + respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); + } + + StringBuffer respBuff = new StringBuffer(); + + String respLn; + + while ((respLn = respRdr.readLine()) != null) { + respBuff.append(respLn + "\n"); + } + respRdr.close(); + + String respString = respBuff.toString(); + + LOG.info("Response body :\n" + respString); + + return (respString); + + } + + +} 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 new file mode 100644 index 000000000..86a4d2a25 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java @@ -0,0 +1,98 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncServiceModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncServiceModel.class); + + private String UUID = null; + private String serviceInstanceNamePrefix = null; + private String filename = null; + + public SdncServiceModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { + + super(sdcCsarHelper, metadata); + + UUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_UUID); + + // extract service topology template input data + addParameter("ecomp_naming",extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING)); + addParameter("naming_policy",extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); + } + + public String getServiceUUID() { + return ("\"" + UUID + "\""); + } + public void setServiceUUID(String serviceUUID) { + this.UUID = serviceUUID; + } + public String getServiceInstanceNamePrefix() { + return serviceInstanceNamePrefix; + } + public void setServiceInstanceNamePrefix(String serviceInstanceNamePrefix) { + if (serviceInstanceNamePrefix != null && !serviceInstanceNamePrefix.isEmpty()) { + this.serviceInstanceNamePrefix = serviceInstanceNamePrefix; + params.put("service_instance_name_prefix", "\"" + serviceInstanceNamePrefix + "\""); + } + } + public String getFilename() { + return filename; + } + public void setFilename(String filename) { + this.filename = filename; + } + + public String getSql(String model_yaml) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into SERVICE_MODEL (service_uuid, model_yaml, filename, "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + getServiceUUID() + ", \"" + model_yaml + "\", \"" + filename + "\", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(");"); + return sb.toString(); + } + +} 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 new file mode 100644 index 000000000..fd304208c --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java @@ -0,0 +1,1125 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.sql.rowset.CachedRowSet; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathFactory; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.tuple.Pair; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.onap.ccsdk.sli.northbound.uebclient.SdncArtifactMap.SdncArtifactType; +import org.openecomp.sdc.api.IDistributionClient; +import org.openecomp.sdc.api.consumer.IDistributionStatusMessage; +import org.openecomp.sdc.api.consumer.INotificationCallback; +import org.openecomp.sdc.api.notification.IArtifactInfo; +import org.openecomp.sdc.api.notification.INotificationData; +import org.openecomp.sdc.api.notification.IResourceInstance; +import org.openecomp.sdc.api.results.IDistributionClientDownloadResult; +import org.openecomp.sdc.api.results.IDistributionClientResult; +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory; +import org.openecomp.sdc.toscaparser.api.Group; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.openecomp.sdc.utils.ArtifactTypeEnum; +import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.openecomp.sdc.utils.DistributionStatusEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class SdncUebCallback implements INotificationCallback { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncUebCallback.class); + + private static DBResourceManager jdbcDataSource = null; + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + + + private class SdncAuthenticator extends Authenticator { + + private final String user; + private final String passwd; + + SdncAuthenticator(String user, String passwd) { + this.user = user; + this.passwd = passwd; + } + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, passwd.toCharArray()); + } + + } + + private class DeployableArtifact { + SdncArtifactType type; + IArtifactInfo artifactInfo; + String svcName; + String resourceName; + String artifactName; + String artifactVersion; + File file; + + public String getArtifactName() { + return artifactName; + } + + + + public String getArtifactVersion() { + return artifactVersion; + } + + + public SdncArtifactType getType() { + return type; + } + + + + public IArtifactInfo getArtifactInfo() { + return artifactInfo; + } + + + public File getFile() { + return file; + } + + + + + public DeployableArtifact(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, File file) { + this.type = type; + this.artifactInfo = artifactInfo; + this.svcName = svcName; + this.resourceName = resourceName; + this.artifactName = artifactInfo.getArtifactName(); + this.artifactVersion = artifactInfo.getArtifactVersion(); + this.file = file; + } + + + public DeployableArtifact(SdncArtifactType type, String svcName, String resourceName, String artifactName, String artifactVersion, File file) { + this.type = type; + this.artifactInfo = null; + this.svcName = svcName; + this.resourceName = resourceName; + this.artifactName = artifactName; + this.artifactVersion = artifactVersion; + this.file = file; + } + + + + public String getSvcName() { + return svcName; + } + + + + public String getResourceName() { + return resourceName; + } + + } + + private final IDistributionClient client; + private final SdncUebConfiguration config; + + private LinkedList deployList[]; + + private static void setJdbcDataSource() throws IOException { + + String propPath = null; + String propDir = System.getenv(SDNC_CONFIG_DIR); + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + propPath = propDir + "/dblib.properties"; + File propFile = new File(propPath); + + if (!propFile.exists()) { + + throw new FileNotFoundException( + "Missing configuration properties file : " + + propFile); + } + + Properties props = new Properties(); + props.load(new FileInputStream(propFile)); + + try { + jdbcDataSource = DBResourceManager.create(props); + } catch(Throwable exc) { + LOG.error("", exc); + } + + if(((DBResourceManager)jdbcDataSource).isActive()){ + LOG.warn( "DBLIB: JDBC DataSource has been initialized."); + } else { + LOG.warn( "DBLIB: JDBC DataSource did not initialize successfully."); + } + } + + private static void loadArtifactMap() { + + } + + public SdncUebCallback(IDistributionClient client, SdncUebConfiguration config) { + this.client = client; + this.config = config; + + } + + @Override + public void activateCallback(INotificationData data) { + + LOG.info("Received notification : ("+data.getDistributionID()+","+data.getServiceName()+","+data.getServiceVersion()+ + ","+data.getServiceDescription() + ")"); + + String incomingDirName = config.getIncomingDir(); + String archiveDirName = config.getArchiveDir(); + + File incomingDir = null; + File archiveDir = null; + + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + + // Process service level artifacts + List artifactList = data.getServiceArtifacts(); + + if (artifactList != null) { + + incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName())); + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName())); + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + for (IArtifactInfo curArtifact : artifactList) + { + + LOG.info("Received artifact " + curArtifact.getArtifactName()); + + handleArtifact(data, data.getServiceName(), null, null, curArtifact, incomingDir, archiveDir); + } + } + + + // Process resource level artifacts + for (IResourceInstance curResource : data.getResources()) { + + LOG.info("Received resource : "+curResource.getResourceName()); + artifactList = curResource.getArtifacts(); + + if (artifactList != null) { + + incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + for (IArtifactInfo curArtifact : artifactList) + { + + LOG.info("Received artifact " + curArtifact.getArtifactName()); + + handleArtifact(data, data.getServiceName(), curResource.getResourceName(), curResource.getResourceType(), curArtifact, incomingDir, archiveDir); + } + } + } + + deployDownloadedFiles(incomingDir, archiveDir, data); + + + } + + + public void deployDownloadedFiles(File incomingDir, File archiveDir, INotificationData data) { + + if (incomingDir == null) { + incomingDir = new File(config.getIncomingDir()); + + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + + } + + if (archiveDir == null) { + archiveDir = new File(config.getArchiveDir()); + + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } + } + + String curFileName = ""; + try (DirectoryStream stream = Files.newDirectoryStream(incomingDir.toPath())) { + for (Path file: stream) { + curFileName = file.toString(); + handleSuccessfulDownload(null,null, null, null, file.toFile(), archiveDir); + } + } catch (Exception x) { + // IOException can never be thrown by the iteration. + // In this snippet, it can only be thrown by newDirectoryStream. + LOG.warn("Cannot process spool file "+ curFileName, x); + } + + // Deploy scheduled deployments + int numPasses = config.getMaxPasses(); + + deployList = new LinkedList[numPasses]; + + for (int i = 0 ; i < numPasses ; i++) { + deployList[i] = new LinkedList(); + } + for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) { + + if (deployList[pass] != null) { + while (! deployList[pass].isEmpty()) { + DeployableArtifact artifact = deployList[pass].pop(); + + DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_ERROR; + + + try { + + deployResult = deploySpoolFile(artifact); + } catch (Exception e) { + LOG.error("Caught exception trying to deploy file", e); + } + + + IArtifactInfo artifactInfo = artifact.getArtifactInfo(); + + if ((artifactInfo != null) && (data != null)) { + IDistributionClientResult deploymentStatus; + deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( + client, data, artifactInfo, + deployResult)); + } + + } + } + } + } + + private void handleArtifact(INotificationData data, String svcName, String resourceName, String resourceType, IArtifactInfo artifact, File incomingDir, File archiveDir) { + + // Download Artifact + IDistributionClientDownloadResult downloadResult = client + .download(artifact); + + if (downloadResult == null) { + + handleFailedDownload(data, artifact); + return; + } + + byte[] payloadBytes = downloadResult.getArtifactPayload(); + + if (payloadBytes == null) { + handleFailedDownload(data, artifact); + return; + } + + String payload = new String(payloadBytes); + + + File spoolFile = new File(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); + + boolean writeSucceeded = false; + + try { + FileWriter spoolFileWriter = new FileWriter(spoolFile); + spoolFileWriter.write(payload); + spoolFileWriter.close(); + writeSucceeded = true; + } catch (Exception e) { + LOG.error("Unable to save downloaded file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); + } + + + if (writeSucceeded && (downloadResult.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS)) { + handleSuccessfulDownload(data, svcName, resourceName, artifact, spoolFile, archiveDir); + + + } else { + handleFailedDownload(data, artifact); + } + + } + + private void handleFailedDownload(INotificationData data, + IArtifactInfo relevantArtifact) { + // Send Download Status + IDistributionClientResult sendDownloadStatus = client + .sendDownloadStatus(buildStatusMessage(client, data, + relevantArtifact, DistributionStatusEnum.DOWNLOAD_ERROR)); + } + + private void handleSuccessfulDownload(INotificationData data, String svcName, String resourceName, + IArtifactInfo artifact, File spoolFile, File archiveDir) { + + if ((data != null) && (artifact != null)) { + // Send Download Status + IDistributionClientResult sendDownloadStatus = client + .sendDownloadStatus(buildStatusMessage(client, data, artifact, DistributionStatusEnum.DOWNLOAD_OK)); + } + + // If an override file exists, read that instead of the file we just downloaded + ArtifactTypeEnum artifactEnum = ArtifactTypeEnum.YANG_XML; + + boolean toscaYamlType = false; + if (artifact != null) { + String artifactTypeString = artifact.getArtifactType(); + if (artifactTypeString.contains("TOSCA_TEMPLATE")) { + toscaYamlType = true; + } + } else { + if (spoolFile.toString().contains(".yml") || spoolFile.toString().contains(".csar")) { + toscaYamlType = true; + } + } + String overrideFileName = config.getOverrideFile(); + if ((overrideFileName != null) && (overrideFileName.length() > 0)) { + File overrideFile = new File(overrideFileName); + + if (overrideFile.exists()) { + artifactEnum = ArtifactTypeEnum.YANG_XML; + spoolFile = overrideFile; + } + + } + + if (toscaYamlType == true) { + processToscaYaml (data, svcName, resourceName, artifact, spoolFile, archiveDir); + + try { + Path source = spoolFile.toPath(); + Path targetDir = archiveDir.toPath(); + + Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); + } + + return; + } + + // Process spool file + Document spoolDoc = null; + File transformedFile = null; + + // Apply XSLTs and get Doc object + try { + if (!spoolFile.isDirectory()) { + transformedFile = applyXslts(spoolFile); + } + } catch (Exception e) { + LOG.error("Caught exception trying to parse XML file", e); + } + + if (transformedFile != null) { + try { + + try { + + DocumentBuilderFactory dbf = DocumentBuilderFactory + .newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + + spoolDoc = db.parse(transformedFile); + } catch (Exception e) { + LOG.error( + "Caught exception trying to parse transformed XML file " + + transformedFile.getAbsolutePath(), e); + } + + } catch (Exception e) { + LOG.error("Caught exception trying to deploy file", e); + } + } + + + if (spoolDoc != null) { + // Analyze file type + SdncArtifactType artifactType = analyzeFileType(artifactEnum, + spoolFile, spoolDoc); + + if (artifactType != null) { + + scheduleDeployment(artifactType, svcName, resourceName, artifact, spoolFile.getName(), transformedFile); + + } + + // SDNGC-2660 : Move file to archive directory even if it is an unrecognized type so that + // we do not keep trying and failing to process it. + try { + Path source = spoolFile.toPath(); + Path targetDir = archiveDir.toPath(); + + Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); + } + } + + + } + + + private void processToscaYaml(INotificationData data, String svcName, String resourceName, + IArtifactInfo artifact, File spoolFile, File archiveDir) { + + // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data + + // TOSCA data extraction flow 1707: + // Use ASDC dist-client to get yaml string - not yet available + String model_yaml = null; + LOG.info("Process TOSCA YAML file: "+spoolFile.toString()); + + SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); + ISdcCsarHelper sdcCsarHelper = null; + try { + sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath()); + } catch (SdcToscaParserException e) { + LOG.error("Could not create SDC TOSCA Parser ", e); + factory.close(); + return; + } + + // Ingest Service Data - 1707 + Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata(); + SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata); + serviceModel.setFilename(spoolFile.toString().substring(spoolFile.toString().lastIndexOf("/")+1)); // will be csar file name + serviceModel.setServiceInstanceNamePrefix(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).substring(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).lastIndexOf(".")+1)); + + try { + cleanUpExistingToscaServiceData(serviceModel.getServiceUUID()); + LOG.info("Call insertToscaData for SERVICE_MODEL serviceUUID = " + serviceModel.getServiceUUID()); + insertToscaData(serviceModel.getSql(model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); + factory.close(); + return; + } + + // Ingest Network (VL) Data - 1707 + //List vlNodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VL"); + List vlNodeTemplatesList = sdcCsarHelper.getServiceVlList(); + + for (NodeTemplate nodeTemplate : vlNodeTemplatesList) { + SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, nodeTemplate); + nodeModel.setServiceUUID(serviceModel.getServiceUUID()); + nodeModel.setEcompGeneratedNaming(SdncBaseModel.extractBooleanInputDefaultValue(sdcCsarHelper, SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING));//service_naming#default#ecomp_generated_naming + + try { + cleanUpExistingToscaData("NETWORK_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); + cleanUpExistingToscaData("VPN_BINDINGS", "network_customization_uuid", nodeModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for NETWORK_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); + // using ASDC dist-client use method for get yaml string + insertToscaData(nodeModel.getSql(model_yaml)); + insertToscaData(nodeModel.getVpnBindingsSql()); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); + } + } + + // Ingest Allotted Resource Data - 1707 + List arNodeTemplatesList = sdcCsarHelper.getAllottedResources(); + + for (NodeTemplate nodeTemplate : arNodeTemplatesList) { + SdncARModel nodeModel = new SdncARModel (sdcCsarHelper, nodeTemplate); + + try { + cleanUpExistingToscaData("ALLOTTED_RESOURCE_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for ALLOTTED_RESOURCE_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); + // using ASDC dist-client use method for get yaml string + insertToscaData(nodeModel.getSql("ALLOTTED_RESOURCE_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); + } + } + + // Ingest Network (VF) Data - 1707 + //List nodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VF"); + List vfNodeTemplatesList = sdcCsarHelper.getServiceVfList(); + + for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { + SdncVFModel vfNodeModel = new SdncVFModel (sdcCsarHelper, nodeTemplate); + + try { + cleanUpExistingToscaData("VF_MODEL", "customization_uuid", vfNodeModel.getCustomizationUUID()) ; + LOG.info("Call insertToscaData for VF_MODEL customizationUUID = " + vfNodeModel.getCustomizationUUID()); + insertToscaData(vfNodeModel.getSql("VF_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_MODEL table ", e); + } + + // For each VF, insert VF_MODULE_MODEL data + List vfModules = sdcCsarHelper.getVfModulesByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); + for (Group group : vfModules){ + SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, group); + + try { + cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_MODULE_MODEL customizationUUID = " + vfModuleModel.getCustomizationUUID()); + insertToscaData(vfModuleModel.getSql("VF_MODULE_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_MODULE_MODEL table ", e); + } + + // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data + // List groupMembers = sdcCsarHelper.getMembersOfGroup(group); - old version + // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. + // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING + List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); // not yet available + for (NodeTemplate vfcNode : groupMembers){ + SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); + + try { + cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING customizationUUID = " + vfModuleModel.getCustomizationUUID()); + insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + + vfModuleModel.getCustomizationUUID() + ", " + vfcModel.getCustomizationUUID() + ", \"" + vfcModel.getVmType() + "\", \"" + vfcModel.getVmCount() + "\")"); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_MODULE_TO_VFC_MAPPING table ", e); + } + + } + + } + + // For each VF, insert VFC_MODEL data + List vfcNodes = sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); + for (NodeTemplate vfcNode : vfcNodes){ + SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); + + try { + cleanUpExistingToscaData("VFC_MODEL", "customization_uuid", vfcModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VFC_MODEL customizationUUID = " + vfcModel.getCustomizationUUID()); + insertToscaData(vfcModel.getSql("VFC_MODEL", model_yaml)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VFC_MODEL table ", e); + } + + } + + // For each VF, insert VF_TO_NETWORK_ROLE_MAPPING data + List cpNodes = sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); + for (NodeTemplate cpNode : cpNodes){ + + // Insert into VF_TO_NETWORK_ROLE_MAPPING vf_customization_uuid and network_role + String cpNetworkRole = sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, "network_role_tag"); + + try { + cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", vfNodeModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING vfCustomizationUUID = " + vfNodeModel.getCustomizationUUID()); + insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + + vfNodeModel.getCustomizationUUID() + ", \"" + cpNetworkRole + "\")"); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VF_TO_NETWORK_ROLE_MAPPING table ", e); + } + + // Insert VFC_TO_NETWORK_ROLE_MAPPING data + Map mappingParams = new HashMap(); + //String cpNetworkRoleTag = "\"" + sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLETAG) + "\""; + // extract network_role, network_role_tag and virtual_binding from this cpNode + SdncBaseModel.addParameter("network_role", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role"), mappingParams); + SdncBaseModel.addParameter("network_role_tag", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role_tag"), mappingParams); + String virtualBinding = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "requirements#virtualBinding") + "\""; + + // get list of cpNodes and vfcNodes with matching virtualBinding + List> matchList = sdcCsarHelper.getNodeTemplatePairsByReqName(sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), virtualBinding); + for (Pair match : matchList) { // should be 1 match? + + // extract values from the left "CP" Node + SdncBaseModel.addParameter("ipv4_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); + //SdncBaseModel.addParameter("ipv4_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); + SdncBaseModel.addParameter("ipv4_ip_version", "dummy_ipv4_vers", mappingParams); + SdncBaseModel.addParameter("ipv6_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); + //SdncBaseModel.addParameter("ipv6_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); + SdncBaseModel.addParameter("ipv6_ip_version", "dummy_ipv6_vers", mappingParams); + //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid + + // extract values from the right "VFC" Node + String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetadata(), "customization_uuid") + "\""; + SdncBaseModel.addParameter("vm_type", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_VMTYPE), mappingParams); + SdncBaseModel.addIntParameter("ipv4_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); + SdncBaseModel.addIntParameter("ipv6_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); + + try { + cleanUpExistingToscaData("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid); + LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING vfcCustomizationUUID = " + vfcCustomizationUuid); + insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid, "", mappingParams)); + } catch (IOException e) { + LOG.error("Could not insert Tosca YAML data into the VFC_TO_NETWORK_ROLE_MAPPING table ", e); + } + + } + + } // CP loop + + } // VF loop + + // Close ASDC TOSCA Parser factory - we are done processing this distribution + factory.close(); + + if ((artifact != null) && (data != null)) { + LOG.info("Update to SDN-C succeeded"); + IDistributionClientResult deploymentStatus; + deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( + client, data, artifact, + DistributionStatusEnum.DEPLOY_OK)); + } + + } + + private void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException + { + + if (jdbcDataSource == null) { + setJdbcDataSource(); + } + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount != 0) { + LOG.info("cleanUpExistingToscaData: " + keyValue); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); + } + + } catch (SQLException e) { + LOG.error("Could not clean up existing " + tableName + " for " + keyValue, e); + } + + } + + + private void cleanUpExistingToscaServiceData(String serviceUUID) throws IOException + { + + if (jdbcDataSource == null) { + setJdbcDataSource(); + } + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData("SELECT * from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount != 0) { + LOG.info("cleanUpExistingToscaData: " + serviceUUID); + jdbcDataSource.writeData("DELETE from NETWORK_MODEL where service_uuid = " + serviceUUID + ";", null, null); + jdbcDataSource.writeData("DELETE from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, null); + } + + } catch (SQLException e) { + LOG.error("Could not clean up existing NETWORK_MODEL and SERVICE_MODEL for service_UUID " + serviceUUID, e); + } + + } + + + private void insertToscaData(String toscaDataString) throws IOException + { + LOG.debug("insertToscaData: " + toscaDataString); + + if (jdbcDataSource == null) { + setJdbcDataSource(); + } + try { + + jdbcDataSource.writeData(toscaDataString, null, null); + + } catch (SQLException e) { + LOG.error("Could not insert Tosca YAML data into the database ", e); + } + + } + + + private SdncArtifactType analyzeFileType(ArtifactTypeEnum artifactType, File spoolFile, Document spoolDoc) { + + if (artifactType != ArtifactTypeEnum.YANG_XML) { + LOG.error("Unexpected artifact type - expecting YANG_XML, got "+artifactType); + return (null); + } + + // Examine outer tag + + try { + + + Element root = spoolDoc.getDocumentElement(); + + String rootName = root.getTagName(); + + if (rootName.contains(":")) { + String[] rootNameElems = rootName.split(":"); + rootName = rootNameElems[rootNameElems.length - 1]; + } + + if (rootName != null) { + SdncArtifactType mapEntry = config.getMapping(rootName); + + + if (mapEntry == null) { + + LOG.error("Unexpected file contents - root tag is "+rootName); + } + return(mapEntry); + } else { + LOG.error("Cannot get root tag from file"); + return(null); + } + + } catch (Exception e) { + LOG.error("Could not parse YANG_XML file "+spoolFile.getName(), e); + return(null); + } + } + + private void scheduleDeployment(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, String spoolFileName, File spoolFile) { + + if (type.getPass() < deployList.length) { + + if (artifactInfo != null) { + LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); + + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); + } else { + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy + Date now = new Date(); + String artifactVersion = sdfDate.format(now); + LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); + String artifactName = spoolFileName; + if (artifactInfo != null) { + artifactName = artifactInfo.getArtifactName(); + } + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactName, artifactVersion, spoolFile)); + } + } else { + LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); + } + } + + + private DistributionStatusEnum deploySpoolFile(DeployableArtifact artifact) { + + DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_OK; + + StringBuffer msgBuffer = new StringBuffer(); + + + String namespace = config.getAsdcApiNamespace(); + if ((namespace == null) || (namespace.length() == 0)) { + namespace="com:att:sdnctl:asdcapi"; + } + + msgBuffer.append("\n"); + + String svcName = artifact.getSvcName(); + String resourceName = artifact.getResourceName(); + String artifactName = artifact.getArtifactName(); + + if (svcName != null) { + if (resourceName != null) { + artifactName = svcName + "/" + resourceName + "/" + artifactName; + } else { + artifactName = svcName + "/" + artifactName; + } + } + + msgBuffer.append(""+artifactName+"\n"); + msgBuffer.append(""+artifact.getArtifactVersion()+"\n"); + + + try { + BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile())); + + String curLine = rdr.readLine(); + + while (curLine != null) { + + if (!curLine.startsWith("\n"); + + + byte[] msgBytes = msgBuffer.toString().getBytes(); + + Document results = postRestXml(artifact.getType().getRpcUrl(config.getAsdcApiBaseUrl()), msgBytes); + + if (results == null) { + + deployResult = DistributionStatusEnum.DEPLOY_ERROR; + } else { + + XPathFactory xpf = XPathFactory.newInstance(); + XPath xp = xpf.newXPath(); + + String asdcApiResponseCode = "500"; + + try { + + asdcApiResponseCode = xp.evaluate("//asdc-api-response-code[position()=1]/text()", results.getDocumentElement()); + } catch (Exception e) { + LOG.error("Caught exception retrying to evaluate xpath", e); + } + + if (asdcApiResponseCode.contains("200")) { + LOG.info("Update to SDN-C succeeded"); + deployResult = DistributionStatusEnum.DEPLOY_OK; + } else { + LOG.info("Update to SDN-C failed (response code "+asdcApiResponseCode+")"); + + if (asdcApiResponseCode.contains("409")) { + deployResult = DistributionStatusEnum.ALREADY_DEPLOYED; + } else { + + deployResult = DistributionStatusEnum.DEPLOY_ERROR; + } + } + } + + + + return(deployResult); + } + + + + + + public static IDistributionStatusMessage buildStatusMessage( + final IDistributionClient client, final INotificationData data, + final IArtifactInfo relevantArtifact, + final DistributionStatusEnum status) { + IDistributionStatusMessage statusMessage = new IDistributionStatusMessage() { + + @Override + public long getTimestamp() { + long currentTimeMillis = System.currentTimeMillis(); + return currentTimeMillis; + } + + @Override + public DistributionStatusEnum getStatus() { + return status; + } + + @Override + public String getDistributionID() { + return data.getDistributionID(); + } + + @Override + public String getConsumerID() { + return client.getConfiguration().getConsumerID(); + } + + @Override + public String getArtifactURL() { + return relevantArtifact.getArtifactURL(); + } + }; + return statusMessage; + + } + + private HttpURLConnection getRestXmlConnection(String urlString, String method) throws IOException + { + URL sdncUrl = new URL(urlString); + Authenticator.setDefault(new SdncAuthenticator(config.getSdncUser(), config.getSdncPasswd())); + + HttpURLConnection conn = (HttpURLConnection) sdncUrl.openConnection(); + + String authStr = config.getSdncUser()+":"+config.getSdncPasswd(); + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + + conn.addRequestProperty("Authentication", "Basic "+encodedAuthStr); + + conn.setRequestMethod(method); + conn.setRequestProperty("Content-Type", "application/xml"); + conn.setRequestProperty("Accept", "application/xml"); + + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setUseCaches(false); + + return(conn); + + } + + private Document postRestXml(String urlString, byte[] msgBytes) { + Document response = null; + + try { + SdncOdlConnection odlConn = SdncOdlConnection.newInstance(urlString, config.getSdncUser(), config.getSdncPasswd()); + + String sdncResp = odlConn.send("POST", "application/xml", new String(msgBytes)); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + + + response = db.parse(new ByteArrayInputStream(sdncResp.getBytes())); + } catch (Exception e) { + LOG.error("Caught exception posting to ODL tier", e); + } + + return(response); + + } + + private File applyXslts(File srcFile) { + + Document doc = null; + + + File inFile = srcFile; + File outFile = null; + + String xsltPathList = config.getXsltPathList(); + + if ((xsltPathList == null) || (xsltPathList.length() == 0)) { + outFile = inFile; + } else { + + String[] xsltPaths = xsltPathList.split(","); + + for (String xsltPath : xsltPaths) { + try{ + + outFile = File.createTempFile("tmp", "xml"); + TransformerFactory factory = TransformerFactory.newInstance(); + Source xslt = new StreamSource(new File(xsltPath)); + Transformer transformer = factory.newTransformer(xslt); + Source text = new StreamSource(inFile); + + + transformer.transform(text, new StreamResult(outFile)); + + inFile = outFile; + + } catch (Exception e) { + LOG.error("Caught exception trying to apply XSLT template "+xsltPath, e); + + } + + } + } + + // After transformations, parse transformed XML + + + return(outFile); + } + + private String escapeFilename(String str) { + StringBuffer retval = new StringBuffer(); + + for (int i = 0 ; i < str.length() ; i++) { + char curchar = str.charAt(i); + if (Character.isJavaIdentifierPart(curchar)) { + retval.append(curchar); + } + } + + return(retval.toString()); + + } + +} 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 new file mode 100644 index 000000000..e8ffc3333 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java @@ -0,0 +1,65 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import org.openecomp.sdc.api.IDistributionClient; +import org.openecomp.sdc.api.results.IDistributionClientResult; +import org.openecomp.sdc.impl.DistributionClientFactory; +import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncUebClient { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncUebConfiguration.class); + + public static void main(String[] args) { + IDistributionClient client = DistributionClientFactory + .createDistributionClient(); + + SdncUebConfiguration config = new SdncUebConfiguration(); + + SdncUebCallback cb = new SdncUebCallback(client, config); + + LOG.info("Scanning for local distribution artifacts before starting client"); + cb.deployDownloadedFiles(null, null, null); + + LOG.info("Initializing ASDC distribution client"); + + IDistributionClientResult result = client.init( + config, cb); + + LOG.info("Initialized ASDC distribution client - results = " + + result.getDistributionMessageResult()); + + if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { + LOG.info("Starting client..."); + IDistributionClientResult start = client.start(); + LOG.info("Client startup result = " + + start.getDistributionMessageResult()); + } + + + } + +} 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 new file mode 100644 index 000000000..bf0d5b823 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java @@ -0,0 +1,280 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +import org.openecomp.sdc.api.consumer.IConfiguration; +import org.openecomp.sdc.utils.ArtifactTypeEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncUebConfiguration implements IConfiguration{ + + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + private static final Logger LOG = LoggerFactory + .getLogger(SdncUebConfiguration.class); + + private String asdcAddress = null; + private String consumerGroup = null; + private String consumerID = null; + private String environmentName = null; + private String password = null; + private int pollingInterval = 30; + private int pollingTimeout = 15; + private List relevantArtifactTypes = null; + private String user = null; + + private String sdncUser = null; + private String sdncPasswd = null; + private String asdcApiBaseUrl = null; + private String asdcApiNamespace = null; + + private SdncArtifactMap artifactMap = SdncArtifactMap.getInstance(); + + public String getAsdcApiNamespace() { + return asdcApiNamespace; + } + + private String incomingDir = null; + + private String archiveDir = null; + + private String overrideFile = null; + + private boolean activateServerTLSAuth; + private String keyStorePassword; + private String keyStorePath; + + private String xsltPathList; + + public String getXsltPathList() { + return xsltPathList; + } + + public String getOverrideFile() { + return overrideFile; + } + + public SdncUebConfiguration() { + + try { + init(); + } catch (Exception e) { + LOG.error("Cannot initialize SdncUebConfiguration", e); + } + } + + public void init() throws IOException { + String propPath = null; + String propDir = System.getenv(SDNC_CONFIG_DIR); + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + propPath = propDir + "/ueb-listener.properties"; + File propFile = new File(propPath); + + + if (!propFile.exists()) { + + throw new FileNotFoundException( + "Missing configuration properties file : " + + propFile); + } + + Properties props = new Properties(); + props.load(new FileInputStream(propFile)); + + asdcAddress = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.asdc-address"); + consumerGroup = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.consumer-group"); + consumerID = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.consumer-id"); + environmentName = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.environment-name"); + password = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.password"); + user = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.user"); + + sdncUser = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.sdnc-user"); + sdncPasswd = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd"); + asdcApiBaseUrl = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url"); + asdcApiNamespace = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.asdc-api-namespace"); + + incomingDir = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.spool.incoming"); + archiveDir = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.spool.archive"); + overrideFile = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.override-file"); + + String curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.polling-interval"); + if ((curval != null) && (curval.length() > 0)) { + try { + pollingInterval = Integer.parseInt(curval); + } catch (Exception e) { + LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-interval ("+curval+")"); + } + } + + curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.polling-timeout"); + if ((curval != null) && (curval.length() > 0)) { + try { + pollingTimeout = Integer.parseInt(curval); + } catch (Exception e) { + LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-timeout ("+curval+")"); + } + } + + curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types"); + if ((curval != null) && (curval.length() > 0)) { + String[] artifactTypes = curval.split(","); + + relevantArtifactTypes = new LinkedList(); + + for (int i = 0 ; i < artifactTypes.length ; i++) { + try { + if (ArtifactTypeEnum.valueOf(artifactTypes[i]) != null) { + relevantArtifactTypes.add(artifactTypes[i]); + } else { + LOG.warn("Skipping unrecognized artifact type "+artifactTypes[i]); + } + } catch (Exception e) { + + LOG.warn("Caught exception validating artifact type "+artifactTypes[i], e); + } + + } + + } + + curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth", "false"); + activateServerTLSAuth = "true".equalsIgnoreCase(curval); + keyStorePath = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.keystore-path"); + keyStorePassword = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.keystore-password"); + xsltPathList = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list"); + + + String artifactMapFile = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.artifact-map"); + if (artifactMapFile != null) { + artifactMap.load(artifactMapFile); + } + + } + + @Override + public String getAsdcAddress() { + return asdcAddress; + } + + @Override + public String getConsumerGroup() { + return consumerGroup; + } + + @Override + public String getConsumerID() { + return consumerID; + } + + @Override + public String getEnvironmentName() { + return environmentName; + } + + @Override + public String getPassword() { + return password; + } + + @Override + public int getPollingInterval() { + return pollingInterval; + } + + @Override + public int getPollingTimeout() { + return pollingTimeout; + } + + @Override + public List getRelevantArtifactTypes() { + return relevantArtifactTypes; + } + + @Override + public String getUser() { + return user; + } + + + public String getSdncUser() { + return sdncUser; + } + + public String getSdncPasswd() { + return sdncPasswd; + } + + public String getAsdcApiBaseUrl() { + return asdcApiBaseUrl; + } + + @Override + public boolean activateServerTLSAuth() { + return activateServerTLSAuth; + } + + @Override + public String getKeyStorePassword() { + return keyStorePassword; + } + + @Override + public String getKeyStorePath() { + return keyStorePath; + } + + public String getIncomingDir() { + return incomingDir; + } + + public String getArchiveDir() { + return archiveDir; + } + + public int getMaxPasses() { + return(artifactMap.getNumPasses()); + } + + public SdncArtifactMap.SdncArtifactType getMapping(String tag) { + return(artifactMap.getMapping(tag)); + } + + @Override + public boolean isFilterInEmptyResources() { + // TODO Auto-generated method stub + return false; + } + + +} 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 new file mode 100644 index 000000000..76f015f9a --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java @@ -0,0 +1,69 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncVFCModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFCModel.class); + + private String vmType = null; + private String vmCount = null; + + public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract properties + vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPE); + //vmCount = extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMCOUNT); - need path to vm_count + vmCount = "1"; + addParameter("vm_type", vmType); + addParameter("vm_type_tag", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG)); + addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); + addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); + addParameter("nfc_naming_code", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFCCODE)); + } + + public String getVmType() { + return vmType; + } + + public void setVmType(String vmType) { + this.vmType = vmType; + } + + public String getVmCount() { + return vmCount; + } + + public void setVmCount(String vmCount) { + this.vmCount = vmCount; + } + +} 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 new file mode 100644 index 000000000..cd79689b4 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java @@ -0,0 +1,56 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncVFModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFModel.class); + + public SdncVFModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + + super(sdcCsarHelper, nodeTemplate); + + // extract metadata + Metadata metadata = nodeTemplate.getMetadata(); + addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); + addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR)); + addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); + + // extract properties + addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_ECOMPGENERATEDNAMING)); + addParameter("naming_policy", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_NAMINGPOLICY)); + addParameter("nf_type", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); + addParameter("nf_role", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)); + addParameter("nf_code", extractValue( nodeTemplate, "nf_naming_code")); + addParameter("nf_function", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); + addParameter("avail_zone_max_count", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); + } + +} 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 new file mode 100644 index 000000000..7ae6c3107 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ + +package org.onap.ccsdk.sli.northbound.uebclient; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; +import org.openecomp.sdc.toscaparser.api.Group; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncVFModuleModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFModuleModel.class); + + public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group) { + + super(sdcCsarHelper, group); + + // extract properties + addParameter("vf_module_type", extractValue(group, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); + addIntParameter("availability_zone_count", extractValue(group, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)); + addParameter("ecomp_generated_vm_assignments", extractBooleanValue(group, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS)); + } + +} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java deleted file mode 100644 index 3472b443a..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncARModel.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Metadata; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncARModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncARModel.class); - - public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - - super(sdcCsarHelper, nodeTemplate); - - // extract metadata - Metadata metadata = nodeTemplate.getMetadata(); - addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); - - // extract properties - //addParameter("role", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_ROLE)); - //addParameter("type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_TYPE)); - wrong location, get from metadata - addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); - addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); - //addParameter("depending_service", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_DEPENDINGSERVICE)); - //addParameter("service_dependency", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_SERVICEDEPENDENCY)); - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java deleted file mode 100644 index 4a9f02a8e..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncArtifactMap.java +++ /dev/null @@ -1,134 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncArtifactMap { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncArtifactMap.class); - - public class SdncArtifactType { - private String tag; - private String artifactType; - private String rpc; - private int pass; - - public String getTag() { - return tag; - } - public String getArtifactType() { - return artifactType; - } - public String getRpc() { - return rpc; - } - - public int getPass() { - return pass; - } - - public String getRpcUrl(String base) { - return(base+rpc); - } - - private SdncArtifactType(String tag, String rpc, String pass) { - this.tag = tag; - this.rpc = rpc; - try { - this.pass = Integer.parseInt(pass); - } catch (Exception e) { - LOG.error("Invalid pass value for artifact map entry ("+tag+","+rpc+","+pass+")"); - } - } - } - - - - private Map mapItems = new HashMap(); - - private int NumPasses = 1; - - public int getNumPasses() { - return NumPasses; - } - - public void load(String fileName) { - - File mapFile = new File(fileName); - - if (mapFile.exists() && mapFile.canRead()) { - - BufferedReader rdr = null; - try { - - rdr = new BufferedReader(new FileReader(mapFile)); - - for (String ln ; (ln = rdr.readLine()) != null ; ) { - String[] lnFields = ln.split(","); - if (lnFields.length == 3) { - SdncArtifactType entry = new SdncArtifactType(lnFields[0], lnFields[1], lnFields[2]); - mapItems.put(entry.getTag(), entry); - if (entry.getPass() + 1 > NumPasses ) { - NumPasses = entry.getPass() + 1; - } - } - } - - - } catch (Exception e) { - LOG.error("Caught exception reading artifact map", e); - return; - } finally { - if (rdr != null) { - try { - rdr.close(); - } catch (IOException e) { - - } - } - } - } - } - - public SdncArtifactType getMapping(String tag) { - if (mapItems.containsKey(tag)) { - return(mapItems.get(tag)); - } else { - return(null); - } - } - - public static SdncArtifactMap getInstance() { - return new SdncArtifactMap(); - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java deleted file mode 100644 index 39c50aed0..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncBaseModel.java +++ /dev/null @@ -1,297 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import java.util.HashMap; -import java.util.Map; - -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Group; -import org.openecomp.sdc.toscaparser.api.Metadata; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncBaseModel.class); - - protected String customizationUUID = null; - protected String invariantUUID = null; - protected String model_yaml = null; - protected String version = null; - - protected Map params = null; - protected ISdcCsarHelper sdcCsarHelper = null; - - public SdncBaseModel() { - - } - - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { - - params = new HashMap(); - this.sdcCsarHelper = sdcCsarHelper; - - // extract service metadata - invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); - addParameter("invariant_uuid",invariantUUID); - addParameter("version",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); - addParameter("name",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); - addParameter("description",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); - addParameter("type",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); - addParameter("category",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY)); - } - - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - - params = new HashMap(); - this.sdcCsarHelper = sdcCsarHelper; - - // extract nodeTemplate metadata - Metadata metadata = nodeTemplate.getMetadata(); - customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); - addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID)); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); - } - - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) { - - params = new HashMap(); - this.sdcCsarHelper = sdcCsarHelper; - - // extract group metadata - Metadata metadata = group.getMetadata(); - //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null - customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID"); - addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); - addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); - } - - protected void addParameter (String name, String value) { - if (value != null && !value.isEmpty()) { - params.put(name, "\"" + value + "\""); - } - } - - protected void addIntParameter (String name, String value) { - if (value != null && !value.isEmpty()) { - params.put(name, value); - } - } - - public static void addIntParameter (String name, String value, Map params) { - if (value != null && !value.isEmpty()) { - params.put(name, value); - } - } - - public static void addParameter (String name, String value, Map params) { - if (value != null && !value.isEmpty()) { - params.put(name, "\"" + value + "\""); - } - } - - protected String extractValue (Metadata metadata, String name) { - String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); - if (value != null) { - return value; - } else { - return ""; - } - } - - public static String extractValue (ISdcCsarHelper sdcCsarHelper, Metadata metadata, String name) { - String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); - if (value != null) { - return value; - } else { - return ""; - } - } - - protected String extractValue (NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); - if (value != null) { - return value; - } else { - return ""; - } - } - - public static String extractValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); - if (value != null) { - return value; - } else { - return ""; - } - } - - protected String extractBooleanValue (NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - - public static String extractBooleanValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - - protected String extractValue (Group group, String name) { - String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); - if (value != null) { - return value; - } else { - return ""; - } - } - - protected String extractBooleanValue (Group group, String name) { - String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - - protected String extractInputDefaultValue (String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null) { - return value; - } else { - return ""; - } - } - - protected String extractBooleanInputDefaultValue (String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - - public static String extractInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null) { - return value; - } else { - return ""; - } - } - - public static String extractBooleanInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - - public static String extractSubstitutionMappingTypeName (ISdcCsarHelper sdcCsarHelper) { - String value = sdcCsarHelper.getServiceSubstitutionMappingsTypeName(); - if (value != null) { - return value; - } else { - return ""; - } - } - - public String getCustomizationUUID() { - return ("\"" + customizationUUID + "\""); - } - public String getCustomizationUUIDNoQuotes() { - return (customizationUUID); - } - public void setCustomizationUUID(String customizationUUID) { - this.customizationUUID = customizationUUID; - } - - public String getSql(String tableName, String model_yaml) { - - StringBuilder sb = new StringBuilder(); - sb.append("INSERT into " + tableName + " (customization_uuid, model_yaml, "); - - int paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - sb.append(paramKey); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(") values (" + getCustomizationUUID() + ", \"" + model_yaml + "\", "); - - paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - String paramValue = params.get(paramKey); - sb.append(paramValue); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(");"); - return sb.toString(); - } - - public static String getSql(String tableName, String keyName, String keyValue, String model_yaml, Map params) { - - StringBuilder sb = new StringBuilder(); - sb.append("INSERT into " + tableName + " (" + keyName + ", "); - - int paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - sb.append(paramKey); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(") values (" + keyValue + ", "); - - paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - String paramValue = params.get(paramKey); - sb.append(paramValue); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(");"); - return sb.toString(); - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java deleted file mode 100644 index f8e5a5b8f..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncNodeModel.java +++ /dev/null @@ -1,145 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncNodeModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncNodeModel.class); - - private String serviceUUID = null; - private String ecompGeneratedNaming = null; - private String [] bindingUuids = null; - - // Using ASDC TOSCA Parser 17.07 - public SdncNodeModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - - super(sdcCsarHelper, nodeTemplate); - - // extract inputs - String ecompGeneratedNaming = extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING); - addParameter("ecomp_generated_naming",ecompGeneratedNaming); - addParameter("naming_policy", extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); - - // extract properties - addParameter("network_type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)); - addParameter("network_role", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)); - addParameter("network_scope", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)); - addParameter("network_technology", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)); - - // extract properties - network_assignments - addParameter("is_shared_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISSHAREDNETWORK)); - addParameter("is_external_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISEXTERNALNETWORK)); - - // extract properties - network_assignments - ipv4_subnet_default_assignment - String useIpv4 = extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#use_ipv4"); - addParameter("use_ipv4", useIpv4); - addParameter("ipv4_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#dhcp_enabled")); - if (useIpv4.contains("Y")) { - addParameter("ipv4_ip_version", "ipv4"); - } - addParameter("ipv4_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#cidr_mask")); - addParameter("eipam_v4_address_plan", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#ip_network_address_plan")); - - // extract properties - network_assignments - ipv6_subnet_default_assignment - String useIpv6 = extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#use_ipv6"); - addParameter("use_ipv6", useIpv6); - addParameter("ipv6_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#dhcp_enabled")); - if (useIpv6.contains("Y")) { - addParameter("ipv6_ip_version", "ipv6"); - } - addParameter("ipv6_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#cidr_mask")); - addParameter("eipam_v6_address_plan", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#ip_network_address_plan")); - - // extract properties - provider_network - addParameter("is_provider_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK)); - addParameter("physical_network_name", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_PHYSICALNETWORKNAME)); - - // extract properties - network_flows - addParameter("is_bound_to_vpn", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_ISBOUNDTOVPN)); - - // extract properties - network_flows - vpn_bindings - String vpnBindingString = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_VPNBINDING); - bindingUuids = vpnBindingString.split(","); - -} - - public String getServiceUUID() { - return serviceUUID; - } - public void setServiceUUID(String serviceUUID) { - this.serviceUUID = serviceUUID; - } - - public String getEcompGeneratedNaming() { - return ecompGeneratedNaming; - } - public void setEcompGeneratedNaming(String ecompGeneratedNaming) { - this.ecompGeneratedNaming = ecompGeneratedNaming; - if (ecompGeneratedNaming != null && !ecompGeneratedNaming.isEmpty()) { - params.put("ecomp_generated_naming", "\"" + ecompGeneratedNaming + "\""); - } - } - - public String getSql(String model_yaml) { - - StringBuilder sb = new StringBuilder(); - sb.append("INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, "); - - int paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - sb.append(paramKey); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(") values (" + serviceUUID + ", " + getCustomizationUUID() + ", \"" + model_yaml + "\", "); - - paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - String paramValue = params.get(paramKey); - sb.append(paramValue); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(");"); - return sb.toString(); - } - - public String getVpnBindingsSql() { - - StringBuilder sb = new StringBuilder(); - for (int i=0; i < bindingUuids.length; i++) { - sb.append("INSERT into VPN_BINDINGS (network_customization_uuid, binding_uuid) values (" + getCustomizationUUID() + ", \"" + bindingUuids[i] + "\"); "); - } - - return sb.toString(); - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java deleted file mode 100644 index 4e0cffab1..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncOdlConnection.java +++ /dev/null @@ -1,158 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.Authenticator; -import java.net.HttpURLConnection; -import java.net.PasswordAuthentication; -import java.net.URL; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSession; - -import org.apache.commons.codec.binary.Base64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class SdncOdlConnection { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncOdlConnection.class); - - private HttpURLConnection httpConn = null; - - private String url = null; - private String user = null; - private String password = null; - - private class SdncAuthenticator extends Authenticator { - - private String user; - private String passwd; - - SdncAuthenticator(String user, String passwd) { - this.user = user; - this.passwd = passwd; - } - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(user, passwd.toCharArray()); - } - - } - - private SdncOdlConnection() { - - } - - private SdncOdlConnection(String url, String user, String password) { - this.url = url; - this.user = user; - this.password = password; - - try { - URL sdncUrl = new URL(url); - Authenticator.setDefault(new SdncAuthenticator(user, password)); - - this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); - } catch (Exception e) { - LOG.error("Unable to create http connection", e); - } - } - - public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException - { - return (new SdncOdlConnection(url, user, password)); - } - - - - public String send(String method, String contentType, String msg) throws IOException { - - LOG.info("Sending REST " + method + " to " + url); - LOG.info("Message body:\n" + msg); - String authStr = user + ":" + password; - String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); - - httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); - - httpConn.setRequestMethod(method); - httpConn.setRequestProperty("Content-Type", contentType); - httpConn.setRequestProperty("Accept", contentType); - - httpConn.setDoInput(true); - httpConn.setDoOutput(true); - httpConn.setUseCaches(false); - - if (httpConn instanceof HttpsURLConnection) { - HostnameVerifier hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); - } - - // Write message - httpConn.setRequestProperty("Content-Length", "" + msg.length()); - DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); - outStr.write(msg.getBytes()); - outStr.close(); - - // Read response - BufferedReader respRdr; - - LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); - - if (httpConn.getResponseCode() < 300) { - - respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); - } else { - respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); - } - - StringBuffer respBuff = new StringBuffer(); - - String respLn; - - while ((respLn = respRdr.readLine()) != null) { - respBuff.append(respLn + "\n"); - } - respRdr.close(); - - String respString = respBuff.toString(); - - LOG.info("Response body :\n" + respString); - - return (respString); - - } - - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java deleted file mode 100644 index 0f645d7a3..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncServiceModel.java +++ /dev/null @@ -1,98 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Metadata; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncServiceModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncServiceModel.class); - - private String UUID = null; - private String serviceInstanceNamePrefix = null; - private String filename = null; - - public SdncServiceModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { - - super(sdcCsarHelper, metadata); - - UUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_UUID); - - // extract service topology template input data - addParameter("ecomp_naming",extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING)); - addParameter("naming_policy",extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); - } - - public String getServiceUUID() { - return ("\"" + UUID + "\""); - } - public void setServiceUUID(String serviceUUID) { - this.UUID = serviceUUID; - } - public String getServiceInstanceNamePrefix() { - return serviceInstanceNamePrefix; - } - public void setServiceInstanceNamePrefix(String serviceInstanceNamePrefix) { - if (serviceInstanceNamePrefix != null && !serviceInstanceNamePrefix.isEmpty()) { - this.serviceInstanceNamePrefix = serviceInstanceNamePrefix; - params.put("service_instance_name_prefix", "\"" + serviceInstanceNamePrefix + "\""); - } - } - public String getFilename() { - return filename; - } - public void setFilename(String filename) { - this.filename = filename; - } - - public String getSql(String model_yaml) { - - StringBuilder sb = new StringBuilder(); - sb.append("INSERT into SERVICE_MODEL (service_uuid, model_yaml, filename, "); - - int paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - sb.append(paramKey); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(") values (" + getServiceUUID() + ", \"" + model_yaml + "\", \"" + filename + "\", "); - - paramCount = 0; - for (String paramKey : params.keySet()) { - paramCount++; - String paramValue = params.get(paramKey); - sb.append(paramValue); - if (paramCount < params.size()) sb.append(", "); - } - - sb.append(");"); - return sb.toString(); - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java deleted file mode 100644 index 496c2cef8..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebCallback.java +++ /dev/null @@ -1,1125 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.net.Authenticator; -import java.net.HttpURLConnection; -import java.net.PasswordAuthentication; -import java.net.URL; -import java.nio.file.DirectoryStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.sql.SQLException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.sql.rowset.CachedRowSet; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathFactory; - -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.tuple.Pair; -import org.onap.ccsdk.sli.core.dblib.DBResourceManager; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.consumer.IDistributionStatusMessage; -import org.openecomp.sdc.api.consumer.INotificationCallback; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.notification.IResourceInstance; -import org.openecomp.sdc.api.results.IDistributionClientDownloadResult; -import org.openecomp.sdc.api.results.IDistributionClientResult; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory; -import org.openecomp.sdc.toscaparser.api.Group; -import org.openecomp.sdc.toscaparser.api.Metadata; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.openecomp.sdc.utils.ArtifactTypeEnum; -import org.openecomp.sdc.utils.DistributionActionResultEnum; -import org.openecomp.sdc.utils.DistributionStatusEnum; -import org.openecomp.sdnc.uebclient.SdncArtifactMap.SdncArtifactType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class SdncUebCallback implements INotificationCallback { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncUebCallback.class); - - private static DBResourceManager jdbcDataSource = null; - private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; - - - private class SdncAuthenticator extends Authenticator { - - private final String user; - private final String passwd; - - SdncAuthenticator(String user, String passwd) { - this.user = user; - this.passwd = passwd; - } - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(user, passwd.toCharArray()); - } - - } - - private class DeployableArtifact { - SdncArtifactType type; - IArtifactInfo artifactInfo; - String svcName; - String resourceName; - String artifactName; - String artifactVersion; - File file; - - public String getArtifactName() { - return artifactName; - } - - - - public String getArtifactVersion() { - return artifactVersion; - } - - - public SdncArtifactType getType() { - return type; - } - - - - public IArtifactInfo getArtifactInfo() { - return artifactInfo; - } - - - public File getFile() { - return file; - } - - - - - public DeployableArtifact(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, File file) { - this.type = type; - this.artifactInfo = artifactInfo; - this.svcName = svcName; - this.resourceName = resourceName; - this.artifactName = artifactInfo.getArtifactName(); - this.artifactVersion = artifactInfo.getArtifactVersion(); - this.file = file; - } - - - public DeployableArtifact(SdncArtifactType type, String svcName, String resourceName, String artifactName, String artifactVersion, File file) { - this.type = type; - this.artifactInfo = null; - this.svcName = svcName; - this.resourceName = resourceName; - this.artifactName = artifactName; - this.artifactVersion = artifactVersion; - this.file = file; - } - - - - public String getSvcName() { - return svcName; - } - - - - public String getResourceName() { - return resourceName; - } - - } - - private final IDistributionClient client; - private final SdncUebConfiguration config; - - private LinkedList deployList[]; - - private static void setJdbcDataSource() throws IOException { - - String propPath = null; - String propDir = System.getenv(SDNC_CONFIG_DIR); - if (propDir == null) { - - propDir = "/opt/sdnc/data/properties"; - } - propPath = propDir + "/dblib.properties"; - File propFile = new File(propPath); - - if (!propFile.exists()) { - - throw new FileNotFoundException( - "Missing configuration properties file : " - + propFile); - } - - Properties props = new Properties(); - props.load(new FileInputStream(propFile)); - - try { - jdbcDataSource = DBResourceManager.create(props); - } catch(Throwable exc) { - LOG.error("", exc); - } - - if(((DBResourceManager)jdbcDataSource).isActive()){ - LOG.warn( "DBLIB: JDBC DataSource has been initialized."); - } else { - LOG.warn( "DBLIB: JDBC DataSource did not initialize successfully."); - } - } - - private static void loadArtifactMap() { - - } - - public SdncUebCallback(IDistributionClient client, SdncUebConfiguration config) { - this.client = client; - this.config = config; - - } - - @Override - public void activateCallback(INotificationData data) { - - LOG.info("Received notification : ("+data.getDistributionID()+","+data.getServiceName()+","+data.getServiceVersion()+ - ","+data.getServiceDescription() + ")"); - - String incomingDirName = config.getIncomingDir(); - String archiveDirName = config.getArchiveDir(); - - File incomingDir = null; - File archiveDir = null; - - if (!incomingDir.exists()) { - incomingDir.mkdirs(); - } - - - if (!archiveDir.exists()) { - archiveDir.mkdirs(); - } - - // Process service level artifacts - List artifactList = data.getServiceArtifacts(); - - if (artifactList != null) { - - incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName())); - if (!incomingDir.exists()) { - incomingDir.mkdirs(); - } - - archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName())); - if (!archiveDir.exists()) { - archiveDir.mkdirs(); - } - for (IArtifactInfo curArtifact : artifactList) - { - - LOG.info("Received artifact " + curArtifact.getArtifactName()); - - handleArtifact(data, data.getServiceName(), null, null, curArtifact, incomingDir, archiveDir); - } - } - - - // Process resource level artifacts - for (IResourceInstance curResource : data.getResources()) { - - LOG.info("Received resource : "+curResource.getResourceName()); - artifactList = curResource.getArtifacts(); - - if (artifactList != null) { - - incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); - if (!incomingDir.exists()) { - incomingDir.mkdirs(); - } - - archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); - if (!archiveDir.exists()) { - archiveDir.mkdirs(); - } - for (IArtifactInfo curArtifact : artifactList) - { - - LOG.info("Received artifact " + curArtifact.getArtifactName()); - - handleArtifact(data, data.getServiceName(), curResource.getResourceName(), curResource.getResourceType(), curArtifact, incomingDir, archiveDir); - } - } - } - - deployDownloadedFiles(incomingDir, archiveDir, data); - - - } - - - public void deployDownloadedFiles(File incomingDir, File archiveDir, INotificationData data) { - - if (incomingDir == null) { - incomingDir = new File(config.getIncomingDir()); - - if (!incomingDir.exists()) { - incomingDir.mkdirs(); - } - - } - - if (archiveDir == null) { - archiveDir = new File(config.getArchiveDir()); - - if (!archiveDir.exists()) { - archiveDir.mkdirs(); - } - } - - String curFileName = ""; - try (DirectoryStream stream = Files.newDirectoryStream(incomingDir.toPath())) { - for (Path file: stream) { - curFileName = file.toString(); - handleSuccessfulDownload(null,null, null, null, file.toFile(), archiveDir); - } - } catch (Exception x) { - // IOException can never be thrown by the iteration. - // In this snippet, it can only be thrown by newDirectoryStream. - LOG.warn("Cannot process spool file "+ curFileName, x); - } - - // Deploy scheduled deployments - int numPasses = config.getMaxPasses(); - - deployList = new LinkedList[numPasses]; - - for (int i = 0 ; i < numPasses ; i++) { - deployList[i] = new LinkedList(); - } - for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) { - - if (deployList[pass] != null) { - while (! deployList[pass].isEmpty()) { - DeployableArtifact artifact = deployList[pass].pop(); - - DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_ERROR; - - - try { - - deployResult = deploySpoolFile(artifact); - } catch (Exception e) { - LOG.error("Caught exception trying to deploy file", e); - } - - - IArtifactInfo artifactInfo = artifact.getArtifactInfo(); - - if ((artifactInfo != null) && (data != null)) { - IDistributionClientResult deploymentStatus; - deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( - client, data, artifactInfo, - deployResult)); - } - - } - } - } - } - - private void handleArtifact(INotificationData data, String svcName, String resourceName, String resourceType, IArtifactInfo artifact, File incomingDir, File archiveDir) { - - // Download Artifact - IDistributionClientDownloadResult downloadResult = client - .download(artifact); - - if (downloadResult == null) { - - handleFailedDownload(data, artifact); - return; - } - - byte[] payloadBytes = downloadResult.getArtifactPayload(); - - if (payloadBytes == null) { - handleFailedDownload(data, artifact); - return; - } - - String payload = new String(payloadBytes); - - - File spoolFile = new File(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); - - boolean writeSucceeded = false; - - try { - FileWriter spoolFileWriter = new FileWriter(spoolFile); - spoolFileWriter.write(payload); - spoolFileWriter.close(); - writeSucceeded = true; - } catch (Exception e) { - LOG.error("Unable to save downloaded file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); - } - - - if (writeSucceeded && (downloadResult.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS)) { - handleSuccessfulDownload(data, svcName, resourceName, artifact, spoolFile, archiveDir); - - - } else { - handleFailedDownload(data, artifact); - } - - } - - private void handleFailedDownload(INotificationData data, - IArtifactInfo relevantArtifact) { - // Send Download Status - IDistributionClientResult sendDownloadStatus = client - .sendDownloadStatus(buildStatusMessage(client, data, - relevantArtifact, DistributionStatusEnum.DOWNLOAD_ERROR)); - } - - private void handleSuccessfulDownload(INotificationData data, String svcName, String resourceName, - IArtifactInfo artifact, File spoolFile, File archiveDir) { - - if ((data != null) && (artifact != null)) { - // Send Download Status - IDistributionClientResult sendDownloadStatus = client - .sendDownloadStatus(buildStatusMessage(client, data, artifact, DistributionStatusEnum.DOWNLOAD_OK)); - } - - // If an override file exists, read that instead of the file we just downloaded - ArtifactTypeEnum artifactEnum = ArtifactTypeEnum.YANG_XML; - - boolean toscaYamlType = false; - if (artifact != null) { - String artifactTypeString = artifact.getArtifactType(); - if (artifactTypeString.contains("TOSCA_TEMPLATE")) { - toscaYamlType = true; - } - } else { - if (spoolFile.toString().contains(".yml") || spoolFile.toString().contains(".csar")) { - toscaYamlType = true; - } - } - String overrideFileName = config.getOverrideFile(); - if ((overrideFileName != null) && (overrideFileName.length() > 0)) { - File overrideFile = new File(overrideFileName); - - if (overrideFile.exists()) { - artifactEnum = ArtifactTypeEnum.YANG_XML; - spoolFile = overrideFile; - } - - } - - if (toscaYamlType == true) { - processToscaYaml (data, svcName, resourceName, artifact, spoolFile, archiveDir); - - try { - Path source = spoolFile.toPath(); - Path targetDir = archiveDir.toPath(); - - Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); - } - - return; - } - - // Process spool file - Document spoolDoc = null; - File transformedFile = null; - - // Apply XSLTs and get Doc object - try { - if (!spoolFile.isDirectory()) { - transformedFile = applyXslts(spoolFile); - } - } catch (Exception e) { - LOG.error("Caught exception trying to parse XML file", e); - } - - if (transformedFile != null) { - try { - - try { - - DocumentBuilderFactory dbf = DocumentBuilderFactory - .newInstance(); - DocumentBuilder db = dbf.newDocumentBuilder(); - - spoolDoc = db.parse(transformedFile); - } catch (Exception e) { - LOG.error( - "Caught exception trying to parse transformed XML file " - + transformedFile.getAbsolutePath(), e); - } - - } catch (Exception e) { - LOG.error("Caught exception trying to deploy file", e); - } - } - - - if (spoolDoc != null) { - // Analyze file type - SdncArtifactType artifactType = analyzeFileType(artifactEnum, - spoolFile, spoolDoc); - - if (artifactType != null) { - - scheduleDeployment(artifactType, svcName, resourceName, artifact, spoolFile.getName(), transformedFile); - - } - - // SDNGC-2660 : Move file to archive directory even if it is an unrecognized type so that - // we do not keep trying and failing to process it. - try { - Path source = spoolFile.toPath(); - Path targetDir = archiveDir.toPath(); - - Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); - } - } - - - } - - - private void processToscaYaml(INotificationData data, String svcName, String resourceName, - IArtifactInfo artifact, File spoolFile, File archiveDir) { - - // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data - - // TOSCA data extraction flow 1707: - // Use ASDC dist-client to get yaml string - not yet available - String model_yaml = null; - LOG.info("Process TOSCA YAML file: "+spoolFile.toString()); - - SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); - ISdcCsarHelper sdcCsarHelper = null; - try { - sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath()); - } catch (SdcToscaParserException e) { - LOG.error("Could not create SDC TOSCA Parser ", e); - factory.close(); - return; - } - - // Ingest Service Data - 1707 - Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata(); - SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata); - serviceModel.setFilename(spoolFile.toString().substring(spoolFile.toString().lastIndexOf("/")+1)); // will be csar file name - serviceModel.setServiceInstanceNamePrefix(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).substring(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).lastIndexOf(".")+1)); - - try { - cleanUpExistingToscaServiceData(serviceModel.getServiceUUID()); - LOG.info("Call insertToscaData for SERVICE_MODEL serviceUUID = " + serviceModel.getServiceUUID()); - insertToscaData(serviceModel.getSql(model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); - factory.close(); - return; - } - - // Ingest Network (VL) Data - 1707 - //List vlNodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VL"); - List vlNodeTemplatesList = sdcCsarHelper.getServiceVlList(); - - for (NodeTemplate nodeTemplate : vlNodeTemplatesList) { - SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, nodeTemplate); - nodeModel.setServiceUUID(serviceModel.getServiceUUID()); - nodeModel.setEcompGeneratedNaming(SdncBaseModel.extractBooleanInputDefaultValue(sdcCsarHelper, SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING));//service_naming#default#ecomp_generated_naming - - try { - cleanUpExistingToscaData("NETWORK_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); - cleanUpExistingToscaData("VPN_BINDINGS", "network_customization_uuid", nodeModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for NETWORK_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); - // using ASDC dist-client use method for get yaml string - insertToscaData(nodeModel.getSql(model_yaml)); - insertToscaData(nodeModel.getVpnBindingsSql()); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); - } - } - - // Ingest Allotted Resource Data - 1707 - List arNodeTemplatesList = sdcCsarHelper.getAllottedResources(); - - for (NodeTemplate nodeTemplate : arNodeTemplatesList) { - SdncARModel nodeModel = new SdncARModel (sdcCsarHelper, nodeTemplate); - - try { - cleanUpExistingToscaData("ALLOTTED_RESOURCE_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for ALLOTTED_RESOURCE_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); - // using ASDC dist-client use method for get yaml string - insertToscaData(nodeModel.getSql("ALLOTTED_RESOURCE_MODEL", model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); - } - } - - // Ingest Network (VF) Data - 1707 - //List nodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VF"); - List vfNodeTemplatesList = sdcCsarHelper.getServiceVfList(); - - for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { - SdncVFModel vfNodeModel = new SdncVFModel (sdcCsarHelper, nodeTemplate); - - try { - cleanUpExistingToscaData("VF_MODEL", "customization_uuid", vfNodeModel.getCustomizationUUID()) ; - LOG.info("Call insertToscaData for VF_MODEL customizationUUID = " + vfNodeModel.getCustomizationUUID()); - insertToscaData(vfNodeModel.getSql("VF_MODEL", model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_MODEL table ", e); - } - - // For each VF, insert VF_MODULE_MODEL data - List vfModules = sdcCsarHelper.getVfModulesByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); - for (Group group : vfModules){ - SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, group); - - try { - cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_MODULE_MODEL customizationUUID = " + vfModuleModel.getCustomizationUUID()); - insertToscaData(vfModuleModel.getSql("VF_MODULE_MODEL", model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_MODULE_MODEL table ", e); - } - - // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data - // List groupMembers = sdcCsarHelper.getMembersOfGroup(group); - old version - // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. - // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING - List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); // not yet available - for (NodeTemplate vfcNode : groupMembers){ - SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); - - try { - cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING customizationUUID = " + vfModuleModel.getCustomizationUUID()); - insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + - vfModuleModel.getCustomizationUUID() + ", " + vfcModel.getCustomizationUUID() + ", \"" + vfcModel.getVmType() + "\", \"" + vfcModel.getVmCount() + "\")"); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_MODULE_TO_VFC_MAPPING table ", e); - } - - } - - } - - // For each VF, insert VFC_MODEL data - List vfcNodes = sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); - for (NodeTemplate vfcNode : vfcNodes){ - SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); - - try { - cleanUpExistingToscaData("VFC_MODEL", "customization_uuid", vfcModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VFC_MODEL customizationUUID = " + vfcModel.getCustomizationUUID()); - insertToscaData(vfcModel.getSql("VFC_MODEL", model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VFC_MODEL table ", e); - } - - } - - // For each VF, insert VF_TO_NETWORK_ROLE_MAPPING data - List cpNodes = sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); - for (NodeTemplate cpNode : cpNodes){ - - // Insert into VF_TO_NETWORK_ROLE_MAPPING vf_customization_uuid and network_role - String cpNetworkRole = sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, "network_role_tag"); - - try { - cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", vfNodeModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING vfCustomizationUUID = " + vfNodeModel.getCustomizationUUID()); - insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + - vfNodeModel.getCustomizationUUID() + ", \"" + cpNetworkRole + "\")"); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_TO_NETWORK_ROLE_MAPPING table ", e); - } - - // Insert VFC_TO_NETWORK_ROLE_MAPPING data - Map mappingParams = new HashMap(); - //String cpNetworkRoleTag = "\"" + sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLETAG) + "\""; - // extract network_role, network_role_tag and virtual_binding from this cpNode - SdncBaseModel.addParameter("network_role", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role"), mappingParams); - SdncBaseModel.addParameter("network_role_tag", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role_tag"), mappingParams); - String virtualBinding = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "requirements#virtualBinding") + "\""; - - // get list of cpNodes and vfcNodes with matching virtualBinding - List> matchList = sdcCsarHelper.getNodeTemplatePairsByReqName(sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), virtualBinding); - for (Pair match : matchList) { // should be 1 match? - - // extract values from the left "CP" Node - SdncBaseModel.addParameter("ipv4_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); - //SdncBaseModel.addParameter("ipv4_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); - SdncBaseModel.addParameter("ipv4_ip_version", "dummy_ipv4_vers", mappingParams); - SdncBaseModel.addParameter("ipv6_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); - //SdncBaseModel.addParameter("ipv6_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); - SdncBaseModel.addParameter("ipv6_ip_version", "dummy_ipv6_vers", mappingParams); - //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid - - // extract values from the right "VFC" Node - String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetadata(), "customization_uuid") + "\""; - SdncBaseModel.addParameter("vm_type", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_VMTYPE), mappingParams); - SdncBaseModel.addIntParameter("ipv4_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); - SdncBaseModel.addIntParameter("ipv6_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); - - try { - cleanUpExistingToscaData("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid); - LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING vfcCustomizationUUID = " + vfcCustomizationUuid); - insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid, "", mappingParams)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VFC_TO_NETWORK_ROLE_MAPPING table ", e); - } - - } - - } // CP loop - - } // VF loop - - // Close ASDC TOSCA Parser factory - we are done processing this distribution - factory.close(); - - if ((artifact != null) && (data != null)) { - LOG.info("Update to SDN-C succeeded"); - IDistributionClientResult deploymentStatus; - deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( - client, data, artifact, - DistributionStatusEnum.DEPLOY_OK)); - } - - } - - private void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException - { - - if (jdbcDataSource == null) { - setJdbcDataSource(); - } - try { - int rowCount = 0; - CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, ""); - while(data.next()) { - rowCount ++; - } - if (rowCount != 0) { - LOG.info("cleanUpExistingToscaData: " + keyValue); - jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); - } - - } catch (SQLException e) { - LOG.error("Could not clean up existing " + tableName + " for " + keyValue, e); - } - - } - - - private void cleanUpExistingToscaServiceData(String serviceUUID) throws IOException - { - - if (jdbcDataSource == null) { - setJdbcDataSource(); - } - try { - int rowCount = 0; - CachedRowSet data = jdbcDataSource.getData("SELECT * from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, ""); - while(data.next()) { - rowCount ++; - } - if (rowCount != 0) { - LOG.info("cleanUpExistingToscaData: " + serviceUUID); - jdbcDataSource.writeData("DELETE from NETWORK_MODEL where service_uuid = " + serviceUUID + ";", null, null); - jdbcDataSource.writeData("DELETE from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, null); - } - - } catch (SQLException e) { - LOG.error("Could not clean up existing NETWORK_MODEL and SERVICE_MODEL for service_UUID " + serviceUUID, e); - } - - } - - - private void insertToscaData(String toscaDataString) throws IOException - { - LOG.debug("insertToscaData: " + toscaDataString); - - if (jdbcDataSource == null) { - setJdbcDataSource(); - } - try { - - jdbcDataSource.writeData(toscaDataString, null, null); - - } catch (SQLException e) { - LOG.error("Could not insert Tosca YAML data into the database ", e); - } - - } - - - private SdncArtifactType analyzeFileType(ArtifactTypeEnum artifactType, File spoolFile, Document spoolDoc) { - - if (artifactType != ArtifactTypeEnum.YANG_XML) { - LOG.error("Unexpected artifact type - expecting YANG_XML, got "+artifactType); - return (null); - } - - // Examine outer tag - - try { - - - Element root = spoolDoc.getDocumentElement(); - - String rootName = root.getTagName(); - - if (rootName.contains(":")) { - String[] rootNameElems = rootName.split(":"); - rootName = rootNameElems[rootNameElems.length - 1]; - } - - if (rootName != null) { - SdncArtifactType mapEntry = config.getMapping(rootName); - - - if (mapEntry == null) { - - LOG.error("Unexpected file contents - root tag is "+rootName); - } - return(mapEntry); - } else { - LOG.error("Cannot get root tag from file"); - return(null); - } - - } catch (Exception e) { - LOG.error("Could not parse YANG_XML file "+spoolFile.getName(), e); - return(null); - } - } - - private void scheduleDeployment(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, String spoolFileName, File spoolFile) { - - if (type.getPass() < deployList.length) { - - if (artifactInfo != null) { - LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); - - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); - } else { - SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy - Date now = new Date(); - String artifactVersion = sdfDate.format(now); - LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); - String artifactName = spoolFileName; - if (artifactInfo != null) { - artifactName = artifactInfo.getArtifactName(); - } - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactName, artifactVersion, spoolFile)); - } - } else { - LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); - } - } - - - private DistributionStatusEnum deploySpoolFile(DeployableArtifact artifact) { - - DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_OK; - - StringBuffer msgBuffer = new StringBuffer(); - - - String namespace = config.getAsdcApiNamespace(); - if ((namespace == null) || (namespace.length() == 0)) { - namespace="com:att:sdnctl:asdcapi"; - } - - msgBuffer.append("\n"); - - String svcName = artifact.getSvcName(); - String resourceName = artifact.getResourceName(); - String artifactName = artifact.getArtifactName(); - - if (svcName != null) { - if (resourceName != null) { - artifactName = svcName + "/" + resourceName + "/" + artifactName; - } else { - artifactName = svcName + "/" + artifactName; - } - } - - msgBuffer.append(""+artifactName+"\n"); - msgBuffer.append(""+artifact.getArtifactVersion()+"\n"); - - - try { - BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile())); - - String curLine = rdr.readLine(); - - while (curLine != null) { - - if (!curLine.startsWith("\n"); - - - byte[] msgBytes = msgBuffer.toString().getBytes(); - - Document results = postRestXml(artifact.getType().getRpcUrl(config.getAsdcApiBaseUrl()), msgBytes); - - if (results == null) { - - deployResult = DistributionStatusEnum.DEPLOY_ERROR; - } else { - - XPathFactory xpf = XPathFactory.newInstance(); - XPath xp = xpf.newXPath(); - - String asdcApiResponseCode = "500"; - - try { - - asdcApiResponseCode = xp.evaluate("//asdc-api-response-code[position()=1]/text()", results.getDocumentElement()); - } catch (Exception e) { - LOG.error("Caught exception retrying to evaluate xpath", e); - } - - if (asdcApiResponseCode.contains("200")) { - LOG.info("Update to SDN-C succeeded"); - deployResult = DistributionStatusEnum.DEPLOY_OK; - } else { - LOG.info("Update to SDN-C failed (response code "+asdcApiResponseCode+")"); - - if (asdcApiResponseCode.contains("409")) { - deployResult = DistributionStatusEnum.ALREADY_DEPLOYED; - } else { - - deployResult = DistributionStatusEnum.DEPLOY_ERROR; - } - } - } - - - - return(deployResult); - } - - - - - - public static IDistributionStatusMessage buildStatusMessage( - final IDistributionClient client, final INotificationData data, - final IArtifactInfo relevantArtifact, - final DistributionStatusEnum status) { - IDistributionStatusMessage statusMessage = new IDistributionStatusMessage() { - - @Override - public long getTimestamp() { - long currentTimeMillis = System.currentTimeMillis(); - return currentTimeMillis; - } - - @Override - public DistributionStatusEnum getStatus() { - return status; - } - - @Override - public String getDistributionID() { - return data.getDistributionID(); - } - - @Override - public String getConsumerID() { - return client.getConfiguration().getConsumerID(); - } - - @Override - public String getArtifactURL() { - return relevantArtifact.getArtifactURL(); - } - }; - return statusMessage; - - } - - private HttpURLConnection getRestXmlConnection(String urlString, String method) throws IOException - { - URL sdncUrl = new URL(urlString); - Authenticator.setDefault(new SdncAuthenticator(config.getSdncUser(), config.getSdncPasswd())); - - HttpURLConnection conn = (HttpURLConnection) sdncUrl.openConnection(); - - String authStr = config.getSdncUser()+":"+config.getSdncPasswd(); - String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); - - conn.addRequestProperty("Authentication", "Basic "+encodedAuthStr); - - conn.setRequestMethod(method); - conn.setRequestProperty("Content-Type", "application/xml"); - conn.setRequestProperty("Accept", "application/xml"); - - conn.setDoInput(true); - conn.setDoOutput(true); - conn.setUseCaches(false); - - return(conn); - - } - - private Document postRestXml(String urlString, byte[] msgBytes) { - Document response = null; - - try { - SdncOdlConnection odlConn = SdncOdlConnection.newInstance(urlString, config.getSdncUser(), config.getSdncPasswd()); - - String sdncResp = odlConn.send("POST", "application/xml", new String(msgBytes)); - - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - DocumentBuilder db = dbf.newDocumentBuilder(); - - - response = db.parse(new ByteArrayInputStream(sdncResp.getBytes())); - } catch (Exception e) { - LOG.error("Caught exception posting to ODL tier", e); - } - - return(response); - - } - - private File applyXslts(File srcFile) { - - Document doc = null; - - - File inFile = srcFile; - File outFile = null; - - String xsltPathList = config.getXsltPathList(); - - if ((xsltPathList == null) || (xsltPathList.length() == 0)) { - outFile = inFile; - } else { - - String[] xsltPaths = xsltPathList.split(","); - - for (String xsltPath : xsltPaths) { - try{ - - outFile = File.createTempFile("tmp", "xml"); - TransformerFactory factory = TransformerFactory.newInstance(); - Source xslt = new StreamSource(new File(xsltPath)); - Transformer transformer = factory.newTransformer(xslt); - Source text = new StreamSource(inFile); - - - transformer.transform(text, new StreamResult(outFile)); - - inFile = outFile; - - } catch (Exception e) { - LOG.error("Caught exception trying to apply XSLT template "+xsltPath, e); - - } - - } - } - - // After transformations, parse transformed XML - - - return(outFile); - } - - private String escapeFilename(String str) { - StringBuffer retval = new StringBuffer(); - - for (int i = 0 ; i < str.length() ; i++) { - char curchar = str.charAt(i); - if (Character.isJavaIdentifierPart(curchar)) { - retval.append(curchar); - } - } - - return(retval.toString()); - - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java deleted file mode 100644 index df5dfc0a9..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.results.IDistributionClientResult; -import org.openecomp.sdc.impl.DistributionClientFactory; -import org.openecomp.sdc.utils.DistributionActionResultEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncUebClient { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncUebConfiguration.class); - - public static void main(String[] args) { - IDistributionClient client = DistributionClientFactory - .createDistributionClient(); - - SdncUebConfiguration config = new SdncUebConfiguration(); - - SdncUebCallback cb = new SdncUebCallback(client, config); - - LOG.info("Scanning for local distribution artifacts before starting client"); - cb.deployDownloadedFiles(null, null, null); - - LOG.info("Initializing ASDC distribution client"); - - IDistributionClientResult result = client.init( - config, cb); - - LOG.info("Initialized ASDC distribution client - results = " - + result.getDistributionMessageResult()); - - if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { - LOG.info("Starting client..."); - IDistributionClientResult start = client.start(); - LOG.info("Client startup result = " - + start.getDistributionMessageResult()); - } - - - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java deleted file mode 100644 index 7855b5ba4..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncUebConfiguration.java +++ /dev/null @@ -1,280 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import java.util.Properties; - -import org.openecomp.sdc.api.consumer.IConfiguration; -import org.openecomp.sdc.utils.ArtifactTypeEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncUebConfiguration implements IConfiguration{ - - private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; - private static final Logger LOG = LoggerFactory - .getLogger(SdncUebConfiguration.class); - - private String asdcAddress = null; - private String consumerGroup = null; - private String consumerID = null; - private String environmentName = null; - private String password = null; - private int pollingInterval = 30; - private int pollingTimeout = 15; - private List relevantArtifactTypes = null; - private String user = null; - - private String sdncUser = null; - private String sdncPasswd = null; - private String asdcApiBaseUrl = null; - private String asdcApiNamespace = null; - - private SdncArtifactMap artifactMap = SdncArtifactMap.getInstance(); - - public String getAsdcApiNamespace() { - return asdcApiNamespace; - } - - private String incomingDir = null; - - private String archiveDir = null; - - private String overrideFile = null; - - private boolean activateServerTLSAuth; - private String keyStorePassword; - private String keyStorePath; - - private String xsltPathList; - - public String getXsltPathList() { - return xsltPathList; - } - - public String getOverrideFile() { - return overrideFile; - } - - public SdncUebConfiguration() { - - try { - init(); - } catch (Exception e) { - LOG.error("Cannot initialize SdncUebConfiguration", e); - } - } - - public void init() throws IOException { - String propPath = null; - String propDir = System.getenv(SDNC_CONFIG_DIR); - if (propDir == null) { - - propDir = "/opt/sdnc/data/properties"; - } - propPath = propDir + "/ueb-listener.properties"; - File propFile = new File(propPath); - - - if (!propFile.exists()) { - - throw new FileNotFoundException( - "Missing configuration properties file : " - + propFile); - } - - Properties props = new Properties(); - props.load(new FileInputStream(propFile)); - - asdcAddress = props.getProperty("org.openecomp.sdnc.uebclient.asdc-address"); - consumerGroup = props.getProperty("org.openecomp.sdnc.uebclient.consumer-group"); - consumerID = props.getProperty("org.openecomp.sdnc.uebclient.consumer-id"); - environmentName = props.getProperty("org.openecomp.sdnc.uebclient.environment-name"); - password = props.getProperty("org.openecomp.sdnc.uebclient.password"); - user = props.getProperty("org.openecomp.sdnc.uebclient.user"); - - sdncUser = props.getProperty("org.openecomp.sdnc.uebclient.sdnc-user"); - sdncPasswd = props.getProperty("org.openecomp.sdnc.uebclient.sdnc-passwd"); - asdcApiBaseUrl = props.getProperty("org.openecomp.sdnc.uebclient.asdc-api-base-url"); - asdcApiNamespace = props.getProperty("org.openecomp.sdnc.uebclient.asdc-api-namespace"); - - incomingDir = props.getProperty("org.openecomp.sdnc.uebclient.spool.incoming"); - archiveDir = props.getProperty("org.openecomp.sdnc.uebclient.spool.archive"); - overrideFile = props.getProperty("org.openecomp.sdnc.uebclient.override-file"); - - String curval = props.getProperty("org.openecomp.sdnc.uebclient.polling-interval"); - if ((curval != null) && (curval.length() > 0)) { - try { - pollingInterval = Integer.parseInt(curval); - } catch (Exception e) { - LOG.warn("Illegal value for org.openecomp.sdnc.uebclient.polling-interval ("+curval+")"); - } - } - - curval = props.getProperty("org.openecomp.sdnc.uebclient.polling-timeout"); - if ((curval != null) && (curval.length() > 0)) { - try { - pollingTimeout = Integer.parseInt(curval); - } catch (Exception e) { - LOG.warn("Illegal value for org.openecomp.sdnc.uebclient.polling-timeout ("+curval+")"); - } - } - - curval = props.getProperty("org.openecomp.sdnc.uebclient.relevant-artifact-types"); - if ((curval != null) && (curval.length() > 0)) { - String[] artifactTypes = curval.split(","); - - relevantArtifactTypes = new LinkedList(); - - for (int i = 0 ; i < artifactTypes.length ; i++) { - try { - if (ArtifactTypeEnum.valueOf(artifactTypes[i]) != null) { - relevantArtifactTypes.add(artifactTypes[i]); - } else { - LOG.warn("Skipping unrecognized artifact type "+artifactTypes[i]); - } - } catch (Exception e) { - - LOG.warn("Caught exception validating artifact type "+artifactTypes[i], e); - } - - } - - } - - curval = props.getProperty("org.openecomp.sdnc.uebclient.activate-server-tls-auth", "false"); - activateServerTLSAuth = "true".equalsIgnoreCase(curval); - keyStorePath = props.getProperty("org.openecomp.sdnc.uebclient.keystore-path"); - keyStorePassword = props.getProperty("org.openecomp.sdnc.uebclient.keystore-password"); - xsltPathList = props.getProperty("org.openecomp.sdnc.uebclient.xslt-path-list"); - - - String artifactMapFile = props.getProperty("org.openecomp.sdnc.uebclient.artifact-map"); - if (artifactMapFile != null) { - artifactMap.load(artifactMapFile); - } - - } - - @Override - public String getAsdcAddress() { - return asdcAddress; - } - - @Override - public String getConsumerGroup() { - return consumerGroup; - } - - @Override - public String getConsumerID() { - return consumerID; - } - - @Override - public String getEnvironmentName() { - return environmentName; - } - - @Override - public String getPassword() { - return password; - } - - @Override - public int getPollingInterval() { - return pollingInterval; - } - - @Override - public int getPollingTimeout() { - return pollingTimeout; - } - - @Override - public List getRelevantArtifactTypes() { - return relevantArtifactTypes; - } - - @Override - public String getUser() { - return user; - } - - - public String getSdncUser() { - return sdncUser; - } - - public String getSdncPasswd() { - return sdncPasswd; - } - - public String getAsdcApiBaseUrl() { - return asdcApiBaseUrl; - } - - @Override - public boolean activateServerTLSAuth() { - return activateServerTLSAuth; - } - - @Override - public String getKeyStorePassword() { - return keyStorePassword; - } - - @Override - public String getKeyStorePath() { - return keyStorePath; - } - - public String getIncomingDir() { - return incomingDir; - } - - public String getArchiveDir() { - return archiveDir; - } - - public int getMaxPasses() { - return(artifactMap.getNumPasses()); - } - - public SdncArtifactMap.SdncArtifactType getMapping(String tag) { - return(artifactMap.getMapping(tag)); - } - - @Override - public boolean isFilterInEmptyResources() { - // TODO Auto-generated method stub - return false; - } - - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java deleted file mode 100644 index 67b786896..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFCModel.java +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncVFCModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncVFCModel.class); - - private String vmType = null; - private String vmCount = null; - - public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - - super(sdcCsarHelper, nodeTemplate); - - // extract properties - vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPE); - //vmCount = extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMCOUNT); - need path to vm_count - vmCount = "1"; - addParameter("vm_type", vmType); - addParameter("vm_type_tag", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG)); - addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); - addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); - addParameter("nfc_naming_code", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFCCODE)); - } - - public String getVmType() { - return vmType; - } - - public void setVmType(String vmType) { - this.vmType = vmType; - } - - public String getVmCount() { - return vmCount; - } - - public void setVmCount(String vmCount) { - this.vmCount = vmCount; - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java deleted file mode 100644 index 4e95e46ba..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModel.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Metadata; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncVFModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncVFModel.class); - - public SdncVFModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - - super(sdcCsarHelper, nodeTemplate); - - // extract metadata - Metadata metadata = nodeTemplate.getMetadata(); - addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); - addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR)); - addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); - - // extract properties - addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_ECOMPGENERATEDNAMING)); - addParameter("naming_policy", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_NAMINGPOLICY)); - addParameter("nf_type", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); - addParameter("nf_role", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)); - addParameter("nf_code", extractValue( nodeTemplate, "nf_naming_code")); - addParameter("nf_function", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); - addParameter("avail_zone_max_count", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); - } - -} diff --git a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java b/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java deleted file mode 100644 index 86df8b2ab..000000000 --- a/ueb-listener/src/main/java/org/openecomp/sdnc/uebclient/SdncVFModuleModel.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.sdnc.uebclient; - -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Group; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SdncVFModuleModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncVFModuleModel.class); - - public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group) { - - super(sdcCsarHelper, group); - - // extract properties - addParameter("vf_module_type", extractValue(group, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); - addIntParameter("availability_zone_count", extractValue(group, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)); - addParameter("ecomp_generated_vm_assignments", extractBooleanValue(group, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS)); - } - -} -- 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(-) 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 ce4a541b00557f52860f16643aff0593178a2a91 Mon Sep 17 00:00:00 2001 From: Brian Freeman Date: Fri, 25 Aug 2017 17:16:00 +0000 Subject: Fix to start script and annotation dependency Change-Id: I38d4ffad440ea5866a398b8a6a7244d8bf156138 Signed-off-by: Brian Freeman Issue-Id: SDNC-67 --- dmaap-listener/pom.xml | 5 +++++ dmaap-listener/src/main/scripts/start-dmaap-listener.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index ac65c16f8..dcdc5ca5a 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -57,6 +57,11 @@ jackson-databind ${fasterxml.jackson.version} + + com.fasterxml.jackson.core + jackson-annotations + ${fasterxml.jackson.version} + junit junit diff --git a/dmaap-listener/src/main/scripts/start-dmaap-listener.sh b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh index 805105863..164ade332 100644 --- a/dmaap-listener/src/main/scripts/start-dmaap-listener.sh +++ b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh @@ -60,7 +60,7 @@ do LISTENERCLASSPATH=$LISTENERCLASSPATH:$file done -${JAVA} ${JAVA_OPTS} -Dlog4j.configuration=file:${UEBLISTENERROOT}/lib/log4j.properties -cp ${LISTENERCLASSPATH} com.att.sdnctl.dmaapclient.DmaapListener & +${JAVA} ${JAVA_OPTS} -Dlog4j.configuration=file:${UEBLISTENERROOT}/lib/log4j.properties -cp ${LISTENERCLASSPATH} org.onap.ccsdk.sli.northbound.dmaapclient.DmaapListener & echo $! > $PIDFILE -- cgit 1.2.3-korg From 64c695ee5c8e2c6c004656fe161f161e4bc28728 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 29 Aug 2017 08:52:32 -0400 Subject: Cleanup artifactId for ccsdk/sli/northbound ArtifactId for ccsdk/sli/northbound pom.xml should not be identical to that for sdnc/northbound, otherwise import to Eclipse of both will be confusing. Updated parent artifactId in module pom.xmls under ccsdk/sli/northbound Change-Id: Ie1e1b7a1cd6bb7442a27ca083f37539cbc0497fb Issue-ID: CCSDK-70 Signed-off-by: Dan Timoney --- asdcApi/pom.xml | 2 +- dataChange/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 9f8d906c3..d4990612e 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound - sdnc-northbound + ccsdk-sli-northbound 0.1.0-SNAPSHOT diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 90e22d219..c07442595 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound - sdnc-northbound + ccsdk-sli-northbound 0.1.0-SNAPSHOT diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index dcdc5ca5a..1cc4acc59 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -10,7 +10,7 @@ DMAAP Listener org.onap.ccsdk.sli.northbound - sdnc-northbound + ccsdk-sli-northbound 0.1.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index c0f7ac616..947567097 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 pom org.onap.ccsdk.sli.northbound - sdnc-northbound + ccsdk-sli-northbound SDN-C Northbound APIs https://wiki.openecomp.org diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 5f8d5ca1b..84e407698 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -10,7 +10,7 @@ UEB Listener org.onap.ccsdk.sli.northbound - sdnc-northbound + ccsdk-sli-northbound 0.1.0-SNAPSHOT -- cgit 1.2.3-korg From 3a7d07ae3abe01e0e6e665a4266cf785e3986dd6 Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Fri, 1 Sep 2017 16:01:07 -0700 Subject: Enable surefire unit testing Issue-Id: CCSDK-67 Change-Id: If05df01e829a7a12ef00a1d778d918664635a48a Signed-off-by: Marcus G K Williams --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 947567097..f9147b12c 100644 --- a/pom.xml +++ b/pom.xml @@ -86,7 +86,7 @@ maven-surefire-plugin 2.17 - true + false -- cgit 1.2.3-korg From 85388e8598e765530b8752fc0bcb237d795e249a Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Tue, 5 Sep 2017 18:19:11 -0700 Subject: Fix staging variables for ccsdk/sli/northbound Issue-Id: CCSDK-67 Change-Id: Ib5fe6cc5cb46e9d25cf66b6ab30e0d8b8654c426 Signed-off-by: Marcus G K Williams --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f9147b12c..d43a274ed 100644 --- a/pom.xml +++ b/pom.xml @@ -95,9 +95,9 @@ 1.6.7 true - https://${openecomp.nexus.host} - ${openecomp.nexus.staging.profile-id} - ${openecomp.nexus.staging.server-id} + https://${onap.nexus.host} + ${onap.nexus.staging.profile-id} + ${onap.nexus.staging.server-id} -- cgit 1.2.3-korg From 6ece0d9a4466984c4f03852336bae09a7cd1dc8d Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 6 Sep 2017 14:04:27 -0400 Subject: Fix unimplemented createInstance The createInstance() method in the provider yang-generated Module class has a default implementation that throws an UnsupportedOperationException. Replaced default implementation with correct code to create an instance of the asdcApi and dataChange provider classes. Change-Id: I1f2b199702a9094f6808ec077d6752c4c5c0c30d Issue-ID: CCSDK-77 Signed-off-by: Dan Timoney --- .../impl/rev140523/AsdcApiProviderModule.java | 24 ++++++++++++++++++---- .../impl/rev140523/DataChangeProviderModule.java | 20 ++++++++++++++---- 2 files changed, 36 insertions(+), 8 deletions(-) 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 ddf8093fb..26dc94285 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 @@ -8,9 +8,9 @@ * 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. @@ -20,6 +20,9 @@ */ package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523; + +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; + public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModule { public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -36,8 +39,21 @@ public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.onap @Override public java.lang.AutoCloseable createInstance() { - // TODO:implement - throw new java.lang.UnsupportedOperationException(); + + + final AsdcApiProvider provider = new AsdcApiProvider(getDataBrokerDependency() + , getNotificationServiceDependency() + , getRpcRegistryDependency()); + + return new AutoCloseable() { + + @Override + public void close() throws Exception { + + provider.close(); + } + }; + } } 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 0655ae20a..e210613b5 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 @@ -8,9 +8,9 @@ * 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. @@ -20,6 +20,9 @@ */ package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523; + +import org.onap.ccsdk.sli.northbound.DataChangeProvider; + public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.AbstractDataChangeProviderModule { public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -36,8 +39,17 @@ public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.o @Override public java.lang.AutoCloseable createInstance() { - // TODO:implement - throw new java.lang.UnsupportedOperationException(); + final DataChangeProvider provider = new DataChangeProvider(getDataBrokerDependency() + , getNotificationServiceDependency() + , getRpcRegistryDependency()); + + return new AutoCloseable() { + + @Override + public void close() throws Exception { + provider.close(); + } + }; } } -- cgit 1.2.3-korg From 8881ebb497e9f35e5ea9d19923fd926db56e8f12 Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Thu, 7 Sep 2017 12:10:08 -0400 Subject: Fix SDNC service registration This change converts AsdcApiProvider and AsdcApiSliClient to utilize Aries Blueprint for service instantiation instead of the ODL Config Subsystem. Change-Id: I5eaebe4c6e5b33fc8beb20b2cfe9acb6e8b6d808 Issue-Id: SDNC-54 Signed-off-by: Ryan Goulding --- asdcApi/features/pom.xml | 7 -- asdcApi/features/src/main/resources/features.xml | 1 - .../src/assembly/assemble_mvnrepo_zip.xml | 8 -- asdcApi/pom.xml | 8 +- asdcApi/provider/pom.xml | 70 ---------------- .../sli/northbound/asdcapi/AsdcApiProvider.java | 93 ++++++++-------------- .../sli/northbound/asdcapi/AsdcApiSliClient.java | 29 ++----- .../impl/rev140523/AsdcApiProviderModule.java | 59 -------------- .../rev140523/AsdcApiProviderModuleFactory.java | 34 -------- .../main/resources/initial/asdcApi-provider.xml | 70 ---------------- .../org/opendaylight/blueprint/asdc-blueprint.xml | 32 ++++++++ .../src/main/yang/asdcApi-provider-impl.yang | 61 -------------- .../sli/northbound/uebclient/SdncUebCallback.java | 2 +- 13 files changed, 73 insertions(+), 401 deletions(-) delete mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java delete mode 100644 asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java delete mode 100644 asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml create mode 100644 asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml delete mode 100755 asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index e6af34c57..0f3a5ddd2 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -16,13 +16,6 @@ asdcApi-model ${project.version} - - org.onap.ccsdk.sli.northbound - asdcApi-provider - ${project.version} - config - xml - org.onap.ccsdk.sli.northbound asdcApi-provider diff --git a/asdcApi/features/src/main/resources/features.xml b/asdcApi/features/src/main/resources/features.xml index 9006f1b94..2048dc12a 100644 --- a/asdcApi/features/src/main/resources/features.xml +++ b/asdcApi/features/src/main/resources/features.xml @@ -33,7 +33,6 @@ mvn:org.onap.ccsdk.sli.northbound/asdcApi-provider/${project.version} sdnc-sli - mvn:org.onap.ccsdk.sli.northbound/asdcApi-provider/${project.version}/xml/config diff --git a/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml index 5c24d73ff..21e271d42 100644 --- a/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -44,12 +44,4 @@ - - - ../provider/src/main/resources/initial/${feature-name}-provider.xml - ./etc/opendaylight/karaf/200-${feature-name}-provider.xml - - - - diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index d4990612e..0adc96e64 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -33,13 +33,7 @@ asdcApi-model ${project.version} - - org.onap.ccsdk.sli.northbound - asdcApi-provider - ${project.version} - config - xml - + org.onap.ccsdk.sli.northbound asdcApi-provider diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 7b7ed4bee..329d6ef2a 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -15,76 +15,6 @@ org.apache.felix maven-bundle-plugin true - - - org.opendaylight.controller.config.yang.config.asdcApi_provider.impl - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - config - - generate-sources - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - ${jmxGeneratorPath} - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - true - - - - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${odl.yang.jmx.generator.version} - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/initial/asdcApi-provider.xml - xml - config - - - - - 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 bd5f74a4f..13198d623 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 @@ -95,32 +95,36 @@ import com.google.common.util.concurrent.Futures; */ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { + private static final Logger LOG = LoggerFactory.getLogger(AsdcApiProvider.class); + private static final String ACTIVE_VERSION = "active"; - private final Logger log = LoggerFactory.getLogger( AsdcApiProvider.class ); - private final String appName = "asdcApi"; + private static final String APPLICATION_NAME = "asdcApi"; private final ExecutorService executor; protected DataBroker dataBroker; protected NotificationProviderService notificationService; protected RpcProviderRegistry rpcRegistry; + private final AsdcApiSliClient asdcApiSliClient; protected BindingAwareBroker.RpcRegistration rpcRegistration; - public AsdcApiProvider(DataBroker dataBroker2, - NotificationProviderService notificationProviderService, - RpcProviderRegistry rpcProviderRegistry) { - this.log.info( "Creating provider for " + appName ); + public AsdcApiProvider(final DataBroker dataBroker, + final NotificationProviderService notificationProviderService, + final RpcProviderRegistry rpcProviderRegistry, + final AsdcApiSliClient asdcApiSliClient) { + + LOG.info("Creating provider for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); - dataBroker = dataBroker2; + this.dataBroker = dataBroker; notificationService = notificationProviderService; rpcRegistry = rpcProviderRegistry; + this.asdcApiSliClient= asdcApiSliClient; initialize(); } public void initialize(){ - log.info( "Initializing provider for " + appName ); - + LOG.info("Initializing {} for {}", this.getClass().getName(), APPLICATION_NAME); createContainers(); @@ -128,10 +132,9 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { if (rpcRegistry != null) { rpcRegistration = rpcRegistry.addRpcImplementation( ASDCAPIService.class, this); - log.info("Initialization complete for " + appName); + LOG.info("Initialization complete for {}", APPLICATION_NAME); } else { - log.warn("Error initializing " + appName - + " : rpcRegistry unset"); + LOG.warn("Error initializing {} : rpcRegistry unset", APPLICATION_NAME); } } } @@ -151,14 +154,14 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { try { CheckedFuture checkedFuture = t.submit(); checkedFuture.get(); - log.info("Create Containers succeeded!: "); + LOG.info("Create Containers succeeded!: "); } catch (InterruptedException | ExecutionException e) { - log.error("Create Containers Failed: " + e); + LOG.error("Create Containers Failed: " + e); e.printStackTrace(); } } else { - log.warn("createContainers : cannot find dataBroker to create containers"); + LOG.warn("createContainers : cannot find dataBroker to create containers"); } } protected void initializeChild() { @@ -167,38 +170,12 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { @Override public void close() throws Exception { - log.info( "Closing provider for " + appName ); + LOG.info( "Closing provider for " + APPLICATION_NAME); executor.shutdown(); rpcRegistration.close(); - log.info( "Successfully closed provider for " + appName ); - } - - public void setDataBroker(DataBroker dataBroker) { - this.dataBroker = dataBroker; - if( log.isDebugEnabled() ){ - log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); - } - } - - public void setNotificationService( - NotificationProviderService notificationService) { - this.notificationService = notificationService; - if( log.isDebugEnabled() ){ - log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); - } - } - - public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { - this.rpcRegistry = rpcRegistry; - - rpcRegistration = rpcRegistry.addRpcImplementation(ASDCAPIService.class, this); - - if( log.isDebugEnabled() ){ - log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); - } + LOG.info( "Successfully closed provider for " + APPLICATION_NAME); } - protected boolean artifactVersionExists(String aName, String aVersion) { InstanceIdentifier artifactInstanceId = InstanceIdentifier.builder(Artifacts.class) @@ -208,7 +185,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { try { data = (Optional) readTx.read(LogicalDatastoreType.CONFIGURATION, artifactInstanceId).get(); } catch (InterruptedException | ExecutionException e) { - log.error("Caught Exception reading MD-SAL for ["+aName+","+ aVersion+"] " ,e); + LOG.error("Caught Exception reading MD-SAL for ["+aName+","+ aVersion+"] " ,e); return false; } @@ -244,7 +221,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { artifact); tx.submit().checkedGet(); } catch (Exception e) { - log.error("Caught exception trying to add artifact entry", e); + LOG.error("Caught exception trying to add artifact entry", e); } } @@ -279,7 +256,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { version); tx.submit().checkedGet(); } catch (Exception e) { - log.error( + LOG.error( "Caught exception trying to save entry to MD-SAL", e); } @@ -307,7 +284,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { version); tx.submit().checkedGet(); } catch (Exception e) { - log.error( + LOG.error( "Caught exception trying to save entry to MD-SAL", e); } @@ -320,10 +297,10 @@ public Future> vfLicenseModelUpdate(VfLice Properties parms = new Properties(); - log.info( SVC_OPERATION +" called." ); + LOG.info( SVC_OPERATION +" called." ); if(input == null ) { - log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + LOG.debug("exiting " +SVC_OPERATION+ " because of invalid input"); return null; } @@ -339,28 +316,24 @@ public Future> vfLicenseModelUpdate(VfLice errorMessage = "Artifact version already exists"; } else { // Translate input object into SLI-consumable properties - log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); + LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); AsdcApiUtil.toProperties(parms, input); // Call directed graph - Properties respProps = null; - - - AsdcApiSliClient sliClient = new AsdcApiSliClient(); try { - if (sliClient.hasGraph("ASDC-API", SVC_OPERATION , null, "sync")) + if (asdcApiSliClient.hasGraph("ASDC-API", SVC_OPERATION , null, "sync")) { try { - respProps = sliClient.execute("ASDC-API", SVC_OPERATION, null, "sync", parms); + respProps = asdcApiSliClient.execute("ASDC-API", SVC_OPERATION, null, "sync", parms); } catch (Exception e) { - log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + LOG.error("Caught exception executing service logic for "+ SVC_OPERATION, e); } } else { errorMessage = "No service logic active for ASDC-API: '" + SVC_OPERATION + "'"; @@ -371,7 +344,7 @@ public Future> vfLicenseModelUpdate(VfLice { errorCode = "500"; errorMessage = e.getMessage(); - log.error("Caught exception looking for service logic", e); + LOG.error("Caught exception looking for service logic", e); } @@ -384,14 +357,14 @@ public Future> vfLicenseModelUpdate(VfLice if ("200".equals(errorCode)) { - log.info("ASDC update succeeded"); + LOG.info("ASDC update succeeded"); // Update config tree applyVfLicenseModelUpdate(input); addArtifactVersion(input.getArtifactName(), input.getArtifactVersion()); } else { - log.info("ASDC update failed ("+errorCode+" : "+errorMessage); + LOG.info("ASDC update failed ("+errorCode+" : "+errorMessage); } // Send response 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 5b268bc28..51fdd7002 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 @@ -25,39 +25,22 @@ import java.util.Properties; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class AsdcApiSliClient { - private static final Logger LOG = LoggerFactory - .getLogger(AsdcApiSliClient.class); + private static final Logger LOG = LoggerFactory.getLogger(AsdcApiSliClient.class); - private SvcLogicService svcLogic = null; + private final SvcLogicService svcLogicService; - public AsdcApiSliClient() - { - BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); - - // Get SvcLogicService reference - ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); - if (sref != null) - { - svcLogic = (SvcLogicService) bctx.getService(sref); - } - else - { - LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); - - } + public AsdcApiSliClient(final SvcLogicService svcLogicService) { + this.svcLogicService = svcLogicService; } public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException { - return(svcLogic.hasGraph(module, rpc, version, mode)); + return(svcLogicService.hasGraph(module, rpc, version, mode)); } @@ -78,7 +61,7 @@ public class AsdcApiSliClient { } } - Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); + Properties respProps = svcLogicService.execute(module, rpc, version, mode, parms); if (LOG.isDebugEnabled()) { 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 deleted file mode 100644 index 26dc94285..000000000 --- a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java +++ /dev/null @@ -1,59 +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========================================================= - */ - -package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523; - -import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; - -public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModule { - public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AsdcApiProviderModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - - - final AsdcApiProvider provider = new AsdcApiProvider(getDataBrokerDependency() - , getNotificationServiceDependency() - , getRpcRegistryDependency()); - - return new AutoCloseable() { - - @Override - public void close() throws Exception { - - provider.close(); - } - }; - - } - -} 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 deleted file mode 100644 index 513e61cff..000000000 --- a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModuleFactory.java +++ /dev/null @@ -1,34 +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========================================================= - */ - -/* -* Generated file -* -* Generated from: yang module name: asdcApi-provider-impl yang module local name: asdcApi-provider-impl -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Mon Aug 14 15:34:51 EDT 2017 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523; -public class AsdcApiProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModuleFactory { - -} diff --git a/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml b/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml deleted file mode 100644 index aefdec281..000000000 --- a/asdcApi/provider/src/main/resources/initial/asdcApi-provider.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - prefix:asdcApi-provider-impl - - asdcApi-provider-impl - - - - binding:binding-rpc-registry - binding-rpc-broker - - - - binding:binding-async-data-broker - binding-data-broker - - - - - binding:binding-notification-service - - binding-notification-broker - - - - - - - - - - - org:onap:ccsdk:sli:northbound:asdcapi:provider:impl?module=asdcApi-provider-impl&revision=2014-05-23 - - - diff --git a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml new file mode 100644 index 000000000..6229db1f6 --- /dev/null +++ b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang b/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang deleted file mode 100755 index 7a1876cc1..000000000 --- a/asdcApi/provider/src/main/yang/asdcApi-provider-impl.yang +++ /dev/null @@ -1,61 +0,0 @@ -module asdcApi-provider-impl { - - yang-version 1; - namespace "org:onap:ccsdk:sli:northbound:asdcapi:provider:impl"; - prefix "asdcApi-provider-impl"; - - import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } - - description - "This module contains the base YANG definitions for - asdcApi-provider impl implementation."; - - revision "2014-05-23" { - description - "Initial revision."; - } - - // This is the definition of the service implementation as a module identity. - identity asdcApi-provider-impl { - base config:module-type; - - // Specifies the prefix for generated java classes. - config:java-name-prefix AsdcApiProvider; - } - - // Augments the 'configuration' choice node under modules/module. - // We consume the three main services, RPCs, DataStore, and Notifications - augment "/config:modules/config:module/config:configuration" { - case asdcApi-provider-impl { - when "/config:modules/config:module/config:type = 'asdcApi-provider-impl'"; - - container rpc-registry { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-rpc-registry; - } - } - } - - container notification-service { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-notification-service; - } - } - } - - container data-broker { - uses config:service-ref { - refine type { - mandatory false; - config:required-identity mdsal:binding-async-data-broker; - } - } - } - } - } -} 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 1e6b19db0..73e8fe55b 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 @@ -209,7 +209,7 @@ public class SdncUebCallback implements INotificationCallback { props.load(new FileInputStream(propFile)); try { - jdbcDataSource = DBResourceManager.create(props); + jdbcDataSource = new DBResourceManager(props); } catch(Throwable exc) { LOG.error("", exc); } -- cgit 1.2.3-korg From ea0aabe54bc7b5d609b587e87ce85765f73fecbc Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Fri, 8 Sep 2017 19:28:18 +0530 Subject: Fix few Blocker sonar issues Fix few Blocker sonar issues in CCSDK SLI Northbound https://sonar.onap.org/component_issues/index?id=org.onap.ccsdk.sli.northbound%3Accsdk-sli-northbound#resolved=false|severities=BLOCKER Change-Id: I8a2f2e9f3bc5bc5c007076e42f77fbf5da1304ac Issue-Id: CCSDK-67 Signed-off-by: Gaurav Agrawal --- .../northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java | 5 ++--- .../ccsdk/sli/northbound/uebclient/SdncArtifactMap.java | 13 +------------ 2 files changed, 3 insertions(+), 15 deletions(-) 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 abd395bfb..1754957da 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 @@ -164,10 +164,9 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { return(null); } - try { - BufferedReader mapReader = new BufferedReader(new FileReader(mapFile)); + try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { - String curLine = null; + String curLine; while ((curLine = mapReader.readLine()) != null) { curLine = curLine.trim(); 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 4c08949c0..dd9437ce9 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 @@ -87,10 +87,7 @@ public class SdncArtifactMap { if (mapFile.exists() && mapFile.canRead()) { - BufferedReader rdr = null; - try { - - rdr = new BufferedReader(new FileReader(mapFile)); + try (BufferedReader rdr = new BufferedReader(new FileReader(mapFile))) { for (String ln ; (ln = rdr.readLine()) != null ; ) { String[] lnFields = ln.split(","); @@ -107,14 +104,6 @@ public class SdncArtifactMap { } catch (Exception e) { LOG.error("Caught exception reading artifact map", e); return; - } finally { - if (rdr != null) { - try { - rdr.close(); - } catch (IOException e) { - - } - } } } } -- cgit 1.2.3-korg From c78bab01fa4667e840aad907ee37fa67b4fe8239 Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Fri, 8 Sep 2017 19:58:55 +0530 Subject: Fix few Blocker sonar issues Fix few Blocker sonar issues in CCSDK SLI Northbound https://sonar.onap.org/component_issues/index?id=org.onap.ccsdk.sli.northbound%3Accsdk-sli-northbound#resolved=false|severities=BLOCKER Change-Id: I7229c7e2a0dabc0ff789b91ae413b9a15ef3cbad Issue-Id: CCSDK-67 Signed-off-by: Gaurav Agrawal --- .../sli/northbound/uebclient/SdncUebCallback.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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 73e8fe55b..e7a42bcb8 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 @@ -208,12 +208,8 @@ public class SdncUebCallback implements INotificationCallback { Properties props = new Properties(); props.load(new FileInputStream(propFile)); - try { - jdbcDataSource = new DBResourceManager(props); - } catch(Throwable exc) { - LOG.error("", exc); - } - + jdbcDataSource = new DBResourceManager(props); + if(((DBResourceManager)jdbcDataSource).isActive()){ LOG.warn( "DBLIB: JDBC DataSource has been initialized."); } else { @@ -405,8 +401,7 @@ public class SdncUebCallback implements INotificationCallback { boolean writeSucceeded = false; - try { - FileWriter spoolFileWriter = new FileWriter(spoolFile); + try (FileWriter spoolFileWriter = new FileWriter(spoolFile)) { spoolFileWriter.write(payload); spoolFileWriter.close(); writeSucceeded = true; @@ -916,11 +911,8 @@ public class SdncUebCallback implements INotificationCallback { msgBuffer.append(""+artifact.getArtifactVersion()+"\n"); - try { - BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile())); - + try (BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile()))){ String curLine = rdr.readLine(); - while (curLine != null) { if (!curLine.startsWith(" Date: Fri, 8 Sep 2017 13:17:30 -0700 Subject: Cleanup project's name in Sonar The name parameter in the root pom.xml should match the project name in gerrit to reflect consistency in Sonar. Change-Id: Iecfd1bf6a7937437728e5cf136b63c896da49b44 Issue-id: CIMAN-65 Signed-off-by: Jessica Wagantall --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d43a274ed..0fe0b502b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - SDN-C Northbound APIs + ccsdk-sli-northbound https://wiki.openecomp.org The SDN-C Northbound APIs repo contains code for northbound API adaptors, typically MD-SAL applications -- cgit 1.2.3-korg From 3f9970cb513e632ea5c1613c3b7ff577ac9fd4d1 Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Thu, 7 Sep 2017 15:21:05 -0400 Subject: Fix SDNC service registration Move the northbound to utilize Aries Blueprint instead of ODL's configuration subsystem Change-Id: I7388391d40912136176bb28b817157676f71557d Issue-Id: SDNC-54 Signed-off-by: Ryan Goulding --- dataChange/features/pom.xml | 6 -- .../features/src/main/resources/features.xml | 1 - .../src/assembly/assemble_mvnrepo_zip.xml | 8 --- dataChange/pom.xml | 7 -- dataChange/provider/pom.xml | 71 ------------------- .../ccsdk/sli/northbound/DataChangeClient.java | 30 ++------ .../ccsdk/sli/northbound/DataChangeProvider.java | 79 ++++++++-------------- .../impl/rev140523/DataChangeProviderModule.java | 55 --------------- .../rev140523/DataChangeProviderModuleFactory.java | 34 ---------- .../main/resources/initial/dataChange-provider.xml | 70 ------------------- .../blueprint/datachange-blueprint.xml | 32 +++++++++ 11 files changed, 68 insertions(+), 325 deletions(-) delete mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java delete mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java delete mode 100644 dataChange/provider/src/main/resources/initial/dataChange-provider.xml create mode 100644 dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index cd48d3f52..9d140cb6e 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -17,12 +17,6 @@ org.onap.ccsdk.sli.northbound dataChange-model - - org.onap.ccsdk.sli.northbound - dataChange-provider - config - xml - org.onap.ccsdk.sli.northbound dataChange-provider diff --git a/dataChange/features/src/main/resources/features.xml b/dataChange/features/src/main/resources/features.xml index 47cdcfd9f..c52bab52f 100644 --- a/dataChange/features/src/main/resources/features.xml +++ b/dataChange/features/src/main/resources/features.xml @@ -31,7 +31,6 @@ sdnc-sli mvn:org.onap.ccsdk.sli.northbound/dataChange-model/${project.version} mvn:org.onap.ccsdk.sli.northbound/dataChange-provider/${project.version} - mvn:org.onap.ccsdk.sli.northbound/dataChange-provider/${project.version}/xml/config diff --git a/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml index 5c24d73ff..21e271d42 100644 --- a/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -44,12 +44,4 @@ - - - ../provider/src/main/resources/initial/${feature-name}-provider.xml - ./etc/opendaylight/karaf/200-${feature-name}-provider.xml - - - - diff --git a/dataChange/pom.xml b/dataChange/pom.xml index c07442595..a5818a5d4 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -33,13 +33,6 @@ dataChange-model ${project.version} - - org.onap.ccsdk.sli.northbound - dataChange-provider - ${project.version} - config - xml - org.onap.ccsdk.sli.northbound dataChange-provider diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index c73c00980..e19114947 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -15,77 +15,6 @@ org.apache.felix maven-bundle-plugin true - - - org.opendaylight.controller.config.yang.config.DataChange_provider.impl - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - - config - - generate-sources - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - ${jmxGeneratorPath} - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - true - - - - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${odl.yang.jmx.generator.version} - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/initial/${feature-name}-provider.xml - xml - config - - - - - 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 75cc0a02e..4bf857797 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 @@ -27,40 +27,22 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationOutputBuilder; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class DataChangeClient { - private static final Logger LOG = LoggerFactory - .getLogger(DataChangeClient.class); + private static final Logger LOG = LoggerFactory.getLogger(DataChangeClient.class); - private SvcLogicService svcLogic = null; + private SvcLogicService svcLogicService = null; - public DataChangeClient() - { - BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); - - // Get SvcLogicService reference - ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); - if (sref != null) - { - svcLogic = (SvcLogicService) bctx.getService(sref); - - } - else - { - LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); - - } + public DataChangeClient(final SvcLogicService svcLogicService) { + this.svcLogicService = svcLogicService; } public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException { - return(svcLogic.hasGraph(module, rpc, version, mode)); + return(svcLogicService.hasGraph(module, rpc, version, mode)); } public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData) @@ -89,7 +71,7 @@ public class DataChangeClient { } } - Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); + Properties respProps = svcLogicService.execute(module, rpc, version, mode, parms); if (LOG.isDebugEnabled()) { 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 dcfbf6ee2..d47bcd1b3 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 @@ -49,33 +49,39 @@ import com.google.common.util.concurrent.Futures; * base class provides some basic logging and initialization / clean up methods. * */ -public class DataChangeProvider implements AutoCloseable, DataChangeService{ +public class DataChangeProvider implements AutoCloseable, DataChangeService { + + private static final Logger LOG = LoggerFactory.getLogger(DataChangeProvider.class); + + private static final String APPLICATION_NAME = "DataChange"; - private final Logger log = LoggerFactory.getLogger( DataChangeProvider.class ); - private final String appName = "DataChange"; private final ExecutorService executor; protected DataBroker dataBroker; protected NotificationProviderService notificationService; protected RpcProviderRegistry rpcRegistry; protected BindingAwareBroker.RpcRegistration rpcRegistration; + private final DataChangeClient dataChangeClient; + + public DataChangeProvider(final DataBroker dataBroker, + final NotificationProviderService notificationProviderService, + final RpcProviderRegistry rpcProviderRegistry, + final DataChangeClient dataChangeClient) { - public DataChangeProvider(DataBroker dataBroker2, - NotificationProviderService notificationProviderService, - RpcProviderRegistry rpcProviderRegistry) { - this.log.info( "Creating provider for " + appName ); + this.LOG.info( "Creating provider for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); - dataBroker = dataBroker2; - notificationService = notificationProviderService; - rpcRegistry = rpcProviderRegistry; + this.dataBroker = dataBroker; + this.notificationService = notificationProviderService; + this.rpcRegistry = rpcProviderRegistry; + this.dataChangeClient = dataChangeClient; initialize(); } public void initialize(){ - log.info( "Initializing provider for " + appName ); + LOG.info( "Initializing provider for {}", APPLICATION_NAME); rpcRegistration = rpcRegistry.addRpcImplementation(DataChangeService.class, this); - log.info( "Initialization complete for " + appName ); + LOG.info( "Initialization complete for {}", APPLICATION_NAME); } protected void initializeChild() { @@ -84,32 +90,10 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService{ @Override public void close() throws Exception { - log.info( "Closing provider for " + appName ); + LOG.info( "Closing provider for {}", APPLICATION_NAME); executor.shutdown(); rpcRegistration.close(); - log.info( "Successfully closed provider for " + appName ); - } - - public void setDataBroker(DataBroker dataBroker) { - this.dataBroker = dataBroker; - if( log.isDebugEnabled() ){ - log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); - } - } - - public void setNotificationService( - NotificationProviderService notificationService) { - this.notificationService = notificationService; - if( log.isDebugEnabled() ){ - log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); - } - } - - public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { - this.rpcRegistry = rpcRegistry; - if( log.isDebugEnabled() ){ - log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); - } + LOG.info( "Successfully closed provider for {}", APPLICATION_NAME); } @Override @@ -120,10 +104,10 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService{ Properties parms = new Properties(); DataChangeNotificationOutputBuilder serviceDataBuilder = new DataChangeNotificationOutputBuilder(); - log.info( SVC_OPERATION +" called." ); + LOG.info( SVC_OPERATION +" called." ); if(input == null || input.getAaiEventId() == null) { - log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + LOG.debug("exiting " +SVC_OPERATION+ " because of invalid input"); serviceDataBuilder.setDataChangeResponseCode("403"); RpcResult rpcResult = RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); @@ -131,46 +115,43 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService{ } // add input to parms - log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); + LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder(input); MdsalHelper.toProperties(parms, inputBuilder.build()); // Call SLI sync method - // Get SvcLogicService reference - - DataChangeClient svcLogicClient = new DataChangeClient(); Properties respProps = null; try { - if (svcLogicClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) + if (dataChangeClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) { try { - respProps = svcLogicClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + respProps = dataChangeClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); } catch (Exception e) { - log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + LOG.error("Caught exception executing service logic for "+ SVC_OPERATION, e); serviceDataBuilder.setDataChangeResponseCode("500"); } } else { - log.error("No service logic active for DataChange: '" + SVC_OPERATION + "'"); + LOG.error("No service logic active for DataChange: '" + SVC_OPERATION + "'"); serviceDataBuilder.setDataChangeResponseCode("503"); } } catch (Exception e) { - log.error("Caught exception looking for service logic", e); + LOG.error("Caught exception looking for service logic", e); serviceDataBuilder.setDataChangeResponseCode("500"); } String errorCode = serviceDataBuilder.getDataChangeResponseCode(); if ( errorCode != null && errorCode.length() != 0 && !( errorCode.equals("0")|| errorCode.equals("200"))) { - log.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); + LOG.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); } else { - log.info("Returned SUCCESS for "+SVC_OPERATION+" "); + LOG.info("Returned SUCCESS for "+SVC_OPERATION+" "); } RpcResult rpcResult = 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 deleted file mode 100644 index e210613b5..000000000 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java +++ /dev/null @@ -1,55 +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========================================================= - */ - -package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523; - -import org.onap.ccsdk.sli.northbound.DataChangeProvider; - -public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.AbstractDataChangeProviderModule { - public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.DataChangeProviderModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - final DataChangeProvider provider = new DataChangeProvider(getDataBrokerDependency() - , getNotificationServiceDependency() - , getRpcRegistryDependency()); - - return new AutoCloseable() { - - @Override - public void close() throws Exception { - provider.close(); - } - }; - } - -} 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 deleted file mode 100644 index 468989998..000000000 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java +++ /dev/null @@ -1,34 +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========================================================= - */ - -/* -* Generated file -* -* Generated from: yang module name: DataChange-provider-impl yang module local name: DataChange-provider-impl -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Tue Aug 15 09:41:53 EDT 2017 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523; -public class DataChangeProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.AbstractDataChangeProviderModuleFactory { - -} diff --git a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml deleted file mode 100644 index 2da0546aa..000000000 --- a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - prefix:DataChange-provider-impl - - DataChange-provider-impl - - - - binding:binding-rpc-registry - binding-rpc-broker - - - - binding:binding-async-data-broker - binding-data-broker - - - - - binding:binding-notification-service - - binding-notification-broker - - - - - - - - - - - org:onap:ccsdk:sli:northbound:datachange:provider:impl?module=DataChange-provider-impl&revision=2014-05-23 - - - diff --git a/dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml b/dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml new file mode 100644 index 000000000..b826b0113 --- /dev/null +++ b/dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit 1.2.3-korg From 6029c038ec36da60a72bea70556abcf64963260e Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 14 Sep 2017 15:25:10 +0530 Subject: Fix Sonar issues few major issues in sli/northbound module Issue-Id: CCSDK-87 Change-Id: I2c1a8b41266aae6941c5f2fdbb8b08ea91dde6ec Signed-off-by: surya-huawei --- .../onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 1b6049278..32e51599e 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 @@ -51,7 +51,7 @@ public class SdncBaseModel { public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { - params = new HashMap(); + params = new HashMap<>(); this.sdcCsarHelper = sdcCsarHelper; // extract service metadata @@ -66,7 +66,7 @@ public class SdncBaseModel { public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - params = new HashMap(); + params = new HashMap<>(); this.sdcCsarHelper = sdcCsarHelper; // extract nodeTemplate metadata @@ -79,7 +79,7 @@ public class SdncBaseModel { public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) { - params = new HashMap(); + params = new HashMap<>(); this.sdcCsarHelper = sdcCsarHelper; // extract group metadata @@ -257,9 +257,9 @@ public class SdncBaseModel { sb.append(") values (" + getCustomizationUUID() + ", \"" + model_yaml + "\", "); paramCount = 0; - for (String paramKey : params.keySet()) { + for (Map.Entry entry : params.entrySet()) { paramCount++; - String paramValue = params.get(paramKey); + String paramValue = entry.getValue(); sb.append(paramValue); if (paramCount < params.size()) sb.append(", "); } @@ -283,9 +283,9 @@ public class SdncBaseModel { sb.append(") values (" + keyValue + ", "); paramCount = 0; - for (String paramKey : params.keySet()) { + for (Map.Entry entry : params.entrySet()) { paramCount++; - String paramValue = params.get(paramKey); + String paramValue = entry.getValue(); sb.append(paramValue); if (paramCount < params.size()) sb.append(", "); } -- cgit 1.2.3-korg From b9e5ea7161c1f09fdf2a8955cb1ed3f1f93483f3 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 14 Sep 2017 15:59:25 -0400 Subject: Use oparent-odlparent in sli/northbound Update sli/northbound to use oparent-odlparent, used by latest version of ccsdk odlparent-carbon-sr1 parent. Change-Id: I77c4452d4af04d3dc4cd0892a9a0dab6c77016bc Issue-ID: CCSDK-43 Signed-off-by: Dan Timoney --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0fe0b502b..fe9477b6b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-carbon-sr1 - 0.0.1-SNAPSHOT + 0.0.2-SNAPSHOT 4.0.0 -- cgit 1.2.3-korg From 58f195402881a8b59fe394578c133fb7689c06d1 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Sun, 17 Sep 2017 23:10:57 +0530 Subject: Fix Sonar issue in sli/northbound module One major issue * move string literals to left side of string comparison Issue-Id: CCSDK-87 Change-Id: Ibd1146a8a12dccc56fb620fe5830efb545ac39a1 Signed-off-by: surya-huawei --- .../src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d47bcd1b3..0977fa0b7 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 @@ -148,7 +148,7 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { String errorCode = serviceDataBuilder.getDataChangeResponseCode(); - if ( errorCode != null && errorCode.length() != 0 && !( errorCode.equals("0")|| errorCode.equals("200"))) { + if (!("0".equals(errorCode) || "200".equals(errorCode))) { LOG.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for "+SVC_OPERATION+" "); -- cgit 1.2.3-korg From b36a9d940c2a865af5b43cad9822f05492235f75 Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Mon, 18 Sep 2017 14:54:37 +0530 Subject: Replace deprecated APIs with newer one Replace following deprecated API 1) NotificationProviderService replaced with NotificationPublishService Change-Id: I3d5117e63083ce77553feb3d3f6d6265576da646 Issue-Id: CCSDK-93 Signed-off-by: Gaurav Agrawal --- .../java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java | 7 ++++--- .../resources/org/opendaylight/blueprint/datachange-blueprint.xml | 2 +- dataChange/provider/src/main/yang/DataChange-provider-impl.yang | 8 ++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) 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 0977fa0b7..2b45cc7d7 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 @@ -28,6 +28,7 @@ import java.util.concurrent.Future; import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; @@ -58,21 +59,21 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { private final ExecutorService executor; protected DataBroker dataBroker; - protected NotificationProviderService notificationService; + protected NotificationPublishService notificationService; protected RpcProviderRegistry rpcRegistry; protected BindingAwareBroker.RpcRegistration rpcRegistration; private final DataChangeClient dataChangeClient; public DataChangeProvider(final DataBroker dataBroker, - final NotificationProviderService notificationProviderService, + final NotificationPublishService notificationPublishService, final RpcProviderRegistry rpcProviderRegistry, final DataChangeClient dataChangeClient) { this.LOG.info( "Creating provider for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); this.dataBroker = dataBroker; - this.notificationService = notificationProviderService; + this.notificationService = notificationPublishService; this.rpcRegistry = rpcProviderRegistry; this.dataChangeClient = dataChangeClient; initialize(); diff --git a/dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml b/dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml index b826b0113..03293015b 100644 --- a/dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml +++ b/dataChange/provider/src/main/resources/org/opendaylight/blueprint/datachange-blueprint.xml @@ -15,7 +15,7 @@ odl:type="default" /> Date: Mon, 18 Sep 2017 18:37:49 +0530 Subject: Replace deprecated API with newer one Replace following deprecated API 1) NotificationProviderService replaced with NotificationPublishService 2) InstanceIdentifier toInstance() replace with build() Change-Id: I50195bf123052270edf3fd9f74af00262a01e650 Issue-Id: CCSDK-93 Signed-off-by: Gaurav Agrawal --- .../ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 19 ++++++++----------- .../org/opendaylight/blueprint/asdc-blueprint.xml | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) 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 13198d623..b9c897ec0 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 @@ -28,12 +28,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.yang.gen.v1.http.xmlns.onap.org.asdc.license.model._1._0.rev160427.vf.license.model.grouping.VfLicenseModel; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.ASDCAPIService; @@ -103,21 +103,21 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { private final ExecutorService executor; protected DataBroker dataBroker; - protected NotificationProviderService notificationService; + protected NotificationPublishService notificationService; protected RpcProviderRegistry rpcRegistry; private final AsdcApiSliClient asdcApiSliClient; protected BindingAwareBroker.RpcRegistration rpcRegistration; public AsdcApiProvider(final DataBroker dataBroker, - final NotificationProviderService notificationProviderService, + final NotificationPublishService notificationPublishService, final RpcProviderRegistry rpcProviderRegistry, final AsdcApiSliClient asdcApiSliClient) { LOG.info("Creating provider for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); this.dataBroker = dataBroker; - notificationService = notificationProviderService; + notificationService = notificationPublishService; rpcRegistry = rpcProviderRegistry; this.asdcApiSliClient= asdcApiSliClient; initialize(); @@ -179,7 +179,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { protected boolean artifactVersionExists(String aName, String aVersion) { InstanceIdentifier artifactInstanceId = InstanceIdentifier.builder(Artifacts.class) - .child(Artifact.class, new ArtifactKey(aName, aVersion)).toInstance(); + .child(Artifact.class, new ArtifactKey(aName, aVersion)).build(); ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional data = null; try { @@ -212,8 +212,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { . builder(Artifacts.class) .child(Artifact.class, artifact.getKey()); - InstanceIdentifier path = aIdBuilder - .toInstance(); + InstanceIdentifier path = aIdBuilder.build(); WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); @@ -248,8 +247,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { . builder(VfLicenseModelVersions.class) .child(VfLicenseModelVersion.class, version.getKey()); - InstanceIdentifier path = versionIdBuilder - .toInstance(); + InstanceIdentifier path = versionIdBuilder.build(); WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); tx.merge(LogicalDatastoreType.CONFIGURATION, path, @@ -275,8 +273,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { . builder(VfLicenseModelVersions.class) .child(VfLicenseModelVersion.class, version.getKey()); - InstanceIdentifier path = versionIdBuilder - .toInstance(); + InstanceIdentifier path = versionIdBuilder.build(); WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); diff --git a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml index 6229db1f6..810ce8c5e 100644 --- a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml +++ b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml @@ -15,7 +15,7 @@ odl:type="default" /> Date: Tue, 19 Sep 2017 15:32:16 +0530 Subject: Fix Sonar Issues few major issues in sli/northbound *Remove unused imports *Iterate over the "entrySet" instead of the "keySet" *Replace the type specification with the diamond operator ("<>") Issue-Id: CCSDK-87 Signed-off-by: surya-huawei Change-Id: Ib2a6f97d3de759b937c1e2acd2e39312e88ad10b --- .../dmaapclient/SdncFlatJsonDmaapConsumer.java | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) 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 1754957da..a3d70c8d9 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 @@ -22,24 +22,12 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; import java.io.BufferedReader; -import java.io.DataOutputStream; import java.io.File; import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.Authenticator; -import java.net.HttpURLConnection; -import java.net.PasswordAuthentication; -import java.net.URL; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSession; - -import org.apache.commons.codec.binary.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -108,14 +96,14 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { ObjectNode inputNode = oMapper.createObjectNode(); - for (String fromField : fieldMap.keySet()) { + for (Map.Entry entry: fieldMap.entrySet()) { - if (!SDNC_ENDPOINT.equals(fromField)) { - JsonNode curNode = instarRootNode.get(fromField); + if (!SDNC_ENDPOINT.equals(entry.getKey())) { + JsonNode curNode = instarRootNode.get(entry.getKey()); if (curNode != null) { String fromValue = curNode.textValue(); - inputNode.put(fieldMap.get(fromField), fromValue); + inputNode.put(entry.getValue(), fromValue); } } } @@ -141,7 +129,7 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { } private Map loadMap(String msgType, String mapDirName) { - Map results = new HashMap(); + Map results = new HashMap<>(); if (mapDirName == null) { -- cgit 1.2.3-korg From c0696b9b0ce62d3f10cd46eae8ac5a5ca99d3b1d Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Tue, 19 Sep 2017 19:06:33 +0530 Subject: Fix critical sonar issues Fix critical sonar issues in CCSDK SLI Northbound by either logging or rethrowing the exception https://sonar.onap.org/component_issues/index?id=org.onap.ccsdk.sli.northbound%3Accsdk-sli-northbound#resolved=false|severities=CRITICAL Change-Id: I718f13b5801ea9d69b5c36f75b5387a0ae59cc6a Issue-Id: CCSDK-67 Signed-off-by: Gaurav Agrawal --- .../java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 3 +-- .../java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java | 2 +- .../ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java | 2 +- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java | 2 +- .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) 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 b9c897ec0..cebcb9986 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 @@ -157,8 +157,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { LOG.info("Create Containers succeeded!: "); } catch (InterruptedException | ExecutionException e) { - LOG.error("Create Containers Failed: " + e); - e.printStackTrace(); + LOG.error("Create Containers Failed: ", e); } } else { LOG.warn("createContainers : cannot find dataBroker to create containers"); 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 91afe1d1a..ec34fe402 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 @@ -106,7 +106,7 @@ public class DmaapListener { try { consumerClass = Class.forName(consumerClassName); } catch (Exception e) { - LOG.error("Could not find DMaap consumer class " + consumerClassName); + LOG.error("Could not find DMaap consumer class {}", consumerClassName, e); } if (consumerClass != null) { 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 1754957da..7196c90a7 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 @@ -135,7 +135,7 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { LOG.info("POST message body would be:\n"+rpcMsgbody); } } catch (Exception e) { - + LOG.error("Unable to process message", e); } } 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 dd9437ce9..9b36cb6b3 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 @@ -66,7 +66,7 @@ public class SdncArtifactMap { try { this.pass = Integer.parseInt(pass); } catch (Exception e) { - LOG.error("Invalid pass value for artifact map entry ("+tag+","+rpc+","+pass+")"); + LOG.error("Invalid pass value for artifact map entry ({} {} {})", tag, rpc, pass, e); } } } 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 3c561118e..3ea092d47 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 @@ -132,7 +132,7 @@ public class SdncUebConfiguration implements IConfiguration{ try { pollingInterval = Integer.parseInt(curval); } catch (Exception e) { - LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-interval ("+curval+")"); + LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-interval ({}) ", curval, e); } } @@ -141,7 +141,7 @@ public class SdncUebConfiguration implements IConfiguration{ try { pollingTimeout = Integer.parseInt(curval); } catch (Exception e) { - LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-timeout ("+curval+")"); + LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-timeout ({}) ", curval, e); } } -- cgit 1.2.3-korg From e350d16c4a4f0a51b19fd60617cdf7f8924aca22 Mon Sep 17 00:00:00 2001 From: Brian Freeman Date: Tue, 19 Sep 2017 16:49:28 +0000 Subject: Fix sli dependency Issue-ID: SDNC-86 Change-Id: I91280ab218e2f1f25ab381eaa9f94dce8f2abdc9 Signed-off-by: Brian Freeman --- asdcApi/features/src/main/resources/features.xml | 2 +- dataChange/features/src/main/resources/features.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/asdcApi/features/src/main/resources/features.xml b/asdcApi/features/src/main/resources/features.xml index 2048dc12a..0f7fe3b8d 100644 --- a/asdcApi/features/src/main/resources/features.xml +++ b/asdcApi/features/src/main/resources/features.xml @@ -32,7 +32,7 @@ mvn:org.onap.ccsdk.sli.northbound/asdcApi-model/${project.version} mvn:org.onap.ccsdk.sli.northbound/asdcApi-provider/${project.version} - sdnc-sli + sdnc-sli diff --git a/dataChange/features/src/main/resources/features.xml b/dataChange/features/src/main/resources/features.xml index c52bab52f..bd090f1cc 100644 --- a/dataChange/features/src/main/resources/features.xml +++ b/dataChange/features/src/main/resources/features.xml @@ -28,7 +28,7 @@ odl-mdsal-broker - sdnc-sli + sdnc-sli mvn:org.onap.ccsdk.sli.northbound/dataChange-model/${project.version} mvn:org.onap.ccsdk.sli.northbound/dataChange-provider/${project.version} -- cgit 1.2.3-korg From a74ffcd839da0b212cc2bca502977f225682dc33 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Wed, 20 Sep 2017 16:18:41 +0530 Subject: Remove useless assigment to local variables *Removed dead stores This is done to avoid waste of resources Issue-Id: CCSDK-87 Change-Id: Ie36255c6583792e2535000ee1bd5b2a3018632ff Signed-off-by: surya-huawei --- .../ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 5 ++--- .../onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) 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 aa3f7261a..60a508e51 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 @@ -59,8 +59,8 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { } ObjectMapper oMapper = new ObjectMapper(); - JsonNode instarRootNode = null; - ObjectNode sdncRootNode = null; + JsonNode instarRootNode ; + ObjectNode sdncRootNode; String instarMsgName = null; 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 e7a42bcb8..6a0c8c394 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 @@ -189,7 +189,7 @@ public class SdncUebCallback implements INotificationCallback { private static void setJdbcDataSource() throws IOException { - String propPath = null; + String propPath; String propDir = System.getenv(SDNC_CONFIG_DIR); if (propDir == null) { @@ -1056,8 +1056,7 @@ public class SdncUebCallback implements INotificationCallback { private File applyXslts(File srcFile) { - Document doc = null; - + Document doc; File inFile = srcFile; File outFile = null; 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 3ea092d47..fdae95d11 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 @@ -91,7 +91,7 @@ public class SdncUebConfiguration implements IConfiguration{ } public void init() throws IOException { - String propPath = null; + String propPath; String propDir = System.getenv(SDNC_CONFIG_DIR); if (propDir == null) { -- cgit 1.2.3-korg From 7359cb451fbc44afaf06be1754b10740e034472e Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Wed, 20 Sep 2017 17:14:38 +0530 Subject: Some minor refinements in CCSDK SLI Northbound Fix few Critical/Major sonar issues in CCSDK SLI Northbound module * Remove useless parentheses * Remove useless assignment to local variable * Use built-in logger method string formatting instead of string concatination * code indentation * Replace for loop with foreach Change-Id: I9a2e3345f23feb2d96045ac714d8acc528de464b Issue-Id: CCSDK-67 Signed-off-by: Ramu N --- .../sli/northbound/uebclient/SdncUebCallback.java | 162 +++++++++------------ .../sli/northbound/uebclient/SdncUebClient.java | 19 +-- .../northbound/uebclient/SdncUebConfiguration.java | 22 +-- 3 files changed, 90 insertions(+), 113 deletions(-) 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 e7a42bcb8..8c59e0399 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 @@ -8,9 +8,9 @@ * 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. @@ -189,10 +189,9 @@ public class SdncUebCallback implements INotificationCallback { private static void setJdbcDataSource() throws IOException { - String propPath = null; + String propPath; String propDir = System.getenv(SDNC_CONFIG_DIR); if (propDir == null) { - propDir = "/opt/sdnc/data/properties"; } propPath = propDir + "/dblib.properties"; @@ -209,8 +208,8 @@ public class SdncUebCallback implements INotificationCallback { props.load(new FileInputStream(propFile)); jdbcDataSource = new DBResourceManager(props); - - if(((DBResourceManager)jdbcDataSource).isActive()){ + + if(jdbcDataSource.isActive()){ LOG.warn( "DBLIB: JDBC DataSource has been initialized."); } else { LOG.warn( "DBLIB: JDBC DataSource did not initialize successfully."); @@ -239,15 +238,6 @@ public class SdncUebCallback implements INotificationCallback { File incomingDir = null; File archiveDir = null; - if (!incomingDir.exists()) { - incomingDir.mkdirs(); - } - - - if (!archiveDir.exists()) { - archiveDir.mkdirs(); - } - // Process service level artifacts List artifactList = data.getServiceArtifacts(); @@ -280,12 +270,14 @@ public class SdncUebCallback implements INotificationCallback { if (artifactList != null) { - incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); + incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName()) + "/" + + escapeFilename(curResource.getResourceName())); if (!incomingDir.exists()) { incomingDir.mkdirs(); } - archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); + archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName()) + "/" + + escapeFilename(curResource.getResourceName())); if (!archiveDir.exists()) { archiveDir.mkdirs(); } @@ -300,8 +292,6 @@ public class SdncUebCallback implements INotificationCallback { } deployDownloadedFiles(incomingDir, archiveDir, data); - - } @@ -333,7 +323,7 @@ public class SdncUebCallback implements INotificationCallback { } catch (Exception x) { // IOException can never be thrown by the iteration. // In this snippet, it can only be thrown by newDirectoryStream. - LOG.warn("Cannot process spool file "+ curFileName, x); + LOG.warn("Cannot process spool file {}", curFileName, x); } // Deploy scheduled deployments @@ -375,11 +365,11 @@ public class SdncUebCallback implements INotificationCallback { } } - private void handleArtifact(INotificationData data, String svcName, String resourceName, String resourceType, IArtifactInfo artifact, File incomingDir, File archiveDir) { + private void handleArtifact(INotificationData data, String svcName, String resourceName, String resourceType, + IArtifactInfo artifact, File incomingDir, File archiveDir) { // Download Artifact - IDistributionClientDownloadResult downloadResult = client - .download(artifact); + IDistributionClientDownloadResult downloadResult = client.download(artifact); if (downloadResult == null) { @@ -412,8 +402,6 @@ public class SdncUebCallback implements INotificationCallback { if (writeSucceeded && (downloadResult.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS)) { handleSuccessfulDownload(data, svcName, resourceName, artifact, spoolFile, archiveDir); - - } else { handleFailedDownload(data, artifact); } @@ -495,15 +483,13 @@ public class SdncUebCallback implements INotificationCallback { try { - DocumentBuilderFactory dbf = DocumentBuilderFactory - .newInstance(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); spoolDoc = db.parse(transformedFile); } catch (Exception e) { - LOG.error( - "Caught exception trying to parse transformed XML file " - + transformedFile.getAbsolutePath(), e); + LOG.error("Caught exception trying to parse transformed XML file {}", + transformedFile.getAbsolutePath(), e); } } catch (Exception e) { @@ -514,8 +500,7 @@ public class SdncUebCallback implements INotificationCallback { if (spoolDoc != null) { // Analyze file type - SdncArtifactType artifactType = analyzeFileType(artifactEnum, - spoolFile, spoolDoc); + SdncArtifactType artifactType = analyzeFileType(artifactEnum, spoolFile, spoolDoc); if (artifactType != null) { @@ -541,14 +526,14 @@ public class SdncUebCallback implements INotificationCallback { private void processToscaYaml(INotificationData data, String svcName, String resourceName, IArtifactInfo artifact, File spoolFile, File archiveDir) { - + // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data - + // TOSCA data extraction flow 1707: // Use ASDC dist-client to get yaml string - not yet available String model_yaml = null; LOG.info("Process TOSCA YAML file: "+spoolFile.toString()); - + SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); ISdcCsarHelper sdcCsarHelper = null; try { @@ -573,7 +558,7 @@ public class SdncUebCallback implements INotificationCallback { LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); factory.close(); return; - } + } // Ingest Network (VL) Data - 1707 //List vlNodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VL"); @@ -583,7 +568,7 @@ public class SdncUebCallback implements INotificationCallback { SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, nodeTemplate); nodeModel.setServiceUUID(serviceModel.getServiceUUID()); nodeModel.setEcompGeneratedNaming(SdncBaseModel.extractBooleanInputDefaultValue(sdcCsarHelper, SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING));//service_naming#default#ecomp_generated_naming - + try { cleanUpExistingToscaData("NETWORK_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); cleanUpExistingToscaData("VPN_BINDINGS", "network_customization_uuid", nodeModel.getCustomizationUUID()); @@ -595,13 +580,13 @@ public class SdncUebCallback implements INotificationCallback { LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); } } - + // Ingest Allotted Resource Data - 1707 List arNodeTemplatesList = sdcCsarHelper.getAllottedResources(); for (NodeTemplate nodeTemplate : arNodeTemplatesList) { SdncARModel nodeModel = new SdncARModel (sdcCsarHelper, nodeTemplate); - + try { cleanUpExistingToscaData("ALLOTTED_RESOURCE_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); LOG.info("Call insertToscaData for ALLOTTED_RESOURCE_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); @@ -611,14 +596,14 @@ public class SdncUebCallback implements INotificationCallback { LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); } } - + // Ingest Network (VF) Data - 1707 //List nodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VF"); List vfNodeTemplatesList = sdcCsarHelper.getServiceVfList(); for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { SdncVFModel vfNodeModel = new SdncVFModel (sdcCsarHelper, nodeTemplate); - + try { cleanUpExistingToscaData("VF_MODEL", "customization_uuid", vfNodeModel.getCustomizationUUID()) ; LOG.info("Call insertToscaData for VF_MODEL customizationUUID = " + vfNodeModel.getCustomizationUUID()); @@ -626,12 +611,12 @@ public class SdncUebCallback implements INotificationCallback { } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the VF_MODEL table ", e); } - + // For each VF, insert VF_MODULE_MODEL data List vfModules = sdcCsarHelper.getVfModulesByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); for (Group group : vfModules){ SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, group); - + try { cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); LOG.info("Call insertToscaData for VF_MODULE_MODEL customizationUUID = " + vfModuleModel.getCustomizationUUID()); @@ -639,19 +624,19 @@ public class SdncUebCallback implements INotificationCallback { } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the VF_MODULE_MODEL table ", e); } - + // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data // List groupMembers = sdcCsarHelper.getMembersOfGroup(group); - old version - // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. + // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); // not yet available for (NodeTemplate vfcNode : groupMembers){ SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); - + try { cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING customizationUUID = " + vfModuleModel.getCustomizationUUID()); - insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + + insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + vfModuleModel.getCustomizationUUID() + ", " + vfcModel.getCustomizationUUID() + ", \"" + vfcModel.getVmType() + "\", \"" + vfcModel.getVmCount() + "\")"); } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the VF_MODULE_TO_VFC_MAPPING table ", e); @@ -660,12 +645,12 @@ public class SdncUebCallback implements INotificationCallback { } } - + // For each VF, insert VFC_MODEL data List vfcNodes = sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); for (NodeTemplate vfcNode : vfcNodes){ SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); - + try { cleanUpExistingToscaData("VFC_MODEL", "customization_uuid", vfcModel.getCustomizationUUID()); LOG.info("Call insertToscaData for VFC_MODEL customizationUUID = " + vfcModel.getCustomizationUUID()); @@ -675,35 +660,35 @@ public class SdncUebCallback implements INotificationCallback { } } - + // For each VF, insert VF_TO_NETWORK_ROLE_MAPPING data List cpNodes = sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); for (NodeTemplate cpNode : cpNodes){ - + // Insert into VF_TO_NETWORK_ROLE_MAPPING vf_customization_uuid and network_role String cpNetworkRole = sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, "network_role_tag"); - + try { cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", vfNodeModel.getCustomizationUUID()); LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING vfCustomizationUUID = " + vfNodeModel.getCustomizationUUID()); - insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + + insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + vfNodeModel.getCustomizationUUID() + ", \"" + cpNetworkRole + "\")"); } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the VF_TO_NETWORK_ROLE_MAPPING table ", e); } - + // Insert VFC_TO_NETWORK_ROLE_MAPPING data Map mappingParams = new HashMap(); //String cpNetworkRoleTag = "\"" + sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLETAG) + "\""; // extract network_role, network_role_tag and virtual_binding from this cpNode SdncBaseModel.addParameter("network_role", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role"), mappingParams); SdncBaseModel.addParameter("network_role_tag", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role_tag"), mappingParams); - String virtualBinding = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "requirements#virtualBinding") + "\""; + String virtualBinding = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "requirements#virtualBinding") + "\""; // get list of cpNodes and vfcNodes with matching virtualBinding - List> matchList = sdcCsarHelper.getNodeTemplatePairsByReqName(sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), virtualBinding); + List> matchList = sdcCsarHelper.getNodeTemplatePairsByReqName(sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), virtualBinding); for (Pair match : matchList) { // should be 1 match? - + // extract values from the left "CP" Node SdncBaseModel.addParameter("ipv4_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); //SdncBaseModel.addParameter("ipv4_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); @@ -711,14 +696,14 @@ public class SdncUebCallback implements INotificationCallback { SdncBaseModel.addParameter("ipv6_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); //SdncBaseModel.addParameter("ipv6_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); SdncBaseModel.addParameter("ipv6_ip_version", "dummy_ipv6_vers", mappingParams); - //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid - + //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid + // extract values from the right "VFC" Node String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetadata(), "customization_uuid") + "\""; SdncBaseModel.addParameter("vm_type", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_VMTYPE), mappingParams); SdncBaseModel.addIntParameter("ipv4_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); SdncBaseModel.addIntParameter("ipv6_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); - + try { cleanUpExistingToscaData("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid); LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING vfcCustomizationUUID = " + vfcCustomizationUuid); @@ -726,16 +711,16 @@ public class SdncUebCallback implements INotificationCallback { } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the VFC_TO_NETWORK_ROLE_MAPPING table ", e); } - - } - - } // CP loop - + + } + + } // CP loop + } // VF loop - + // Close ASDC TOSCA Parser factory - we are done processing this distribution factory.close(); - + if ((artifact != null) && (data != null)) { LOG.info("Update to SDN-C succeeded"); IDistributionClientResult deploymentStatus; @@ -743,58 +728,58 @@ public class SdncUebCallback implements INotificationCallback { client, data, artifact, DistributionStatusEnum.DEPLOY_OK)); } - + } - + private void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException { - + if (jdbcDataSource == null) { setJdbcDataSource(); } try { int rowCount = 0; CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, ""); - while(data.next()) { - rowCount ++; + while(data.next()) { + rowCount ++; } if (rowCount != 0) { LOG.info("cleanUpExistingToscaData: " + keyValue); jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); } - - } catch (SQLException e) { + + } catch (SQLException e) { LOG.error("Could not clean up existing " + tableName + " for " + keyValue, e); - } - + } + } - + private void cleanUpExistingToscaServiceData(String serviceUUID) throws IOException { - + if (jdbcDataSource == null) { setJdbcDataSource(); } try { int rowCount = 0; CachedRowSet data = jdbcDataSource.getData("SELECT * from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, ""); - while(data.next()) { - rowCount ++; + while(data.next()) { + rowCount ++; } if (rowCount != 0) { LOG.info("cleanUpExistingToscaData: " + serviceUUID); jdbcDataSource.writeData("DELETE from NETWORK_MODEL where service_uuid = " + serviceUUID + ";", null, null); jdbcDataSource.writeData("DELETE from SERVICE_MODEL where service_uuid = " + serviceUUID + ";", null, null); } - - } catch (SQLException e) { + + } catch (SQLException e) { LOG.error("Could not clean up existing NETWORK_MODEL and SERVICE_MODEL for service_UUID " + serviceUUID, e); - } - + } + } - + private void insertToscaData(String toscaDataString) throws IOException { LOG.debug("insertToscaData: " + toscaDataString); @@ -867,11 +852,8 @@ public class SdncUebCallback implements INotificationCallback { Date now = new Date(); String artifactVersion = sdfDate.format(now); LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); - String artifactName = spoolFileName; - if (artifactInfo != null) { - artifactName = artifactInfo.getArtifactName(); - } - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactName, artifactVersion, spoolFile)); + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, spoolFileName, + artifactVersion, spoolFile)); } } else { LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); 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 e19646e39..d29890486 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 @@ -8,9 +8,9 @@ * 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. @@ -30,12 +30,10 @@ import org.slf4j.LoggerFactory; public class SdncUebClient { - private static final Logger LOG = LoggerFactory - .getLogger(SdncUebConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(SdncUebConfiguration.class); public static void main(String[] args) { - IDistributionClient client = DistributionClientFactory - .createDistributionClient(); + IDistributionClient client = DistributionClientFactory.createDistributionClient(); SdncUebConfiguration config = new SdncUebConfiguration(); @@ -46,17 +44,14 @@ public class SdncUebClient { LOG.info("Initializing ASDC distribution client"); - IDistributionClientResult result = client.init( - config, cb); + IDistributionClientResult result = client.init(config, cb); - LOG.info("Initialized ASDC distribution client - results = " - + result.getDistributionMessageResult()); + LOG.info("Initialized ASDC distribution client - results = {}", result.getDistributionMessageResult()); if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { LOG.info("Starting client..."); IDistributionClientResult start = client.start(); - LOG.info("Client startup result = " - + start.getDistributionMessageResult()); + LOG.info("Client startup result = {}", start.getDistributionMessageResult()); } 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 3ea092d47..4d9c82464 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 @@ -8,9 +8,9 @@ * 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. @@ -91,7 +91,7 @@ public class SdncUebConfiguration implements IConfiguration{ } public void init() throws IOException { - String propPath = null; + String propPath; String propDir = System.getenv(SDNC_CONFIG_DIR); if (propDir == null) { @@ -149,18 +149,18 @@ public class SdncUebConfiguration implements IConfiguration{ if ((curval != null) && (curval.length() > 0)) { String[] artifactTypes = curval.split(","); - relevantArtifactTypes = new LinkedList(); + relevantArtifactTypes = new LinkedList<>(); - for (int i = 0 ; i < artifactTypes.length ; i++) { + for (String artifactType : artifactTypes) { try { - if (ArtifactTypeEnum.valueOf(artifactTypes[i]) != null) { - relevantArtifactTypes.add(artifactTypes[i]); + if (ArtifactTypeEnum.valueOf(artifactType) != null) { + relevantArtifactTypes.add(artifactType); } else { - LOG.warn("Skipping unrecognized artifact type "+artifactTypes[i]); + LOG.warn("Skipping unrecognized artifact type {}", artifactType); } } catch (Exception e) { - LOG.warn("Caught exception validating artifact type "+artifactTypes[i], e); + LOG.warn("Caught exception validating artifact type {}", artifactType, e); } } @@ -263,11 +263,11 @@ public class SdncUebConfiguration implements IConfiguration{ } public int getMaxPasses() { - return(artifactMap.getNumPasses()); + return artifactMap.getNumPasses(); } public SdncArtifactMap.SdncArtifactType getMapping(String tag) { - return(artifactMap.getMapping(tag)); + return artifactMap.getMapping(tag); } @Override -- cgit 1.2.3-korg From b5603e3052857610ac4ee677bbe5164af3e8d520 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 21 Sep 2017 15:55:14 +0530 Subject: Use Integer.toString for type conversion *Used Integer.toString instead of implicit type conversion This is done to make use of static and reduce cycles *Removed one unused import *Removed unnecessary parantheses Sometimes useless parantheses can be misleading hence removed Issue-Id: CCSDK-87 Change-Id: I23f56cb7c5a6dafa79f64d5cd8faa0994f0ff288 Signed-off-by: surya-huawei --- .../onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 e31219a23..6aaf41cd9 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 @@ -28,7 +28,6 @@ import java.io.InputStreamReader; import java.net.Authenticator; import java.net.HttpURLConnection; import java.net.PasswordAuthentication; -import java.net.ProtocolException; import java.net.URL; import javax.net.ssl.HostnameVerifier; @@ -88,7 +87,7 @@ public class SdncOdlConnection { public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException { - return (new SdncOdlConnection(url, user, password)); + return new SdncOdlConnection(url, user, password); } @@ -121,7 +120,7 @@ public class SdncOdlConnection { } // Write message - httpConn.setRequestProperty("Content-Length", "" + msg.length()); + httpConn.setRequestProperty("Content-Length", Integer.toString(msg.length())); DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); outStr.write(msg.getBytes()); outStr.close(); @@ -151,7 +150,7 @@ public class SdncOdlConnection { LOG.info("Response body :\n" + respString); - return (respString); + return respString; } -- cgit 1.2.3-korg From 40289adf50be8419eda4d5e49d27b86a016312b7 Mon Sep 17 00:00:00 2001 From: Bharat saraswal Date: Thu, 21 Sep 2017 18:25:09 +0530 Subject: Resolved below sonar issues. Method complextity. Redudant code and varibales. Exception handling. Refacting of code. Issue-Id:CCSDK-87 Change-Id: I757c6a6d3c403f81f725ad97a7759225d0709468 Signed-off-by: Bharat saraswal --- .../sli/northbound/dmaapclient/DmaapListener.java | 280 +++++++++++---------- .../northbound/dmaapclient/SdncDmaapConsumer.java | 234 ++++++++--------- .../dmaapclient/SdncFlatJsonDmaapConsumer.java | 211 ++++++++-------- .../northbound/dmaapclient/SdncOdlConnection.java | 225 ++++++++--------- 4 files changed, 475 insertions(+), 475 deletions(-) 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 ec34fe402..de76e454e 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 @@ -26,140 +26,156 @@ import java.io.FileInputStream; import java.util.LinkedList; import java.util.List; import java.util.Properties; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class DmaapListener { - - private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; - private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; - private static final Logger LOG = LoggerFactory - .getLogger(DmaapListener.class); - - public static void main(String[] args) { - - Properties properties = new Properties(); - - - String propFileName = DMAAP_LISTENER_PROPERTIES; - - if (args.length > 0) { - propFileName = args[0]; - } - - String propPath = null; - String propDir = System.getenv(SDNC_CONFIG_DIR); - - List consumers = new LinkedList(); - - if (propDir == null) { - - propDir = "/opt/sdnc/data/properties"; - } - - if (!propFileName.startsWith("/")) { - propPath = propDir + "/" + propFileName; - } - - File propFile = new File(propPath); - - if (!propFile.canRead()) { - LOG.error("Cannot read properties file "+propPath); - System.exit(1); - } - - try { - properties.load(new FileInputStream(propFile)); - } catch (Exception e) { - LOG.error("Caught exception loading properties from "+propPath, e); - System.exit(1); - } - - String subscriptionStr = properties.getProperty("subscriptions"); - - boolean threadsRunning = false; - - LOG.debug("Dmaap subscriptions : "+subscriptionStr); - - if (subscriptionStr != null) { - String[] subscriptions = subscriptionStr.split(";"); - - for (int i = 0; i < subscriptions.length; i++) { - String[] subscription = subscriptions[i].split(":"); - String consumerClassName = subscription[0]; - String propertyPath = subscription[1]; - - LOG.debug("Handling subscription [" + consumerClassName + "," + propertyPath + "]"); - - if (propertyPath == null) { - LOG.error("Invalid subscription (" + subscriptions[i] + ") property file missing"); - continue; - } - - if (!propertyPath.startsWith("/")) { - propertyPath = propDir + "/" + propertyPath; - } - - Class consumerClass = null; - - try { - consumerClass = Class.forName(consumerClassName); - } catch (Exception e) { - LOG.error("Could not find DMaap consumer class {}", consumerClassName, e); - } - - if (consumerClass != null) { - - SdncDmaapConsumer consumer = null; - - try { - consumer = (SdncDmaapConsumer) consumerClass.newInstance(); - } catch (Exception e) { - LOG.error("Could not create consumer from class " + consumerClassName, e); - } - - if (consumer != null) { - LOG.debug("Initializing consumer " + consumerClassName + "(" + propertyPath + ")"); - consumer.init(properties, propertyPath); - - if (consumer.isReady()) { - Thread consumerThread = new Thread(consumer); - consumerThread.start(); - consumers.add(consumer); - threadsRunning = true; - LOG.info("Started consumer thread (" + consumerClassName + " : " + propertyPath + ")"); - } else { - LOG.debug("Consumer " + consumerClassName + " is not ready"); - } - } - - } - - } - } - - while (threadsRunning) { - - threadsRunning = false; - for (SdncDmaapConsumer consumer : consumers) { - if (consumer.isRunning()) { - threadsRunning = true; - } - } - - if (!threadsRunning) { - break; - } - - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - - } - } - - LOG.info("No listener threads running - exitting"); - - } + + private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; + private static final String DMAAP_LISTENER_PROPERTIES_DIR = "/opt/sdnc/data/properties"; + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + private static final Logger LOG = LoggerFactory.getLogger(DmaapListener.class); + + public static void main(String[] args) { + + Properties properties = new Properties(); + String propFileName = DMAAP_LISTENER_PROPERTIES; + String propPath = null; + String propDir = System.getenv(SDNC_CONFIG_DIR); + List consumers = new LinkedList<>(); + + if (args.length > 0) { + propFileName = args[0]; + } + + if (propDir == null) { + propDir = DMAAP_LISTENER_PROPERTIES_DIR; + } + + if (!propFileName.startsWith("/")) { + propPath = propDir + "/" + propFileName; + } + + if (propPath != null) { + properties = loadProperties(propPath, properties); + + String subscriptionStr = properties.getProperty("subscriptions"); + + boolean threadsRunning = false; + + LOG.debug("Dmaap subscriptions : " + subscriptionStr); + + if (subscriptionStr != null) { + threadsRunning = handleSubscriptions(subscriptionStr, propDir, properties, consumers); + } + + while (threadsRunning) { + threadsRunning = updateThreadState(consumers); + if (!threadsRunning) { + break; + } + + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + LOG.error(e.getLocalizedMessage(), e); + } + } + + LOG.info("No listener threads running - exiting"); + } + } + + private static boolean updateThreadState(List consumers) { + boolean threadsRunning = false; + for (SdncDmaapConsumer consumer : consumers) { + if (consumer.isRunning()) { + threadsRunning = true; + } + } + return threadsRunning; + } + + private static Properties loadProperties(String propPath, Properties properties) { + File propFile = new File(propPath); + + if (!propFile.canRead()) { + LOG.error("Cannot read properties file " + propPath); + System.exit(1); + } + + try (FileInputStream in = new FileInputStream(propFile)) { + properties.load(in); + } catch (Exception e) { + LOG.error("Caught exception loading properties from " + propPath, e); + System.exit(1); + } + return properties; + } + + private static boolean handleSubscriptions(String subscriptionStr, String propDir, Properties properties, + List consumers) { + String[] subscriptions = subscriptionStr.split(";"); + + for (String subscription1 : subscriptions) { + String[] subscription = subscription1.split(":"); + String consumerClassName = subscription[0]; + String propertyPath = subscription[1]; + + LOG.debug(String.format("Handling subscription [%s,%s]", consumerClassName, propertyPath)); + + if (propertyPath == null) { + LOG.error(String.format("Invalid subscription (%s) property file missing", subscription1)); + continue; + } + + if (!propertyPath.startsWith("/")) { + propertyPath = propDir + "/" + propertyPath; + } + + Class consumerClass = null; + + try { + consumerClass = Class.forName(consumerClassName); + } catch (Exception e) { + LOG.error("Could not find DMaap consumer class {}", consumerClassName, e); + } + + if (consumerClass != null) { + return handleConsumerClass(consumerClass, consumerClassName, propertyPath, + properties, consumers); + } + } + return false; + } + + private static boolean handleConsumerClass(Class consumerClass, String consumerClassName, String propertyPath, + Properties properties, List consumers) { + + SdncDmaapConsumer consumer = null; + + try { + consumer = (SdncDmaapConsumer) consumerClass.newInstance(); + } catch (Exception e) { + LOG.error("Could not create consumer from class " + consumerClassName, e); + } + + if (consumer != null) { + LOG.debug(String.format("Initializing consumer %s(%s)", consumerClassName, propertyPath)); + consumer.init(properties, propertyPath); + + if (consumer.isReady()) { + Thread consumerThread = new Thread(consumer); + consumerThread.start(); + consumers.add(consumer); + + LOG.info(String.format("Started consumer thread (%s : %s)", consumerClassName, + propertyPath)); + return true; + } else { + LOG.debug(String.format("Consumer %s is not ready", consumerClassName)); + } + } + return false; + } } 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 c1320d6b4..a0c555303 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 @@ -21,126 +21,132 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; +import com.att.nsa.mr.client.MRClientFactory; +import com.att.nsa.mr.client.MRConsumer; +import com.att.nsa.mr.client.response.MRConsumerResponse; import java.io.File; import java.io.FileInputStream; import java.util.Properties; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.att.nsa.mr.client.MRClientFactory; -import com.att.nsa.mr.client.MRConsumer; -import com.att.nsa.mr.client.response.MRConsumerResponse; - public abstract class SdncDmaapConsumer implements Runnable { - private static final Logger LOG = LoggerFactory - .getLogger(SdncDmaapConsumer.class); - - private String propertiesPath = ""; - private Properties properties = null; - MRConsumer consumer = null; - MRConsumerResponse consumerResponse = null; - boolean running = false; - boolean ready = false; - int fetchPause = 5000; // Default pause between fetchs - 5 seconds - - public boolean isReady() { - return ready; - } - - int timeout = 15000; // Default timeout - 15 seconds - - public boolean isRunning() { - return running; - } - - public SdncDmaapConsumer() { - - } - - public SdncDmaapConsumer(Properties properties, String propertiesPath) { - init(properties, propertiesPath); - } - - public String getProperty(String name) { - return(properties.getProperty(name, "")); - } - - public void init(Properties properties, String propertiesPath) { - - this.propertiesPath = propertiesPath; - - try { - - this.properties = (Properties) properties.clone(); - - this.properties.load(new FileInputStream(new File(propertiesPath))); - - String timeoutStr = properties.getProperty("timeout"); - - if ((timeoutStr != null) && (timeoutStr.length() > 0)) { - try { - timeout = Integer.parseInt(timeoutStr); - } catch (NumberFormatException e) { - LOG.error("Non-numeric value specified for timeout ("+timeoutStr+")"); - } - } - - String fetchPauseStr = properties.getProperty("fetchPause"); - if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { - try { - fetchPause = Integer.parseInt(fetchPauseStr); - } catch (NumberFormatException e) { - LOG.error("Non-numeric valud specified for fetchPause ("+fetchPauseStr+")"); - } - } - - this.consumer = MRClientFactory.createConsumer(propertiesPath); - ready = true; - } catch (Exception e) { - LOG.error("Error initializing DMaaP consumer from file "+propertiesPath, e); - } - } - - - @Override - public void run() { - if (ready) { - - running = true; - - while (running) { - - try { - boolean noData = true; - consumerResponse = consumer.fetchWithReturnConsumerResponse(timeout, -1); - for (String msg : consumerResponse.getActualMessages()) { - noData = false; - LOG.info("Received message from DMaaP:\n"+msg); - processMsg(msg); - } - - if (noData) { - if (fetchPause > 0) { - - LOG.info("No data received from fetch. Pausing "+fetchPause+" ms before retry"); - Thread.sleep(fetchPause); - } else { - - LOG.info("No data received from fetch. No fetch pause specified - retrying immediately"); - } - } - } catch (Exception e) { - LOG.error("Caught exception reading from DMaaP", e); - running = false; - } - - - } - } - - } - - abstract public void processMsg(String msg) throws InvalidMessageException; + private static final Logger LOG = LoggerFactory + .getLogger(SdncDmaapConsumer.class); + + private String propertiesPath = ""; + private Properties properties = null; + private MRConsumer consumer = null; + private MRConsumerResponse consumerResponse = null; + private boolean running = false; + private boolean ready = false; + private int fetchPause = 5000; // Default pause between fetch - 5 seconds + private int timeout = 15000; // Default timeout - 15 seconds + + public boolean isReady() { + return ready; + } + + + public boolean isRunning() { + return running; + } + + public SdncDmaapConsumer() { + + } + + public SdncDmaapConsumer(Properties properties, String propertiesPath) { + init(properties, propertiesPath); + } + + public String getProperty(String name) { + return (properties.getProperty(name, "")); + } + + public void init(Properties properties, String propertiesPath) { + + this.propertiesPath = propertiesPath; + + try (FileInputStream in = new FileInputStream(new File(propertiesPath))) { + + this.properties = (Properties) properties.clone(); + this.properties.load(in); + + String timeoutStr = properties.getProperty("timeout"); + + if ((timeoutStr != null) && (timeoutStr.length() > 0)) { + timeout = parseTimeOutValue(timeoutStr); + } + + String fetchPauseStr = properties.getProperty("fetchPause"); + if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { + fetchPause = parseFetchPause(fetchPauseStr); + } + + this.consumer = MRClientFactory.createConsumer(propertiesPath); + ready = true; + } catch (Exception e) { + LOG.error("Error initializing DMaaP consumer from file " + propertiesPath, e); + } + } + + private int parseTimeOutValue(String timeoutStr) { + try { + return Integer.parseInt(timeoutStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric value specified for timeout (" + timeoutStr + ")"); + } + return timeout; + } + + private int parseFetchPause(String fetchPauseStr) { + try { + return Integer.parseInt(fetchPauseStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric value specified for fetchPause (" + fetchPauseStr + ")"); + } + return fetchPause; + } + + + @Override + public void run() { + if (ready) { + + running = true; + + while (running) { + + try { + boolean noData = true; + consumerResponse = consumer.fetchWithReturnConsumerResponse(timeout, -1); + for (String msg : consumerResponse.getActualMessages()) { + noData = false; + LOG.info("Received message from DMaaP:\n" + msg); + processMsg(msg); + } + + if (noData) { + pauseThread(); + } + } catch (Exception e) { + LOG.error("Caught exception reading from DMaaP", e); + running = false; + } + } + } + } + + private void pauseThread() throws InterruptedException { + if (fetchPause > 0) { + LOG.info(String.format("No data received from fetch. Pausing %d ms before retry", fetchPause)); + Thread.sleep(fetchPause); + } else { + LOG.info("No data received from fetch. No fetch pause specified - retrying immediately"); + } + } + + abstract public void processMsg(String msg) throws InvalidMessageException; } 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 60a508e51..1d499a1e7 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 @@ -21,163 +21,148 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.HashMap; import java.util.Iterator; import java.util.Map; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { - private static final Logger LOG = LoggerFactory - .getLogger(SdncFlatJsonDmaapConsumer.class); - - private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; - private static final String SDNC_ENDPOINT = "SDNC.endpoint"; - - - - @Override - public void processMsg(String msg) throws InvalidMessageException { - - processMsg(msg, null); - } - - public void processMsg(String msg, String mapDirName) throws InvalidMessageException { - - if (msg == null) { - throw new InvalidMessageException("Null message"); - } - - ObjectMapper oMapper = new ObjectMapper(); - JsonNode instarRootNode ; - ObjectNode sdncRootNode; - - String instarMsgName = null; - - try { - instarRootNode = oMapper.readTree(msg); - } catch (Exception e) { - throw new InvalidMessageException("Cannot parse json object", e); - } + private static final Logger LOG = LoggerFactory.getLogger(SdncFlatJsonDmaapConsumer.class); - Iterator> instarFields = instarRootNode.fields(); + private static final String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + private static final String SDNC_ENDPOINT = "SDNC.endpoint"; - while (instarFields.hasNext()) { - Map.Entry entry = instarFields.next(); + @Override + public void processMsg(String msg) throws InvalidMessageException { - instarMsgName = entry.getKey(); - instarRootNode = entry.getValue(); - break; - } + processMsg(msg, null); + } - Map fieldMap = loadMap(instarMsgName, mapDirName); + public void processMsg(String msg, String mapDirName) throws InvalidMessageException { - if (fieldMap == null) { - throw new InvalidMessageException("Unable to process message - cannot load field mappings"); - } + if (msg == null) { + throw new InvalidMessageException("Null message"); + } - if (!fieldMap.containsKey(SDNC_ENDPOINT)) { - throw new InvalidMessageException("No SDNC endpoint known for message "+instarMsgName); - } + ObjectMapper oMapper = new ObjectMapper(); + JsonNode instarRootNode; + ObjectNode sdncRootNode; - String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); + String instarMsgName = null; - sdncRootNode = oMapper.createObjectNode(); - ObjectNode inputNode = oMapper.createObjectNode(); + try { + instarRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + Iterator> instarFields = instarRootNode.fields(); - for (Map.Entry entry: fieldMap.entrySet()) { + while (instarFields.hasNext()) { + Map.Entry entry = instarFields.next(); - if (!SDNC_ENDPOINT.equals(entry.getKey())) { - JsonNode curNode = instarRootNode.get(entry.getKey()); - if (curNode != null) { - String fromValue = curNode.textValue(); + instarMsgName = entry.getKey(); + instarRootNode = entry.getValue(); + break; + } - inputNode.put(entry.getValue(), fromValue); - } - } - } - sdncRootNode.put("input", inputNode); + Map fieldMap = loadMap(instarMsgName, mapDirName); - try { - String rpcMsgbody = oMapper.writeValueAsString(sdncRootNode); - String odlUrlBase = getProperty("sdnc.odl.url-base"); - String odlUser = getProperty("sdnc.odl.user"); - String odlPassword = getProperty("sdnc.odl.password"); + if (fieldMap == null) { + throw new InvalidMessageException("Unable to process message - cannot load field mappings"); + } - if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { - SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + sdncEndpoint, odlUser, odlPassword); + if (!fieldMap.containsKey(SDNC_ENDPOINT)) { + throw new InvalidMessageException("No SDNC endpoint known for message " + instarMsgName); + } - 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); - } + String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); - } + sdncRootNode = oMapper.createObjectNode(); + ObjectNode inputNode = oMapper.createObjectNode(); - private Map loadMap(String msgType, String mapDirName) { - Map results = new HashMap<>(); + for (Map.Entry entry : fieldMap.entrySet()) { + if (!SDNC_ENDPOINT.equals(entry.getKey())) { + JsonNode curNode = instarRootNode.get(entry.getKey()); + if (curNode != null) { + String fromValue = curNode.textValue(); - if (mapDirName == null) { - String rootdir = System.getenv(DMAAPLISTENERROOT); + inputNode.put(entry.getValue(), fromValue); + } + } + } + sdncRootNode.put("input", inputNode); - if ((rootdir == null) || (rootdir.length() == 0)) { - rootdir = "/opt/app/dmaap-listener"; - } + try { + String rpcMsgbody = oMapper.writeValueAsString(sdncRootNode); + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); - mapDirName = rootdir + "/lib"; + 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); + } + } - String mapFilename = mapDirName + "/" + msgType + ".map"; + private Map loadMap(String msgType, String mapDirName) { + Map results = new HashMap<>(); - File mapFile = new File(mapFilename); + if (mapDirName == null) { + String rootdir = System.getenv(DMAAPLISTENERROOT); - if (!mapFile.canRead()) { - LOG.error("Cannot read map file ("+mapFilename+")"); - return(null); - } + if ((rootdir == null) || (rootdir.length() == 0)) { + rootdir = "/opt/app/dmaap-listener"; + } - try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { + mapDirName = rootdir + "/lib"; + } - String curLine; + String mapFilename = mapDirName + "/" + msgType + ".map"; - while ((curLine = mapReader.readLine()) != null) { - curLine = curLine.trim(); + File mapFile = new File(mapFilename); - if ((curLine.length() > 0) && (!curLine.startsWith("#"))) { + if (!mapFile.canRead()) { + LOG.error(String.format("Cannot read map file (%s)", mapFilename)); + return (null); + } - if (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); - } + try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { - return(results); - } + 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/SdncOdlConnection.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java index 6aaf41cd9..f88f7bf8c 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 @@ -29,130 +29,123 @@ import java.net.Authenticator; import java.net.HttpURLConnection; import java.net.PasswordAuthentication; import java.net.URL; - import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; - import org.apache.commons.codec.binary.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncOdlConnection { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncOdlConnection.class); - - private HttpURLConnection httpConn = null; - - private String url = null; - private String user = null; - private String password = null; - - private class SdncAuthenticator extends Authenticator { - - private String user; - private String passwd; - - SdncAuthenticator(String user, String passwd) { - this.user = user; - this.passwd = passwd; - } - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(user, passwd.toCharArray()); - } - - } - - private SdncOdlConnection() { - - } - - private SdncOdlConnection(String url, String user, String password) { - this.url = url; - this.user = user; - this.password = password; - - try { - URL sdncUrl = new URL(url); - Authenticator.setDefault(new SdncAuthenticator(user, password)); - - this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); - } catch (Exception e) { - LOG.error("Unable to create http connection", e); - } - } - - public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException - { - return new SdncOdlConnection(url, user, password); - } - - - - public String send(String method, String contentType, String msg) throws IOException { - - LOG.info("Sending REST " + method + " to " + url); - LOG.info("Message body:\n" + msg); - String authStr = user + ":" + password; - String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); - - httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); - - httpConn.setRequestMethod(method); - httpConn.setRequestProperty("Content-Type", contentType); - httpConn.setRequestProperty("Accept", contentType); - - httpConn.setDoInput(true); - httpConn.setDoOutput(true); - httpConn.setUseCaches(false); - - if (httpConn instanceof HttpsURLConnection) { - HostnameVerifier hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); - } - - // Write message - httpConn.setRequestProperty("Content-Length", Integer.toString(msg.length())); - DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); - outStr.write(msg.getBytes()); - outStr.close(); - - // Read response - BufferedReader respRdr; - - LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); - - if (httpConn.getResponseCode() < 300) { - - respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); - } else { - respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); - } - - StringBuffer respBuff = new StringBuffer(); - - String respLn; - - while ((respLn = respRdr.readLine()) != null) { - respBuff.append(respLn + "\n"); - } - respRdr.close(); - - String respString = respBuff.toString(); - - LOG.info("Response body :\n" + respString); - - return respString; - - } - + private static final Logger LOG = LoggerFactory + .getLogger(SdncOdlConnection.class); + + private HttpURLConnection httpConn = null; + + private String url = null; + private String user = null; + private String password = null; + + private class SdncAuthenticator extends Authenticator { + + private String user; + private String passwd; + + SdncAuthenticator(String user, String passwd) { + this.user = user; + this.passwd = passwd; + } + + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, passwd.toCharArray()); + } + } + + private SdncOdlConnection() { + + } + + private SdncOdlConnection(String url, String user, String password) { + this.url = url; + this.user = user; + this.password = password; + + try { + URL sdncUrl = new URL(url); + Authenticator.setDefault(new SdncAuthenticator(user, password)); + + this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); + } catch (Exception e) { + LOG.error("Unable to create http connection", e); + } + } + + public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException { + return new SdncOdlConnection(url, user, password); + } + + + public String send(String method, String contentType, String msg) throws IOException { + + LOG.info(String.format("Sending REST %s to %s", method, url)); + LOG.info(String.format("Message body:%n%s", msg)); + String authStr = user + ":" + password; + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + + httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); + + httpConn.setRequestMethod(method); + httpConn.setRequestProperty("Content-Type", contentType); + httpConn.setRequestProperty("Accept", contentType); + + httpConn.setDoInput(true); + httpConn.setDoOutput(true); + httpConn.setUseCaches(false); + + if (httpConn instanceof HttpsURLConnection) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); + } + + // Write message + httpConn.setRequestProperty("Content-Length", Integer.toString(msg.length())); + DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); + outStr.write(msg.getBytes()); + outStr.close(); + + // Read response + BufferedReader respRdr; + + LOG.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); + + if (httpConn.getResponseCode() < 300) { + + respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); + } else { + respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); + } + + StringBuilder respBuff = new StringBuilder(); + + String respLn; + + while ((respLn = respRdr.readLine()) != null) { + respBuff.append(respLn).append("\n"); + } + respRdr.close(); + + String respString = respBuff.toString(); + + LOG.info(String.format("Response body :%n%s", respString)); + + return respString; + } } -- cgit 1.2.3-korg From 862cac3e7b7b7bd835439d3a905d9c241a7ae742 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Fri, 22 Sep 2017 16:50:44 +0530 Subject: Remove unnecessary constructs *Remove unused imports *Remove useless paranthesis This is done as sometimes they can be misleading *Replace type specification with diamond operator(<>) This is done to reduce verbosity of generics code Issue-Id: CCSDK-87 Change-Id: Ic356859939fe40cecec2e65c96d79cd6a655787e Signed-off-by: surya-huawei --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 9b36cb6b3..3605465d4 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 @@ -24,7 +24,6 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; -import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -57,7 +56,7 @@ public class SdncArtifactMap { } public String getRpcUrl(String base) { - return(base+rpc); + return base+rpc; } private SdncArtifactType(String tag, String rpc, String pass) { @@ -73,7 +72,7 @@ public class SdncArtifactMap { - private Map mapItems = new HashMap(); + private Map mapItems = new HashMap<>(); private int NumPasses = 1; @@ -110,9 +109,9 @@ public class SdncArtifactMap { public SdncArtifactType getMapping(String tag) { if (mapItems.containsKey(tag)) { - return(mapItems.get(tag)); + return mapItems.get(tag); } else { - return(null); + return null; } } -- cgit 1.2.3-korg From e5a46e5667e52c8bd8ceb4f322ff4d300223267c Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Mon, 25 Sep 2017 17:31:57 +0530 Subject: Fix some sonar issues in sli/northbound *Replace type specification with diamond operator This is done to reduce the verbosity of generics code *Replace ("") with ('') in String.lastIndexOf() This is more efficient for single character *Remove temp variable which is immediately returned New variable is not necessary as the caller cannot see this Issue-Id: CCSDK-87 Change-Id: I353652de723a624935d819b2bc817b4907af98ed Signed-off-by: surya-huawei --- .../onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 0664e8283..5d83c5d16 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 @@ -332,7 +332,7 @@ public class SdncUebCallback implements INotificationCallback { deployList = new LinkedList[numPasses]; for (int i = 0 ; i < numPasses ; i++) { - deployList[i] = new LinkedList(); + deployList[i] = new LinkedList<>(); } for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) { @@ -450,7 +450,7 @@ public class SdncUebCallback implements INotificationCallback { } - if (toscaYamlType == true) { + if (toscaYamlType) { processToscaYaml (data, svcName, resourceName, artifact, spoolFile, archiveDir); try { @@ -547,7 +547,8 @@ public class SdncUebCallback implements INotificationCallback { // Ingest Service Data - 1707 Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata(); SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata); - serviceModel.setFilename(spoolFile.toString().substring(spoolFile.toString().lastIndexOf("/")+1)); // will be csar file name + serviceModel.setFilename(spoolFile.toString().substring(spoolFile + .toString().lastIndexOf('/')+1)); // will be csar file name serviceModel.setServiceInstanceNamePrefix(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).substring(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).lastIndexOf(".")+1)); try { @@ -678,7 +679,7 @@ public class SdncUebCallback implements INotificationCallback { } // Insert VFC_TO_NETWORK_ROLE_MAPPING data - Map mappingParams = new HashMap(); + Map mappingParams = new HashMap<>(); //String cpNetworkRoleTag = "\"" + sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLETAG) + "\""; // extract network_role, network_role_tag and virtual_binding from this cpNode SdncBaseModel.addParameter("network_role", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role"), mappingParams); @@ -963,8 +964,7 @@ public class SdncUebCallback implements INotificationCallback { @Override public long getTimestamp() { - long currentTimeMillis = System.currentTimeMillis(); - return currentTimeMillis; + return System.currentTimeMillis(); } @Override -- cgit 1.2.3-korg From b720f1b77fe2c96e2afb1bafed5b02724ab50e37 Mon Sep 17 00:00:00 2001 From: shashikanth Date: Tue, 26 Sep 2017 14:56:41 +0530 Subject: Deleted redundant try catch block Extract this nested try block into a separate method. https://sonar.onap.org/component_issues?id=org.onap.ccsdk.sli.northbound%3Accsdk-sli-northbound#resolved=false|severities=MAJOR|rules=squid%3AS1141 Issue-Id: CCSDK-87 Change-Id: I989791d876b5a199f75983ba5137770f80995ef1 Signed-off-by: shashikanth.vh --- .../ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) 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 0664e8283..9723ed4d5 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 @@ -480,20 +480,13 @@ public class SdncUebCallback implements INotificationCallback { if (transformedFile != null) { try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); - try { - - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - DocumentBuilder db = dbf.newDocumentBuilder(); - - spoolDoc = db.parse(transformedFile); - } catch (Exception e) { - LOG.error("Caught exception trying to parse transformed XML file {}", - transformedFile.getAbsolutePath(), e); - } - + spoolDoc = db.parse(transformedFile); } catch (Exception e) { - LOG.error("Caught exception trying to deploy file", e); + LOG.error("Caught exception trying to parse transformed XML file {}", + transformedFile.getAbsolutePath(), e); } } -- cgit 1.2.3-korg From cd7f49ca4072db9b5f1d86b72666fa9077bc31f6 Mon Sep 17 00:00:00 2001 From: shashikanth Date: Wed, 27 Sep 2017 15:43:48 +0530 Subject: Improve SDNC Sonar coverage Added initial test cases for ASDC-APIs Issue-Id: SDNC-101 Change-Id: Iad8be979e39099e4ece8210dbd5d2c9c64b60990 Signed-off-by: shashikanth.vh --- asdcApi/provider/pom.xml | 155 ++++++++++++++------- .../sdnc/northbound/asdcapi/TestAsdcApiApi.java | 107 ++++++++++++++ 2 files changed, 208 insertions(+), 54 deletions(-) create mode 100644 asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 329d6ef2a..cb6872653 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -1,59 +1,106 @@ - 4.0.0 - - asdcApi - org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT - - asdcApi-provider - bundle + 4.0.0 + + asdcApi + org.onap.ccsdk.sli.northbound + 0.1.0-SNAPSHOT + + asdcApi-provider + bundle - - - - org.apache.felix - maven-bundle-plugin - true - - - + + + + org.apache.felix + maven-bundle-plugin + true + + + + + + + org.onap.ccsdk.sli.northbound + asdcApi-model + ${project.version} + + + org.opendaylight.controller + config-api + ${odl.controller.config.api.version} + + + org.opendaylight.controller + sal-binding-config + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-binding-api + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-common-util + ${odl.mdsal.version} + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + + + + org.opendaylight.controller + sal-test-model + ${odl.mdsal.version} + test + + + org.opendaylight.netconf + sal-rest-connector + ${odl.mdsal.version} + test + + + + org.opendaylight.controller + sal-binding-broker-impl + ${odl.mdsal.version} + test + + + org.opendaylight.controller + sal-binding-broker-impl + ${odl.mdsal.version} + test-jar + tests + test + + + junit + junit + ${junit.version} + test + + + org.testng + testng + 6.11 + test + + + org.mockito + mockito-core + ${mockito.version} + test + + - - - org.onap.ccsdk.sli.northbound - asdcApi-model - ${project.version} - - - org.opendaylight.controller - config-api - ${odl.controller.config.api.version} - - - org.opendaylight.controller - sal-binding-config - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-binding-api - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-common-util - ${odl.mdsal.version} - - - org.onap.ccsdk.sli.core - sli-common - ${sdnctl.sli.version} - - - org.onap.ccsdk.sli.core - sli-provider - ${sdnctl.sli.version} - - diff --git a/asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java b/asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java new file mode 100644 index 000000000..c78abc8f7 --- /dev/null +++ b/asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java @@ -0,0 +1,107 @@ +/*- + * ============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.sdnc.northbound.asdcapi; + +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiSliClient; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateOutput; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; + +public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { + + private AsdcApiProvider asdcApiProvider; + private static final Logger LOG = LoggerFactory.getLogger(AsdcApiProvider.class); + + @Before + public void setUp() throws Exception { + if (null == asdcApiProvider) { + DataBroker dataBroker = getDataBroker(); + NotificationPublishService mockNotification = mock(NotificationPublishService.class); + RpcProviderRegistry mockRpcRegistry = mock(RpcProviderRegistry.class); + AsdcApiSliClient mockSliClient = mock(AsdcApiSliClient.class); + asdcApiProvider = new AsdcApiProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient); + } + } + + //Testcase should return error 503 when No service logic active for ASDC-API. + @Test + public void testVfLicenseModelUpdate() { + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); + + inputBuilder.setArtifactName("abc"); + inputBuilder.setArtifactVersion("1"); + + // TODO: currently initialize SvcLogicServiceClient is failing, need to fix + java.util.concurrent.Future> future = asdcApiProvider + .vfLicenseModelUpdate(inputBuilder.build()); + RpcResult rpcResult = null; + try { + rpcResult = future.get(); + } catch (Exception e) { + fail("Error : " + e); + } + LOG.info("result: {}", rpcResult); + assertEquals("503", rpcResult.getResult().getAsdcApiResponseCode()); + } + + //Input parameter validation + @Test + public void testVfLicenseModelUpdateInputValidation() { + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); + + inputBuilder.setArtifactName("abc"); + inputBuilder.setArtifactVersion("1"); + + java.util.concurrent.Future> future = asdcApiProvider + .vfLicenseModelUpdate(null); + assertNull(future); + } + + @Test(expected = IllegalArgumentException.class) + public void testVfLicenseModelUpdateValidation1() { + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); + + java.util.concurrent.Future> future = asdcApiProvider + .vfLicenseModelUpdate(inputBuilder.build()); + RpcResult rpcResult = null; + try { + rpcResult = future.get(); + } catch (Exception e) { + fail("Error : " + e); + } + } +} -- cgit 1.2.3-korg From 15bd116393a09ffa10d71361c7930e9ff91f288c Mon Sep 17 00:00:00 2001 From: Brian Freeman Date: Thu, 28 Sep 2017 11:03:28 +0000 Subject: Setup ReadTheDocs Issue-ID: CCSDK-107 Change-Id: I98bc6f3a3827bb1f4e03eb08474b15e26662705f Signed-off-by: Brian Freeman --- docs/index.rst | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docs/index.rst diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 000000000..833e1aa96 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,8 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. + +TODO Add files to toctree and delete this header +------------------------------------------------ +.. toctree:: + :maxdepth: 1 + + -- cgit 1.2.3-korg From 119808a2ded9ea8c4dd9d1eef96f39ab2e001ff7 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 3 Oct 2017 04:04:30 -0400 Subject: Add unit test for ueb-listener Add unit test case for ueb-listener. Change-Id: Ia61f8e5bc0e817aa0f4a042d8e05b02ec9e2013b Issue-ID: CCSDK-106 Signed-off-by: Dan Timoney --- ueb-listener/pom.xml | 12 +++++++++ .../sli/northbound/uebclient/SdncUebCallback.java | 4 +++ .../northbound/uebclient/SdncUebConfiguration.java | 22 +++++++++++----- .../northbound/uebclient/TestSdncUebCallback.java | 30 ++++++++++++++++++++++ .../src/test/resources/ueb-listener.properties | 19 ++++++++++++++ 5 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java create mode 100755 ueb-listener/src/test/resources/ueb-listener.properties diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 84e407698..c00395d6e 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -63,6 +63,18 @@ ${junit.version} test + + org.testng + testng + 6.11 + test + + + org.mockito + mockito-core + ${mockito.version} + test + org.onap.ccsdk.sli.core dblib-provider 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 f25ce1458..f00d73724 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 @@ -1073,6 +1073,10 @@ public class SdncUebCallback implements INotificationCallback { } private String escapeFilename(String str) { + + if (str == null) { + str = ""; + } StringBuffer retval = new StringBuffer(); for (int i = 0 ; i < str.length() ; i++) { 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 4d9c82464..d97abacbd 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 @@ -82,21 +82,31 @@ public class SdncUebConfiguration implements IConfiguration{ } public SdncUebConfiguration() { + String propDir = System.getenv(SDNC_CONFIG_DIR); + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + try { + init(propDir); + } catch (Exception e) { + LOG.error("Cannot initialize SdncUebConfiguration", e); + } + } + public SdncUebConfiguration(String propDir) { try { - init(); + init(propDir); } catch (Exception e) { LOG.error("Cannot initialize SdncUebConfiguration", e); } } - public void init() throws IOException { + + public void init(String propDir) throws IOException { String propPath; - String propDir = System.getenv(SDNC_CONFIG_DIR); - if (propDir == null) { - propDir = "/opt/sdnc/data/properties"; - } + propPath = propDir + "/ueb-listener.properties"; File propFile = new File(propPath); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java new file mode 100644 index 000000000..93fadc989 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -0,0 +1,30 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.api.IDistributionClient; +import org.openecomp.sdc.api.notification.INotificationData; + +import static org.mockito.Mockito.mock; + +public class TestSdncUebCallback { + SdncUebConfiguration config; + + @Before + public void setUp() throws Exception { + config = new SdncUebConfiguration("src/test/resources"); + } + + @Test + public void test() { + + IDistributionClient iDistClient = mock(IDistributionClient.class); + SdncUebCallback cb = new SdncUebCallback(iDistClient, config); + + INotificationData iData = mock(INotificationData.class); + cb.activateCallback(iData); + } + +} diff --git a/ueb-listener/src/test/resources/ueb-listener.properties b/ueb-listener/src/test/resources/ueb-listener.properties new file mode 100755 index 000000000..7855b2116 --- /dev/null +++ b/ueb-listener/src/test/resources/ueb-listener.properties @@ -0,0 +1,19 @@ +org.openecomp.sdnc.uebclient.asdc-address=localhost:1234 +org.openecomp.sdnc.uebclient.consumer-group=ccsdk1 +org.openecomp.sdnc.uebclient.consumer-id=localhost_ccsdk1 +org.openecomp.sdnc.uebclient.environment-name=UNITTEST +org.openecomp.sdnc.uebclient.password=123456 +org.openecomp.sdnc.uebclient.user=test +org.openecomp.sdnc.uebclient.sdnc-user=test +org.openecomp.sdnc.uebclient.sdnc-passwd=test +org.openecomp.sdnc.uebclient.asdc-api-base-url=http://localhost:8282/restconf/operations/ +org.openecomp.sdnc.uebclient.asdc-api-namespace=org:onap:ccsdk +org.openecomp.sdnc.uebclient.spool.incoming=src/test/resources/incoming +org.openecomp.sdnc.uebclient.spool.archive=src/test/resources/archive +org.openecomp.sdnc.uebclient.polling-interval=30 +org.openecomp.sdnc.uebclient.polling-timeout=15 +org.openecomp.sdnc.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION +org.openecomp.sdnc.uebclient.activate-server-tls-auth=false +org.openecomp.sdnc.uebclient.keystore-path= +org.openecomp.sdnc.uebclient.keystore-password= +org.openecomp.sdnc.uebclient.xslt-path-list=src/main/resources/removeNs.xslt,src/main/resources/normalizeTagNames.xslt -- cgit 1.2.3-korg From 12d893efa353bc5bd5054cd59998a623f5d058d0 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 3 Oct 2017 07:34:22 -0400 Subject: Add unit test for dmaap-listener Add unit test case for dmaap-listener. Change-Id: I501614016c96d8300bc15cdf1819691f95c467f4 Issue-ID: CCSDK-106 Signed-off-by: Dan Timoney --- .../sli/northbound/dmaapclient/DmaapListener.java | 8 ++-- .../northbound/dmaapclient/TestDmaapListener.java | 52 ++++++++++++++++++++++ .../src/test/resources/dmaap-consumer-1.properties | 35 +++++++++++++++ .../resources/dmaap-listener.preferredRoute.txt | 1 + .../src/test/resources/dmaap-listener.properties | 1 + 5 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java create mode 100755 dmaap-listener/src/test/resources/dmaap-consumer-1.properties create mode 100755 dmaap-listener/src/test/resources/dmaap-listener.preferredRoute.txt create mode 100755 dmaap-listener/src/test/resources/dmaap-listener.properties 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 de76e454e..ce099cd64 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 @@ -8,9 +8,9 @@ * 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. @@ -96,7 +96,7 @@ public class DmaapListener { return threadsRunning; } - private static Properties loadProperties(String propPath, Properties properties) { + static Properties loadProperties(String propPath, Properties properties) { File propFile = new File(propPath); if (!propFile.canRead()) { @@ -113,7 +113,7 @@ public class DmaapListener { return properties; } - private static boolean handleSubscriptions(String subscriptionStr, String propDir, Properties properties, + static boolean handleSubscriptions(String subscriptionStr, String propDir, Properties properties, List consumers) { String[] subscriptions = subscriptionStr.split(";"); diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java new file mode 100644 index 000000000..943ef0204 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java @@ -0,0 +1,52 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.*; + +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestDmaapListener { + + private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; + private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources"; + + private static final Logger LOG = LoggerFactory.getLogger(TestDmaapListener.class); + + @Before + public void setUp() throws Exception { + } + + @Test + public void test() { + Properties properties = new Properties(); + String propFileName = DMAAP_LISTENER_PROPERTIES; + String propPath = null; + String propDir = DMAAP_LISTENER_PROPERTIES_DIR; + + List consumers = new LinkedList<>(); + + + propPath = propDir + "/" + propFileName; + + if (propPath != null) { + properties = DmaapListener.loadProperties(propPath, properties); + + String subscriptionStr = properties.getProperty("subscriptions"); + + boolean threadsRunning = false; + + LOG.debug("Dmaap subscriptions : " + subscriptionStr); + + if (subscriptionStr != null) { + threadsRunning = DmaapListener.handleSubscriptions(subscriptionStr, propDir, properties, consumers); + } + } + } + +} diff --git a/dmaap-listener/src/test/resources/dmaap-consumer-1.properties b/dmaap-listener/src/test/resources/dmaap-consumer-1.properties new file mode 100755 index 000000000..ae83ef8c2 --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-consumer-1.properties @@ -0,0 +1,35 @@ +TransportType=HTTPAAF +Latitude =40.397443 +Longitude =-74.135602 +Version =1.0 +ServiceName =localhost/events +Environment =DEV +Partner = +SubContextPath =/ +Protocol =http +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=ccsdk-unittest +id=ccsdk_unittest +timeout=15000 +limit=1000 +filter= +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=15000 +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:8282/restconf/operations + diff --git a/dmaap-listener/src/test/resources/dmaap-listener.preferredRoute.txt b/dmaap-listener/src/test/resources/dmaap-listener.preferredRoute.txt new file mode 100755 index 000000000..88705f73b --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-listener.preferredRoute.txt @@ -0,0 +1 @@ +preferredRouteKey=ABC123 \ 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 new file mode 100755 index 000000000..ed180e515 --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-listener.properties @@ -0,0 +1 @@ +subscriptions=org.onap.ccsdk.sli.northbound.dmaapclient.DummyDmaapConsumer:dmaap-consumer-1.properties \ No newline at end of file -- cgit 1.2.3-korg From 20806dda3204d6e83db0f062e958bef78d2d779d Mon Sep 17 00:00:00 2001 From: shashikanth Date: Tue, 3 Oct 2017 16:58:51 +0530 Subject: Improve SDNC coverage Added initial test cases for dataChange. Issue-Id: SDNC-101 Change-Id: I112a6695f4d4ca92b78884d25fef12f382598b37 Signed-off-by: shashikanth.vh --- dataChange/provider/pom.xml | 158 +++++++++++++-------- .../sdnc/northbound/dataChange/TestDataChange.java | 95 +++++++++++++ 2 files changed, 194 insertions(+), 59 deletions(-) create mode 100644 dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index e19114947..f3e1f0fd4 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -1,65 +1,105 @@ - 4.0.0 - - dataChange - org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT - - dataChange-provider - bundle + 4.0.0 + + dataChange + org.onap.ccsdk.sli.northbound + 0.1.0-SNAPSHOT + + dataChange-provider + bundle - - - - org.apache.felix - maven-bundle-plugin - true - - - + + + + org.apache.felix + maven-bundle-plugin + true + + + - - - org.onap.ccsdk.sli.northbound - dataChange-model - - - org.opendaylight.controller - config-api + + + org.onap.ccsdk.sli.northbound + dataChange-model + + + org.opendaylight.controller + config-api - ${odl.controller.config.api.version} - - - org.opendaylight.controller - sal-binding-config - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-binding-api - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-common-util - ${odl.mdsal.version} - - - org.onap.ccsdk.sli.core - sli-common - ${sdnctl.sli.version} - - - org.onap.ccsdk.sli.core - sli-provider - ${sdnctl.sli.version} - - - junit - junit - ${junit.version} - test - - + ${odl.controller.config.api.version} + + + org.opendaylight.controller + sal-binding-config + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-binding-api + ${odl.mdsal.version} + + + org.opendaylight.controller + sal-common-util + ${odl.mdsal.version} + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + + + + org.opendaylight.controller + sal-test-model + ${odl.mdsal.version} + test + + + org.opendaylight.netconf + sal-rest-connector + ${odl.mdsal.version} + test + + + + org.opendaylight.controller + sal-binding-broker-impl + ${odl.mdsal.version} + test + + + org.opendaylight.controller + sal-binding-broker-impl + ${odl.mdsal.version} + test-jar + tests + test + + + junit + junit + ${junit.version} + test + + + org.testng + testng + 6.11 + test + + + org.mockito + mockito-core + ${mockito.version} + test + + diff --git a/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java b/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java new file mode 100644 index 000000000..7855375a3 --- /dev/null +++ b/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java @@ -0,0 +1,95 @@ +/*- + * ============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.sdnc.northbound; + +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.northbound.DataChangeProvider; +import org.onap.ccsdk.sli.northbound.DataChangeClient; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationInput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationOutput; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; + +public class TestDataChange extends AbstractConcurrentDataBrokerTest { + + private DataChangeProvider dataChangeProvider; + private static final Logger LOG = LoggerFactory.getLogger(DataChangeProvider.class); + + @Before + public void setUp() throws Exception { + if (null == dataChangeProvider) { + DataBroker dataBroker = getDataBroker(); + NotificationPublishService mockNotification = mock(NotificationPublishService.class); + RpcProviderRegistry mockRpcRegistry = mock(RpcProviderRegistry.class); + DataChangeClient mockSliClient = mock(DataChangeClient.class); + dataChangeProvider = new DataChangeProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient); + } + } + + //Testcase should return error 503 when No service logic active for dataChange. + @Test + public void testDataChangeNotification() { + + DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder(); + + inputBuilder.setAaiEventId("1"); + + + // TODO: currently initialize SvcLogicServiceClient is failing, need to fix + java.util.concurrent.Future> future = dataChangeProvider + .dataChangeNotification(inputBuilder.build()); + RpcResult rpcResult = null; + try { + rpcResult = future.get(); + } catch (Exception e) { + fail("Error : " + e); + } + LOG.info("result: {}", rpcResult); + assertEquals("503", rpcResult.getResult().getDataChangeResponseCode()); + } + + //Input parameter validation + @Test + public void testDataChangeNotificationInputValidation() { + + java.util.concurrent.Future> future = dataChangeProvider + .dataChangeNotification(null); + RpcResult rpcResult = null; + try { + rpcResult = future.get(); + } catch (Exception e) { + fail("Error : " + e); + } + LOG.info("result: {}", rpcResult); + assertEquals("403", rpcResult.getResult().getDataChangeResponseCode()); + } +} -- cgit 1.2.3-korg From fa9d764ef796f450f5f031a8c2a43ee60ab8b829 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 3 Oct 2017 14:30:51 -0400 Subject: Add ueb-listener unit test Enhance ueb-listener unit test to verify TOSCA parse Change-Id: Iedc675ead3ef69e4fa7151c8c4c500990c0ee6a7 Issue-ID: CCSDK-106 Signed-off-by: Dan Timoney --- .../sli/northbound/asdcapi/TestAsdcApiApi.java | 107 +++++++++++++++++++++ .../sdnc/northbound/asdcapi/TestAsdcApiApi.java | 107 --------------------- ueb-listener/pom.xml | 9 +- .../sli/northbound/uebclient/SdncARModel.java | 14 +-- .../sli/northbound/uebclient/SdncBaseModel.java | 60 ++++++------ .../sli/northbound/uebclient/SdncServiceModel.java | 2 +- .../sli/northbound/uebclient/SdncUebCallback.java | 15 +-- .../northbound/uebclient/SdncUebConfiguration.java | 17 ++-- .../sli/northbound/uebclient/SdncVFModel.java | 16 +-- .../northbound/uebclient/TestSdncUebCallback.java | 35 ++++++- ...t_resources_csars_service-NfodService-csar.csar | Bin 0 -> 38938 bytes ueb-listener/src/test/resources/log4j.properties | 30 ++++++ .../src/test/resources/ueb-listener.properties | 38 ++++---- 13 files changed, 257 insertions(+), 193 deletions(-) create mode 100644 asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java delete mode 100644 asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java create mode 100644 ueb-listener/src/test/resources/incoming/src_test_resources_csars_service-NfodService-csar.csar create mode 100644 ueb-listener/src/test/resources/log4j.properties diff --git a/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java new file mode 100644 index 000000000..f65bbc045 --- /dev/null +++ b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java @@ -0,0 +1,107 @@ +/*- + * ============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.asdcapi; + +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiSliClient; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateOutput; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; + +public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { + + private AsdcApiProvider asdcApiProvider; + private static final Logger LOG = LoggerFactory.getLogger(AsdcApiProvider.class); + + @Before + public void setUp() throws Exception { + if (null == asdcApiProvider) { + DataBroker dataBroker = getDataBroker(); + NotificationPublishService mockNotification = mock(NotificationPublishService.class); + RpcProviderRegistry mockRpcRegistry = mock(RpcProviderRegistry.class); + AsdcApiSliClient mockSliClient = mock(AsdcApiSliClient.class); + asdcApiProvider = new AsdcApiProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient); + } + } + + //Testcase should return error 503 when No service logic active for ASDC-API. + @Test + public void testVfLicenseModelUpdate() { + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); + + inputBuilder.setArtifactName("abc"); + inputBuilder.setArtifactVersion("1"); + + // TODO: currently initialize SvcLogicServiceClient is failing, need to fix + java.util.concurrent.Future> future = asdcApiProvider + .vfLicenseModelUpdate(inputBuilder.build()); + RpcResult rpcResult = null; + try { + rpcResult = future.get(); + } catch (Exception e) { + fail("Error : " + e); + } + LOG.info("result: {}", rpcResult); + assertEquals("503", rpcResult.getResult().getAsdcApiResponseCode()); + } + + //Input parameter validation + @Test + public void testVfLicenseModelUpdateInputValidation() { + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); + + inputBuilder.setArtifactName("abc"); + inputBuilder.setArtifactVersion("1"); + + java.util.concurrent.Future> future = asdcApiProvider + .vfLicenseModelUpdate(null); + assertNull(future); + } + + @Test(expected = IllegalArgumentException.class) + public void testVfLicenseModelUpdateValidation1() { + + VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); + + java.util.concurrent.Future> future = asdcApiProvider + .vfLicenseModelUpdate(inputBuilder.build()); + RpcResult rpcResult = null; + try { + rpcResult = future.get(); + } catch (Exception e) { + fail("Error : " + e); + } + } +} diff --git a/asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java b/asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java deleted file mode 100644 index c78abc8f7..000000000 --- a/asdcApi/provider/src/test/java/org/onap/sdnc/northbound/asdcapi/TestAsdcApiApi.java +++ /dev/null @@ -1,107 +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========================================================= - */ - -package org.onap.sdnc.northbound.asdcapi; - -import org.junit.Before; -import org.junit.Test; -import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; -import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiSliClient; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateOutput; -import org.opendaylight.yangtools.yang.common.RpcResult; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; - -public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { - - private AsdcApiProvider asdcApiProvider; - private static final Logger LOG = LoggerFactory.getLogger(AsdcApiProvider.class); - - @Before - public void setUp() throws Exception { - if (null == asdcApiProvider) { - DataBroker dataBroker = getDataBroker(); - NotificationPublishService mockNotification = mock(NotificationPublishService.class); - RpcProviderRegistry mockRpcRegistry = mock(RpcProviderRegistry.class); - AsdcApiSliClient mockSliClient = mock(AsdcApiSliClient.class); - asdcApiProvider = new AsdcApiProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient); - } - } - - //Testcase should return error 503 when No service logic active for ASDC-API. - @Test - public void testVfLicenseModelUpdate() { - - VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); - - inputBuilder.setArtifactName("abc"); - inputBuilder.setArtifactVersion("1"); - - // TODO: currently initialize SvcLogicServiceClient is failing, need to fix - java.util.concurrent.Future> future = asdcApiProvider - .vfLicenseModelUpdate(inputBuilder.build()); - RpcResult rpcResult = null; - try { - rpcResult = future.get(); - } catch (Exception e) { - fail("Error : " + e); - } - LOG.info("result: {}", rpcResult); - assertEquals("503", rpcResult.getResult().getAsdcApiResponseCode()); - } - - //Input parameter validation - @Test - public void testVfLicenseModelUpdateInputValidation() { - - VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); - - inputBuilder.setArtifactName("abc"); - inputBuilder.setArtifactVersion("1"); - - java.util.concurrent.Future> future = asdcApiProvider - .vfLicenseModelUpdate(null); - assertNull(future); - } - - @Test(expected = IllegalArgumentException.class) - public void testVfLicenseModelUpdateValidation1() { - - VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); - - java.util.concurrent.Future> future = asdcApiProvider - .vfLicenseModelUpdate(inputBuilder.build()); - RpcResult rpcResult = null; - try { - rpcResult = future.get(); - } catch (Exception e) { - fail("Error : " + e); - } - } -} diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index c00395d6e..68d8fc080 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -14,7 +14,8 @@ 0.1.0-SNAPSHOT - 1.1.7-SNAPSHOT + 1.1.32-SNAPSHOT + 1.1.34-SNAPSHOT 2.9.0.pr1 true /opt/app/ueb-listener @@ -31,6 +32,12 @@ ${sdc.client.version} compile + + org.openecomp.sdc.sdc-tosca + sdc-tosca + ${sdc.tosca.version} + compile + org.slf4j slf4j-api 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 75b19cd2e..8d480a4d1 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 @@ -8,9 +8,9 @@ * 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. @@ -23,24 +23,24 @@ package org.onap.ccsdk.sli.northbound.uebclient; import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Metadata; import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.openecomp.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncARModel extends SdncBaseModel { - + private static final Logger LOG = LoggerFactory .getLogger(SdncARModel.class); public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { super(sdcCsarHelper, nodeTemplate); - + // extract metadata - Metadata metadata = nodeTemplate.getMetadata(); + Metadata metadata = nodeTemplate.getMetaData(); addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); - + // extract properties //addParameter("role", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_ROLE)); //addParameter("type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_TYPE)); - wrong location, get from metadata 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 32e51599e..6128f288b 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 @@ -8,9 +8,9 @@ * 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. @@ -27,33 +27,33 @@ import java.util.Map; import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; import org.openecomp.sdc.toscaparser.api.Group; -import org.openecomp.sdc.toscaparser.api.Metadata; import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.openecomp.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncBaseModel { - + private static final Logger LOG = LoggerFactory .getLogger(SdncBaseModel.class); - + protected String customizationUUID = null; protected String invariantUUID = null; - protected String model_yaml = null; - protected String version = null; - + protected String model_yaml = null; + protected String version = null; + protected Map params = null; protected ISdcCsarHelper sdcCsarHelper = null; public SdncBaseModel() { - + } - + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { params = new HashMap<>(); this.sdcCsarHelper = sdcCsarHelper; - + // extract service metadata invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); addParameter("invariant_uuid",invariantUUID); @@ -70,11 +70,11 @@ public class SdncBaseModel { this.sdcCsarHelper = sdcCsarHelper; // extract nodeTemplate metadata - Metadata metadata = nodeTemplate.getMetadata(); + Metadata metadata = nodeTemplate.getMetaData(); customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID)); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) { @@ -86,9 +86,9 @@ public class SdncBaseModel { Metadata metadata = group.getMetadata(); //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID"); - addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); - addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); + addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); + addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); } protected void addParameter (String name, String value) { @@ -102,26 +102,26 @@ public class SdncBaseModel { params.put(name, value); } } - + public static void addIntParameter (String name, String value, Map params) { if (value != null && !value.isEmpty()) { params.put(name, value); } } - + public static void addParameter (String name, String value, Map params) { if (value != null && !value.isEmpty()) { params.put(name, "\"" + value + "\""); } } - + protected String extractValue (Metadata metadata, String name) { String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); if (value != null) { return value; } else { return ""; - } + } } public static String extractValue (ISdcCsarHelper sdcCsarHelper, Metadata metadata, String name) { @@ -130,7 +130,7 @@ public class SdncBaseModel { return value; } else { return ""; - } + } } protected String extractValue (NodeTemplate nodeTemplate, String name) { @@ -241,19 +241,19 @@ public class SdncBaseModel { public void setCustomizationUUID(String customizationUUID) { this.customizationUUID = customizationUUID; } - + public String getSql(String tableName, String model_yaml) { - + StringBuilder sb = new StringBuilder(); sb.append("INSERT into " + tableName + " (customization_uuid, model_yaml, "); - + int paramCount = 0; for (String paramKey : params.keySet()) { paramCount++; sb.append(paramKey); if (paramCount < params.size()) sb.append(", "); } - + sb.append(") values (" + getCustomizationUUID() + ", \"" + model_yaml + "\", "); paramCount = 0; @@ -267,19 +267,19 @@ public class SdncBaseModel { sb.append(");"); return sb.toString(); } - + public static String getSql(String tableName, String keyName, String keyValue, String model_yaml, Map params) { - + StringBuilder sb = new StringBuilder(); sb.append("INSERT into " + tableName + " (" + keyName + ", "); - + int paramCount = 0; for (String paramKey : params.keySet()) { paramCount++; sb.append(paramKey); if (paramCount < params.size()) sb.append(", "); } - + sb.append(") values (" + keyValue + ", "); paramCount = 0; @@ -293,5 +293,5 @@ public class SdncBaseModel { sb.append(");"); return sb.toString(); } - + } 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 3df27be6e..d3fd16791 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 @@ -23,7 +23,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Metadata; +import org.openecomp.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 f00d73724..b3c96d9d8 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 @@ -74,8 +74,8 @@ import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory; import org.openecomp.sdc.toscaparser.api.Group; -import org.openecomp.sdc.toscaparser.api.Metadata; import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.openecomp.sdc.toscaparser.api.elements.Metadata; import org.openecomp.sdc.utils.ArtifactTypeEnum; import org.openecomp.sdc.utils.DistributionActionResultEnum; import org.openecomp.sdc.utils.DistributionStatusEnum; @@ -238,6 +238,8 @@ public class SdncUebCallback implements INotificationCallback { File incomingDir = null; File archiveDir = null; + LOG.debug("IncomingDirName is {}", incomingDirName); + // Process service level artifacts List artifactList = data.getServiceArtifacts(); @@ -298,12 +300,15 @@ public class SdncUebCallback implements INotificationCallback { public void deployDownloadedFiles(File incomingDir, File archiveDir, INotificationData data) { if (incomingDir == null) { + LOG.debug("incomingDir is null - using {}", config.getIncomingDir()); incomingDir = new File(config.getIncomingDir()); if (!incomingDir.exists()) { incomingDir.mkdirs(); } + } else { + LOG.debug("incomingDir is not null - it is {}", incomingDir.getPath()); } if (archiveDir == null) { @@ -315,6 +320,7 @@ public class SdncUebCallback implements INotificationCallback { } String curFileName = ""; + LOG.debug("Scanning {} - {} for downloaded files", incomingDir.getPath(), incomingDir.toPath()); try (DirectoryStream stream = Files.newDirectoryStream(incomingDir.toPath())) { for (Path file: stream) { curFileName = file.toString(); @@ -533,7 +539,6 @@ public class SdncUebCallback implements INotificationCallback { sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath()); } catch (SdcToscaParserException e) { LOG.error("Could not create SDC TOSCA Parser ", e); - factory.close(); return; } @@ -550,7 +555,6 @@ public class SdncUebCallback implements INotificationCallback { insertToscaData(serviceModel.getSql(model_yaml)); } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); - factory.close(); return; } @@ -693,7 +697,7 @@ public class SdncUebCallback implements INotificationCallback { //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid // extract values from the right "VFC" Node - String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetadata(), "customization_uuid") + "\""; + String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetaData(), "customization_uuid") + "\""; SdncBaseModel.addParameter("vm_type", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_VMTYPE), mappingParams); SdncBaseModel.addIntParameter("ipv4_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); SdncBaseModel.addIntParameter("ipv6_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); @@ -712,8 +716,7 @@ public class SdncUebCallback implements INotificationCallback { } // VF loop - // Close ASDC TOSCA Parser factory - we are done processing this distribution - factory.close(); + if ((artifact != null) && (data != null)) { LOG.info("Update to SDN-C succeeded"); 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 d97abacbd..b49a66070 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 @@ -30,7 +30,6 @@ import java.util.List; import java.util.Properties; import org.openecomp.sdc.api.consumer.IConfiguration; -import org.openecomp.sdc.utils.ArtifactTypeEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -162,16 +161,8 @@ public class SdncUebConfiguration implements IConfiguration{ relevantArtifactTypes = new LinkedList<>(); for (String artifactType : artifactTypes) { - try { - if (ArtifactTypeEnum.valueOf(artifactType) != null) { - relevantArtifactTypes.add(artifactType); - } else { - LOG.warn("Skipping unrecognized artifact type {}", artifactType); - } - } catch (Exception e) { - LOG.warn("Caught exception validating artifact type {}", artifactType, e); - } + relevantArtifactTypes.add(artifactType); } @@ -282,7 +273,11 @@ public class SdncUebConfiguration implements IConfiguration{ @Override public boolean isFilterInEmptyResources() { - // TODO Auto-generated method stub + return false; + } + + @Override + public Boolean isUseHttpsWithDmaap() { return false; } 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 deed20cf4..fd71527de 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 @@ -8,9 +8,9 @@ * 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. @@ -23,13 +23,13 @@ package org.onap.ccsdk.sli.northbound.uebclient; import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Metadata; import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.openecomp.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncVFModel extends SdncBaseModel { - + private static final Logger LOG = LoggerFactory .getLogger(SdncVFModel.class); @@ -38,11 +38,11 @@ public class SdncVFModel extends SdncBaseModel { super(sdcCsarHelper, nodeTemplate); // extract metadata - Metadata metadata = nodeTemplate.getMetadata(); + Metadata metadata = nodeTemplate.getMetaData(); addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); - addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR)); - addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); - + addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR)); + addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); + // extract properties addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_ECOMPGENERATEDNAMING)); addParameter("naming_policy", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_NAMINGPOLICY)); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index 93fadc989..609d12011 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -1,15 +1,25 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; + +import java.io.File; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openecomp.sdc.api.IDistributionClient; import org.openecomp.sdc.api.notification.INotificationData; - -import static org.mockito.Mockito.mock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestSdncUebCallback { + + private static final Logger LOG = LoggerFactory + .getLogger(TestSdncUebCallback.class); SdncUebConfiguration config; @Before @@ -17,6 +27,25 @@ public class TestSdncUebCallback { config = new SdncUebConfiguration("src/test/resources"); } + @After + public void tearDown() throws Exception { + // Move anything in archive back to incoming + String curFileName = ""; + + Path incomingPath = new File(config.getIncomingDir()).toPath(); + File archiveDir = new File(config.getArchiveDir()); + try (DirectoryStream stream = Files.newDirectoryStream(archiveDir.toPath())) { + for (Path file: stream) { + Files.move(file, incomingPath.resolve(file.getFileName()), StandardCopyOption.REPLACE_EXISTING); + } + } catch (Exception x) { + // IOException can never be thrown by the iteration. + // In this snippet, it can only be thrown by newDirectoryStream. + LOG.warn("Cannot replace spool file {}", curFileName, x); + } + + } + @Test public void test() { diff --git a/ueb-listener/src/test/resources/incoming/src_test_resources_csars_service-NfodService-csar.csar b/ueb-listener/src/test/resources/incoming/src_test_resources_csars_service-NfodService-csar.csar new file mode 100644 index 000000000..329076a15 Binary files /dev/null and b/ueb-listener/src/test/resources/incoming/src_test_resources_csars_service-NfodService-csar.csar differ diff --git a/ueb-listener/src/test/resources/log4j.properties b/ueb-listener/src/test/resources/log4j.properties new file mode 100644 index 000000000..71849c3db --- /dev/null +++ b/ueb-listener/src/test/resources/log4j.properties @@ -0,0 +1,30 @@ +### +# ============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 + +# CONSOLE is set to be a ConsoleAppender using a PatternLayout. +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.Threshold=DEBUG +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 + + diff --git a/ueb-listener/src/test/resources/ueb-listener.properties b/ueb-listener/src/test/resources/ueb-listener.properties index 7855b2116..548cc4c45 100755 --- a/ueb-listener/src/test/resources/ueb-listener.properties +++ b/ueb-listener/src/test/resources/ueb-listener.properties @@ -1,19 +1,19 @@ -org.openecomp.sdnc.uebclient.asdc-address=localhost:1234 -org.openecomp.sdnc.uebclient.consumer-group=ccsdk1 -org.openecomp.sdnc.uebclient.consumer-id=localhost_ccsdk1 -org.openecomp.sdnc.uebclient.environment-name=UNITTEST -org.openecomp.sdnc.uebclient.password=123456 -org.openecomp.sdnc.uebclient.user=test -org.openecomp.sdnc.uebclient.sdnc-user=test -org.openecomp.sdnc.uebclient.sdnc-passwd=test -org.openecomp.sdnc.uebclient.asdc-api-base-url=http://localhost:8282/restconf/operations/ -org.openecomp.sdnc.uebclient.asdc-api-namespace=org:onap:ccsdk -org.openecomp.sdnc.uebclient.spool.incoming=src/test/resources/incoming -org.openecomp.sdnc.uebclient.spool.archive=src/test/resources/archive -org.openecomp.sdnc.uebclient.polling-interval=30 -org.openecomp.sdnc.uebclient.polling-timeout=15 -org.openecomp.sdnc.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION -org.openecomp.sdnc.uebclient.activate-server-tls-auth=false -org.openecomp.sdnc.uebclient.keystore-path= -org.openecomp.sdnc.uebclient.keystore-password= -org.openecomp.sdnc.uebclient.xslt-path-list=src/main/resources/removeNs.xslt,src/main/resources/normalizeTagNames.xslt +org.onap.ccsdk.sli.northbound.uebclient.asdc-address=localhost:1234 +org.onap.ccsdk.sli.northbound.uebclient.consumer-group=ccsdk1 +org.onap.ccsdk.sli.northbound.uebclient.consumer-id=localhost_ccsdk1 +org.onap.ccsdk.sli.northbound.uebclient.environment-name=UNITTEST +org.onap.ccsdk.sli.northbound.uebclient.password=123456 +org.onap.ccsdk.sli.northbound.uebclient.user=test +org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=test +org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=test +org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url=http://localhost:8282/restconf/operations/ +org.onap.ccsdk.sli.northbound.uebclient.asdc-api-namespace=org:onap:ccsdk +org.onap.ccsdk.sli.northbound.uebclient.spool.incoming=src/test/resources/incoming +org.onap.ccsdk.sli.northbound.uebclient.spool.archive=src/test/resources/archive +org.onap.ccsdk.sli.northbound.uebclient.polling-interval=30 +org.onap.ccsdk.sli.northbound.uebclient.polling-timeout=15 +org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION +org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth=false +org.onap.ccsdk.sli.northbound.uebclient.keystore-path= +org.onap.ccsdk.sli.northbound.uebclient.keystore-password= +org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list= \ No newline at end of file -- cgit 1.2.3-korg From 138a0022b67f9771d69b2c4e82bbce2a054d12cd Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 3 Oct 2017 20:04:32 -0400 Subject: Add ueb-listener test case Add test case for license-model parsing in ueb-listener. Change-Id: I279e269f7ba3c6f37c09f71b99b20d4e9e661e23 Issue-ID: CCSDK-106 Signed-off-by: Dan Timoney --- ueb-listener/src/test/resources/incoming/vf-license-model.xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 ueb-listener/src/test/resources/incoming/vf-license-model.xml diff --git a/ueb-listener/src/test/resources/incoming/vf-license-model.xml b/ueb-listener/src/test/resources/incoming/vf-license-model.xml new file mode 100644 index 000000000..c5e33eeb5 --- /dev/null +++ b/ueb-listener/src/test/resources/incoming/vf-license-model.xml @@ -0,0 +1 @@ +BroadsoftE5A18BC3D2454091B02EA3F69EB1DB46Broadsoft EPtbp200728ad6b0-912e-432b-853e-373845d410adtbpVMAbsolute100Placeholder BS LPKtbpUniversal3be519b2-abf3-449f-9851-0ac70ccb5632tbpVMtbpasdfasfdsdfPlaceholder LPK4ACF252A84FA4FEC9C98AA0DFCFFFBCE \ No newline at end of file -- cgit 1.2.3-korg From 0df357bc4d684d13029d702312995659373fc711 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 3 Oct 2017 20:34:31 -0400 Subject: Improve ueb-listener tests Use Maria4JDB to improve test coverage of ueb-listener. Change-Id: Ifb88916434bb1b293b4bbd6fae069cd1e88c9d8d Issue-ID: CCSDK-106 Signed-off-by: Dan Timoney --- ueb-listener/pom.xml | 8 ++++- .../sli/northbound/uebclient/SdncUebCallback.java | 8 ++++- .../northbound/uebclient/TestSdncUebCallback.java | 35 ++++++++++++++++++++ ueb-listener/src/test/resources/dblib.properties | 38 ++++++++++++++++++++++ 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 ueb-listener/src/test/resources/dblib.properties diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 68d8fc080..2241047f6 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -41,7 +41,7 @@ org.slf4j slf4j-api - 1.7.10 + 1.7.21 org.slf4j @@ -81,6 +81,12 @@ mockito-core ${mockito.version} test + + + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.3 + test org.onap.ccsdk.sli.core 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 b3c96d9d8..2cc08e1ae 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 @@ -207,7 +207,13 @@ public class SdncUebCallback implements INotificationCallback { Properties props = new Properties(); props.load(new FileInputStream(propFile)); - jdbcDataSource = new DBResourceManager(props); + setJdbcDataSource(new DBResourceManager(props)); + + } + + static void setJdbcDataSource(DBResourceManager dbMgr) { + + jdbcDataSource = dbMgr; if(jdbcDataSource.isActive()){ LOG.warn( "DBLIB: JDBC DataSource has been initialized."); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index 609d12011..d62618c6d 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -3,28 +3,60 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.mockito.Mockito.mock; import java.io.File; +import java.io.InputStream; +import java.net.URL; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.util.Properties; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.openecomp.sdc.api.IDistributionClient; import org.openecomp.sdc.api.notification.INotificationData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import ch.vorburger.mariadb4j.DB; +import ch.vorburger.mariadb4j.DBConfigurationBuilder; + public class TestSdncUebCallback { private static final Logger LOG = LoggerFactory .getLogger(TestSdncUebCallback.class); SdncUebConfiguration config; + DBResourceManager dblibSvc; + DB db; @Before public void setUp() throws Exception { config = new SdncUebConfiguration("src/test/resources"); + + URL propUrl = getClass().getResource("/dblib.properties"); + + InputStream propStr = getClass().getResourceAsStream("/dblib.properties"); + + Properties props = new Properties(); + + props.load(propStr); + + + // Start MariaDB4j database + DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder(); + config.setPort(0); // 0 => autom. detect free port + db = DB.newEmbeddedDB(config.build()); + db.start(); + + + // Override jdbc URL and database name + props.setProperty("org.onap.ccsdk.sli.jdbc.database", "test"); + props.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test")); + + + dblibSvc = new DBResourceManager(props); } @After @@ -44,6 +76,8 @@ public class TestSdncUebCallback { LOG.warn("Cannot replace spool file {}", curFileName, x); } + db.stop(); + } @Test @@ -51,6 +85,7 @@ public class TestSdncUebCallback { IDistributionClient iDistClient = mock(IDistributionClient.class); SdncUebCallback cb = new SdncUebCallback(iDistClient, config); + cb.setJdbcDataSource(dblibSvc); INotificationData iData = mock(INotificationData.class); cb.activateCallback(iData); diff --git a/ueb-listener/src/test/resources/dblib.properties b/ueb-listener/src/test/resources/dblib.properties new file mode 100644 index 000000000..9506ac8d1 --- /dev/null +++ b/ueb-listener/src/test/resources/dblib.properties @@ -0,0 +1,38 @@ +### +# ============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========================================================= +### + +# dblib.properrties +org.onap.ccsdk.sli.dbtype=jdbc + +org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01 +org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl +org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver +org.onap.ccsdk.sli.jdbc.database=sdnctl +org.onap.ccsdk.sli.jdbc.user=sdnctl +org.onap.ccsdk.sli.jdbc.password=gamma +org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01 +org.onap.ccsdk.sli.jdbc.connection.timeout=50 +org.onap.ccsdk.sli.jdbc.request.timeout=100 +org.onap.ccsdk.sli.jdbc.limit.init=10 +org.onap.ccsdk.sli.jdbc.limit.min=10 +org.onap.ccsdk.sli.jdbc.limit.max=20 +org.onap.dblib.connection.recovery=false + -- cgit 1.2.3-korg From 70eb2ae5c2f87511a34aeab170b13a7d3bdae66a Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 4 Oct 2017 16:58:38 -0400 Subject: Test TOSCA table insertion Add code to create TOSCA tables in test driver to test TOSCA table insertion in ueb-listener TOSCA parser test. Change-Id: Ib8c3fcdb25fbdba39b4700553d8c01b684efa384 Issue-ID: CCSDK-102 Signed-off-by: Dan Timoney --- .../sli/northbound/uebclient/SdncArtifactMap.java | 6 +- .../sli/northbound/uebclient/SdncUebCallback.java | 2 +- .../northbound/uebclient/SdncUebConfiguration.java | 3 + .../northbound/uebclient/TestSdncUebCallback.java | 129 +++++++++++++++++++++ ueb-listener/src/test/resources/artifact.map | 2 + .../src/test/resources/ueb-listener.properties | 3 +- version.properties | 4 +- 7 files changed, 143 insertions(+), 6 deletions(-) create mode 100644 ueb-listener/src/test/resources/artifact.map 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 3605465d4..671d47a9f 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 @@ -8,9 +8,9 @@ * 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. @@ -104,6 +104,8 @@ public class SdncArtifactMap { LOG.error("Caught exception reading artifact map", e); return; } + } else { + LOG.info("Artifact map {} does not exist or is not readable", fileName); } } 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 2cc08e1ae..67e042b5d 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 @@ -561,7 +561,7 @@ public class SdncUebCallback implements INotificationCallback { insertToscaData(serviceModel.getSql(model_yaml)); } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); - return; + // return; } // Ingest Network (VL) Data - 1707 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 b49a66070..75cb9c971 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 @@ -177,7 +177,10 @@ public class SdncUebConfiguration implements IConfiguration{ String artifactMapFile = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.artifact-map"); if (artifactMapFile != null) { + LOG.info("Loading artifactMapFile {}", artifactMapFile); artifactMap.load(artifactMapFile); + } else { + LOG.warn("artifact-map is unset"); } } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index d62618c6d..79a598ce5 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -25,6 +25,125 @@ import ch.vorburger.mariadb4j.DBConfigurationBuilder; public class TestSdncUebCallback { + + private static final String CRTBL_SERVICE_MODEL = "CREATE TABLE `SERVICE_MODEL` (\n" + + " `service_uuid` varchar(255) NOT NULL,\n" + + " `model_yaml` longblob,\n" + + " `invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " `name` varchar(255) DEFAULT NULL,\n" + + " `description` varchar(1024) DEFAULT NULL,\n" + + " `type` varchar(255) DEFAULT NULL,\n" + + " `category` varchar(255) DEFAULT NULL,\n" + + " `ecomp_naming` char(1) DEFAULT NULL,\n" + + " `service_instance_name_prefix` varchar(255) DEFAULT NULL,\n" + + " `filename` varchar(100) DEFAULT NULL,\n" + + " `naming_policy` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`service_uuid`)\n" + + ") "; + + private static final String CRTBL_NETWORK_MODEL = "CREATE TABLE `NETWORK_MODEL` (\n" + + " `customization_uuid` varchar(255) NOT NULL,\n" + + " `service_uuid` varchar(255) NOT NULL,\n" + + " `model_yaml` longblob,\n" + + " `invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " `uuid` varchar(255) DEFAULT NULL,\n" + + " `network_type` varchar(255) DEFAULT NULL,\n" + + " `network_role` varchar(255) DEFAULT NULL,\n" + + " `network_technology` varchar(255) DEFAULT NULL,\n" + + " `network_scope` varchar(255) DEFAULT NULL,\n" + + " `naming_policy` varchar(255) DEFAULT NULL,\n" + + " `ecomp_generated_naming` char(1) DEFAULT NULL,\n" + + " `is_shared_network` char(1) DEFAULT NULL,\n" + + " `is_external_network` char(1) DEFAULT NULL,\n" + + " `is_provider_network` char(1) DEFAULT NULL,\n" + + " `physical_network_name` varchar(255) DEFAULT NULL,\n" + + " `is_bound_to_vpn` char(1) DEFAULT NULL,\n" + + " `vpn_binding` varchar(255) DEFAULT NULL,\n" + + " `use_ipv4` char(1) DEFAULT NULL,\n" + + " `ipv4_dhcp_enabled` char(1) DEFAULT NULL,\n" + + " `ipv4_ip_version` char(1) DEFAULT NULL,\n" + + " `ipv4_cidr_mask` varchar(255) DEFAULT NULL,\n" + + " `eipam_v4_address_plan` varchar(255) DEFAULT NULL,\n" + + " `use_ipv6` char(1) DEFAULT NULL,\n" + + " `ipv6_dhcp_enabled` char(1) DEFAULT NULL,\n" + + " `ipv6_ip_version` char(1) DEFAULT NULL,\n" + + " `ipv6_cidr_mask` varchar(255) DEFAULT NULL,\n" + + " `eipam_v6_address_plan` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`customization_uuid`),\n" + + " KEY `FK_NETWORK_MODEL` (`service_uuid`),\n" + + " CONSTRAINT `FK_NETWORK_MODEL` FOREIGN KEY (`service_uuid`) REFERENCES `SERVICE_MODEL` (`service_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION\n" + + ")"; + + private static final String CRTBL_ALLOTTED_RESOURCE_MODEL = "CREATE TABLE `ALLOTTED_RESOURCE_MODEL` (\n" + + " `customization_uuid` varchar(255) NOT NULL,\n" + + " `model_yaml` longblob,\n" + + " `invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " `uuid` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " `naming_policy` varchar(255) DEFAULT NULL,\n" + + " `ecomp_generated_naming` char(1) DEFAULT NULL,\n" + + " `depending_service` varchar(255) DEFAULT NULL,\n" + + " `role` varchar(255) DEFAULT NULL,\n" + + " `type` varchar(255) DEFAULT NULL,\n" + + " `service_dependency` varchar(255) DEFAULT NULL,\n" + + " `allotted_resource_type` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`customization_uuid`)\n" + + ") "; + + private static final String CRTBL_VFC_MODEL = "CREATE TABLE `VFC_MODEL` (\n" + + " `customization_uuid` varchar(255) NOT NULL,\n" + + " `model_yaml` longblob,\n" + + " `invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " `uuid` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " `naming_policy` varchar(255) DEFAULT NULL,\n" + + " `ecomp_generated_naming` char(1) DEFAULT NULL,\n" + + " `nfc_function` varchar(255) DEFAULT NULL,\n" + + " `nfc_naming_code` varchar(255) DEFAULT NULL,\n" + + " `vm_type` varchar(255) DEFAULT NULL,\n" + + " `vm_type_tag` varchar(255) DEFAULT NULL,\n" + + " `vm_image_name` varchar(255) DEFAULT NULL,\n" + + " `vm_flavor_name` varchar(255) DEFAULT NULL,\n" + + " `high_availability` varchar(255) DEFAULT NULL,\n" + + " `nfc_naming` varchar(255) DEFAULT NULL,\n" + + " `min_instances` int(11) DEFAULT NULL,\n" + + " `max_instances` int(11) DEFAULT NULL,\n" + + " PRIMARY KEY (`customization_uuid`)\n" + + ") "; + + private static final String CRTBL_VF_MODEL = "CREATE TABLE `VF_MODEL` (\n" + + " `customization_uuid` varchar(255) NOT NULL,\n" + + " `model_yaml` longblob,\n" + + " `invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " `uuid` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " `name` varchar(255) DEFAULT NULL,\n" + + " `naming_policy` varchar(255) DEFAULT NULL,\n" + + " `ecomp_generated_naming` char(1) DEFAULT NULL,\n" + + " `avail_zone_max_count` int(11) DEFAULT NULL,\n" + + " `nf_function` varchar(255) DEFAULT NULL,\n" + + " `nf_code` varchar(255) DEFAULT NULL,\n" + + " `nf_type` varchar(255) DEFAULT NULL,\n" + + " `nf_role` varchar(255) DEFAULT NULL,\n" + + " `vendor` varchar(255) DEFAULT NULL,\n" + + " `vendor_version` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`customization_uuid`)\n" + + ")"; + + private static final String CRTBL_VF_MODULE_MODEL = "CREATE TABLE `VF_MODULE_MODEL` (\n" + + " `customization_uuid` varchar(255) NOT NULL,\n" + + " `model_yaml` longblob,\n" + + " `invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " `uuid` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " `vf_module_type` varchar(255) DEFAULT NULL,\n" + + " `availability_zone_count` int(11) DEFAULT NULL,\n" + + " `ecomp_generated_vm_assignments` char(1) DEFAULT NULL,\n" + + " PRIMARY KEY (`customization_uuid`)\n" + + ")"; + private static final Logger LOG = LoggerFactory .getLogger(TestSdncUebCallback.class); SdncUebConfiguration config; @@ -35,6 +154,7 @@ public class TestSdncUebCallback { public void setUp() throws Exception { config = new SdncUebConfiguration("src/test/resources"); + URL propUrl = getClass().getResource("/dblib.properties"); InputStream propStr = getClass().getResourceAsStream("/dblib.properties"); @@ -56,7 +176,16 @@ public class TestSdncUebCallback { props.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test")); + // Create dblib connection dblibSvc = new DBResourceManager(props); + + // Create TOSCA tables + dblibSvc.writeData(CRTBL_SERVICE_MODEL, null, null); + dblibSvc.writeData(CRTBL_NETWORK_MODEL, null, null); + dblibSvc.writeData(CRTBL_VFC_MODEL, null, null); + dblibSvc.writeData(CRTBL_VF_MODEL, null, null); + dblibSvc.writeData(CRTBL_VF_MODULE_MODEL, null, null); + dblibSvc.writeData(CRTBL_ALLOTTED_RESOURCE_MODEL, null, null); } @After diff --git a/ueb-listener/src/test/resources/artifact.map b/ueb-listener/src/test/resources/artifact.map new file mode 100644 index 000000000..0256515f0 --- /dev/null +++ b/ueb-listener/src/test/resources/artifact.map @@ -0,0 +1,2 @@ +vf-license-model,ASDC-API:vf-license-model-update,0 +bad-entry,0 diff --git a/ueb-listener/src/test/resources/ueb-listener.properties b/ueb-listener/src/test/resources/ueb-listener.properties index 548cc4c45..4b9886ee5 100755 --- a/ueb-listener/src/test/resources/ueb-listener.properties +++ b/ueb-listener/src/test/resources/ueb-listener.properties @@ -16,4 +16,5 @@ org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types=YANG_XML,VF_LICE org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth=false org.onap.ccsdk.sli.northbound.uebclient.keystore-path= org.onap.ccsdk.sli.northbound.uebclient.keystore-password= -org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list= \ No newline at end of file +org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list= +org.onap.ccsdk.sli.northbound.uebclient.artifact-map=src/test/resources/artifact.map \ No newline at end of file diff --git a/version.properties b/version.properties index 709250395..3d3e5b582 100644 --- a/version.properties +++ b/version.properties @@ -4,8 +4,8 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=0 -feature_revision=1 +sprint_number=1 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 905f1d2016e8bc4d02a801017a31b20c4eb2119e Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 5 Oct 2017 15:20:33 +0530 Subject: Add a test for SdncJsonDmaapConsumer *Add a unit test in sli/northbound module This Test checks whether an InvalidMessageException is thrown when null is passed to processMsg method Issue-Id: CCSDK-106 Change-Id: I52327377f4582d8c24cef87f0360b977f2f216fc Signed-off-by: surya-huawei --- .../dmaapclient/TestSdncJsonDmaapConsumer.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java new file mode 100644 index 000000000..0d65231da --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java @@ -0,0 +1,22 @@ +/* + * 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 org.junit.Test; + +public class TestSdncJsonDmaapConsumer { + private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; + private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources"; + + @Test(expected = InvalidMessageException.class) + public void testProcessMsg_shouldThrowException() throws Exception { + SdncFlatJsonDmaapConsumer consumer = new SdncFlatJsonDmaapConsumer(); + consumer.processMsg(null); + } +} -- cgit 1.2.3-korg From 1aab3d043fca73edbdb5da1972a947d92ce85a77 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 5 Oct 2017 15:49:13 +0530 Subject: Add a test for DummyDmaapConsumer *Add a unit test in sli/northbound module This is to improve code coverage of DummyDmaapConsumer class Issue-Id: CCSDK-106 Change-Id: Iecd4970a0cd82c94a219b1a2e861fcc3da11f23c Signed-off-by: surya-huawei --- .../dmaapclient/TestDummyDmaapConsumer.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDummyDmaapConsumer.java diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDummyDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDummyDmaapConsumer.java new file mode 100644 index 000000000..47330c622 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDummyDmaapConsumer.java @@ -0,0 +1,26 @@ +/* + * 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 org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class TestDummyDmaapConsumer { + private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; + private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources"; + + DummyDmaapConsumer consumer = new DummyDmaapConsumer(); + + @Test + public void testProcessMsg(){ + consumer.processMsg(null); + } + +} -- cgit 1.2.3-korg From 73d1bd7ab120c112f0febbcfa5b549be7e9754ea Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Mon, 9 Oct 2017 10:02:22 -0400 Subject: Add retry to ueb-listener Added retry mechanism to ueb-listener to handle case where ueb-listener comes up before DMaap or SDC. Change-Id: I0d96bd1fe4d3d0fdb5e01d9f42304b54bea0a550 Issue-ID: CCSDK-112 Signed-off-by: Dan Timoney --- ueb-listener/src/assembly/assemble_zip.xml | 6 ++-- .../sli/northbound/uebclient/SdncUebClient.java | 35 +++++++++++++++++++--- .../northbound/uebclient/SdncUebConfiguration.java | 13 ++++++++ .../src/test/resources/ueb-listener.properties | 1 + 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/ueb-listener/src/assembly/assemble_zip.xml b/ueb-listener/src/assembly/assemble_zip.xml index 97a229d2c..7a21aca48 100644 --- a/ueb-listener/src/assembly/assemble_zip.xml +++ b/ueb-listener/src/assembly/assemble_zip.xml @@ -8,9 +8,9 @@ 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. @@ -34,7 +34,7 @@ - src/main/bin + src/main/scripts bin 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 d29890486..1d1f47634 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 @@ -39,6 +39,7 @@ public class SdncUebClient { SdncUebCallback cb = new SdncUebCallback(client, config); + LOG.info("Scanning for local distribution artifacts before starting client"); cb.deployDownloadedFiles(null, null, null); @@ -48,13 +49,39 @@ public class SdncUebClient { LOG.info("Initialized ASDC distribution client - results = {}", result.getDistributionMessageResult()); - if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { - LOG.info("Starting client..."); - IDistributionClientResult start = client.start(); - LOG.info("Client startup result = {}", start.getDistributionMessageResult()); + long startTm = System.currentTimeMillis(); + int sleepTm = config.getPollingInterval() * 1000; + long maxWaitTm = config.getClientStartupTimeout() * 1000; + + boolean keepWaiting = true; + + while (keepWaiting) { + if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { + LOG.info("Starting client..."); + try { + IDistributionClientResult start = client.start(); + LOG.info("Client startup result = {}", start.getDistributionMessageResult()); + keepWaiting = false; + } catch(Exception e) { + LOG.info("Client startup failure", e); + } + + if (System.currentTimeMillis() - startTm < maxWaitTm) { + keepWaiting = false; + } else { + + try { + Thread.sleep(sleepTm); + } catch (InterruptedException e) { + // Ignore + } + } + } + } + } } 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 75cb9c971..bf7dc88a5 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 @@ -46,6 +46,7 @@ public class SdncUebConfiguration implements IConfiguration{ private String password = null; private int pollingInterval = 30; private int pollingTimeout = 15; + private int clientStartupTimeout = 900; private List relevantArtifactTypes = null; private String user = null; @@ -154,6 +155,14 @@ public class SdncUebConfiguration implements IConfiguration{ } } + curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.client-startup-timeout"); + if ((curval != null) && (curval.length() > 0)) { + try { + clientStartupTimeout = Integer.parseInt(curval); + } catch (Exception e) { + LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-timeout ({}) ", curval, e); + } + } curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types"); if ((curval != null) && (curval.length() > 0)) { String[] artifactTypes = curval.split(","); @@ -225,6 +234,10 @@ public class SdncUebConfiguration implements IConfiguration{ return relevantArtifactTypes; } + public int getClientStartupTimeout() { + return clientStartupTimeout; + } + @Override public String getUser() { return user; diff --git a/ueb-listener/src/test/resources/ueb-listener.properties b/ueb-listener/src/test/resources/ueb-listener.properties index 4b9886ee5..35c380595 100755 --- a/ueb-listener/src/test/resources/ueb-listener.properties +++ b/ueb-listener/src/test/resources/ueb-listener.properties @@ -12,6 +12,7 @@ org.onap.ccsdk.sli.northbound.uebclient.spool.incoming=src/test/resources/incomi org.onap.ccsdk.sli.northbound.uebclient.spool.archive=src/test/resources/archive org.onap.ccsdk.sli.northbound.uebclient.polling-interval=30 org.onap.ccsdk.sli.northbound.uebclient.polling-timeout=15 +org.onap.ccsdk.sli.northbound.uebclient.client-startup-timeout=60 org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth=false org.onap.ccsdk.sli.northbound.uebclient.keystore-path= -- cgit 1.2.3-korg From 806de96eefaaf8ad6685a2c24b7dea03eb629ba2 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 12 Oct 2017 12:17:55 +0530 Subject: Remove IOException in method declaration *This is done because IOException cannot be thrown from the method and is hence superflous Issue-Id: CCSDK-117 Change-Id: I0712cfbf610f815e76ed33b0039ecb5e3cc7bbbe Signed-off-by: surya-huawei --- .../org/onap/ccsdk/sli/northbound/dmaapclient/SdncOdlConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f88f7bf8c..6eeef9b48 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 @@ -83,7 +83,7 @@ public class SdncOdlConnection { } } - public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException { + public static SdncOdlConnection newInstance(String url, String user, String password) { return new SdncOdlConnection(url, user, password); } -- cgit 1.2.3-korg From adef520003cc54ae60fc62154df8caacb0610243 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 12 Oct 2017 09:04:22 -0400 Subject: Add readthedocs documentation for sli/northbound Add readthedocs documentation for sli/northbound. Change-Id: I8ca9d7e839408094ab3754500d71fe7463f0b0e4 Issue-ID: CCSDK-107 Signed-off-by: Dan Timoney --- asdcApi/model/pom.xml | 165 +- .../src/main/resources/asdc-api.20170201.json | 3415 ++++++++++++++++++++ dataChange/model/pom.xml | 165 +- .../src/main/resources/dataChange.20150519.json | 136 + docs/apis/asdcApi.rst | 15 + docs/apis/dataChange.rst | 15 + docs/architecture.rst | 12 + docs/build.rst | 18 + docs/index.rst | 9 +- docs/logging.rst | 14 + docs/nodes.rst | 1031 ++++++ docs/offeredapis.rst | 13 + docs/release-notes.rst | 45 + 13 files changed, 4897 insertions(+), 156 deletions(-) create mode 100644 asdcApi/model/src/main/resources/asdc-api.20170201.json create mode 100644 dataChange/model/src/main/resources/dataChange.20150519.json create mode 100644 docs/apis/asdcApi.rst create mode 100644 docs/apis/dataChange.rst create mode 100644 docs/architecture.rst create mode 100644 docs/build.rst create mode 100644 docs/logging.rst create mode 100644 docs/nodes.rst create mode 100644 docs/offeredapis.rst create mode 100644 docs/release-notes.rst diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 327b8627e..3665e4fab 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -1,81 +1,92 @@ - - 4.0.0 - - asdcApi - org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT - - org.onap.ccsdk.sli.northbound - asdcApi-model - 0.1.0-SNAPSHOT - bundle + + 4.0.0 + + asdcApi + org.onap.ccsdk.sli.northbound + 0.1.0-SNAPSHOT + + org.onap.ccsdk.sli.northbound + asdcApi-model + 0.1.0-SNAPSHOT + bundle - + - - - org.apache.felix - maven-bundle-plugin - true - - - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - - - - generate-sources - - - ${yang.file.directory} - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - true - - - - - - - - - org.opendaylight.mdsal - yang-binding - ${odl.mdsal.yang.binding.version} - - - org.opendaylight.yangtools - yang-common - ${odl.yangtools.version} - - - org.opendaylight.mdsal.model - ietf-inet-types - ${odl.ietf-inet-types.version} - - - org.opendaylight.mdsal.model - ietf-yang-types - ${odl.ietf-yang-types.version} - - + + + org.apache.felix + maven-bundle-plugin + true + + + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${odl.yangtools.yang.maven.plugin.version} + + + org.opendaylight.mdsal + maven-sal-api-gen-plugin + ${odl.sal.api.gen.plugin.version} + jar + + + org.opendaylight.netconf + sal-rest-docgen-maven + ${odl.restconf.version} + jar + + + + + + generate-sources + + + ${yang.file.directory} + + + org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.netconf.sal.rest.doc.maven.StaticDocGenerator + target/swagger + + + true + + + + + + + + + org.opendaylight.mdsal + yang-binding + ${odl.mdsal.yang.binding.version} + + + org.opendaylight.yangtools + yang-common + ${odl.yangtools.version} + + + org.opendaylight.mdsal.model + ietf-inet-types + ${odl.ietf-inet-types.version} + + + org.opendaylight.mdsal.model + ietf-yang-types + ${odl.ietf-yang-types.version} + + diff --git a/asdcApi/model/src/main/resources/asdc-api.20170201.json b/asdcApi/model/src/main/resources/asdc-api.20170201.json new file mode 100644 index 000000000..c82c75159 --- /dev/null +++ b/asdcApi/model/src/main/resources/asdc-api.20170201.json @@ -0,0 +1,3415 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0" + }, + "basePath": "/restconf", + "paths": { + "/config": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "**(config)artifacts", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API(config)artifacts-TOP" + } + }, + { + "in": "body", + "name": "**(config)vf-license-model-versions", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API(config)vf-license-model-versions-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)ASDC-API_modulePOST" + } + } + }, + "description": "SDC Interface", + "operationId": "POST-ASDC-API_module" + } + }, + "/config/ASDC-API:artifacts": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "operationId": "DELETE-artifacts" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)artifacts" + } + } + }, + "operationId": "GET-artifacts" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "**(config)artifact", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/artifacts(config)artifact-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)artifactsPOST" + } + } + }, + "operationId": "POST-artifacts" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "(config)artifacts", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API(config)artifacts-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API(config)artifacts-TOP" + } + } + }, + "operationId": "PUT-artifacts" + } + }, + "/config/ASDC-API:artifacts/artifact/{artifact-name}/{artifact-version}": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Name of artifact", + "in": "path", + "name": "artifact-name", + "required": true, + "type": "string" + }, + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "operationId": "DELETE-artifact" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Name of artifact", + "in": "path", + "name": "artifact-name", + "required": true, + "type": "string" + }, + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)artifact" + } + } + }, + "operationId": "GET-artifact" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Name of artifact", + "in": "path", + "name": "artifact-name", + "required": true, + "type": "string" + }, + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)artifact", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/artifacts(config)artifact-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/artifacts(config)artifact-TOP" + } + } + }, + "operationId": "PUT-artifact" + } + }, + "/config/ASDC-API:vf-license-model-versions": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "operationId": "DELETE-vf-license-model-versions" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)vf-license-model-versions" + } + } + }, + "operationId": "GET-vf-license-model-versions" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "**(config)vf-license-model-version", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions(config)vf-license-model-version-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)vf-license-model-versionsPOST" + } + } + }, + "operationId": "POST-vf-license-model-versions" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "(config)vf-license-model-versions", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API(config)vf-license-model-versions-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API(config)vf-license-model-versions-TOP" + } + } + }, + "operationId": "PUT-vf-license-model-versions" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "operationId": "DELETE-vf-license-model-version" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)vf-license-model-version" + } + } + }, + "operationId": "GET-vf-license-model-version" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)vf-license-model", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)vf-license-model-versionPOST" + } + } + }, + "operationId": "POST-vf-license-model-version" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)vf-license-model-version", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions(config)vf-license-model-version-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions(config)vf-license-model-version-TOP" + } + } + }, + "operationId": "PUT-vf-license-model-version" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-vf-license-model" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)vf-license-model" + } + } + }, + "description": "xxxx", + "operationId": "GET-vf-license-model" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)feature-group-list", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model(config)feature-group-list-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)vf-license-modelPOST" + } + } + }, + "description": "xxxx", + "operationId": "POST-vf-license-model" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)vf-license-model", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-vf-license-model" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-feature-group-list" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)feature-group-list" + } + } + }, + "description": "xxxx", + "operationId": "GET-feature-group-list" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)feature-group", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)feature-group-listPOST" + } + } + }, + "description": "xxxx", + "operationId": "POST-feature-group-list" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)feature-group-list", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model(config)feature-group-list-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model(config)feature-group-list-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-feature-group-list" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-feature-group" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)feature-group" + } + } + }, + "description": "xxxx", + "operationId": "GET-feature-group" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)license-key-group-list", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)license-key-group-list-TOP" + } + }, + { + "in": "body", + "name": "**(config)entitlement-pool-list", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)feature-groupPOST" + } + } + }, + "description": "xxxx", + "operationId": "POST-feature-group" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)feature-group", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-feature-group" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/entitlement-pool-list": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-entitlement-pool-list" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)entitlement-pool-list" + } + } + }, + "description": "xxxx", + "operationId": "GET-entitlement-pool-list" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)entitlement-pool", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)entitlement-pool-listPOST" + } + } + }, + "description": "xxxx", + "operationId": "POST-entitlement-pool-list" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)entitlement-pool-list", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-entitlement-pool-list" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-entitlement-pool" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)entitlement-pool" + } + } + }, + "description": "xxxx", + "operationId": "GET-entitlement-pool" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)time", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time-TOP" + } + }, + { + "in": "body", + "name": "**(config)operational-scope", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope-TOP" + } + }, + { + "in": "body", + "name": "**(config)threshold-value", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value-TOP" + } + }, + { + "in": "body", + "name": "**(config)entitlement-metric", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric-TOP" + } + }, + { + "in": "body", + "name": "**(config)aggregation-function", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)entitlement-poolPOST" + } + } + }, + "description": "xxxx", + "operationId": "POST-entitlement-pool" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)entitlement-pool", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-entitlement-pool" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool/aggregation-function": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-aggregation-function" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)aggregation-function" + } + } + }, + "description": "xxxx", + "operationId": "GET-aggregation-function" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)aggregation-function", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-aggregation-function" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool/entitlement-metric": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-entitlement-metric" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)entitlement-metric" + } + } + }, + "description": "xxxx", + "operationId": "GET-entitlement-metric" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)entitlement-metric", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-entitlement-metric" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool/operational-scope": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-operational-scope" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)operational-scope" + } + } + }, + "description": "xxxx", + "operationId": "GET-operational-scope" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)operational-scope", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-operational-scope" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool/threshold-value": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-threshold-value" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)threshold-value" + } + } + }, + "description": "xxxx", + "operationId": "GET-threshold-value" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)threshold-value", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-threshold-value" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool/time": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-time" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)time" + } + } + }, + "description": "xxxx", + "operationId": "GET-time" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)time", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-time" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/license-key-group-list": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-license-key-group-list" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)license-key-group-list" + } + } + }, + "description": "xxxx", + "operationId": "GET-license-key-group-list" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)license-key-group", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)license-key-group-listPOST" + } + } + }, + "description": "xxxx", + "operationId": "POST-license-key-group-list" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)license-key-group-list", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)license-key-group-list-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)license-key-group-list-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-license-key-group-list" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-license-key-group" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)license-key-group" + } + } + }, + "description": "xxxx", + "operationId": "GET-license-key-group" + }, + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "**(config)operational-scope", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)license-key-groupPOST" + } + } + }, + "description": "xxxx", + "operationId": "POST-license-key-group" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)license-key-group", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-license-key-group" + } + }, + "/config/ASDC-API:vf-license-model-versions/vf-license-model-version/{artifact-version}/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group/operational-scope": { + "delete": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified" + } + }, + "description": "xxxx", + "operationId": "DELETE-operational-scope" + }, + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config)operational-scope" + } + } + }, + "description": "xxxx", + "operationId": "GET-operational-scope" + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "description": "Version of artifact", + "in": "path", + "name": "artifact-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "(config)operational-scope", + "required": false, + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope-TOP" + } + } + }, + "description": "xxxx", + "operationId": "PUT-operational-scope" + } + }, + "/operational/ASDC-API:artifacts": { + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(operational)artifacts" + } + } + }, + "operationId": "GET-artifacts" + } + }, + "/operational/ASDC-API:vf-license-model-versions": { + "get": { + "produces": [ + "application/json", + "application/xml" + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(operational)vf-license-model-versions" + } + } + }, + "operationId": "GET-vf-license-model-versions" + } + }, + "/operations/ASDC-API:vf-license-model-update": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(vf-license-model-update)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(vf-license-model-update)output-TOP" + } + } + }, + "operationId": "vf-license-model-update" + } + } + }, + "definitions": { + "(config)ASDC-API_modulePOST": { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/ASDC-API(config)artifacts" + }, + "type": "object" + }, + "vf-license-model-versions": { + "items": { + "$ref": "#/definitions/ASDC-API(config)vf-license-model-versions" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config)aggregation-functionPOST": { + "properties": { + "other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "value": { + "$ref": "#/definitions/Peak", + "description": "xxxx", + "enum": [ + "Peak", + "Average", + "Other" + ] + } + }, + "type": "object" + }, + "(config)artifactPOST": { + "properties": { + "artifact-name": { + "$ref": "#/definitions/Some artifact-name", + "description": "Name of artifact" + }, + "artifact-version": { + "$ref": "#/definitions/Some artifact-version", + "description": "Version of artifact" + } + }, + "type": "object" + }, + "(config)artifactsPOST": { + "properties": { + "artifact": { + "items": { + "$ref": "#/definitions/ASDC-API/artifacts(config)artifact" + }, + "type": "array" + } + }, + "type": "object" + }, + "(config)entitlement-metricPOST": { + "properties": { + "other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "value": { + "$ref": "#/definitions/Software_Instances_Count", + "description": "xxxx", + "enum": [ + "Software_Instances_Count", + "CPU", + "Core", + "Trunks", + "User", + "Subscribers", + "Tenants", + "Tokens", + "Seats", + "Units_TB", + "Units_GB", + "Units_MB", + "Other" + ] + } + }, + "type": "object" + }, + "(config)entitlement-pool-listPOST": { + "properties": { + "entitlement-pool": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool" + }, + "type": "array" + } + }, + "type": "object" + }, + "(config)entitlement-poolPOST": { + "properties": { + "aggregation-function": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function" + }, + "type": "object" + }, + "description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "entitlement-metric": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric" + }, + "type": "object" + }, + "entitlement-pool-uuid": { + "$ref": "#/definitions/Some entitlement-pool-uuid", + "description": "xxxx" + }, + "increments": { + "$ref": "#/definitions/Some increments", + "description": "xxxx" + }, + "manufacturer-reference-number": { + "$ref": "#/definitions/Some manufacturer-reference-number", + "description": "xxxx" + }, + "name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + }, + "operational-scope": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope" + }, + "type": "object" + }, + "threshold-value": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value" + }, + "type": "object" + }, + "time": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config)feature-group-listPOST": { + "properties": { + "feature-group": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list(config)feature-group" + }, + "type": "array" + } + }, + "type": "object" + }, + "(config)feature-groupPOST": { + "properties": { + "att-part-number": { + "$ref": "#/definitions/Some att-part-number", + "description": "xxxx" + }, + "description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "entitlement-pool-list": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list" + }, + "type": "object" + }, + "feature-group-uuid": { + "$ref": "#/definitions/Some feature-group-uuid", + "description": "xxxx" + }, + "license-key-group-list": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group(config)license-key-group-list" + }, + "type": "object" + }, + "name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + } + }, + "type": "object" + }, + "(config)license-key-group-listPOST": { + "properties": { + "license-key-group": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group" + }, + "type": "array" + }, + "name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + } + }, + "type": "object" + }, + "(config)license-key-groupPOST": { + "properties": { + "description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "license-key-group-uuid": { + "$ref": "#/definitions/Some license-key-group-uuid", + "description": "xxxx" + }, + "name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + }, + "operational-scope": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope" + }, + "type": "object" + }, + "type": { + "$ref": "#/definitions/Universal", + "description": "xxxx", + "enum": [ + "Universal", + "Unique", + "One_Time" + ] + } + }, + "type": "object" + }, + "(config)operational-scopePOST": { + "properties": { + "other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "value": { + "$ref": "#/definitions/Network_Wide", + "description": "xxxx", + "enum": [ + "Network_Wide", + "Availability_Zone", + "Data_Center", + "Tenant", + "VM", + "CPU", + "Core", + "Other" + ] + } + }, + "type": "object" + }, + "(config)threshold-valuePOST": { + "properties": { + "unit": { + "$ref": "#/definitions/Absolute", + "description": "xxxx", + "enum": [ + "Absolute", + "Percentage" + ] + }, + "value": { + "$ref": "#/definitions/0", + "description": "xxxx" + } + }, + "type": "object" + }, + "(config)timePOST": { + "properties": { + "other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "value": { + "$ref": "#/definitions/Hour", + "description": "xxxx", + "enum": [ + "Hour", + "Day", + "Month", + "Quarter", + "Year", + "Other" + ] + } + }, + "type": "object" + }, + "(config)vf-license-model-versionPOST": { + "properties": { + "artifact-name": { + "$ref": "#/definitions/Some artifact-name", + "description": "Name of artifact" + }, + "artifact-version": { + "$ref": "#/definitions/Some artifact-version", + "description": "Version of artifact" + }, + "vf-license-model": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config)vf-license-model-versionsPOST": { + "properties": { + "vf-license-model-version": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions(config)vf-license-model-version" + }, + "type": "array" + } + }, + "type": "object" + }, + "(config)vf-license-modelPOST": { + "properties": { + "feature-group-list": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model(config)feature-group-list" + }, + "type": "object" + }, + "vendor-name": { + "$ref": "#/definitions/Some vendor-name", + "description": "xxxx" + }, + "vf-id": { + "$ref": "#/definitions/Some vf-id", + "description": "xxxx" + } + }, + "type": "object" + }, + "(vf-license-model-update)input": { + "properties": { + "ASDC-API:artifact-name": { + "$ref": "#/definitions/Some artifact-name", + "description": "Name of artifact" + }, + "ASDC-API:artifact-version": { + "$ref": "#/definitions/Some artifact-version", + "description": "Version of artifact" + }, + "ASDC-API:vf-license-model": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API(config)vf-license-model" + }, + "type": "object" + } + }, + "type": "object" + }, + "(vf-license-model-update)input-TOP": { + "properties": { + "ASDC-API:input": { + "items": { + "$ref": "#/definitions/(vf-license-model-update)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(vf-license-model-update)output": { + "properties": { + "ASDC-API:asdc-api-response-code": { + "$ref": "#/definitions/Some asdc-api-response-code", + "description": "Code indicating success/failure" + }, + "ASDC-API:asdc-api-response-text": { + "$ref": "#/definitions/Some asdc-api-response-text", + "description": "Text indicating reason for failure" + } + }, + "type": "object" + }, + "(vf-license-model-update)output-TOP": { + "properties": { + "ASDC-API:output": { + "items": { + "$ref": "#/definitions/(vf-license-model-update)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API(config)artifacts": { + "properties": { + "ASDC-API:artifact": { + "items": { + "$ref": "#/definitions/ASDC-API/artifacts(config)artifact" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API(config)artifacts-TOP": { + "properties": { + "ASDC-API:artifacts": { + "items": { + "$ref": "#/definitions/ASDC-API(config)artifacts" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API(config)vf-license-model": { + "properties": { + "ASDC-API:feature-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model(config)feature-group-list" + }, + "type": "object" + }, + "ASDC-API:vendor-name": { + "$ref": "#/definitions/Some vendor-name", + "description": "xxxx" + }, + "ASDC-API:vf-id": { + "$ref": "#/definitions/Some vf-id", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API(config)vf-license-model-TOP": { + "properties": { + "ASDC-API:vf-license-model": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API(config)vf-license-model" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API(config)vf-license-model-versions": { + "properties": { + "ASDC-API:vf-license-model-version": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions(config)vf-license-model-version" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API(config)vf-license-model-versions-TOP": { + "properties": { + "ASDC-API:vf-license-model-versions": { + "items": { + "$ref": "#/definitions/ASDC-API(config)vf-license-model-versions" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API(operational)artifacts": { + "type": "object" + }, + "ASDC-API(operational)artifacts-TOP": { + "properties": { + "ASDC-API:artifacts": { + "items": { + "$ref": "#/definitions/ASDC-API(operational)artifacts" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API(operational)vf-license-model-versions": { + "type": "object" + }, + "ASDC-API(operational)vf-license-model-versions-TOP": { + "properties": { + "ASDC-API:vf-license-model-versions": { + "items": { + "$ref": "#/definitions/ASDC-API(operational)vf-license-model-versions" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/artifacts(config)artifact": { + "properties": { + "ASDC-API:artifact-name": { + "$ref": "#/definitions/Some artifact-name", + "description": "Name of artifact" + }, + "ASDC-API:artifact-version": { + "$ref": "#/definitions/Some artifact-version", + "description": "Version of artifact" + } + }, + "type": "object" + }, + "ASDC-API/artifacts(config)artifact-TOP": { + "properties": { + "ASDC-API:artifact": { + "items": { + "$ref": "#/definitions/ASDC-API/artifacts(config)artifact" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model(config)feature-group-list": { + "properties": { + "ASDC-API:feature-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list(config)feature-group" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model(config)feature-group-list-TOP": { + "properties": { + "ASDC-API:feature-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model(config)feature-group-list" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions(config)vf-license-model-version": { + "properties": { + "ASDC-API:artifact-name": { + "$ref": "#/definitions/Some artifact-name", + "description": "Name of artifact" + }, + "ASDC-API:artifact-version": { + "$ref": "#/definitions/Some artifact-version", + "description": "Version of artifact" + }, + "ASDC-API:vf-license-model": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions(config)vf-license-model-version-TOP": { + "properties": { + "ASDC-API:vf-license-model-version": { + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions(config)vf-license-model-version" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model": { + "properties": { + "ASDC-API:feature-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model(config)feature-group-list" + }, + "type": "object" + }, + "ASDC-API:vendor-name": { + "$ref": "#/definitions/Some vendor-name", + "description": "xxxx" + }, + "ASDC-API:vf-id": { + "$ref": "#/definitions/Some vf-id", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model-TOP": { + "properties": { + "ASDC-API:vf-license-model": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version(config)vf-license-model" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model(config)feature-group-list": { + "properties": { + "ASDC-API:feature-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model(config)feature-group-list-TOP": { + "properties": { + "ASDC-API:feature-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model(config)feature-group-list" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group": { + "properties": { + "ASDC-API:att-part-number": { + "$ref": "#/definitions/Some att-part-number", + "description": "xxxx" + }, + "ASDC-API:description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "ASDC-API:entitlement-pool-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list" + }, + "type": "object" + }, + "ASDC-API:feature-group-uuid": { + "$ref": "#/definitions/Some feature-group-uuid", + "description": "xxxx" + }, + "ASDC-API:license-key-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)license-key-group-list" + }, + "type": "object" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group-TOP": { + "properties": { + "ASDC-API:feature-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list": { + "properties": { + "ASDC-API:entitlement-pool": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list-TOP": { + "properties": { + "ASDC-API:entitlement-pool-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)license-key-group-list": { + "properties": { + "ASDC-API:license-key-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group" + }, + "type": "array" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)license-key-group-list-TOP": { + "properties": { + "ASDC-API:license-key-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group(config)license-key-group-list" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool": { + "properties": { + "ASDC-API:aggregation-function": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function" + }, + "type": "object" + }, + "ASDC-API:description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "ASDC-API:entitlement-metric": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric" + }, + "type": "object" + }, + "ASDC-API:entitlement-pool-uuid": { + "$ref": "#/definitions/Some entitlement-pool-uuid", + "description": "xxxx" + }, + "ASDC-API:increments": { + "$ref": "#/definitions/Some increments", + "description": "xxxx" + }, + "ASDC-API:manufacturer-reference-number": { + "$ref": "#/definitions/Some manufacturer-reference-number", + "description": "xxxx" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + }, + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope" + }, + "type": "object" + }, + "ASDC-API:threshold-value": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value" + }, + "type": "object" + }, + "ASDC-API:time": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool-TOP": { + "properties": { + "ASDC-API:entitlement-pool": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Peak", + "description": "xxxx", + "enum": [ + "Peak", + "Average", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function-TOP": { + "properties": { + "ASDC-API:aggregation-function": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Software_Instances_Count", + "description": "xxxx", + "enum": [ + "Software_Instances_Count", + "CPU", + "Core", + "Trunks", + "User", + "Subscribers", + "Tenants", + "Tokens", + "Seats", + "Units_TB", + "Units_GB", + "Units_MB", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric-TOP": { + "properties": { + "ASDC-API:entitlement-metric": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Network_Wide", + "description": "xxxx", + "enum": [ + "Network_Wide", + "Availability_Zone", + "Data_Center", + "Tenant", + "VM", + "CPU", + "Core", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope-TOP": { + "properties": { + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value": { + "properties": { + "ASDC-API:unit": { + "$ref": "#/definitions/Absolute", + "description": "xxxx", + "enum": [ + "Absolute", + "Percentage" + ] + }, + "ASDC-API:value": { + "$ref": "#/definitions/0", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value-TOP": { + "properties": { + "ASDC-API:threshold-value": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Hour", + "description": "xxxx", + "enum": [ + "Hour", + "Day", + "Month", + "Quarter", + "Year", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time-TOP": { + "properties": { + "ASDC-API:time": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group": { + "properties": { + "ASDC-API:description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "ASDC-API:license-key-group-uuid": { + "$ref": "#/definitions/Some license-key-group-uuid", + "description": "xxxx" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + }, + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope" + }, + "type": "object" + }, + "ASDC-API:type": { + "$ref": "#/definitions/Universal", + "description": "xxxx", + "enum": [ + "Universal", + "Unique", + "One_Time" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group-TOP": { + "properties": { + "ASDC-API:license-key-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Network_Wide", + "description": "xxxx", + "enum": [ + "Network_Wide", + "Availability_Zone", + "Data_Center", + "Tenant", + "VM", + "CPU", + "Core", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope-TOP": { + "properties": { + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list(config)feature-group": { + "properties": { + "ASDC-API:att-part-number": { + "$ref": "#/definitions/Some att-part-number", + "description": "xxxx" + }, + "ASDC-API:description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "ASDC-API:entitlement-pool-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list" + }, + "type": "object" + }, + "ASDC-API:feature-group-uuid": { + "$ref": "#/definitions/Some feature-group-uuid", + "description": "xxxx" + }, + "ASDC-API:license-key-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group(config)license-key-group-list" + }, + "type": "object" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list(config)feature-group-TOP": { + "properties": { + "ASDC-API:feature-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list(config)feature-group" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list": { + "properties": { + "ASDC-API:entitlement-pool": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list-TOP": { + "properties": { + "ASDC-API:entitlement-pool-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group(config)entitlement-pool-list" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group(config)license-key-group-list": { + "properties": { + "ASDC-API:license-key-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group" + }, + "type": "array" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group(config)license-key-group-list-TOP": { + "properties": { + "ASDC-API:license-key-group-list": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group(config)license-key-group-list" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool": { + "properties": { + "ASDC-API:aggregation-function": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function" + }, + "type": "object" + }, + "ASDC-API:description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "ASDC-API:entitlement-metric": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric" + }, + "type": "object" + }, + "ASDC-API:entitlement-pool-uuid": { + "$ref": "#/definitions/Some entitlement-pool-uuid", + "description": "xxxx" + }, + "ASDC-API:increments": { + "$ref": "#/definitions/Some increments", + "description": "xxxx" + }, + "ASDC-API:manufacturer-reference-number": { + "$ref": "#/definitions/Some manufacturer-reference-number", + "description": "xxxx" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + }, + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope" + }, + "type": "object" + }, + "ASDC-API:threshold-value": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value" + }, + "type": "object" + }, + "ASDC-API:time": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool-TOP": { + "properties": { + "ASDC-API:entitlement-pool": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list(config)entitlement-pool" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Peak", + "description": "xxxx", + "enum": [ + "Peak", + "Average", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function-TOP": { + "properties": { + "ASDC-API:aggregation-function": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Software_Instances_Count", + "description": "xxxx", + "enum": [ + "Software_Instances_Count", + "CPU", + "Core", + "Trunks", + "User", + "Subscribers", + "Tenants", + "Tokens", + "Seats", + "Units_TB", + "Units_GB", + "Units_MB", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric-TOP": { + "properties": { + "ASDC-API:entitlement-metric": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Network_Wide", + "description": "xxxx", + "enum": [ + "Network_Wide", + "Availability_Zone", + "Data_Center", + "Tenant", + "VM", + "CPU", + "Core", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope-TOP": { + "properties": { + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value": { + "properties": { + "ASDC-API:unit": { + "$ref": "#/definitions/Absolute", + "description": "xxxx", + "enum": [ + "Absolute", + "Percentage" + ] + }, + "ASDC-API:value": { + "$ref": "#/definitions/0", + "description": "xxxx" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value-TOP": { + "properties": { + "ASDC-API:threshold-value": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Hour", + "description": "xxxx", + "enum": [ + "Hour", + "Day", + "Month", + "Quarter", + "Year", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time-TOP": { + "properties": { + "ASDC-API:time": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time" + }, + "type": "object" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group": { + "properties": { + "ASDC-API:description": { + "$ref": "#/definitions/Some description", + "description": "xxxx" + }, + "ASDC-API:license-key-group-uuid": { + "$ref": "#/definitions/Some license-key-group-uuid", + "description": "xxxx" + }, + "ASDC-API:name": { + "$ref": "#/definitions/Some name", + "description": "xxxx" + }, + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope" + }, + "type": "object" + }, + "ASDC-API:type": { + "$ref": "#/definitions/Universal", + "description": "xxxx", + "enum": [ + "Universal", + "Unique", + "One_Time" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group-TOP": { + "properties": { + "ASDC-API:license-key-group": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group" + }, + "type": "array" + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope": { + "properties": { + "ASDC-API:other": { + "$ref": "#/definitions/Some other", + "description": "xxxx" + }, + "ASDC-API:value": { + "$ref": "#/definitions/Network_Wide", + "description": "xxxx", + "enum": [ + "Network_Wide", + "Availability_Zone", + "Data_Center", + "Tenant", + "VM", + "CPU", + "Core", + "Other" + ] + } + }, + "type": "object" + }, + "ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope-TOP": { + "properties": { + "ASDC-API:operational-scope": { + "description": "xxxx", + "items": { + "$ref": "#/definitions/ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope" + }, + "type": "object" + } + }, + "type": "object" + }, + "unique_empty_identifier": {} + } +} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 20dddeb97..5f7101cdc 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -1,82 +1,93 @@ - - 4.0.0 - - dataChange - org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT - - org.onap.ccsdk.sli.northbound - dataChange-model - 0.1.0-SNAPSHOT - bundle + + 4.0.0 + + dataChange + org.onap.ccsdk.sli.northbound + 0.1.0-SNAPSHOT + + org.onap.ccsdk.sli.northbound + dataChange-model + 0.1.0-SNAPSHOT + bundle - - - - org.apache.felix - maven-bundle-plugin - true - - - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - - - - generate-sources - - - ${yang.file.directory} - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - true - - - - - - + + + + org.apache.felix + maven-bundle-plugin + true + + + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${odl.yangtools.yang.maven.plugin.version} + + + org.opendaylight.mdsal + maven-sal-api-gen-plugin + ${odl.sal.api.gen.plugin.version} + jar + + + org.opendaylight.netconf + sal-rest-docgen-maven + ${odl.restconf.version} + jar + + + + + + generate-sources + + + ${yang.file.directory} + + + org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.netconf.sal.rest.doc.maven.StaticDocGenerator + target/swagger + + + true + + + + + + - - - org.opendaylight.mdsal - yang-binding - ${odl.mdsal.yang.binding.version} - - - org.opendaylight.yangtools - yang-common - ${odl.yangtools.version} - - - org.opendaylight.mdsal.model - ietf-inet-types - ${odl.ietf-inet-types.version} - - - org.opendaylight.mdsal.model - ietf-yang-types - ${odl.ietf-yang-types.version} - - + + + org.opendaylight.mdsal + yang-binding + ${odl.mdsal.yang.binding.version} + + + org.opendaylight.yangtools + yang-common + ${odl.yangtools.version} + + + org.opendaylight.mdsal.model + ietf-inet-types + ${odl.ietf-inet-types.version} + + + org.opendaylight.mdsal.model + ietf-yang-types + ${odl.ietf-yang-types.version} + + diff --git a/dataChange/model/src/main/resources/dataChange.20150519.json b/dataChange/model/src/main/resources/dataChange.20150519.json new file mode 100644 index 000000000..128195b52 --- /dev/null +++ b/dataChange/model/src/main/resources/dataChange.20150519.json @@ -0,0 +1,136 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0" + }, + "basePath": "/restconf", + "paths": { + "/operations/DataChange:data-change-notification": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(data-change-notification)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(data-change-notification)output-TOP" + } + } + }, + "operationId": "data-change-notification" + } + } + }, + "definitions": { + "(config)DataChange_modulePOST": { + "type": "object" + }, + "(config)key-dataPOST": { + "properties": { + "key-name": { + "$ref": "#/definitions/Some key-name" + }, + "key-value": { + "$ref": "#/definitions/Some key-value" + } + }, + "type": "object" + }, + "(data-change-notification)input": { + "properties": { + "DataChange:aai-event-id": { + "$ref": "#/definitions/Some aai-event-id" + }, + "DataChange:aai-event-trigger": { + "$ref": "#/definitions/Update", + "enum": [ + "Update", + "Delete" + ] + }, + "DataChange:aai-node-type": { + "$ref": "#/definitions/Some aai-node-type" + }, + "DataChange:key-data": { + "items": { + "$ref": "#/definitions/DataChange(config)key-data" + }, + "type": "array" + }, + "DataChange:selflink": { + "$ref": "#/definitions/Some selflink" + } + }, + "type": "object" + }, + "(data-change-notification)input-TOP": { + "properties": { + "DataChange:input": { + "items": { + "$ref": "#/definitions/(data-change-notification)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(data-change-notification)output": { + "properties": { + "DataChange:data-change-response-code": { + "$ref": "#/definitions/Some data-change-response-code" + } + }, + "type": "object" + }, + "(data-change-notification)output-TOP": { + "properties": { + "DataChange:output": { + "items": { + "$ref": "#/definitions/(data-change-notification)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "DataChange(config)key-data": { + "properties": { + "DataChange:key-name": { + "$ref": "#/definitions/Some key-name" + }, + "DataChange:key-value": { + "$ref": "#/definitions/Some key-value" + } + }, + "type": "object" + }, + "DataChange(config)key-data-TOP": { + "properties": { + "DataChange:key-data": { + "items": { + "$ref": "#/definitions/DataChange(config)key-data" + }, + "type": "array" + } + }, + "type": "object" + }, + "unique_empty_identifier": {} + } +} diff --git a/docs/apis/asdcApi.rst b/docs/apis/asdcApi.rst new file mode 100644 index 000000000..c9091401d --- /dev/null +++ b/docs/apis/asdcApi.rst @@ -0,0 +1,15 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +ASDC-API (2017-02-01) +===================== + +.. toctree:: + :maxdepth: 1 + :titlesonly: + + + +.. swaggerv2doc:: https://gerrit.onap.org/r/gitweb?p=ccsdk/sli/northbound.git;a=blob_plain;f=asdcApi/model/src/main/resources/asdc-api.20170201.json + + diff --git a/docs/apis/dataChange.rst b/docs/apis/dataChange.rst new file mode 100644 index 000000000..9a9dc0444 --- /dev/null +++ b/docs/apis/dataChange.rst @@ -0,0 +1,15 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +dataChange(2015-05-19) +====================== + +.. toctree:: + :maxdepth: 1 + :titlesonly: + + + +.. swaggerv2doc:: https://gerrit.onap.org/r/gitweb?p=ccsdk/sli/northbound.git;a=blob_plain;f=dataChange/model/src/main/resources/dataChange.20150519.json + + diff --git a/docs/architecture.rst b/docs/architecture.rst new file mode 100644 index 000000000..f2648df37 --- /dev/null +++ b/docs/architecture.rst @@ -0,0 +1,12 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Architecture +============ + + +Capabilities +------------ +This repository contains source code and Yang models for the northbound interfaces +used to process updates from SDC (ASDC-API) and for processing data change notifications +from A&AI (dataChange). diff --git a/docs/build.rst b/docs/build.rst new file mode 100644 index 000000000..0a4c308e6 --- /dev/null +++ b/docs/build.rst @@ -0,0 +1,18 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Build +===== + + +Environment +----------- +Requires maven release 3.3 or greater + +Steps +----- +To compile this code: + +1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the ONAP repositories and OpenDaylight repositories. + +2. To compile, run "mvn clean install". \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 833e1aa96..9be06c84e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,8 +1,13 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. -TODO Add files to toctree and delete this header ------------------------------------------------- +CCSDK SLI Northbound API +------------------------ .. toctree:: :maxdepth: 1 + architecture.rst + offeredapis.rst + logging.rst + build.rst + release-notes.rst diff --git a/docs/logging.rst b/docs/logging.rst new file mode 100644 index 000000000..187eb03b7 --- /dev/null +++ b/docs/logging.rst @@ -0,0 +1,14 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Logging +======= +CCSDK uses slf4j to log messages to the standard OpenDaylight karaf.log +log file. + +Where to Access Information +--------------------------- +Logs are found within the SDNC docker container, in the directory +/opt/opendaylight/current/data/logs. + + diff --git a/docs/nodes.rst b/docs/nodes.rst new file mode 100644 index 000000000..3bdeabcfa --- /dev/null +++ b/docs/nodes.rst @@ -0,0 +1,1031 @@ +--- Service Logic Interpreter --- Dan Timoney --- 2014-11-12 --- + +Supported node types +==================== + +The following built-in node types are currently supported: + +- Flow Control + + - `**block** <#Block_node>`__ + + - `**call** <#Call_node>`__ + + - `**for** <#For_node>`__ + + - `**return** <#Return_node>`__ + + - `**set** <#Set_node>`__ + + - `**switch** <#Switch_node>`__ + +- Device Management + + - `**configure** <#Configure_node>`__ + +- Java Plugin Support + + - `**execute** <#Execute_node>`__ + +- Recording + + - `**record** <#Record_node>`__ + +- Resource Management + + - `**delete** <#Delete_node>`__ + + - `**exists** <#Exists_node>`__ + + - `**get-resource** <#Get-resource_node>`__ + + - `**is-available** <#Is-available_node>`__ + + - `**notify** <#Notify_node>`__ + + - `**release** <#Release_node>`__ + + - `**reserve** <#Reserve_node>`__ + + - `**save** <#Save_node>`__ + + - `**update** <#Update_node>`__ + +Flow Control +------------ + +Block node +~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **block** node is used to executes a set of nodes. + +Attributes +^^^^^^^^^^ + ++--------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| **atomic** | if *true*, then if a node returns failure, subsequent nodes will not be executed and nodes already executed will be backed out. | ++--------------+-----------------------------------------------------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + +None + +Example +^^^^^^^ + +:: + + + + + + + + + + + + + +Call node +~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **call** node is used to call another graph + +Attributes +^^^^^^^^^^ + ++---------------+------------------------------------------------------------------------------------+ +| **module** | Module of directed graph to call. If unset, defaults to that of calling graph | ++---------------+------------------------------------------------------------------------------------+ +| **rpc** | rpc of directed graph to call. | ++---------------+------------------------------------------------------------------------------------+ +| **version** | version of graph to call, If unset, uses active version. | ++---------------+------------------------------------------------------------------------------------+ +| **mode** | mode (sync/async) of graph to call. If unset, defaults to that of calling graph. | ++---------------+------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +Not applicable + +Outcomes +^^^^^^^^ + ++-----------------+------------------------------+ +| **success** | Sub graph returned success | ++-----------------+------------------------------+ +| **not-found** | Graph not found | ++-----------------+------------------------------+ +| **failure** | Subgraph returned success | ++-----------------+------------------------------+ + +Table: . + +Example +^^^^^^^ + +:: + + + +For node +~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **for** node provides a fixed iteration looping mechanism, similar to +the Java for loop + +Attributes +^^^^^^^^^^ + ++-------------+------------------+ +| **index** | index variable | ++-------------+------------------+ +| **start** | initial value | ++-------------+------------------+ +| **end** | maximum value | ++-------------+------------------+ + +Parameters +^^^^^^^^^^ + +Not applicable. + +Outcomes +^^^^^^^^ + +Not applicable. The **status** node has no outcomes. + +Example +^^^^^^^ + +:: + + + + + + + + + +Return node +~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **return** node is used to return a status to the invoking MD-SAL +application + +Attributes +^^^^^^^^^^ + ++--------------+---------------------------------------------------+ +| **status** | Status value to return (*success* or *failure*) | ++--------------+---------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +The following optional parameters may be passed to convey more detailed +status information. + ++---------------------+-----------------------------------------------------------------+ +| **error-code** | A brief, usually numeric, code indicating the error condition | ++---------------------+-----------------------------------------------------------------+ +| **error-message** | A more detailed error message | ++---------------------+-----------------------------------------------------------------+ + +Outcomes +^^^^^^^^ + +Not applicable. The **status** node has no outcomes. + +Example +^^^^^^^ + +:: + + + + + + +Set node +~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **set** node is used to set one or more values in the execution +context + +Attributes +^^^^^^^^^^ + ++---------------------+-------------------------------------------------------------------------------------+ +| **only-if-unset** | If true the set node will only execute if the current value of the target is null | ++---------------------+-------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +Values to be set are passed as parameters + +Outcomes +^^^^^^^^ + +Not applicable. The **set** node has no outcomes. + +Example +^^^^^^^ + +:: + + + + + +Switch node +~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **switch** node is used to make a decision based on its **test** +attribute. + +Attributes +^^^^^^^^^^ + ++------------+---------------------+ +| **test** | Condition to test | ++------------+---------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + +Depends on the **test** condition + +Example +^^^^^^^ + +:: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Device Management +----------------- + +Configure node +~~~~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **configure** node is used to configure a device. + +Attributes +^^^^^^^^^^ + ++----------------+-----------------------------------------------------------------------------------+ +| **adaptor** | Fully qualified Java class of resource adaptor to be used | ++----------------+-----------------------------------------------------------------------------------+ +| **activate** | Activate device/interface, for devices that support a separate activation step. | ++----------------+-----------------------------------------------------------------------------------+ +| **key** | SQL-like string specifying criteria for item to configure | ++----------------+-----------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +Specific to device adaptor. + +Outcomes +^^^^^^^^ + ++----------------------+------------------------------------------------------------------+ +| **success** | Device successfully configured | ++----------------------+------------------------------------------------------------------+ +| **not-found** | Element to be configured does not exist. | ++----------------------+------------------------------------------------------------------+ +| **not-ready** | Element is not in a state where it can be configured/activated | ++----------------------+------------------------------------------------------------------+ +| **already-active** | Attempt to activate element that is already active | ++----------------------+------------------------------------------------------------------+ +| **failure** | Configure failed for some other reason | ++----------------------+------------------------------------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Java Plugin Support +------------------- + +Execute node +~~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +An **execute** node is used to execute Java code supplied as a plugin + +Attributes +^^^^^^^^^^ + ++--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of plugin to be used | ++--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **method** | Name of method in the plugin class to execute. Method must return void, and take 2 arguments: a Map (for parameters) and a SvcLogicContext (to allow plugin read/write access to context memory) | ++--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +Specific to plugin / method + +Outcomes +^^^^^^^^ + ++--------------------------+-----------------------------------------------------------------+ +| **success** | Device successfully configured | ++--------------------------+-----------------------------------------------------------------+ +| **not-found** | Plugin class could not be loaded | ++--------------------------+-----------------------------------------------------------------+ +| **unsupported-method** | Named method taking (Map, SvcLogicContext) could not be found | ++--------------------------+-----------------------------------------------------------------+ +| **failure** | Configure failed for some other reason | ++--------------------------+-----------------------------------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + + + + + + + + + + + +Recording +--------- + +Record node +~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **record** node is used to record an event. For example, this might be +used to log provisioning events. + +Attributes +^^^^^^^^^^ + ++--------------+---------------------------------------------------+ +| **plugin** | Fully qualified Java class to handle recording. | ++--------------+---------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +Parameters will depend on the plugin being used. For the FileRecorder +class, the parameters are as follows + ++--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **file** | The file to which the record should be written | ++--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **field1** | First field to write. There will be **field** parameters for each field to write, from **field1** through **fieldN**. A special value \_\_TIMESTAMP\_\_ may be assigned to a field to insert the current timestamp | ++--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Outcomes +^^^^^^^^ + ++---------------+--------------------------------------------+ +| **success** | Record successfully written | ++---------------+--------------------------------------------+ +| **failure** | Record could not be successfully written | ++---------------+--------------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + +Resource Management +------------------- + +Delete node +~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **delete** node is used to delete a resource from the local resource +inventory. + +Attributes +^^^^^^^^^^ + ++----------------+-------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+-------------------------------------------------------------+ +| **resource** | Type of resource to delete | ++----------------+-------------------------------------------------------------+ +| **key** | SQL-like string specifying key to delete | ++----------------+-------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + ++---------------+--------------------------------------------+ +| **success** | Resource specified deleted successfully. | ++---------------+--------------------------------------------+ +| *failure*> | Resource specified was not deleted | ++---------------+--------------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + +Exists node +~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +An **exists** node is used to determine whether a particular instance of +a resource exists. For example, this might be used to test whether a +particular switch CLLI is provisioned. + +Attributes +^^^^^^^^^^ + ++----------------+-------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+-------------------------------------------------------------+ +| **resource** | Type of resource to check | ++----------------+-------------------------------------------------------------+ +| **key** | SQL-like string specifying key to check for | ++----------------+-------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + ++-------------+---------------------------------+ +| **true** | Resource specified exists. | ++-------------+---------------------------------+ +| **false** | Resource specified is unknown | ++-------------+---------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + +Get-resource node +~~~~~~~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **get-resource** node is used to retrieve information about a +particular resource and make it available to other nodes in the service +logic tree. For example, this might be used to retrieve information +about a particular uni-port. + +Attributes +^^^^^^^^^^ + ++----------------+------------------------------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+------------------------------------------------------------------------------------------+ +| **resource** | Type of resource to retrieve | ++----------------+------------------------------------------------------------------------------------------+ +| **key** | SQL-like string specifying criteria for retrieval | ++----------------+------------------------------------------------------------------------------------------+ +| **pfx** | Prefix to add to context variable names set for data retrieved | ++----------------+------------------------------------------------------------------------------------------+ +| **select** | String to specify, if key matches multiple entries, which entry should take precedence | ++----------------+------------------------------------------------------------------------------------------+ +| **order-by** | Prefix to add to context variable names set for data retrieved | ++----------------+------------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + ++-----------------+--------------------------------------------------+ +| **success** | Resource successfully retrieved | ++-----------------+--------------------------------------------------+ +| **not-found** | Resource referenced does not exist | ++-----------------+--------------------------------------------------+ +| **failure** | Resource retrieve failed for some other reason | ++-----------------+--------------------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + + + + +Is-available node +~~~~~~~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +An **is-available** node is used to determine whether a particular type +of resource is available. For example, this might be used to test +whether any ports are available for assignment on a particular switch. + +Attributes +^^^^^^^^^^ + ++----------------+------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+------------------------------------------------------------------+ +| **resource** | Type of resource to check | ++----------------+------------------------------------------------------------------+ +| **key** | SQL-like string specifying key to check for | ++----------------+------------------------------------------------------------------+ +| **pfx** | Prefix to add to context variable names set for data retrieved | ++----------------+------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + ++-------------+---------------------------------------+ +| **true** | Resource requested is available | ++-------------+---------------------------------------+ +| **false** | Resource requested is not available | ++-------------+---------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + +Notify node +~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **notify** node is used to inform an external application (e.g. A&AI) +that a resource was updated. + +Attributes +^^^^^^^^^^ + ++----------------+---------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+---------------------------------------------------------------------+ +| **resource** | Identifies resource that was updated | ++----------------+---------------------------------------------------------------------+ +| **action** | Action that triggered notification to be sent (ADD/UPDATE/DELETE) | ++----------------+---------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + ++---------------+----------------------------------------+ +| **success** | Notification was successful | ++---------------+----------------------------------------+ +| **failure** | Notification failed is not available | ++---------------+----------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + +Release node +~~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **release** node is used to mark a resource as no longer in use, and +thus available for assignment. + +Attributes +^^^^^^^^^^ + ++----------------+------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+------------------------------------------------------------------+ +| **resource** | Type of resource to release | ++----------------+------------------------------------------------------------------+ +| **key** | SQL-like string specifying key to check of resource to release | ++----------------+------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + ++-----------------+-------------------------------------------------+ +| **success** | Resource successfully released | ++-----------------+-------------------------------------------------+ +| **not-found** | Resource referenced does not exist | ++-----------------+-------------------------------------------------+ +| **failure** | Resource release failed for some other reason | ++-----------------+-------------------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + + + + +Reserve node +~~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **reserve** node is used to reserve a particular type of resource.. +For example, this might be used to reserve a port on a particular +switch. + +Attributes +^^^^^^^^^^ + ++----------------+----------------------------------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+----------------------------------------------------------------------------------------------+ +| **resource** | Type of resource to reserve | ++----------------+----------------------------------------------------------------------------------------------+ +| **key** | SQL-like string specifying criteria for reservation | ++----------------+----------------------------------------------------------------------------------------------+ +| **select** | String to specify, if **key** matches multiple entries, which entry should take precedence | ++----------------+----------------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +None + +Outcomes +^^^^^^^^ + ++---------------+----------------------------------------------------+ +| **success** | Resource requested was successfully reserved | ++---------------+----------------------------------------------------+ +| **failure** | Resource requested was not successfully reserved | ++---------------+----------------------------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + +Save node +~~~~~~~~~ + +Description +^^^^^^^^^^^ + +A **save** node is used to save information about a particular resource +to persistent storage. For example, this might be used to save +information about a particular uni-port. + +Attributes +^^^^^^^^^^ + ++----------------+------------------------------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+------------------------------------------------------------------------------------------+ +| **resource** | Type of resource to save | ++----------------+------------------------------------------------------------------------------------------+ +| **key** | SQL-like string specifying criteria for retrieval | ++----------------+------------------------------------------------------------------------------------------+ +| **force** | If "true", save resource even if this resource is already stored in persistent storage | ++----------------+------------------------------------------------------------------------------------------+ +| **pfx** | Prefix to be prepended to variable names, when attributes are set in SvcLogicContext | ++----------------+------------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +Values to save (columns) are specified as parameters, with each name +corresponding to a column name and each value corresponding to the value +to set. + +Outcomes +^^^^^^^^ + ++---------------+-------------------------------+ +| **success** | Resource successfully saved | ++---------------+-------------------------------+ +| **failure** | Resource save failed | ++---------------+-------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + + +Update node +~~~~~~~~~~~ + +Description +^^^^^^^^^^^ + +An **update** node is used to update information about a particular +resource to persistent storage. + +Attributes +^^^^^^^^^^ + ++----------------+----------------------------------------------------------------------------------------+ +| **plugin** | Fully qualified Java class of resource adaptor to be used | ++----------------+----------------------------------------------------------------------------------------+ +| **resource** | Type of resource to update | ++----------------+----------------------------------------------------------------------------------------+ +| **key** | SQL-like string specifying criteria for retrieval | ++----------------+----------------------------------------------------------------------------------------+ +| **pfx** | Prefix to be prepended to variable names, when attributes are set in SvcLogicContext | ++----------------+----------------------------------------------------------------------------------------+ + +Parameters +^^^^^^^^^^ + +Values to save (columns) are specified as parameters, with each name +corresponding to a column name and each value corresponding to the value +to set. + +Outcomes +^^^^^^^^ + ++---------------+-------------------------------+ +| **success** | Resource successfully saved | ++---------------+-------------------------------+ +| **failure** | Resource save failed | ++---------------+-------------------------------+ + +Example +^^^^^^^ + +:: + + + + + + + + + diff --git a/docs/offeredapis.rst b/docs/offeredapis.rst new file mode 100644 index 000000000..2eebdec92 --- /dev/null +++ b/docs/offeredapis.rst @@ -0,0 +1,13 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Offered APIs +============ + +.. toctree:: + :maxdepth: 1 + :titlesonly: + + apis/asdcApi.rst + apis/dataChange.rst + diff --git a/docs/release-notes.rst b/docs/release-notes.rst new file mode 100644 index 000000000..21ff338cf --- /dev/null +++ b/docs/release-notes.rst @@ -0,0 +1,45 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. + +Release Notes +============= + +.. note:: + * This Release Notes must be updated each time the team decides to Release new artifacts. + * The scope of this Release Notes is for this particular component. In other words, each ONAP component has its Release Notes. + * This Release Notes is cumulative, the most recently Released artifact is made visible in the top of this Release Notes. + * Except the date and the version number, all the other sections are optional but there must be at least one section describing the purpose of this new release. + * This note must be removed after content has been added. + + +Version: x.y.z +-------------- + + +:Release Date: yyyy-mm-dd + + + +**New Features** + +One or two sentences explaining the purpose of this Release. + +**Bug Fixes** + - `CIMAN-65 `_ and a sentence explaining what this defect is addressing. +**Known Issues** + - `CIMAN-65 `_ and two, three sentences. + One sentences explaining what is the issue. + + Another sentence explaining the impact of the issue. + + And an optional sentence providing a workaround. + +**Security Issues** + You may want to include a reference to CVE (Common Vulnerabilities and Exposures) `CVE `_ + + +**Upgrade Notes** + +**Deprecation Notes** + +**Other** + -- cgit 1.2.3-korg From c2f3ec47d2d45ba4021c5cde7cea21515f276cf3 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Fri, 13 Oct 2017 15:51:22 -0400 Subject: Fix sli/northbound blueprint Wrong package name is used for NotificationPublishService in blueprint, resulting in asdcApi and dataChange not being loaded properly. Change-Id: I144f8e4bd48e547e7c7241e9ebaacf744d808022 Issue-ID: CCSDK-119 Signed-off-by: Dan Timoney --- .../src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml | 2 +- .../main/resources/org/opendaylight/blueprint/datachange-blueprint.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml index 810ce8c5e..9ad08d3db 100644 --- a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml +++ b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml @@ -15,7 +15,7 @@ odl:type="default" /> Date: Mon, 16 Oct 2017 14:42:00 -0400 Subject: Fix ueb-listener client name Fix package name of ueb listener client in jar manifest Change-Id: I1db2acd8b269ffbf88d41f827c3baaa22b253bd7 Issue-ID: SDNC-129 Signed-off-by: Dan Timoney --- ueb-listener/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 2241047f6..33d2967fd 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -119,7 +119,7 @@ true - org.openecomp.sdnc.uebclient.SdncUebClient + org.onap.ccsdk.sli.northbound.uebclient.SdncUebClient -- cgit 1.2.3-korg From 55f55a83170d21ff2dcd219f9bdd6ef908fdd626 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 25 Oct 2017 15:37:22 -0400 Subject: Use version 0.1.0 of parent Update to use version 0.1.0 (released version) of parent pom Change-Id: Ie639cffd028efd67d4e91765f25ba6ed29af21bc Issue-ID: CCSDK-80 Signed-off-by: Dan Timoney --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe9477b6b..073e779e0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-carbon-sr1 - 0.0.2-SNAPSHOT + 0.1.0 4.0.0 -- cgit 1.2.3-korg From f9137ed6fb50680ab30b66a97d9d68f6dcc0a47c Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 1 Nov 2017 13:19:42 -0400 Subject: Update SDC version Per SDC PTL, we should be using version 1.1.32 of both the distribution client and Tosca parser. Change-Id: Ib1a059db9e71fc98ff0c6b961577c1fa1cdaa67b Issue-ID: SDNC-144 Signed-off-by: Dan Timoney --- ueb-listener/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 33d2967fd..13af485df 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -14,8 +14,8 @@ 0.1.0-SNAPSHOT - 1.1.32-SNAPSHOT - 1.1.34-SNAPSHOT + 1.1.32 + 1.1.32 2.9.0.pr1 true /opt/app/ueb-listener -- cgit 1.2.3-korg From da99eed5436f92eb2b4794cc0399bdb0eb400afc Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Mon, 6 Nov 2017 17:19:46 -0500 Subject: Ignore TOSCA YML TOSCA is passed in 2 formats : YML and CSAR. The SDC TOSCA parser only handles CSAR, so YML artifact cannot be passed to it. Since CSAR artifact all data needed (that is, there is nothing in YML that SDNC needs that is not in the CSAR), it can be safely ignored. Change-Id: I54aa2ae49e3ba0aa23b280fa106ada3d588897a0 Issue-ID: SDNC-169 Signed-off-by: Dan Timoney --- .../sli/northbound/uebclient/SdncUebCallback.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 67e042b5d..d01b02589 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 @@ -440,15 +440,15 @@ public class SdncUebCallback implements INotificationCallback { // If an override file exists, read that instead of the file we just downloaded ArtifactTypeEnum artifactEnum = ArtifactTypeEnum.YANG_XML; - boolean toscaYamlType = false; + boolean toscaCsarType = false; if (artifact != null) { String artifactTypeString = artifact.getArtifactType(); - if (artifactTypeString.contains("TOSCA_TEMPLATE")) { - toscaYamlType = true; + if (artifactTypeString.contains("TOSCA_CSAR")) { + toscaCsarType = true; } } else { - if (spoolFile.toString().contains(".yml") || spoolFile.toString().contains(".csar")) { - toscaYamlType = true; + if (spoolFile.toString().contains(".csar")) { + toscaCsarType = true; } } String overrideFileName = config.getOverrideFile(); @@ -462,8 +462,8 @@ public class SdncUebCallback implements INotificationCallback { } - if (toscaYamlType) { - processToscaYaml (data, svcName, resourceName, artifact, spoolFile, archiveDir); + if (toscaCsarType) { + processToscaCsar (data, svcName, resourceName, artifact, spoolFile, archiveDir); try { Path source = spoolFile.toPath(); @@ -529,7 +529,7 @@ public class SdncUebCallback implements INotificationCallback { } - private void processToscaYaml(INotificationData data, String svcName, String resourceName, + private void processToscaCsar(INotificationData data, String svcName, String resourceName, IArtifactInfo artifact, File spoolFile, File archiveDir) { // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data @@ -537,7 +537,7 @@ public class SdncUebCallback implements INotificationCallback { // TOSCA data extraction flow 1707: // Use ASDC dist-client to get yaml string - not yet available String model_yaml = null; - LOG.info("Process TOSCA YAML file: "+spoolFile.toString()); + LOG.info("Process TOSCA CSAR file: "+spoolFile.toString()); SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); ISdcCsarHelper sdcCsarHelper = null; -- cgit 1.2.3-korg From f1cdb6b4212168879f623abd4beb345dadf200dd Mon Sep 17 00:00:00 2001 From: Lalena Aria Date: Wed, 8 Nov 2017 16:25:41 +0000 Subject: Abstract Changes made: update AAI Service path list from the latest version published by AAI Team Change-Id: Ie6d5451777cfd45b528acdfe098e31f26ab3714c Issue-ID: SDC-564 Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncUebCallback.java | 33 ++++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) 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 d01b02589..aa856b4fe 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 @@ -26,6 +26,7 @@ import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; @@ -396,21 +397,35 @@ public class SdncUebCallback implements INotificationCallback { return; } - String payload = new String(payloadBytes); - File spoolFile = new File(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); boolean writeSucceeded = false; - try (FileWriter spoolFileWriter = new FileWriter(spoolFile)) { - spoolFileWriter.write(payload); - spoolFileWriter.close(); - writeSucceeded = true; - } catch (Exception e) { - LOG.error("Unable to save downloaded file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); - } + // Save zip if TOSCA_CSAR + if (artifact.getArtifactType().contains("TOSCA_CSAR") || artifact.getArtifactName().contains(".csar")) { + try { + FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); + outFile.write(payloadBytes, 0, payloadBytes.length); + outFile.close(); + writeSucceeded = true; + } catch (Exception e) { + LOG.error("Unable to save downloaded zip file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); + } + + } else { + String payload = new String(payloadBytes); + + try { + FileWriter spoolFileWriter = new FileWriter(spoolFile); + spoolFileWriter.write(payload); + spoolFileWriter.close(); + writeSucceeded = true; + } catch (Exception e) { + LOG.error("Unable to save downloaded file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); + } + } if (writeSucceeded && (downloadResult.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS)) { handleSuccessfulDownload(data, svcName, resourceName, artifact, spoolFile, archiveDir); -- cgit 1.2.3-korg From 2f9282706b2eaca0c271d6da27b3dbc0692accc2 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 9 Nov 2017 07:19:49 -0500 Subject: Roll to version 0.1.1-SNAPSHOT Roll to next release version Change-Id: I7df5f5c516db6b4459a6f6063bf754e058a4048d Issue-ID: CCSDK-141 Signed-off-by: Dan Timoney --- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 2 +- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 4 ++-- pom.xml | 2 +- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 0f3a5ddd2..16f93591d 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT asdcApi-features diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 32f505053..03153fe63 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT asdcApi-installer asdcApi - Karaf Installer diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 3665e4fab..fc874b4c8 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,11 +5,11 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT bundle diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 0adc96e64..677d94ba2 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT pom org.onap.ccsdk.sli.northbound asdcApi - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index cb6872653..12240b388 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT asdcApi-provider bundle diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 9d140cb6e..7377ffc85 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -4,11 +4,11 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT jar diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 940144f53..fc44b8743 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -4,7 +4,7 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT dataChange-installer dataChange - Karaf Installer diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 5f7101cdc..939b218b0 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,11 +5,11 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT bundle diff --git a/dataChange/pom.xml b/dataChange/pom.xml index a5818a5d4..57aed1f09 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT pom org.onap.ccsdk.sli.northbound dataChange - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index f3e1f0fd4..d534e30e6 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -4,7 +4,7 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT dataChange-provider bundle diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 1cc4acc59..6746cdd89 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.sli.northbound jar dmaap-listener - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT DMAAP Listener DMAAP Listener org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT 1.1.7-SNAPSHOT diff --git a/pom.xml b/pom.xml index 073e779e0..9479abb51 100644 --- a/pom.xml +++ b/pom.xml @@ -112,7 +112,7 @@ AT&T - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 13af485df..8a83bb5da 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.sli.northbound jar ueb-listener - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT UEB Listener UEB Listener org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT 1.1.32 diff --git a/version.properties b/version.properties index 3d3e5b582..ef1134635 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=1 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 292cce64a1a610283306a5f2280c787d8edb916d Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 9 Nov 2017 15:18:24 -0500 Subject: Add dhcp event handler Add event handler for DHCP event Change-Id: I2e23ace8ae481bf100f236a4e2723d721eec3470 Issue-ID: CCSDK-142 Signed-off-by: Dan Timoney --- dmaap-listener/pom.xml | 9 +- .../dmaapclient/SdncDhcpEventConsumer.java | 136 +++++++++++++++++++++ .../dmaapclient/TestSdncDhcpEventConsumer.java | 130 ++++++++++++++++++++ dmaap-listener/src/test/resources/dblib.properties | 38 ++++++ 4 files changed, 312 insertions(+), 1 deletion(-) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java create mode 100644 dmaap-listener/src/test/resources/dblib.properties diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 6746cdd89..d1e173ca0 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -34,7 +34,7 @@ org.slf4j slf4j-api - 1.7.10 + 1.7.21 org.slf4j @@ -68,6 +68,13 @@ ${junit.version} test + + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.3 + test + + org.onap.ccsdk.sli.core dblib-provider diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java new file mode 100644 index 000000000..666ed68e1 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java @@ -0,0 +1,136 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.SQLException; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; + +public class SdncDhcpEventConsumer extends SdncDmaapConsumer { + private static final Logger LOG = LoggerFactory.getLogger(SdncDhcpEventConsumer.class); + + private static final String MAC_ADDR_TAG = "macaddr"; + private static final String MSG_NAME_TAG = "msg_name"; + private static final String IP_ADDR_TAG = "yiaddr"; + + private static DBResourceManager jdbcDataSource = null; + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + + private class MissingDhcpAttributeException extends InvalidMessageException { + + public MissingDhcpAttributeException(String fieldName) { + super("Invalid DHCP event - missing " + fieldName + " attribute"); + } + } + + private static void setJdbcDataSource() throws IOException { + + String propPath; + String propDir = System.getenv(SDNC_CONFIG_DIR); + if (propDir == null) { + propDir = "/opt/onap/sdnc/data/properties"; + } + propPath = propDir + "/dblib.properties"; + File propFile = new File(propPath); + + if (!propFile.exists()) { + + throw new FileNotFoundException("Missing configuration properties file : " + propFile); + } + + Properties props = new Properties(); + props.load(new FileInputStream(propFile)); + + setJdbcDataSource(new DBResourceManager(props)); + + } + + static void setJdbcDataSource(DBResourceManager dbMgr) { + + jdbcDataSource = dbMgr; + + if (jdbcDataSource.isActive()) { + LOG.warn("DBLIB: JDBC DataSource has been initialized."); + } else { + LOG.warn("DBLIB: JDBC DataSource did not initialize successfully."); + } + } + + @Override + public void processMsg(String msg) throws InvalidMessageException { + if (msg == null) { + throw new InvalidMessageException("Null message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + + JsonNode dhcpRootNode; + String msgName; + String macAddr; + String ipAddr; + + try { + dhcpRootNode = oMapper.readTree(msg); + + } catch (IOException e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + JsonNode msgNameNode = dhcpRootNode.get(MSG_NAME_TAG); + if (msgNameNode != null) { + msgName = msgNameNode.textValue(); + + } else { + throw new MissingDhcpAttributeException(MSG_NAME_TAG); + } + + JsonNode macAddrNode = dhcpRootNode.get(MAC_ADDR_TAG); + if (macAddrNode != null) { + macAddr = macAddrNode.textValue(); + + } else { + throw new MissingDhcpAttributeException(MAC_ADDR_TAG); + } + + JsonNode ipAddrNode = dhcpRootNode.get(IP_ADDR_TAG); + if (ipAddrNode != null) { + ipAddr = ipAddrNode.textValue(); + + } else { + throw new MissingDhcpAttributeException(IP_ADDR_TAG); + } + + LOG.debug("Got DHCP event : msg name {}; mac addr {}; ip addr {}", msgName, macAddr, ipAddr); + + if (jdbcDataSource == null) { + try { + setJdbcDataSource(); + } catch (IOException e) { + LOG.error("Could not create JDBC connection", e); + return; + } + } + + try { + + jdbcDataSource.writeData("INSERT INTO DHCP_MAP(mac_addr, ip_addr) VALUES('" + macAddr + "','" + ipAddr + "')", + null, null); + + } catch (SQLException e) { + LOG.error("Could not insert DHCP event data into the database ", e); + } + + } + +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java new file mode 100644 index 000000000..8c3a839c2 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java @@ -0,0 +1,130 @@ +/** + * + */ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.*; + +import java.io.InputStream; +import java.net.URL; +import java.sql.SQLException; +import java.util.Properties; + +import javax.sql.rowset.CachedRowSet; + +import org.junit.After; +import org.junit.BeforeClass; +import org.junit.Test; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ch.vorburger.mariadb4j.DB; +import ch.vorburger.mariadb4j.DBConfigurationBuilder; + +/** + * @author dt5972 + * + */ +public class TestSdncDhcpEventConsumer { + + private static final Logger LOG = LoggerFactory.getLogger(TestSdncDhcpEventConsumer.class); + + + private static final String DHCP_MAP_TABLE = "CREATE TABLE `DHCP_MAP` (\n" + + " mac_addr varchar(80) NOT NULL,\n" + + " ip_addr varchar(80),\n" + + " PRIMARY KEY(`mac_addr`)\n" + + ")"; + + + + private static final String VALID_DHCP_EVENT = "{\"msg_name\":\"DHCPACK\"," + + "\"macaddr\":\"fa:16:3e:8f:ea:68\"," + + "\"yiaddr\":\"10.3.0.2\"}"; + private static final String MISSING_MSG_NAME_DHCP_EVENT = "{\"macaddr\":\"fa:16:3e:8f:ea:68\"," + + "\"yiaddr\":\"10.3.0.2\"}"; + private static final String MISSING_MAC_ADDR_DHCP_EVENT = "{\"msg_name\":\"DHCPACK\"," + + "\"yiaddr\":\"10.3.0.2\"}"; + private static final String MISSING_IP_ADDR_DHCP_EVENT = "{\"msg_name\":\"DHCPACK\"," + + "\"macaddr\":\"fa:16:3e:8f:ea:68\"}"; + + private static final String GET_DHCP_MAPPING = "SELECT * FROM DHCP_MAP WHERE mac_addr = 'fa:16:3e:8f:ea:68'"; + + + private static DBResourceManager dblibSvc; + private static DB db; + + private static SdncDhcpEventConsumer consumer; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + + LOG.debug("Setting up DHCP event testing"); + + InputStream propStr = TestSdncDhcpEventConsumer.class.getResourceAsStream("/dblib.properties"); + + Properties props = new Properties(); + + props.load(propStr); + + + // Start MariaDB4j database + + LOG.debug("Starting MariaDB instance"); + DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder(); + config.setPort(0); // 0 => autom. detect free port + db = DB.newEmbeddedDB(config.build()); + db.start(); + + + // Override jdbc URL and database name + props.setProperty("org.onap.ccsdk.sli.jdbc.database", "test"); + props.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test")); + + + // Create dblib connection + + LOG.debug("Getting DBResourceManager instance"); + dblibSvc = new DBResourceManager(props); + + // Create DHCP_MAP table + dblibSvc.writeData(DHCP_MAP_TABLE, null, null); + + consumer = new SdncDhcpEventConsumer(); + consumer.setJdbcDataSource(dblibSvc); + LOG.debug("Setup complete"); + + } + + + @Test + public void testValid() throws InvalidMessageException, SQLException { + consumer.processMsg(VALID_DHCP_EVENT); + + CachedRowSet results = dblibSvc.getData(GET_DHCP_MAPPING, null, null); + + if (!results.next()) { + fail("Test query ["+GET_DHCP_MAPPING+"] returned no data"); + } + + } + + @Test (expected = InvalidMessageException.class) + public void testMissingMsgName() throws InvalidMessageException { + consumer.processMsg(MISSING_MSG_NAME_DHCP_EVENT); + } + + @Test (expected = InvalidMessageException.class) + public void testMissingMacAddress() throws InvalidMessageException { + consumer.processMsg(MISSING_MAC_ADDR_DHCP_EVENT); + } + + @Test (expected = InvalidMessageException.class) + public void testMissingIpAddress() throws InvalidMessageException { + consumer.processMsg(MISSING_IP_ADDR_DHCP_EVENT); + } +} diff --git a/dmaap-listener/src/test/resources/dblib.properties b/dmaap-listener/src/test/resources/dblib.properties new file mode 100644 index 000000000..9506ac8d1 --- /dev/null +++ b/dmaap-listener/src/test/resources/dblib.properties @@ -0,0 +1,38 @@ +### +# ============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========================================================= +### + +# dblib.properrties +org.onap.ccsdk.sli.dbtype=jdbc + +org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01 +org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl +org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver +org.onap.ccsdk.sli.jdbc.database=sdnctl +org.onap.ccsdk.sli.jdbc.user=sdnctl +org.onap.ccsdk.sli.jdbc.password=gamma +org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01 +org.onap.ccsdk.sli.jdbc.connection.timeout=50 +org.onap.ccsdk.sli.jdbc.request.timeout=100 +org.onap.ccsdk.sli.jdbc.limit.init=10 +org.onap.ccsdk.sli.jdbc.limit.min=10 +org.onap.ccsdk.sli.jdbc.limit.max=20 +org.onap.dblib.connection.recovery=false + -- cgit 1.2.3-korg From 024e6d1689ee38b37ac054636557b5dff8f26270 Mon Sep 17 00:00:00 2001 From: Brian Freeman Date: Sun, 12 Nov 2017 22:34:34 +0000 Subject: Change dmaapClient dependency Issue-ID: CCSDK-142 Change-Id: I5a3cd0626c71eadd414ab9939774d159638b99a6 Signed-off-by: Brian Freeman --- dmaap-listener/pom.xml | 20 ++++++++++++++++---- .../northbound/dmaapclient/SdncDmaapConsumer.java | 10 ++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index d1e173ca0..0ebde6ced 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -18,7 +18,8 @@ 2.9.0.pr1 true /opt/app/dmaap-listener - 0.2.12 + 1.0.0-SNAPSHOT + yyMMdd-HHmmss ${maven.build.timestamp} ${project.version}-${build.number} @@ -27,7 +28,7 @@ - com.att.nsa + org.onap.dmaap.messagerouter.dmaapclient dmaapClient ${dmaap.listener.version} @@ -97,8 +98,19 @@ 1.7 - - + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + true + org.onap.ccsdk.sli.northbound.dmaapclient.DmaapListener + + + + maven-assembly-plugin 2.6 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 a0c555303..a51ea7c88 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 @@ -71,19 +71,25 @@ public abstract class SdncDmaapConsumer implements Runnable { try (FileInputStream in = new FileInputStream(new File(propertiesPath))) { + LOG.debug("propertiesPath: " + propertiesPath); this.properties = (Properties) properties.clone(); this.properties.load(in); - String timeoutStr = properties.getProperty("timeout"); + + String timeoutStr = this.properties.getProperty("timeout"); + LOG.debug("timeoutStr: " + timeoutStr); if ((timeoutStr != null) && (timeoutStr.length() > 0)) { timeout = parseTimeOutValue(timeoutStr); } - String fetchPauseStr = properties.getProperty("fetchPause"); + String fetchPauseStr = this.properties.getProperty("fetchPause"); + LOG.debug("fetchPause(Str): " + fetchPauseStr); if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { fetchPause = parseFetchPause(fetchPauseStr); } + LOG.debug("fetchPause: " + fetchPause); + this.consumer = MRClientFactory.createConsumer(propertiesPath); ready = true; -- cgit 1.2.3-korg From 32a9ecade35bc3e742dfbc9e86d887f25b5f49c9 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Mon, 13 Nov 2017 10:04:11 -0500 Subject: Handle duplicate DHCP event Handle case where 2 DHCP events received for same mac addr. Should use most recent IP address. Change-Id: I90399ce3c39e07c2472366c78115812a64e9124b Issue-ID: CCSDK-142 Signed-off-by: Dan Timoney --- .../ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java | 3 +-- .../sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java index 666ed68e1..03560d309 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java @@ -124,8 +124,7 @@ public class SdncDhcpEventConsumer extends SdncDmaapConsumer { try { - jdbcDataSource.writeData("INSERT INTO DHCP_MAP(mac_addr, ip_addr) VALUES('" + macAddr + "','" + ipAddr + "')", - null, null); + jdbcDataSource.writeData("INSERT INTO DHCP_MAP(mac_addr, ip_addr) VALUES('" + macAddr + "','" + ipAddr + "') ON DUPLICATE KEY UPDATE ip_addr = '"+ipAddr+"'", null, null); } catch (SQLException e) { LOG.error("Could not insert DHCP event data into the database ", e); diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java index 8c3a839c2..04f098ade 100644 --- a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncDhcpEventConsumer.java @@ -42,6 +42,9 @@ public class TestSdncDhcpEventConsumer { private static final String VALID_DHCP_EVENT = "{\"msg_name\":\"DHCPACK\"," + "\"macaddr\":\"fa:16:3e:8f:ea:68\"," + "\"yiaddr\":\"10.3.0.2\"}"; + private static final String SECOND_DHCP_EVENT = "{\"msg_name\":\"DHCPACK\"," + + "\"macaddr\":\"fa:16:3e:8f:ea:68\"," + + "\"yiaddr\":\"10.3.0.3\"}"; private static final String MISSING_MSG_NAME_DHCP_EVENT = "{\"macaddr\":\"fa:16:3e:8f:ea:68\"," + "\"yiaddr\":\"10.3.0.2\"}"; private static final String MISSING_MAC_ADDR_DHCP_EVENT = "{\"msg_name\":\"DHCPACK\"," + @@ -104,11 +107,17 @@ public class TestSdncDhcpEventConsumer { @Test public void testValid() throws InvalidMessageException, SQLException { consumer.processMsg(VALID_DHCP_EVENT); + consumer.processMsg(SECOND_DHCP_EVENT); CachedRowSet results = dblibSvc.getData(GET_DHCP_MAPPING, null, null); if (!results.next()) { fail("Test query ["+GET_DHCP_MAPPING+"] returned no data"); + } else { + String ipAddr = results.getString("ip_addr"); + if (!"10.3.0.3".equals(ipAddr)) { + fail("Expecting ipAddr to be 10.3.0.3, but was "+ipAddr); + } } } -- cgit 1.2.3-korg From 3a2b6ca0e3733f45485e2c9da2e6dfe95b77128a Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 14 Nov 2017 19:04:51 +0000 Subject: Update CCSDK northbound ueb-listener Changes made: Corrected extraction locations for role, type, ecomp_generated_naming and naming_policy in ALLOTTED_RESOURCE_MODEL. Change-Id: I59d1625ee226e194ecba81c84ead964df6307676 Issue-ID: SDNC-194 Signed-off-by: lalena.aria --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 8d480a4d1..78225de40 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 @@ -42,10 +42,10 @@ public class SdncARModel extends SdncBaseModel { addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); // extract properties - //addParameter("role", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_ROLE)); - //addParameter("type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_TYPE)); - wrong location, get from metadata - addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); - addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); + addParameter("role", extractValue (nodeTemplate, "nf_role")); + addParameter("type", extractValue (nodeTemplate, "nf_type")); + addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, "nf_naming#ecomp_generated_naming")); + addParameter("naming_policy", extractValue (nodeTemplate, "nf_naming#naming_policy")); //addParameter("depending_service", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_DEPENDINGSERVICE)); //addParameter("service_dependency", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_SERVICEDEPENDENCY)); } -- cgit 1.2.3-korg From 5ce9e010d1151fdb13b3eb32439431a06040380b Mon Sep 17 00:00:00 2001 From: Rich Bennett Date: Wed, 15 Nov 2017 06:55:41 -0500 Subject: Rm docs in repo consolidated w/ ccsdk/distribution Change-Id: I6d02b60651b48ff279be7b7207cd422207c5481f Issue-ID: DOC-130 Signed-off-by: Rich Bennett --- docs/apis/asdcApi.rst | 15 - docs/apis/dataChange.rst | 15 - docs/architecture.rst | 12 - docs/build.rst | 18 - docs/index.rst | 13 - docs/logging.rst | 14 - docs/nodes.rst | 1031 ---------------------------------------------- docs/offeredapis.rst | 13 - docs/release-notes.rst | 45 -- 9 files changed, 1176 deletions(-) delete mode 100644 docs/apis/asdcApi.rst delete mode 100644 docs/apis/dataChange.rst delete mode 100644 docs/architecture.rst delete mode 100644 docs/build.rst delete mode 100644 docs/index.rst delete mode 100644 docs/logging.rst delete mode 100644 docs/nodes.rst delete mode 100644 docs/offeredapis.rst delete mode 100644 docs/release-notes.rst diff --git a/docs/apis/asdcApi.rst b/docs/apis/asdcApi.rst deleted file mode 100644 index c9091401d..000000000 --- a/docs/apis/asdcApi.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -ASDC-API (2017-02-01) -===================== - -.. toctree:: - :maxdepth: 1 - :titlesonly: - - - -.. swaggerv2doc:: https://gerrit.onap.org/r/gitweb?p=ccsdk/sli/northbound.git;a=blob_plain;f=asdcApi/model/src/main/resources/asdc-api.20170201.json - - diff --git a/docs/apis/dataChange.rst b/docs/apis/dataChange.rst deleted file mode 100644 index 9a9dc0444..000000000 --- a/docs/apis/dataChange.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -dataChange(2015-05-19) -====================== - -.. toctree:: - :maxdepth: 1 - :titlesonly: - - - -.. swaggerv2doc:: https://gerrit.onap.org/r/gitweb?p=ccsdk/sli/northbound.git;a=blob_plain;f=dataChange/model/src/main/resources/dataChange.20150519.json - - diff --git a/docs/architecture.rst b/docs/architecture.rst deleted file mode 100644 index f2648df37..000000000 --- a/docs/architecture.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -Architecture -============ - - -Capabilities ------------- -This repository contains source code and Yang models for the northbound interfaces -used to process updates from SDC (ASDC-API) and for processing data change notifications -from A&AI (dataChange). diff --git a/docs/build.rst b/docs/build.rst deleted file mode 100644 index 0a4c308e6..000000000 --- a/docs/build.rst +++ /dev/null @@ -1,18 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -Build -===== - - -Environment ------------ -Requires maven release 3.3 or greater - -Steps ------ -To compile this code: - -1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the ONAP repositories and OpenDaylight repositories. - -2. To compile, run "mvn clean install". \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 9be06c84e..000000000 --- a/docs/index.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. - -CCSDK SLI Northbound API ------------------------- -.. toctree:: - :maxdepth: 1 - - architecture.rst - offeredapis.rst - logging.rst - build.rst - release-notes.rst - diff --git a/docs/logging.rst b/docs/logging.rst deleted file mode 100644 index 187eb03b7..000000000 --- a/docs/logging.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -Logging -======= -CCSDK uses slf4j to log messages to the standard OpenDaylight karaf.log -log file. - -Where to Access Information ---------------------------- -Logs are found within the SDNC docker container, in the directory -/opt/opendaylight/current/data/logs. - - diff --git a/docs/nodes.rst b/docs/nodes.rst deleted file mode 100644 index 3bdeabcfa..000000000 --- a/docs/nodes.rst +++ /dev/null @@ -1,1031 +0,0 @@ ---- Service Logic Interpreter --- Dan Timoney --- 2014-11-12 --- - -Supported node types -==================== - -The following built-in node types are currently supported: - -- Flow Control - - - `**block** <#Block_node>`__ - - - `**call** <#Call_node>`__ - - - `**for** <#For_node>`__ - - - `**return** <#Return_node>`__ - - - `**set** <#Set_node>`__ - - - `**switch** <#Switch_node>`__ - -- Device Management - - - `**configure** <#Configure_node>`__ - -- Java Plugin Support - - - `**execute** <#Execute_node>`__ - -- Recording - - - `**record** <#Record_node>`__ - -- Resource Management - - - `**delete** <#Delete_node>`__ - - - `**exists** <#Exists_node>`__ - - - `**get-resource** <#Get-resource_node>`__ - - - `**is-available** <#Is-available_node>`__ - - - `**notify** <#Notify_node>`__ - - - `**release** <#Release_node>`__ - - - `**reserve** <#Reserve_node>`__ - - - `**save** <#Save_node>`__ - - - `**update** <#Update_node>`__ - -Flow Control ------------- - -Block node -~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **block** node is used to executes a set of nodes. - -Attributes -^^^^^^^^^^ - -+--------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| **atomic** | if *true*, then if a node returns failure, subsequent nodes will not be executed and nodes already executed will be backed out. | -+--------------+-----------------------------------------------------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -None - -Example -^^^^^^^ - -:: - - - - - - - - - - - - - -Call node -~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **call** node is used to call another graph - -Attributes -^^^^^^^^^^ - -+---------------+------------------------------------------------------------------------------------+ -| **module** | Module of directed graph to call. If unset, defaults to that of calling graph | -+---------------+------------------------------------------------------------------------------------+ -| **rpc** | rpc of directed graph to call. | -+---------------+------------------------------------------------------------------------------------+ -| **version** | version of graph to call, If unset, uses active version. | -+---------------+------------------------------------------------------------------------------------+ -| **mode** | mode (sync/async) of graph to call. If unset, defaults to that of calling graph. | -+---------------+------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -Not applicable - -Outcomes -^^^^^^^^ - -+-----------------+------------------------------+ -| **success** | Sub graph returned success | -+-----------------+------------------------------+ -| **not-found** | Graph not found | -+-----------------+------------------------------+ -| **failure** | Subgraph returned success | -+-----------------+------------------------------+ - -Table: . - -Example -^^^^^^^ - -:: - - - -For node -~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **for** node provides a fixed iteration looping mechanism, similar to -the Java for loop - -Attributes -^^^^^^^^^^ - -+-------------+------------------+ -| **index** | index variable | -+-------------+------------------+ -| **start** | initial value | -+-------------+------------------+ -| **end** | maximum value | -+-------------+------------------+ - -Parameters -^^^^^^^^^^ - -Not applicable. - -Outcomes -^^^^^^^^ - -Not applicable. The **status** node has no outcomes. - -Example -^^^^^^^ - -:: - - - - - - - - - -Return node -~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **return** node is used to return a status to the invoking MD-SAL -application - -Attributes -^^^^^^^^^^ - -+--------------+---------------------------------------------------+ -| **status** | Status value to return (*success* or *failure*) | -+--------------+---------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -The following optional parameters may be passed to convey more detailed -status information. - -+---------------------+-----------------------------------------------------------------+ -| **error-code** | A brief, usually numeric, code indicating the error condition | -+---------------------+-----------------------------------------------------------------+ -| **error-message** | A more detailed error message | -+---------------------+-----------------------------------------------------------------+ - -Outcomes -^^^^^^^^ - -Not applicable. The **status** node has no outcomes. - -Example -^^^^^^^ - -:: - - - - - - -Set node -~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **set** node is used to set one or more values in the execution -context - -Attributes -^^^^^^^^^^ - -+---------------------+-------------------------------------------------------------------------------------+ -| **only-if-unset** | If true the set node will only execute if the current value of the target is null | -+---------------------+-------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -Values to be set are passed as parameters - -Outcomes -^^^^^^^^ - -Not applicable. The **set** node has no outcomes. - -Example -^^^^^^^ - -:: - - - - - -Switch node -~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **switch** node is used to make a decision based on its **test** -attribute. - -Attributes -^^^^^^^^^^ - -+------------+---------------------+ -| **test** | Condition to test | -+------------+---------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -Depends on the **test** condition - -Example -^^^^^^^ - -:: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Device Management ------------------ - -Configure node -~~~~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **configure** node is used to configure a device. - -Attributes -^^^^^^^^^^ - -+----------------+-----------------------------------------------------------------------------------+ -| **adaptor** | Fully qualified Java class of resource adaptor to be used | -+----------------+-----------------------------------------------------------------------------------+ -| **activate** | Activate device/interface, for devices that support a separate activation step. | -+----------------+-----------------------------------------------------------------------------------+ -| **key** | SQL-like string specifying criteria for item to configure | -+----------------+-----------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -Specific to device adaptor. - -Outcomes -^^^^^^^^ - -+----------------------+------------------------------------------------------------------+ -| **success** | Device successfully configured | -+----------------------+------------------------------------------------------------------+ -| **not-found** | Element to be configured does not exist. | -+----------------------+------------------------------------------------------------------+ -| **not-ready** | Element is not in a state where it can be configured/activated | -+----------------------+------------------------------------------------------------------+ -| **already-active** | Attempt to activate element that is already active | -+----------------------+------------------------------------------------------------------+ -| **failure** | Configure failed for some other reason | -+----------------------+------------------------------------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Java Plugin Support -------------------- - -Execute node -~~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -An **execute** node is used to execute Java code supplied as a plugin - -Attributes -^^^^^^^^^^ - -+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of plugin to be used | -+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| **method** | Name of method in the plugin class to execute. Method must return void, and take 2 arguments: a Map (for parameters) and a SvcLogicContext (to allow plugin read/write access to context memory) | -+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -Specific to plugin / method - -Outcomes -^^^^^^^^ - -+--------------------------+-----------------------------------------------------------------+ -| **success** | Device successfully configured | -+--------------------------+-----------------------------------------------------------------+ -| **not-found** | Plugin class could not be loaded | -+--------------------------+-----------------------------------------------------------------+ -| **unsupported-method** | Named method taking (Map, SvcLogicContext) could not be found | -+--------------------------+-----------------------------------------------------------------+ -| **failure** | Configure failed for some other reason | -+--------------------------+-----------------------------------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - - - - - - - - - - - -Recording ---------- - -Record node -~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **record** node is used to record an event. For example, this might be -used to log provisioning events. - -Attributes -^^^^^^^^^^ - -+--------------+---------------------------------------------------+ -| **plugin** | Fully qualified Java class to handle recording. | -+--------------+---------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -Parameters will depend on the plugin being used. For the FileRecorder -class, the parameters are as follows - -+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| **file** | The file to which the record should be written | -+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| **field1** | First field to write. There will be **field** parameters for each field to write, from **field1** through **fieldN**. A special value \_\_TIMESTAMP\_\_ may be assigned to a field to insert the current timestamp | -+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - -Outcomes -^^^^^^^^ - -+---------------+--------------------------------------------+ -| **success** | Record successfully written | -+---------------+--------------------------------------------+ -| **failure** | Record could not be successfully written | -+---------------+--------------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - -Resource Management -------------------- - -Delete node -~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **delete** node is used to delete a resource from the local resource -inventory. - -Attributes -^^^^^^^^^^ - -+----------------+-------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+-------------------------------------------------------------+ -| **resource** | Type of resource to delete | -+----------------+-------------------------------------------------------------+ -| **key** | SQL-like string specifying key to delete | -+----------------+-------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -+---------------+--------------------------------------------+ -| **success** | Resource specified deleted successfully. | -+---------------+--------------------------------------------+ -| *failure*> | Resource specified was not deleted | -+---------------+--------------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - -Exists node -~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -An **exists** node is used to determine whether a particular instance of -a resource exists. For example, this might be used to test whether a -particular switch CLLI is provisioned. - -Attributes -^^^^^^^^^^ - -+----------------+-------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+-------------------------------------------------------------+ -| **resource** | Type of resource to check | -+----------------+-------------------------------------------------------------+ -| **key** | SQL-like string specifying key to check for | -+----------------+-------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -+-------------+---------------------------------+ -| **true** | Resource specified exists. | -+-------------+---------------------------------+ -| **false** | Resource specified is unknown | -+-------------+---------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - -Get-resource node -~~~~~~~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **get-resource** node is used to retrieve information about a -particular resource and make it available to other nodes in the service -logic tree. For example, this might be used to retrieve information -about a particular uni-port. - -Attributes -^^^^^^^^^^ - -+----------------+------------------------------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+------------------------------------------------------------------------------------------+ -| **resource** | Type of resource to retrieve | -+----------------+------------------------------------------------------------------------------------------+ -| **key** | SQL-like string specifying criteria for retrieval | -+----------------+------------------------------------------------------------------------------------------+ -| **pfx** | Prefix to add to context variable names set for data retrieved | -+----------------+------------------------------------------------------------------------------------------+ -| **select** | String to specify, if key matches multiple entries, which entry should take precedence | -+----------------+------------------------------------------------------------------------------------------+ -| **order-by** | Prefix to add to context variable names set for data retrieved | -+----------------+------------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -+-----------------+--------------------------------------------------+ -| **success** | Resource successfully retrieved | -+-----------------+--------------------------------------------------+ -| **not-found** | Resource referenced does not exist | -+-----------------+--------------------------------------------------+ -| **failure** | Resource retrieve failed for some other reason | -+-----------------+--------------------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - - - - -Is-available node -~~~~~~~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -An **is-available** node is used to determine whether a particular type -of resource is available. For example, this might be used to test -whether any ports are available for assignment on a particular switch. - -Attributes -^^^^^^^^^^ - -+----------------+------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+------------------------------------------------------------------+ -| **resource** | Type of resource to check | -+----------------+------------------------------------------------------------------+ -| **key** | SQL-like string specifying key to check for | -+----------------+------------------------------------------------------------------+ -| **pfx** | Prefix to add to context variable names set for data retrieved | -+----------------+------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -+-------------+---------------------------------------+ -| **true** | Resource requested is available | -+-------------+---------------------------------------+ -| **false** | Resource requested is not available | -+-------------+---------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - -Notify node -~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **notify** node is used to inform an external application (e.g. A&AI) -that a resource was updated. - -Attributes -^^^^^^^^^^ - -+----------------+---------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+---------------------------------------------------------------------+ -| **resource** | Identifies resource that was updated | -+----------------+---------------------------------------------------------------------+ -| **action** | Action that triggered notification to be sent (ADD/UPDATE/DELETE) | -+----------------+---------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -+---------------+----------------------------------------+ -| **success** | Notification was successful | -+---------------+----------------------------------------+ -| **failure** | Notification failed is not available | -+---------------+----------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - -Release node -~~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **release** node is used to mark a resource as no longer in use, and -thus available for assignment. - -Attributes -^^^^^^^^^^ - -+----------------+------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+------------------------------------------------------------------+ -| **resource** | Type of resource to release | -+----------------+------------------------------------------------------------------+ -| **key** | SQL-like string specifying key to check of resource to release | -+----------------+------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -+-----------------+-------------------------------------------------+ -| **success** | Resource successfully released | -+-----------------+-------------------------------------------------+ -| **not-found** | Resource referenced does not exist | -+-----------------+-------------------------------------------------+ -| **failure** | Resource release failed for some other reason | -+-----------------+-------------------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - - - - -Reserve node -~~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **reserve** node is used to reserve a particular type of resource.. -For example, this might be used to reserve a port on a particular -switch. - -Attributes -^^^^^^^^^^ - -+----------------+----------------------------------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+----------------------------------------------------------------------------------------------+ -| **resource** | Type of resource to reserve | -+----------------+----------------------------------------------------------------------------------------------+ -| **key** | SQL-like string specifying criteria for reservation | -+----------------+----------------------------------------------------------------------------------------------+ -| **select** | String to specify, if **key** matches multiple entries, which entry should take precedence | -+----------------+----------------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -None - -Outcomes -^^^^^^^^ - -+---------------+----------------------------------------------------+ -| **success** | Resource requested was successfully reserved | -+---------------+----------------------------------------------------+ -| **failure** | Resource requested was not successfully reserved | -+---------------+----------------------------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - -Save node -~~~~~~~~~ - -Description -^^^^^^^^^^^ - -A **save** node is used to save information about a particular resource -to persistent storage. For example, this might be used to save -information about a particular uni-port. - -Attributes -^^^^^^^^^^ - -+----------------+------------------------------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+------------------------------------------------------------------------------------------+ -| **resource** | Type of resource to save | -+----------------+------------------------------------------------------------------------------------------+ -| **key** | SQL-like string specifying criteria for retrieval | -+----------------+------------------------------------------------------------------------------------------+ -| **force** | If "true", save resource even if this resource is already stored in persistent storage | -+----------------+------------------------------------------------------------------------------------------+ -| **pfx** | Prefix to be prepended to variable names, when attributes are set in SvcLogicContext | -+----------------+------------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -Values to save (columns) are specified as parameters, with each name -corresponding to a column name and each value corresponding to the value -to set. - -Outcomes -^^^^^^^^ - -+---------------+-------------------------------+ -| **success** | Resource successfully saved | -+---------------+-------------------------------+ -| **failure** | Resource save failed | -+---------------+-------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - - -Update node -~~~~~~~~~~~ - -Description -^^^^^^^^^^^ - -An **update** node is used to update information about a particular -resource to persistent storage. - -Attributes -^^^^^^^^^^ - -+----------------+----------------------------------------------------------------------------------------+ -| **plugin** | Fully qualified Java class of resource adaptor to be used | -+----------------+----------------------------------------------------------------------------------------+ -| **resource** | Type of resource to update | -+----------------+----------------------------------------------------------------------------------------+ -| **key** | SQL-like string specifying criteria for retrieval | -+----------------+----------------------------------------------------------------------------------------+ -| **pfx** | Prefix to be prepended to variable names, when attributes are set in SvcLogicContext | -+----------------+----------------------------------------------------------------------------------------+ - -Parameters -^^^^^^^^^^ - -Values to save (columns) are specified as parameters, with each name -corresponding to a column name and each value corresponding to the value -to set. - -Outcomes -^^^^^^^^ - -+---------------+-------------------------------+ -| **success** | Resource successfully saved | -+---------------+-------------------------------+ -| **failure** | Resource save failed | -+---------------+-------------------------------+ - -Example -^^^^^^^ - -:: - - - - - - - - - diff --git a/docs/offeredapis.rst b/docs/offeredapis.rst deleted file mode 100644 index 2eebdec92..000000000 --- a/docs/offeredapis.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -Offered APIs -============ - -.. toctree:: - :maxdepth: 1 - :titlesonly: - - apis/asdcApi.rst - apis/dataChange.rst - diff --git a/docs/release-notes.rst b/docs/release-notes.rst deleted file mode 100644 index 21ff338cf..000000000 --- a/docs/release-notes.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. - -Release Notes -============= - -.. note:: - * This Release Notes must be updated each time the team decides to Release new artifacts. - * The scope of this Release Notes is for this particular component. In other words, each ONAP component has its Release Notes. - * This Release Notes is cumulative, the most recently Released artifact is made visible in the top of this Release Notes. - * Except the date and the version number, all the other sections are optional but there must be at least one section describing the purpose of this new release. - * This note must be removed after content has been added. - - -Version: x.y.z --------------- - - -:Release Date: yyyy-mm-dd - - - -**New Features** - -One or two sentences explaining the purpose of this Release. - -**Bug Fixes** - - `CIMAN-65 `_ and a sentence explaining what this defect is addressing. -**Known Issues** - - `CIMAN-65 `_ and two, three sentences. - One sentences explaining what is the issue. - - Another sentence explaining the impact of the issue. - - And an optional sentence providing a workaround. - -**Security Issues** - You may want to include a reference to CVE (Common Vulnerabilities and Exposures) `CVE `_ - - -**Upgrade Notes** - -**Deprecation Notes** - -**Other** - -- cgit 1.2.3-korg From b87ff9b0683e410a6e0d0eac9f6b413aa9171cd4 Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Thu, 16 Nov 2017 23:51:48 -0800 Subject: Bump minor version Bump minor version in preparation for Amsterdam branching. Change-Id: I3d8c31a414a0539e2e59cb103f3395b863e7c18a Issue-ID: CIMAN-120 Signed-off-by: Jessica Wagantall --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index ef1134635..ebb19b8f6 100644 --- a/version.properties +++ b/version.properties @@ -4,7 +4,7 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=1 +sprint_number=2 feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From e4273428d8af86850e97da84a1bbaaffb06269ff Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Fri, 17 Nov 2017 16:56:52 -0800 Subject: Bump minor version Bump minor version in preparation for Amsterdam branching. (part 2) Change-Id: If8259634fe96f9a78cf59a9346dd051cc674e6c3 Issue-ID: CIMAN-120 Signed-off-by: Jessica Wagantall --- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 2 +- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 6 +++--- pom.xml | 2 +- ueb-listener/pom.xml | 4 ++-- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 16f93591d..73cc0dd12 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT asdcApi-features diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 03153fe63..1b7666935 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT asdcApi-installer asdcApi - Karaf Installer diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index fc874b4c8..a3b94f54f 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,11 +5,11 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT bundle diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 677d94ba2..932569b09 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT pom org.onap.ccsdk.sli.northbound asdcApi - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 12240b388..9382b9d8a 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -4,7 +4,7 @@ asdcApi org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT asdcApi-provider bundle diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 7377ffc85..93dbd0554 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -4,11 +4,11 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT jar diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index fc44b8743..31623ba13 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -4,7 +4,7 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT dataChange-installer dataChange - Karaf Installer diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 939b218b0..c3d6d6b5c 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,11 +5,11 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT bundle diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 57aed1f09..f0bbf6eb3 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT pom org.onap.ccsdk.sli.northbound dataChange - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index d534e30e6..7d35817ef 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -4,7 +4,7 @@ dataChange org.onap.ccsdk.sli.northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT dataChange-provider bundle diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 0ebde6ced..d9f4084f4 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -4,17 +4,17 @@ org.onap.ccsdk.sli.northbound jar dmaap-listener - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT DMAAP Listener DMAAP Listener org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT - 1.1.7-SNAPSHOT + 1.2.0-SNAPSHOT 2.9.0.pr1 true /opt/app/dmaap-listener diff --git a/pom.xml b/pom.xml index 9479abb51..ded5f124b 100644 --- a/pom.xml +++ b/pom.xml @@ -112,7 +112,7 @@ AT&T - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 8a83bb5da..21173680a 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.sli.northbound jar ueb-listener - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT UEB Listener UEB Listener org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT 1.1.32 -- cgit 1.2.3-korg From de105b1594de8203e3af72c2e70a29a9e848b557 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 21 Nov 2017 15:33:09 -0500 Subject: Fix version.properties Reset patch version to 0 in version.properties Change-Id: Ife38d85b4aef218a98901c7b5c7d951e11690f54 Issue-ID: CIMAN-120 Signed-off-by: Dan Timoney --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index ebb19b8f6..efb7e63bc 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=2 -feature_revision=1 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 0bf3682de79e4274566b37a941eef609d26559c2 Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Wed, 13 Dec 2017 19:01:16 +0530 Subject: Fix dmaapClient version Fix org.onap.dmaap.messagerouter.dmaapClinet:dmappClient.jar version Change-Id: I5bbf068b21eb3563195c55b0156f2ff401873e45 Issue-ID: CCSDK-154 Signed-off-by: Ramu N --- dmaap-listener/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index d9f4084f4..8705ff1aa 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -18,7 +18,7 @@ 2.9.0.pr1 true /opt/app/dmaap-listener - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT yyMMdd-HHmmss ${maven.build.timestamp} -- cgit 1.2.3-korg From bb266b8b2436841ed4b950df187f1fb88376bb22 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Thu, 14 Dec 2017 15:11:04 +0530 Subject: Removal of unused parenthesis Change-Id: I5050503d1993e880851fb56f6b7c3ef8ece192b6 Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java | 2 +- .../org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModel.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) 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 821057ef3..a2556b4ba 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 @@ -87,7 +87,7 @@ public class SdncOdlConnection { public static SdncOdlConnection newInstance(String url, String user, String password) throws IOException { - return (new SdncOdlConnection(url, user, password)); + return new SdncOdlConnection(url, user, password); } 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 d3fd16791..012c3d9e2 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 @@ -28,10 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncServiceModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncServiceModel.class); - + private String UUID = null; private String serviceInstanceNamePrefix = null; private String filename = null; @@ -48,7 +45,7 @@ public class SdncServiceModel extends SdncBaseModel { } public String getServiceUUID() { - return ("\"" + UUID + "\""); + return "\"" + UUID + "\""; } public void setServiceUUID(String serviceUUID) { this.UUID = serviceUUID; -- cgit 1.2.3-korg From e994e1ae5d445c649946ea7703f00e7e1b6adb55 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Fri, 15 Dec 2017 18:54:34 +0530 Subject: Removal of unused variables Change-Id: I73dff3b51f1895fc0282e4d3d662bc9019a87e31 Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java | 3 --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 3 --- 2 files changed, 6 deletions(-) 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 78225de40..b26c50fb2 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 @@ -30,9 +30,6 @@ import org.slf4j.LoggerFactory; public class SdncARModel extends SdncBaseModel { - private static final Logger LOG = LoggerFactory - .getLogger(SdncARModel.class); - public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { super(sdcCsarHelper, nodeTemplate); 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 6128f288b..4737f8508 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 @@ -34,9 +34,6 @@ import org.slf4j.LoggerFactory; public class SdncBaseModel { - private static final Logger LOG = LoggerFactory - .getLogger(SdncBaseModel.class); - protected String customizationUUID = null; protected String invariantUUID = null; protected String model_yaml = null; -- cgit 1.2.3-korg From 22a18f12b2338c15dc266289955efa94ba99c157 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Thu, 14 Dec 2017 16:27:14 +0530 Subject: Removal of useless parenthesis Change-Id: Ida52e0fab68d33ef446378024441ca3af0762f70 Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 4 ++-- .../org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) 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 6128f288b..758f862ba 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 @@ -233,10 +233,10 @@ public class SdncBaseModel { } public String getCustomizationUUID() { - return ("\"" + customizationUUID + "\""); + return "\"" + customizationUUID + "\""; } public String getCustomizationUUIDNoQuotes() { - return (customizationUUID); + return customizationUUID; } public void setCustomizationUUID(String customizationUUID) { this.customizationUUID = customizationUUID; 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 2fec84cb1..0a4931715 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 @@ -28,10 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncNodeModel extends SdncBaseModel { - - private static final Logger LOG = LoggerFactory - .getLogger(SdncNodeModel.class); - + private String serviceUUID = null; private String ecompGeneratedNaming = null; private String [] bindingUuids = null; @@ -41,7 +38,7 @@ public class SdncNodeModel extends SdncBaseModel { super(sdcCsarHelper, nodeTemplate); - // extract inputs + // extract inpuecompGeneratedNamingts String ecompGeneratedNaming = extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING); addParameter("ecomp_generated_naming",ecompGeneratedNaming); addParameter("naming_policy", extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); -- cgit 1.2.3-korg From ec6b8d46a51c4f7b6dbc762e76d7f229a544fe1e Mon Sep 17 00:00:00 2001 From: root1 Date: Wed, 13 Dec 2017 11:56:13 +0530 Subject: Removal of useless parenthesis Issue-ID: CCSDK-151 Change-Id: Id27a026c599803705dd0675253b212e16228000a Signed-off-by: root1 --- .../java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 51fdd7002..02dc786ac 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 @@ -40,7 +40,7 @@ public class AsdcApiSliClient { public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException { - return(svcLogicService.hasGraph(module, rpc, version, mode)); + return svcLogicService.hasGraph(module, rpc, version, mode); } @@ -88,7 +88,7 @@ public class AsdcApiSliClient { } - return (respProps); + return respProps; } } -- cgit 1.2.3-korg From 383d433f5cbb7394a9c335eff7759c9e2126f106 Mon Sep 17 00:00:00 2001 From: root1 Date: Wed, 13 Dec 2017 14:24:43 +0530 Subject: Fixed to improve the Maintainability of code Issue-ID: CCSDK-151 Change-Id: If8bf17dd0e5387855ddbff9198107f334ded59c5 Signed-off-by: SRINIVAS V --- .../ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 13 +++++++------ .../org/onap/ccsdk/sli/northbound/DataChangeClient.java | 15 ++++++++------- .../org/onap/ccsdk/sli/northbound/DataChangeProvider.java | 4 +--- 3 files changed, 16 insertions(+), 16 deletions(-) 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 cebcb9986..ea5740967 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 @@ -301,19 +301,20 @@ public Future> vfLicenseModelUpdate(VfLice } VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(input); - input = inputBuilder.build(); + + VfLicenseModelUpdateInput inputVfLic = inputBuilder.build(); String errorMessage = "Success"; String errorCode = "200"; // If this artifact already exists, reject this update - if (artifactVersionExists(input.getArtifactName(), input.getArtifactVersion())) { + if (artifactVersionExists(inputVfLic.getArtifactName(), inputVfLic.getArtifactVersion())) { errorCode = "409"; errorMessage = "Artifact version already exists"; } else { // Translate input object into SLI-consumable properties - LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); - AsdcApiUtil.toProperties(parms, input); + LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + inputVfLic); + AsdcApiUtil.toProperties(parms, inputVfLic); // Call directed graph @@ -356,8 +357,8 @@ public Future> vfLicenseModelUpdate(VfLice LOG.info("ASDC update succeeded"); // Update config tree - applyVfLicenseModelUpdate(input); - addArtifactVersion(input.getArtifactName(), input.getArtifactVersion()); + applyVfLicenseModelUpdate(inputVfLic); + addArtifactVersion(inputVfLic.getArtifactName(), inputVfLic.getArtifactVersion()); } else { LOG.info("ASDC update failed ("+errorCode+" : "+errorMessage); 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 4bf857797..959b2b6fb 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 @@ -42,7 +42,7 @@ public class DataChangeClient { public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException { - return(svcLogicService.hasGraph(module, rpc, version, mode)); + return svcLogicService.hasGraph(module, rpc, version, mode); } public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData) @@ -56,22 +56,23 @@ public class DataChangeClient { public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData, Properties parms) throws SvcLogicException { - parms = MdsalHelper.toProperties(parms, serviceData); + Properties localProp; + localProp = MdsalHelper.toProperties(parms, serviceData); if (LOG.isDebugEnabled()) { LOG.debug("Parameters passed to SLI"); - for (Object key : parms.keySet()) { + for (Object key : localProp.keySet()) { String parmName = (String) key; - String parmValue = parms.getProperty(parmName); + String parmValue = localProp.getProperty(parmName); LOG.debug(parmName+" = "+parmValue); } } - Properties respProps = svcLogicService.execute(module, rpc, version, mode, parms); + Properties respProps = svcLogicService.execute(module, rpc, version, mode, localProp); if (LOG.isDebugEnabled()) { @@ -86,12 +87,12 @@ public class DataChangeClient { } } if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - return (respProps); + return respProps; } MdsalHelper.toBuilder(respProps, serviceData); - return (respProps); + return respProps; } } 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 2b45cc7d7..91482d852 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 @@ -121,15 +121,13 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { MdsalHelper.toProperties(parms, inputBuilder.build()); // Call SLI sync method - Properties respProps = null; - try { if (dataChangeClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) { try { - respProps = dataChangeClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + dataChangeClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); } catch (Exception e) { -- cgit 1.2.3-korg From 6cf53198be74497668c3ed38f2127b26ae74bc69 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Tue, 19 Dec 2017 19:23:28 +0530 Subject: typeCasting issue and useless assignment fix Change-Id: Iab98bdec347fc9b15afc78de1b99eab8fbff5ad1 Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 2 +- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 aa856b4fe..39ed39676 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 @@ -881,7 +881,7 @@ public class SdncUebCallback implements INotificationCallback { private DistributionStatusEnum deploySpoolFile(DeployableArtifact artifact) { - DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_OK; + DistributionStatusEnum deployResult; StringBuffer msgBuffer = new StringBuffer(); 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 1d1f47634..0694a6da7 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 @@ -51,7 +51,7 @@ public class SdncUebClient { long startTm = System.currentTimeMillis(); int sleepTm = config.getPollingInterval() * 1000; - long maxWaitTm = config.getClientStartupTimeout() * 1000; + long maxWaitTm = config.getClientStartupTimeout() * 1000L; boolean keepWaiting = true; -- cgit 1.2.3-korg From 613f3941a43afa5347c5df6e6e764869d0475973 Mon Sep 17 00:00:00 2001 From: root1 Date: Tue, 19 Dec 2017 20:28:25 +0530 Subject: Removal of useless parenthesis Change-Id: I6ef27a2795e91948b996055decffc051373d6113 Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 1d499a1e7..231fa0e4f 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 @@ -140,7 +140,7 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { if (!mapFile.canRead()) { LOG.error(String.format("Cannot read map file (%s)", mapFilename)); - return (null); + return null; } try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) { @@ -160,9 +160,9 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { mapReader.close(); } catch (Exception e) { LOG.error("Caught exception reading map " + mapFilename, e); - return (null); + return null; } - return (results); + return results; } } -- cgit 1.2.3-korg From 0d27d85eb387bd56b1f8dab34a9381bcc20db7d5 Mon Sep 17 00:00:00 2001 From: root1 Date: Tue, 19 Dec 2017 19:02:44 +0530 Subject: Fixed as per Java Code Conventions Change-Id: Ib17c601ad6a2999e4396f84e18831b5f907557eb Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../sli/northbound/dmaapclient/SdncDmaapConsumer.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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 a51ea7c88..ed71337a3 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 @@ -44,15 +44,6 @@ public abstract class SdncDmaapConsumer implements Runnable { private int fetchPause = 5000; // Default pause between fetch - 5 seconds private int timeout = 15000; // Default timeout - 15 seconds - public boolean isReady() { - return ready; - } - - - public boolean isRunning() { - return running; - } - public SdncDmaapConsumer() { } @@ -61,8 +52,16 @@ public abstract class SdncDmaapConsumer implements Runnable { init(properties, propertiesPath); } + public boolean isReady() { + return ready; + } + + public boolean isRunning() { + return running; + } + public String getProperty(String name) { - return (properties.getProperty(name, "")); + return properties.getProperty(name, ""); } public void init(Properties properties, String propertiesPath) { -- cgit 1.2.3-korg From 124fa28fffe41658dd9a7fc77c91b3279a7c92cd Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Thu, 21 Dec 2017 15:59:52 +0530 Subject: Impact on performance fix Change-Id: I36e82265087ebce69c7f01c8e75b7c932a969d0e Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 a2556b4ba..78d9c5bc9 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 @@ -137,7 +137,7 @@ public class SdncOdlConnection { respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); } - StringBuffer respBuff = new StringBuffer(); + StringBuilder respBuff = new StringBuilder(); String respLn; @@ -150,7 +150,7 @@ public class SdncOdlConnection { LOG.info("Response body :\n" + respString); - return (respString); + return respString; } -- cgit 1.2.3-korg From 263950413073f5d1d7af3d2854052af8ec41d281 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Thu, 21 Dec 2017 16:52:36 +0530 Subject: Removal of unused private field Change-Id: Ie2d33f7f9dba20a4d0fdf6a33f8574e953633a69 Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java | 5 +---- .../ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) 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 a51ea7c88..a9f5fedad 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 @@ -35,7 +35,6 @@ public abstract class SdncDmaapConsumer implements Runnable { private static final Logger LOG = LoggerFactory .getLogger(SdncDmaapConsumer.class); - private String propertiesPath = ""; private Properties properties = null; private MRConsumer consumer = null; private MRConsumerResponse consumerResponse = null; @@ -62,13 +61,11 @@ public abstract class SdncDmaapConsumer implements Runnable { } public String getProperty(String name) { - return (properties.getProperty(name, "")); + return properties.getProperty(name, ""); } public void init(Properties properties, String propertiesPath) { - this.propertiesPath = propertiesPath; - try (FileInputStream in = new FileInputStream(new File(propertiesPath))) { LOG.debug("propertiesPath: " + propertiesPath); 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 1d499a1e7..ce65e783e 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 @@ -124,6 +124,8 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { private Map loadMap(String msgType, String mapDirName) { Map results = new HashMap<>(); + String dirName = mapDirName; + if (mapDirName == null) { String rootdir = System.getenv(DMAAPLISTENERROOT); @@ -131,10 +133,10 @@ public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { rootdir = "/opt/app/dmaap-listener"; } - mapDirName = rootdir + "/lib"; + dirName = rootdir + "/lib"; } - String mapFilename = mapDirName + "/" + msgType + ".map"; + String mapFilename = dirName + "/" + msgType + ".map"; File mapFile = new File(mapFilename); -- cgit 1.2.3-korg From ae93ec85ad6ee1a926309770bcf4b2d1607e420c Mon Sep 17 00:00:00 2001 From: SRINIVAS V Date: Thu, 28 Dec 2017 12:23:54 +0530 Subject: Removal of useless parenthesis Change-Id: I27289de2837414d45efcdd3f617d2b399a8f8ac6 Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 39ed39676..0db96f54b 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 @@ -845,15 +845,15 @@ public class SdncUebCallback implements INotificationCallback { LOG.error("Unexpected file contents - root tag is "+rootName); } - return(mapEntry); + return mapEntry; } else { LOG.error("Cannot get root tag from file"); - return(null); + return null; } } catch (Exception e) { LOG.error("Could not parse YANG_XML file "+spoolFile.getName(), e); - return(null); + return null; } } @@ -922,7 +922,7 @@ public class SdncUebCallback implements INotificationCallback { } } catch (Exception e) { LOG.error("Could not process spool file "+artifact.getFile().getName(), e); - return(DistributionStatusEnum.DEPLOY_ERROR); + return DistributionStatusEnum.DEPLOY_ERROR; } msgBuffer.append("\n"); @@ -966,7 +966,7 @@ public class SdncUebCallback implements INotificationCallback { - return(deployResult); + return deployResult; } @@ -977,7 +977,7 @@ public class SdncUebCallback implements INotificationCallback { final IDistributionClient client, final INotificationData data, final IArtifactInfo relevantArtifact, final DistributionStatusEnum status) { - IDistributionStatusMessage statusMessage = new IDistributionStatusMessage() { + IDistributionStatusMessage statusMessage = new IDistributionStatusMessage() { @Override public long getTimestamp() { -- cgit 1.2.3-korg From ea30060e14c8bf675322e216d6cc443981474671 Mon Sep 17 00:00:00 2001 From: SRINIVAS V Date: Fri, 29 Dec 2017 15:31:54 +0530 Subject: Fixed as per Java Code Conventions Change-Id: I3a6fef42ba03db226705d96382f6cd6b4cfe14e7 Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 0db96f54b..5fd2e2a87 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 @@ -367,8 +367,7 @@ public class SdncUebCallback implements INotificationCallback { IArtifactInfo artifactInfo = artifact.getArtifactInfo(); if ((artifactInfo != null) && (data != null)) { - IDistributionClientResult deploymentStatus; - deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( + client.sendDeploymentStatus(buildStatusMessage( client, data, artifactInfo, deployResult)); } -- cgit 1.2.3-korg From ed713dafb77bb57b62ed8eb7da4a1364dca0ad17 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Tue, 2 Jan 2018 11:55:42 +0530 Subject: Removal of unused variable Change-Id: Idaf07c98ef0fef3923ddd7a9e185b727cb93b16f Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../sli/northbound/uebclient/SdncUebCallback.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) 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 0db96f54b..89459bcdf 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 @@ -266,7 +266,7 @@ public class SdncUebCallback implements INotificationCallback { LOG.info("Received artifact " + curArtifact.getArtifactName()); - handleArtifact(data, data.getServiceName(), null, null, curArtifact, incomingDir, archiveDir); + handleArtifact(data, data.getServiceName(), null, curArtifact, incomingDir, archiveDir); } } @@ -295,7 +295,7 @@ public class SdncUebCallback implements INotificationCallback { LOG.info("Received artifact " + curArtifact.getArtifactName()); - handleArtifact(data, data.getServiceName(), curResource.getResourceName(), curResource.getResourceType(), curArtifact, incomingDir, archiveDir); + handleArtifact(data, data.getServiceName(), curResource.getResourceName(), curArtifact, incomingDir, archiveDir); } } } @@ -367,8 +367,7 @@ public class SdncUebCallback implements INotificationCallback { IArtifactInfo artifactInfo = artifact.getArtifactInfo(); if ((artifactInfo != null) && (data != null)) { - IDistributionClientResult deploymentStatus; - deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( + client.sendDeploymentStatus(buildStatusMessage( client, data, artifactInfo, deployResult)); } @@ -378,7 +377,7 @@ public class SdncUebCallback implements INotificationCallback { } } - private void handleArtifact(INotificationData data, String svcName, String resourceName, String resourceType, + private void handleArtifact(INotificationData data, String svcName, String resourceName, IArtifactInfo artifact, File incomingDir, File archiveDir) { // Download Artifact @@ -438,22 +437,21 @@ public class SdncUebCallback implements INotificationCallback { private void handleFailedDownload(INotificationData data, IArtifactInfo relevantArtifact) { // Send Download Status - IDistributionClientResult sendDownloadStatus = client - .sendDownloadStatus(buildStatusMessage(client, data, + client.sendDownloadStatus(buildStatusMessage(client, data, relevantArtifact, DistributionStatusEnum.DOWNLOAD_ERROR)); } private void handleSuccessfulDownload(INotificationData data, String svcName, String resourceName, - IArtifactInfo artifact, File spoolFile, File archiveDir) { + IArtifactInfo artifact, File inpSpoolFile, File archiveDir) { if ((data != null) && (artifact != null)) { // Send Download Status - IDistributionClientResult sendDownloadStatus = client - .sendDownloadStatus(buildStatusMessage(client, data, artifact, DistributionStatusEnum.DOWNLOAD_OK)); + client.sendDownloadStatus(buildStatusMessage(client, data, artifact, DistributionStatusEnum.DOWNLOAD_OK)); } // If an override file exists, read that instead of the file we just downloaded ArtifactTypeEnum artifactEnum = ArtifactTypeEnum.YANG_XML; + File spoolFile = inpSpoolFile; boolean toscaCsarType = false; if (artifact != null) { @@ -478,7 +476,7 @@ public class SdncUebCallback implements INotificationCallback { } if (toscaCsarType) { - processToscaCsar (data, svcName, resourceName, artifact, spoolFile, archiveDir); + processToscaCsar (data, resourceName, artifact, spoolFile, archiveDir); try { Path source = spoolFile.toPath(); @@ -544,7 +542,7 @@ public class SdncUebCallback implements INotificationCallback { } - private void processToscaCsar(INotificationData data, String svcName, String resourceName, + private void processToscaCsar(INotificationData data, String resourceName, IArtifactInfo artifact, File spoolFile, File archiveDir) { // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data -- cgit 1.2.3-korg From df299c18dc8c00878dccdf3086556a08ca202896 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Tue, 2 Jan 2018 12:48:58 +0530 Subject: Exception issue fix Change-Id: I75eafe5267909dc1102287ef9bc8dffdb1d5dcba Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../sli/northbound/uebclient/SdncUebCallback.java | 35 +++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) 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 89459bcdf..b9df86ef3 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 @@ -325,18 +325,16 @@ public class SdncUebCallback implements INotificationCallback { archiveDir.mkdirs(); } } - - String curFileName = ""; + LOG.debug("Scanning {} - {} for downloaded files", incomingDir.getPath(), incomingDir.toPath()); try (DirectoryStream stream = Files.newDirectoryStream(incomingDir.toPath())) { for (Path file: stream) { - curFileName = file.toString(); handleSuccessfulDownload(null,null, null, null, file.toFile(), archiveDir); } - } catch (Exception x) { + } catch (IOException x) { // IOException can never be thrown by the iteration. // In this snippet, it can only be thrown by newDirectoryStream. - LOG.warn("Cannot process spool file {}", curFileName, x); + LOG.warn("Cannot process spool file", x); } // Deploy scheduled deployments @@ -856,23 +854,24 @@ public class SdncUebCallback implements INotificationCallback { } private void scheduleDeployment(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, String spoolFileName, File spoolFile) { + if (deployList != null) { + if (type.getPass() < deployList.length) { - if (type.getPass() < deployList.length) { - - if (artifactInfo != null) { - LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); + if (artifactInfo != null) { + LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); + } else { + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy + Date now = new Date(); + String artifactVersion = sdfDate.format(now); + LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, spoolFileName, + artifactVersion, spoolFile)); + } } else { - SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy - Date now = new Date(); - String artifactVersion = sdfDate.format(now); - LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, spoolFileName, - artifactVersion, spoolFile)); + LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); } - } else { - LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); } } -- cgit 1.2.3-korg From 3908e30b9e7dcabe942dc60a4894b332c028141b Mon Sep 17 00:00:00 2001 From: SRINIVAS V Date: Fri, 29 Dec 2017 16:11:33 +0530 Subject: Fixed as per Java Code Conventions Change-Id: I0b2315c4a48b5c1c267dec10ce22ded559c98192 Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b9df86ef3..36a3392ac 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 @@ -572,7 +572,7 @@ public class SdncUebCallback implements INotificationCallback { insertToscaData(serviceModel.getSql(model_yaml)); } catch (IOException e) { LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); - // return; + } // Ingest Network (VL) Data - 1707 -- cgit 1.2.3-korg From 8489bd15b6c156af7d73b1c57a02564b187393c9 Mon Sep 17 00:00:00 2001 From: SRINIVAS V Date: Thu, 4 Jan 2018 11:36:13 +0530 Subject: Fixed as per Java Code Conventions *Changed to svcOperation rather than svc_OPERATION Change-Id: I6267aa3396b3601a3673460ca776f1e46edd4ba6 Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../ccsdk/sli/northbound/DataChangeProvider.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 91482d852..40ebde69a 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 @@ -100,15 +100,15 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { @Override public Future> dataChangeNotification( DataChangeNotificationInput input) { - final String SVC_OPERATION = "data-change-notification"; + final String svcOperation = "data-change-notification"; Properties parms = new Properties(); DataChangeNotificationOutputBuilder serviceDataBuilder = new DataChangeNotificationOutputBuilder(); - LOG.info( SVC_OPERATION +" called." ); + LOG.info( svcOperation +" called." ); if(input == null || input.getAaiEventId() == null) { - LOG.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + LOG.debug("exiting " +svcOperation+ " because of invalid input"); serviceDataBuilder.setDataChangeResponseCode("403"); RpcResult rpcResult = RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); @@ -116,26 +116,26 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { } // add input to parms - LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); + LOG.info("Adding INPUT data for "+svcOperation+" input: " + input); DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder(input); MdsalHelper.toProperties(parms, inputBuilder.build()); // Call SLI sync method try { - if (dataChangeClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) + if (dataChangeClient.hasGraph("DataChange", svcOperation , null, "sync")) { try { - dataChangeClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + dataChangeClient.execute("DataChange", svcOperation, null, "sync", serviceDataBuilder, parms); } catch (Exception e) { - LOG.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + LOG.error("Caught exception executing service logic for "+ svcOperation, e); serviceDataBuilder.setDataChangeResponseCode("500"); } } else { - LOG.error("No service logic active for DataChange: '" + SVC_OPERATION + "'"); + LOG.error("No service logic active for DataChange: '" + svcOperation + "'"); serviceDataBuilder.setDataChangeResponseCode("503"); } } @@ -148,9 +148,9 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { String errorCode = serviceDataBuilder.getDataChangeResponseCode(); if (!("0".equals(errorCode) || "200".equals(errorCode))) { - LOG.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); + LOG.error("Returned FAILED for "+svcOperation+" error code: '" + errorCode + "'"); } else { - LOG.info("Returned SUCCESS for "+SVC_OPERATION+" "); + LOG.info("Returned SUCCESS for "+svcOperation+" "); } RpcResult rpcResult = -- cgit 1.2.3-korg From d3216a55d2f85b850e692781d9243320da85e8c0 Mon Sep 17 00:00:00 2001 From: SRINIVAS V Date: Thu, 4 Jan 2018 11:47:12 +0530 Subject: Fixed as per Java Code Conventions *Changed to svcOperation rather than svc_OPERATION Change-Id: I3e5f704368ba5d0de8af92a84e298aab5008742b Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 ea5740967..7f830bcc8 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 @@ -289,14 +289,14 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { @Override public Future> vfLicenseModelUpdate(VfLicenseModelUpdateInput input) { - final String SVC_OPERATION = "vf-license-model-update"; + final String svcOperation = "vf-license-model-update"; Properties parms = new Properties(); - LOG.info( SVC_OPERATION +" called." ); + LOG.info( svcOperation +" called." ); if(input == null ) { - LOG.debug("exiting " +SVC_OPERATION+ " because of invalid input"); + LOG.debug("exiting " +svcOperation+ " because of invalid input"); return null; } @@ -313,7 +313,7 @@ public Future> vfLicenseModelUpdate(VfLice errorMessage = "Artifact version already exists"; } else { // Translate input object into SLI-consumable properties - LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + inputVfLic); + LOG.info("Adding INPUT data for "+svcOperation+" input: " + inputVfLic); AsdcApiUtil.toProperties(parms, inputVfLic); @@ -321,19 +321,19 @@ public Future> vfLicenseModelUpdate(VfLice Properties respProps = null; try { - if (asdcApiSliClient.hasGraph("ASDC-API", SVC_OPERATION , null, "sync")) + if (asdcApiSliClient.hasGraph("ASDC-API", svcOperation , null, "sync")) { try { - respProps = asdcApiSliClient.execute("ASDC-API", SVC_OPERATION, null, "sync", parms); + respProps = asdcApiSliClient.execute("ASDC-API", svcOperation, null, "sync", parms); } catch (Exception e) { - LOG.error("Caught exception executing service logic for "+ SVC_OPERATION, e); + LOG.error("Caught exception executing service logic for "+ svcOperation, e); } } else { - errorMessage = "No service logic active for ASDC-API: '" + SVC_OPERATION + "'"; + errorMessage = "No service logic active for ASDC-API: '" + svcOperation + "'"; errorCode = "503"; } } -- cgit 1.2.3-korg From 477fa7f6a778173e15aaf3cb2f795cdbec85e13a Mon Sep 17 00:00:00 2001 From: SRINIVAS V Date: Thu, 4 Jan 2018 21:57:52 +0530 Subject: Removed unused code *Deleted commented code Change-Id: I03ebfab9d66f2a9e51233ec6312698af7ed91584 Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../sli/northbound/uebclient/SdncUebCallback.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) 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 36a3392ac..a876ec524 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 @@ -576,7 +576,6 @@ public class SdncUebCallback implements INotificationCallback { } // Ingest Network (VL) Data - 1707 - //List vlNodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VL"); List vlNodeTemplatesList = sdcCsarHelper.getServiceVlList(); for (NodeTemplate nodeTemplate : vlNodeTemplatesList) { @@ -613,7 +612,6 @@ public class SdncUebCallback implements INotificationCallback { } // Ingest Network (VF) Data - 1707 - //List nodeTemplatesList = sdcCsarHelper.getServiceNodeTemplatesByType("VF"); List vfNodeTemplatesList = sdcCsarHelper.getServiceVfList(); for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { @@ -641,7 +639,6 @@ public class SdncUebCallback implements INotificationCallback { } // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data - // List groupMembers = sdcCsarHelper.getMembersOfGroup(group); - old version // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); // not yet available @@ -706,12 +703,11 @@ public class SdncUebCallback implements INotificationCallback { // extract values from the left "CP" Node SdncBaseModel.addParameter("ipv4_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); - //SdncBaseModel.addParameter("ipv4_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); + SdncBaseModel.addParameter("ipv4_ip_version", "dummy_ipv4_vers", mappingParams); SdncBaseModel.addParameter("ipv6_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); - //SdncBaseModel.addParameter("ipv6_ip_version", SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_IPVERSION), mappingParams); + SdncBaseModel.addParameter("ipv6_ip_version", "dummy_ipv6_vers", mappingParams); - //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid // extract values from the right "VFC" Node String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetaData(), "customization_uuid") + "\""; @@ -816,7 +812,7 @@ public class SdncUebCallback implements INotificationCallback { if (artifactType != ArtifactTypeEnum.YANG_XML) { LOG.error("Unexpected artifact type - expecting YANG_XML, got "+artifactType); - return (null); + return null; } // Examine outer tag @@ -1025,7 +1021,7 @@ public class SdncUebCallback implements INotificationCallback { conn.setDoOutput(true); conn.setUseCaches(false); - return(conn); + return conn; } @@ -1046,7 +1042,7 @@ public class SdncUebCallback implements INotificationCallback { LOG.error("Caught exception posting to ODL tier", e); } - return(response); + return response; } @@ -1090,7 +1086,7 @@ public class SdncUebCallback implements INotificationCallback { // After transformations, parse transformed XML - return(outFile); + return outFile; } private String escapeFilename(String str) { @@ -1107,7 +1103,7 @@ public class SdncUebCallback implements INotificationCallback { } } - return(retval.toString()); + return retval.toString(); } -- cgit 1.2.3-korg From ef57280a782d3d009bcaa2481c9f26b2b7e1b877 Mon Sep 17 00:00:00 2001 From: SRINIVAS V Date: Sat, 6 Jan 2018 22:37:33 +0530 Subject: Fixed as per Java Code Conventions *Removed the commented code of addParameter function *Code optimized Change-Id: Ibd711561d1f94854df464d6e94de6ef2fc8b6cd6 Issue-ID: CCSDK-151 Signed-off-by: SRINIVAS V --- .../java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 6 +----- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) 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 7f830bcc8..0c2ce2fc2 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 @@ -189,11 +189,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { } - if (data.isPresent()) { - return true; - } else { - return false; - } + return data.isPresent(); } protected void addArtifactVersion(String aName, String aVersion) { 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 b26c50fb2..65215593a 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 @@ -43,8 +43,6 @@ public class SdncARModel extends SdncBaseModel { addParameter("type", extractValue (nodeTemplate, "nf_type")); addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, "nf_naming#ecomp_generated_naming")); addParameter("naming_policy", extractValue (nodeTemplate, "nf_naming#naming_policy")); - //addParameter("depending_service", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_DEPENDINGSERVICE)); - //addParameter("service_dependency", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_SERVICEDEPENDENCY)); } } -- cgit 1.2.3-korg From 25a55717cf3d16c3bbaf0efdf197e5ccd68123da Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Fri, 5 Jan 2018 12:15:29 +0530 Subject: Exception issue *deployList is used before initialization which results in NullPointer Exception. Change-Id: I53d43d7656577368ac35db78ba27c015a2c8ac52 Issue-ID: CCSDK-170 Signed-off-by: prakash.e --- .../sli/northbound/uebclient/SdncUebCallback.java | 43 +++++++++++----------- 1 file changed, 21 insertions(+), 22 deletions(-) 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 b9df86ef3..35e62f88c 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 @@ -326,6 +326,15 @@ public class SdncUebCallback implements INotificationCallback { } } + // Deploy scheduled deployments + int numPasses = config.getMaxPasses(); + + deployList = new LinkedList[numPasses]; + + for (int i = 0 ; i < numPasses ; i++) { + deployList[i] = new LinkedList<>(); + } + LOG.debug("Scanning {} - {} for downloaded files", incomingDir.getPath(), incomingDir.toPath()); try (DirectoryStream stream = Files.newDirectoryStream(incomingDir.toPath())) { for (Path file: stream) { @@ -337,14 +346,6 @@ public class SdncUebCallback implements INotificationCallback { LOG.warn("Cannot process spool file", x); } - // Deploy scheduled deployments - int numPasses = config.getMaxPasses(); - - deployList = new LinkedList[numPasses]; - - for (int i = 0 ; i < numPasses ; i++) { - deployList[i] = new LinkedList<>(); - } for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) { if (deployList[pass] != null) { @@ -854,24 +855,22 @@ public class SdncUebCallback implements INotificationCallback { } private void scheduleDeployment(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, String spoolFileName, File spoolFile) { - if (deployList != null) { - if (type.getPass() < deployList.length) { + if (type.getPass() < deployList.length) { - if (artifactInfo != null) { - LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); + if (artifactInfo != null) { + LOG.debug("Scheduling " + artifactInfo.getArtifactName() + " version " + artifactInfo.getArtifactVersion() + " for deployment"); - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); - } else { - SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy - Date now = new Date(); - String artifactVersion = sdfDate.format(now); - LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); - deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, spoolFileName, - artifactVersion, spoolFile)); - } + deployList[type.getPass()].add(new org.onap.ccsdk.sli.northbound.uebclient.SdncUebCallback.DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); } else { - LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy + Date now = new Date(); + String artifactVersion = sdfDate.format(now); + LOG.debug("Scheduling " + spoolFileName + " version " + artifactVersion + " for deployment"); + deployList[type.getPass()].add(new org.onap.ccsdk.sli.northbound.uebclient.SdncUebCallback.DeployableArtifact(type, svcName, resourceName, spoolFileName, + artifactVersion, spoolFile)); } + } else { + LOG.info("Pass for type " + type.getTag() + " is " + type.getPass() + " which is not <= " + deployList.length); } } -- cgit 1.2.3-korg From 8c449d91d0271d1119a40b1d693ef21154508ce1 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Tue, 9 Jan 2018 21:14:18 +0530 Subject: Removal of unused variables *Romoved unused variables and code changes for performance improvement Change-Id: Ibe1993b750653d24379ffcc3638b71f6cefcaa6b Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 5041b4dc3..7c4f35a6f 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 @@ -875,7 +875,7 @@ public class SdncUebCallback implements INotificationCallback { DistributionStatusEnum deployResult; - StringBuffer msgBuffer = new StringBuffer(); + StringBuilder msgBuffer = new StringBuilder(); String namespace = config.getAsdcApiNamespace(); @@ -1047,8 +1047,6 @@ public class SdncUebCallback implements INotificationCallback { private File applyXslts(File srcFile) { - Document doc; - File inFile = srcFile; File outFile = null; @@ -1093,7 +1091,7 @@ public class SdncUebCallback implements INotificationCallback { if (str == null) { str = ""; } - StringBuffer retval = new StringBuffer(); + StringBuilder retval = new StringBuilder(); for (int i = 0 ; i < str.length() ; i++) { char curchar = str.charAt(i); -- cgit 1.2.3-korg From 0b8794f5ef4c0d4bdd6fff4d8bb83bfebc6f8744 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Tue, 9 Jan 2018 21:27:21 +0530 Subject: Removed of unused parameter *unused parameter and unused function is removed Change-Id: Ibf0f72d2948ad27313967ecadfb54f2a2bf0060b Issue-ID: CCSDK-151 Signed-off-by: prakash.e --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 7c4f35a6f..cf6a2ab25 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 @@ -223,10 +223,6 @@ public class SdncUebCallback implements INotificationCallback { } } - private static void loadArtifactMap() { - - } - public SdncUebCallback(IDistributionClient client, SdncUebConfiguration config) { this.client = client; this.config = config; @@ -475,7 +471,7 @@ public class SdncUebCallback implements INotificationCallback { } if (toscaCsarType) { - processToscaCsar (data, resourceName, artifact, spoolFile, archiveDir); + processToscaCsar (data, artifact, spoolFile, archiveDir); try { Path source = spoolFile.toPath(); @@ -541,7 +537,7 @@ public class SdncUebCallback implements INotificationCallback { } - private void processToscaCsar(INotificationData data, String resourceName, + private void processToscaCsar(INotificationData data, IArtifactInfo artifact, File spoolFile, File archiveDir) { // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data -- cgit 1.2.3-korg From d43a8024c63c3c2b9c9882ec9ce3d05d20e3e8d0 Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Tue, 16 Jan 2018 18:53:23 +0530 Subject: Fixed DmaapListener multiple consumer thread issue DmaapListener handleSubscriptions method returns after creating consumer thread for first subscription string, issue is fixed by removing return. https://jira.onap.org/browse/CCSDK-173 Issue-ID: CCSDK-173 Change-Id: I796b000b22762cda0a4f4fa929d5e2aabdcc7e8b Signed-off-by: shashikanth.vh --- .../java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ce099cd64..2be08cb8b 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 @@ -142,11 +142,11 @@ public class DmaapListener { } if (consumerClass != null) { - return handleConsumerClass(consumerClass, consumerClassName, propertyPath, + handleConsumerClass(consumerClass, consumerClassName, propertyPath, properties, consumers); } } - return false; + return !consumers.isEmpty(); } private static boolean handleConsumerClass(Class consumerClass, String consumerClassName, String propertyPath, -- cgit 1.2.3-korg From 10b6a72f544dd1331e9dba53e77c61deaafbd19f Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 22 Feb 2018 17:22:31 -0600 Subject: Nitrogen port: sli/northbound Update sli/northbound to compile for ODL Nitrogen Change-Id: Ib14fea5dd3922175bd183afb9f3c85edaa7a2f0c Issue-ID: CCSDK-177 Signed-off-by: Dan Timoney --- asdcApi/features/ccsdk-asdcApi/pom.xml | 47 ++++ asdcApi/features/features-asdcApi/pom.xml | 29 +++ asdcApi/features/pom.xml | 150 ++---------- asdcApi/features/src/main/resources/features.xml | 38 --- asdcApi/installer/pom.xml | 32 ++- .../src/main/resources/scripts/install-feature.sh | 9 +- asdcApi/model/pom.xml | 84 +------ asdcApi/pom.xml | 48 +--- asdcApi/provider/pom.xml | 46 ++-- .../sli/northbound/asdcapi/TestAsdcApiApi.java | 9 +- dataChange/features/ccsdk-dataChange/pom.xml | 47 ++++ dataChange/features/features-dataChange/pom.xml | 29 +++ dataChange/features/pom.xml | 150 ++---------- .../features/src/main/resources/features.xml | 36 --- dataChange/installer/pom.xml | 264 +++++++++++---------- .../src/main/resources/scripts/install-feature.sh | 9 +- dataChange/model/pom.xml | 84 +------ dataChange/pom.xml | 46 +--- dataChange/provider/pom.xml | 177 ++++++-------- .../src/main/yang/DataChange-provider-impl.yang | 65 ----- dmaap-listener/pom.xml | 254 ++++++++++---------- pom.xml | 22 +- ueb-listener/pom.xml | 25 +- version.properties | 2 +- 24 files changed, 656 insertions(+), 1046 deletions(-) create mode 100644 asdcApi/features/ccsdk-asdcApi/pom.xml create mode 100644 asdcApi/features/features-asdcApi/pom.xml delete mode 100644 asdcApi/features/src/main/resources/features.xml create mode 100644 dataChange/features/ccsdk-dataChange/pom.xml create mode 100644 dataChange/features/features-dataChange/pom.xml delete mode 100644 dataChange/features/src/main/resources/features.xml delete mode 100755 dataChange/provider/src/main/yang/DataChange-provider-impl.yang diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml new file mode 100644 index 000000000..061e5edc8 --- /dev/null +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-asdcApi + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + asdcApi-model + ${project.version} + + + ${project.groupId} + asdcApi-provider + ${project.version} + + + + diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml new file mode 100644 index 000000000..2ac8f59d8 --- /dev/null +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + features-asdcApi + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-asdcApi + ${project.version} + xml + features + + + + diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 73cc0dd12..5b940021c 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -1,131 +1,23 @@ - - 4.0.0 - - asdcApi - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT - - asdcApi-features - - jar - - - - org.onap.ccsdk.sli.northbound - asdcApi-model - ${project.version} - - - org.onap.ccsdk.sli.northbound - asdcApi-provider - ${project.version} - - - - org.opendaylight.mdsal - features-mdsal - ${odl.mdsal.features.version} - features - xml - - - runtime - - - - - - - org.opendaylight.controller - opendaylight-karaf-empty - ${odl.karaf.empty.distro.version} - zip - - - - - - org.opendaylight.odlparent - features-test - test - ${odl.commons.opendaylight.version} - - - - org.opendaylight.yangtools - features-yangtools - ${odl.yangtools.version} - features - xml - runtime - - - - - - - true - src/main/resources - - - - - org.apache.maven.plugins - maven-resources-plugin - - - filter - - resources - - generate-resources - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/${features.file} - xml - features - - - - - - - - + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + org.onap.ccsdk.sli.northbound + asdcApi-features + 0.2.1-SNAPSHOT + pom + + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + + ccsdk-asdcApi + features-asdcApi + diff --git a/asdcApi/features/src/main/resources/features.xml b/asdcApi/features/src/main/resources/features.xml deleted file mode 100644 index 0f7fe3b8d..000000000 --- a/asdcApi/features/src/main/resources/features.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - - - - odl-mdsal-broker - - mvn:org.onap.ccsdk.sli.northbound/asdcApi-model/${project.version} - mvn:org.onap.ccsdk.sli.northbound/asdcApi-provider/${project.version} - - sdnc-sli - - - diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 1b7666935..aac236bde 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -1,19 +1,25 @@ 4.0.0 + - asdcApi - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + org.onap.ccsdk.sli.northbound asdcApi-installer - asdcApi - Karaf Installer + 0.2.1-SNAPSHOT pom + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + - sdnc-asdcApi - sdnc-asdcApi - mvn:org.onap.ccsdk.sli.northbound/asdcApi-features/${project.version}/xml/features + ccsdk-asdcApi + ${application.name} + mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features false @@ -21,10 +27,10 @@ org.onap.ccsdk.sli.northbound - asdcApi-features + ${application.name} ${project.version} - features xml + features * @@ -32,7 +38,11 @@ - + + org.onap.ccsdk.sli.northbound + asdcApi-model + ${project.version} + org.onap.ccsdk.sli.northbound asdcApi-provider @@ -100,7 +110,6 @@ false false org.onap.ccsdk.sli.northbound - sli-common,sli-provider,dblib-provider provided @@ -135,5 +144,4 @@ - diff --git a/asdcApi/installer/src/main/resources/scripts/install-feature.sh b/asdcApi/installer/src/main/resources/scripts/install-feature.sh index e986764b9..cee4a4952 100644 --- a/asdcApi/installer/src/main/resources/scripts/install-feature.sh +++ b/asdcApi/installer/src/main/resources/scripts/install-feature.sh @@ -10,9 +10,9 @@ # 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. @@ -23,7 +23,6 @@ ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} -ODL_KARAF_CLIENT_OPTS=${ODL_KARAF_CLIENT_OPTS:-"-u karaf"} INSTALLERDIR=$(dirname $0) REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip @@ -36,5 +35,5 @@ else exit 1 fi -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories} -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:install ${features.boot} +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index a3b94f54f..27e5905b9 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -1,92 +1,32 @@ - + 4.0.0 + - asdcApi - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + org.onap.ccsdk.sli.northbound asdcApi-model - 0.2.0-SNAPSHOT + 0.2.1-SNAPSHOT bundle - + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - - - org.apache.felix - maven-bundle-plugin - true - - - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - org.opendaylight.netconf - sal-rest-docgen-maven - ${odl.restconf.version} - jar - - - - - - generate-sources - - - ${yang.file.directory} - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - org.opendaylight.netconf.sal.rest.doc.maven.StaticDocGenerator - target/swagger - - - true - - - - - - - - org.opendaylight.mdsal - yang-binding - ${odl.mdsal.yang.binding.version} - - - org.opendaylight.yangtools - yang-common - ${odl.yangtools.version} - + org.opendaylight.mdsal.model ietf-inet-types - ${odl.ietf-inet-types.version} org.opendaylight.mdsal.model ietf-yang-types - ${odl.ietf-yang-types.version} + + diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 932569b09..78c2fcb6b 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -1,51 +1,20 @@ - + 4.0.0 - org.onap.ccsdk.sli.northbound - ccsdk-sli-northbound - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + - pom org.onap.ccsdk.sli.northbound asdcApi - 0.2.0-SNAPSHOT - - - asdcApi - - - - - - - org.onap.ccsdk.sli.northbound - asdcApi-features - features - xml - ${project.version} - - - - org.onap.ccsdk.sli.northbound - asdcApi-model - ${project.version} - - - - org.onap.ccsdk.sli.northbound - asdcApi-provider - ${project.version} - - - - - - - + 0.2.1-SNAPSHOT + pom + ccsdk-sli-northbound :: asdcApi model @@ -54,4 +23,5 @@ installer + diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 9382b9d8a..3f33af028 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -1,23 +1,22 @@ - + 4.0.0 + - asdcApi - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + + org.onap.ccsdk.sli.northbound asdcApi-provider + 0.2.1-SNAPSHOT bundle - - - - org.apache.felix - maven-bundle-plugin - true - - - + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + @@ -25,60 +24,49 @@ asdcApi-model ${project.version} - - org.opendaylight.controller - config-api - ${odl.controller.config.api.version} - org.opendaylight.controller sal-binding-config - ${odl.mdsal.version} + org.opendaylight.controller sal-binding-api - ${odl.mdsal.version} + org.opendaylight.controller sal-common-util - ${odl.mdsal.version} + org.onap.ccsdk.sli.core sli-common - ${sdnctl.sli.version} org.onap.ccsdk.sli.core sli-provider - ${sdnctl.sli.version} org.opendaylight.controller sal-test-model - ${odl.mdsal.version} test org.opendaylight.netconf sal-rest-connector - ${odl.mdsal.version} test org.opendaylight.controller sal-binding-broker-impl - ${odl.mdsal.version} test org.opendaylight.controller sal-binding-broker-impl - ${odl.mdsal.version} test-jar tests test @@ -86,21 +74,19 @@ junit junit - ${junit.version} test org.testng testng - 6.11 test org.mockito mockito-core - ${mockito.version} test + diff --git a/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java index f65bbc045..6ad9a829f 100644 --- a/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java +++ b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java @@ -21,10 +21,12 @@ package org.onap.ccsdk.sli.northbound.asdcapi; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; import org.junit.Before; import org.junit.Test; -import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; -import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiSliClient; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; @@ -35,9 +37,6 @@ import org.opendaylight.yangtools.yang.common.RpcResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; - public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { private AsdcApiProvider asdcApiProvider; diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml new file mode 100644 index 000000000..5d38e33c2 --- /dev/null +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-dataChange + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + dataChange-model + ${project.version} + + + ${project.groupId} + dataChange-provider + ${project.version} + + + + diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml new file mode 100644 index 000000000..470f95bde --- /dev/null +++ b/dataChange/features/features-dataChange/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + features-dataChange + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-dataChange + ${project.version} + xml + features + + + + diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 93dbd0554..c32e72ce7 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -1,130 +1,24 @@ - - 4.0.0 - - dataChange - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT - - org.onap.ccsdk.sli.northbound - dataChange-features - 0.2.0-SNAPSHOT - - jar - - - - org.onap.ccsdk.sli.northbound - dataChange-model - - - org.onap.ccsdk.sli.northbound - dataChange-provider - - - - org.opendaylight.mdsal - features-mdsal - features - ${odl.mdsal.features.version} - xml - - runtime - - - - - - - org.opendaylight.controller - opendaylight-karaf-empty - ${odl.karaf.empty.distro.version} - zip - - - - - - org.opendaylight.odlparent - features-test - test - ${odl.commons.opendaylight.version} - - - - org.opendaylight.yangtools - features-yangtools - ${odl.yangtools.version} - features - xml - runtime - - - - - - - true - src/main/resources - - - - - org.apache.maven.plugins - maven-resources-plugin - - - filter - - resources - - generate-resources - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/${features.file} - xml - features - - - - - - - - + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + dataChange-features + 0.2.1-SNAPSHOT + pom + + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + + ccsdk-dataChange + features-dataChange + diff --git a/dataChange/features/src/main/resources/features.xml b/dataChange/features/src/main/resources/features.xml deleted file mode 100644 index bd090f1cc..000000000 --- a/dataChange/features/src/main/resources/features.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - - - - odl-mdsal-broker - sdnc-sli - mvn:org.onap.ccsdk.sli.northbound/dataChange-model/${project.version} - mvn:org.onap.ccsdk.sli.northbound/dataChange-provider/${project.version} - - - diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 31623ba13..f67669931 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -1,139 +1,149 @@ - - 4.0.0 - - dataChange - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT - - dataChange-installer - dataChange - Karaf Installer - pom + + 4.0.0 - - sdnc-dataChange - sdnc-dataChange - mvn:org.onap.ccsdk.sli.northbound/dataChange-features/${project.version}/xml/features - false - + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + - + org.onap.ccsdk.sli.northbound + dataChange-installer + 0.2.1-SNAPSHOT + pom - - org.onap.ccsdk.sli.northbound - dataChange-features - ${project.version} - features - xml - - - * - * - - - + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - - org.onap.ccsdk.sli.northbound - dataChange-provider - ${project.version} - + + ccsdk-dataChange + ${application.name} + mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features + false + + - + + org.onap.ccsdk.sli.northbound + ${application.name} + ${project.version} + xml + features + + + * + * + + + + + org.onap.ccsdk.sli.northbound + dataChange-model + ${project.version} + - - - - maven-assembly-plugin - 2.6 - - - maven-repo-zip - - single - - package - - false - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - false - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false - org.onap.ccsdk.sli.northbound - sli-common,sli-provider,dblib-provider - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + + org.onap.ccsdk.sli.northbound + dataChange-provider + ${project.version} + - - - - + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + false + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + false + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.northbound + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + diff --git a/dataChange/installer/src/main/resources/scripts/install-feature.sh b/dataChange/installer/src/main/resources/scripts/install-feature.sh index e986764b9..cee4a4952 100644 --- a/dataChange/installer/src/main/resources/scripts/install-feature.sh +++ b/dataChange/installer/src/main/resources/scripts/install-feature.sh @@ -10,9 +10,9 @@ # 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. @@ -23,7 +23,6 @@ ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} -ODL_KARAF_CLIENT_OPTS=${ODL_KARAF_CLIENT_OPTS:-"-u karaf"} INSTALLERDIR=$(dirname $0) REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip @@ -36,5 +35,5 @@ else exit 1 fi -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories} -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:install ${features.boot} +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index c3d6d6b5c..2b3851690 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -1,93 +1,31 @@ - + 4.0.0 + - dataChange - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + org.onap.ccsdk.sli.northbound dataChange-model - 0.2.0-SNAPSHOT + 0.2.1-SNAPSHOT bundle - - - - - org.apache.felix - maven-bundle-plugin - true - - - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - org.opendaylight.netconf - sal-rest-docgen-maven - ${odl.restconf.version} - jar - - - - - - generate-sources - - - ${yang.file.directory} - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - org.opendaylight.netconf.sal.rest.doc.maven.StaticDocGenerator - target/swagger - - - true - - - - - - + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - - org.opendaylight.mdsal - yang-binding - ${odl.mdsal.yang.binding.version} - - - org.opendaylight.yangtools - yang-common - ${odl.yangtools.version} - org.opendaylight.mdsal.model ietf-inet-types - ${odl.ietf-inet-types.version} org.opendaylight.mdsal.model ietf-yang-types - ${odl.ietf-yang-types.version} + + diff --git a/dataChange/pom.xml b/dataChange/pom.xml index f0bbf6eb3..cd1cd9683 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -1,52 +1,26 @@ - + 4.0.0 - org.onap.ccsdk.sli.northbound - ccsdk-sli-northbound - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + - pom org.onap.ccsdk.sli.northbound dataChange - 0.2.0-SNAPSHOT - - - dataChange - - - - - - - org.onap.ccsdk.sli.northbound - dataChange-features - features - xml - ${project.version} - - - - org.onap.ccsdk.sli.northbound - dataChange-model - ${project.version} - - - org.onap.ccsdk.sli.northbound - dataChange-provider - ${project.version} - - - + 0.2.1-SNAPSHOT + pom - + ccsdk-sli-northbound :: dataChange - + model features provider installer + diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 7d35817ef..1722912ce 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -1,105 +1,86 @@ - - 4.0.0 - - dataChange - org.onap.ccsdk.sli.northbound - 0.2.0-SNAPSHOT - - dataChange-provider - bundle + + 4.0.0 - - - - org.apache.felix - maven-bundle-plugin - true - - - + + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + - - - org.onap.ccsdk.sli.northbound - dataChange-model - - - org.opendaylight.controller - config-api + org.onap.ccsdk.sli.northbound + dataChange-provider + 0.2.1-SNAPSHOT + bundle - ${odl.controller.config.api.version} - - - org.opendaylight.controller - sal-binding-config - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-binding-api - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-common-util - ${odl.mdsal.version} - - - org.onap.ccsdk.sli.core - sli-common - ${sdnctl.sli.version} - - - org.onap.ccsdk.sli.core - sli-provider - ${sdnctl.sli.version} - + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + + + org.onap.ccsdk.sli.northbound + dataChange-model + ${project.version} + + + org.opendaylight.controller + sal-binding-config + + + + org.opendaylight.controller + sal-binding-api + + + org.onap.ccsdk.sli.core + sli-common + + + org.onap.ccsdk.sli.core + sli-provider + + + + org.opendaylight.controller + sal-test-model + test + + + org.opendaylight.netconf + sal-rest-connector + test + + + + org.opendaylight.controller + sal-binding-broker-impl + test + + + org.opendaylight.controller + sal-binding-broker-impl + test-jar + tests + test + + + junit + junit + test + + + org.testng + testng + 6.11 + test + + + org.mockito + mockito-core + test + + - - org.opendaylight.controller - sal-test-model - ${odl.mdsal.version} - test - - - org.opendaylight.netconf - sal-rest-connector - ${odl.mdsal.version} - test - - - org.opendaylight.controller - sal-binding-broker-impl - ${odl.mdsal.version} - test - - - org.opendaylight.controller - sal-binding-broker-impl - ${odl.mdsal.version} - test-jar - tests - test - - - junit - junit - ${junit.version} - test - - - org.testng - testng - 6.11 - test - - - org.mockito - mockito-core - ${mockito.version} - test - - diff --git a/dataChange/provider/src/main/yang/DataChange-provider-impl.yang b/dataChange/provider/src/main/yang/DataChange-provider-impl.yang deleted file mode 100755 index f7ca378b6..000000000 --- a/dataChange/provider/src/main/yang/DataChange-provider-impl.yang +++ /dev/null @@ -1,65 +0,0 @@ -module DataChange-provider-impl { - - yang-version 1; - namespace "org:onap:ccsdk:sli:northbound:datachange:provider:impl"; - prefix "DataChange-provider-impl"; - - import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } - import opendaylight-sal-binding-broker-impl { - prefix binding-impl; - revision-date 2013-10-28; - } - - description - "This module contains the base YANG definitions for - DataChange-provider impl implementation."; - - revision "2014-05-23" { - description - "Initial revision."; - } - - // This is the definition of the service implementation as a module identity. - identity DataChange-provider-impl { - base config:module-type; - - // Specifies the prefix for generated java classes. - config:java-name-prefix DataChangeProvider; - } - - // Augments the 'configuration' choice node under modules/module. - // We consume the three main services, RPCs, DataStore, and Notifications - augment "/config:modules/config:module/config:configuration" { - case DataChange-provider-impl { - when "/config:modules/config:module/config:type = 'DataChange-provider-impl'"; - - container rpc-registry { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-rpc-registry; - } - } - } - - container notification-publish-adapter { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity binding-impl:binding-new-notification-publish-service; - } - } - } - - container data-broker { - uses config:service-ref { - refine type { - mandatory false; - config:required-identity mdsal:binding-async-data-broker; - } - } - } - } - } -} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 8705ff1aa..f6d04e247 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -1,140 +1,144 @@ - - 4.0.0 - org.onap.ccsdk.sli.northbound - jar - dmaap-listener - 0.2.0-SNAPSHOT + + 4.0.0 - DMAAP Listener - DMAAP Listener - - org.onap.ccsdk.sli.northbound - ccsdk-sli-northbound - 0.2.0-SNAPSHOT - - - 1.2.0-SNAPSHOT - 2.9.0.pr1 - true - /opt/app/dmaap-listener - 1.1.0-SNAPSHOT + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + - yyMMdd-HHmmss - ${maven.build.timestamp} - ${project.version}-${build.number} - + org.onap.ccsdk.sli.northbound + dmaap-listener + 0.2.1-SNAPSHOT + jar - + ccsdk-sli-northbound :: dmaap-listener + DMAAP Listener - - org.onap.dmaap.messagerouter.dmaapclient - dmaapClient - ${dmaap.listener.version} - - - org.slf4j - slf4j-api - 1.7.21 - - - org.slf4j - slf4j-log4j12 - 1.6.1 - compile - - - log4j - log4j - 1.2.17 - - - com.fasterxml.jackson.core - jackson-core - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.core - jackson-databind - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.core - jackson-annotations - ${fasterxml.jackson.version} - - - junit - junit - ${junit.version} - test - - + + 1.2.0-SNAPSHOT + 2.9.0.pr1 + true + /opt/app/dmaap-listener + 1.1.0-SNAPSHOT + + yyMMdd-HHmmss + ${maven.build.timestamp} + ${project.version}-${build.number} + + + + + + org.onap.dmaap.messagerouter.dmaapclient + dmaapClient + ${dmaap.listener.version} + + + org.slf4j + slf4j-api + 1.7.21 + + + org.slf4j + slf4j-log4j12 + 1.6.1 + compile + + + log4j + log4j + 1.2.17 + + + com.fasterxml.jackson.core + jackson-core + ${fasterxml.jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${fasterxml.jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${fasterxml.jackson.version} + + + junit + junit + ${junit.version} + test + + ch.vorburger.mariaDB4j mariaDB4j 2.2.3 test - - org.onap.ccsdk.sli.core - dblib-provider - ${sdnctl.dblib.version} - - - - + + org.onap.ccsdk.sli.core + dblib-provider + ${sdnctl.dblib.version} + + - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - true - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - true - org.onap.ccsdk.sli.northbound.dmaapclient.DmaapListener - - - - - - maven-assembly-plugin - 2.6 - - - create-zip - - single - - package - - true - ${project.artifactId}.${project.version} - true - - src/assembly/assemble_zip.xml - - false - - - - + + - - + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + true + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + true + org.onap.ccsdk.sli.northbound.dmaapclient.DmaapListener + + + + + + maven-assembly-plugin + 2.6 + + + create-zip + + single + + package + + true + ${project.artifactId}.${project.version} + true + + src/assembly/assemble_zip.xml + + false + + + + + + diff --git a/pom.xml b/pom.xml index ded5f124b..63bcb6ead 100644 --- a/pom.xml +++ b/pom.xml @@ -3,8 +3,8 @@ org.onap.ccsdk.parent - odlparent-carbon-sr1 - 0.1.0 + odlparent-lite + 1.0.1-SNAPSHOT 4.0.0 @@ -13,32 +13,32 @@ ccsdk-sli-northbound ccsdk-sli-northbound - https://wiki.openecomp.org + https://wiki.onap.org The SDN-C Northbound APIs repo contains code for northbound API adaptors, typically MD-SAL applications JIRA - https://jira.openecomp.org/ + https://jira.onap.org/ - scm:git:ssh://git@${openecomp.git.host}/sdnc-northbound.git + scm:git:ssh://git@${onap.git.host}/sdnc-northbound.git - scm:git:ssh://${openecomp.git.host}:${openecomp.git.port}/${openecomp.git.project}/sdnc-northbound.git - ${openecomp.git.protocol}://${openecomp.git.host}/projects/${openecomp.git.project}/repos/sdnc-northbound/browse + scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/sdnc-northbound.git + ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/sdnc-northbound/browse Jenkins - https://jenkins.openecomp.org/ + https://jenkins.onap.org/ sdnc-javadoc - dav:https://${openecomp.nexus.host}:${openecomp.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} + dav:https://${onap.nexus.host}:${onap.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} @@ -110,9 +110,9 @@ ueb-listener - AT&T + ONAP - 0.2.0-SNAPSHOT + 0.2.1-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 21173680a..b8ec986c1 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -1,18 +1,21 @@ 4.0.0 - org.onap.ccsdk.sli.northbound - jar - ueb-listener - 0.2.0-SNAPSHOT - UEB Listener - UEB Listener - org.onap.ccsdk.sli.northbound - ccsdk-sli-northbound - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + org.onap.ccsdk.sli.northbound + ueb-listener + 0.2.1-SNAPSHOT + jar + + ccsdk-sli-northbound :: ueb-listener + UEB Listener + 1.1.32 1.1.32 @@ -91,9 +94,10 @@ org.onap.ccsdk.sli.core dblib-provider - ${sdnctl.dblib.version} + ${sdnctl.dblib.version} + @@ -150,5 +154,4 @@ - diff --git a/version.properties b/version.properties index efb7e63bc..ebb19b8f6 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=2 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- 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 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 22a9e045d42ad629010cc4200369a4453fbe0df7 Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Mon, 26 Mar 2018 19:24:35 +0530 Subject: coverageSdncFlatJsonDmaapConsumer Coverage improvement for SdncFlatJsonDmaapConsumer https://jira.onap.org/browse/CCSDK-213?jql=project%20%3D%20CCSDK%20AND%20text%20~%20coverage Issue-ID: CCSDK-213 Change-Id: I95e824c5c83b9c36ce0c475368235182e851c254 Signed-off-by: shashikanth.vh --- .../northbound/dmaapclient/TestSdncJsonDmaapConsumer.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java index 0d65231da..01bd3cf28 100644 --- a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java @@ -19,4 +19,16 @@ public class TestSdncJsonDmaapConsumer { SdncFlatJsonDmaapConsumer consumer = new SdncFlatJsonDmaapConsumer(); consumer.processMsg(null); } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullFieldMap_shouldThrowException() throws Exception { + SdncFlatJsonDmaapConsumer consumer = new SdncFlatJsonDmaapConsumer(); + + String msg = "{\n" + + " \"input\" : { \n" + + " }\n" + + "}"; + + consumer.processMsg(msg); + } } -- cgit 1.2.3-korg From 7dee0c8d2680888271da556fedc7ea0d0bc773f9 Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Tue, 27 Mar 2018 19:17:33 +0530 Subject: SdncOdlConnection coverage Coverage improvement for SdncOdlConnection https://jira.onap.org/browse/CCSDK-213?jql=project%20%3D%20CCSDK%20AND%20text%20~%20coverage Issue-ID: CCSDK-213 Change-Id: I8045722de77e8884be485bd6f1ed2243c08d2d2b Signed-off-by: shashikanth.vh --- .../dmaapclient/TestSdncOdlConnection.java | 26 +++++++++++++ .../uebclient/TestSdncOdlConnection.java | 45 ++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncOdlConnection.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncOdlConnection.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncOdlConnection.java new file mode 100644 index 000000000..db24a4545 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncOdlConnection.java @@ -0,0 +1,26 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import org.junit.Test; + +import java.io.IOException; +import java.net.ConnectException; + +public class TestSdncOdlConnection { + + @Test + public void test() { + + try { + SdncOdlConnection sdncOdlConnection = SdncOdlConnection.newInstance("https://127.0.0.1:8447/aai/v11/network/pnfs/pnf/a8098c1a-f86e-11da-bd1a-00112444be1e", "", ""); + sdncOdlConnection.send("PUT", "application/json", "{\n" + + " \"input\" : { \n" + + " }\n" + + "}"); + } catch (ConnectException e) { + //Connection exception + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java new file mode 100644 index 000000000..1fac0c299 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java @@ -0,0 +1,45 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import ch.vorburger.mariadb4j.DB; +import ch.vorburger.mariadb4j.DBConfigurationBuilder; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.openecomp.sdc.api.IDistributionClient; +import org.openecomp.sdc.api.notification.INotificationData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.ConnectException; +import java.net.URL; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.Properties; + +import static org.mockito.Mockito.mock; + +public class TestSdncOdlConnection { + + @Test + public void test() { + + try { + SdncOdlConnection sdncOdlConnection = SdncOdlConnection.newInstance("https://127.0.0.1:8447/aai/v11/network/pnfs/pnf/a8098c1a-f86e-11da-bd1a-00112444be1e", "", ""); + sdncOdlConnection.send("PUT", "application/json", "{\n" + + " \"input\" : { \n" + + " }\n" + + "}"); + } catch (ConnectException e) { + //Connection exception + } catch (IOException e) { + e.printStackTrace(); + } + } + +} -- cgit 1.2.3-korg From 448607990ac6b73d21f8d1b781e37ec798d7e29e Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Wed, 28 Mar 2018 14:49:39 +0530 Subject: coverage SdncFlatJsonDmaapConsumer Coverage improvement for SdncFlatJsonDmaapConsumer https://jira.onap.org/browse/CCSDK-213?jql=project%20%3D%20CCSDK%20AND%20text%20~%20coverage Issue-ID: CCSDK-213 Change-Id: Idb08f426e1626f8aa2b12d2c53f1960474af59c2 Signed-off-by: shashikanth.vh --- .../dmaapclient/TestSdncJsonDmaapConsumer.java | 106 ++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java index 01bd3cf28..620098cb7 100644 --- a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java @@ -10,6 +10,16 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; import org.junit.Test; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.InputStream; +import java.lang.reflect.Field; + +import java.util.Map; +import java.util.Properties; + public class TestSdncJsonDmaapConsumer { private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources"; @@ -19,9 +29,103 @@ public class TestSdncJsonDmaapConsumer { SdncFlatJsonDmaapConsumer consumer = new SdncFlatJsonDmaapConsumer(); consumer.processMsg(null); } + + @Test + public void testProcessMsgFieldMap() throws Exception { + SdncFlatJsonDmaapConsumer consumer = new SdncFlatJsonDmaapConsumer(); + + String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + File directory = new File("lib"); + + if (! directory.exists()){ + directory.mkdir(); + } + + File file = new File("lib" + "/" + "input.map"); + try{ + FileWriter fw = new FileWriter(file.getAbsoluteFile()); + BufferedWriter bw = new BufferedWriter(fw); + bw.write("SDNC.endpoint=>http://localhost:8282/restconf/operations"); + bw.close(); + } + catch (Exception 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); + } + + String msg = "{\n" + + " \"input\" : { \n" + + " }\n" + + "}"; + + InputStream propStr = TestSdncJsonDmaapConsumer.class.getResourceAsStream("/dmaap-consumer-pserver.properties"); + Properties props = new Properties(); + + props.load(propStr); + + consumer.init(props, "src/test/resources/dmaap-consumer-pserver.properties"); + consumer.processMsg(msg); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgFieldMapNoSdncEndPoint() throws Exception { + SdncFlatJsonDmaapConsumer consumer = new SdncFlatJsonDmaapConsumer(); + + String DMAAPLISTENERROOT = "DMAAPLISTENERROOT"; + File directory = new File("lib"); + + if (! directory.exists()){ + directory.mkdir(); + } + + File file = new File("lib" + "/" + "input.map"); + try{ + FileWriter fw = new FileWriter(file.getAbsoluteFile()); + BufferedWriter bw = new BufferedWriter(fw); + bw.write("SDNC"); + bw.close(); + } + catch (Exception 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); + } + + String msg = "{\n" + + " \"input\" : { \n" + + " }\n" + + "}"; + + InputStream propStr = TestSdncJsonDmaapConsumer.class.getResourceAsStream("/dmaap-consumer-pserver.properties"); + Properties props = new Properties(); + + props.load(propStr); + + consumer.init(props, "src/test/resources/dmaap-consumer-pserver.properties"); + consumer.processMsg(msg); + } @Test(expected = InvalidMessageException.class) - public void testProcessMsgNullFieldMap_shouldThrowException() throws Exception { + public void testProcessMsgFieldMapNoFieldMap() throws Exception { SdncFlatJsonDmaapConsumer consumer = new SdncFlatJsonDmaapConsumer(); String msg = "{\n" + -- 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 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 7fc8f9fe913e35121c8e9f6e222c9b741beefdda Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Wed, 28 Mar 2018 17:32:01 +0530 Subject: coverage SdncAaiDmaapConsumer Coverage improvement for SdncAaiDmaapConsumer https://jira.onap.org/browse/CCSDK-213?jql=project%20%3D%20CCSDK%20AND%20text%20~%20coverage Issue-ID: CCSDK-213 Change-Id: Icc9af3a9f27d4bae543525b5651d1f6485ef8857 Signed-off-by: shashikanth.vh --- .../dmaapclient/TestSdncPserverDmaapReceiver.java | 90 +++++++++++++++++++++ .../incoming/src_test_resources_csars_nsepc.csar | Bin 0 -> 42569 bytes 2 files changed, 90 insertions(+) create mode 100644 ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar 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..963b20d68 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 @@ -10,8 +10,15 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; import static org.junit.Assert.assertTrue; +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; +import org.apache.commons.io.FileUtils; + import org.junit.Before; import org.junit.Test; @@ -81,5 +88,88 @@ public class TestSdncPserverDmaapReceiver { assertTrue(rpcMsgbody.indexOf("common-header") != -1); } + @Test + public void testProcessMsgFieldMap() 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(); + + SdncAaiDmaapConsumer consumer = new SdncAaiDmaapConsumer(); + + InputStream propStr = TestSdncPserverDmaapReceiver.class.getResourceAsStream("/dmaap-consumer-pserver.properties"); + + + props.load(propStr); + + consumer.init(props, "src/test/resources/dmaap-consumer-pserver.properties"); + consumer.processMsg(aaiInput); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullMessage() throws Exception { + Properties props = new Properties(); + + SdncAaiDmaapConsumer consumer = new SdncAaiDmaapConsumer(); + consumer.processMsg(null); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgInvalidMessage() throws Exception { + Properties props = new Properties(); + + SdncAaiDmaapConsumer consumer = new SdncAaiDmaapConsumer(); + consumer.processMsg("test"); + } + + @Test + public void testProcessMsgMissingEventHeader() throws Exception { + Properties props = new Properties(); + + SdncAaiDmaapConsumer consumer = new SdncAaiDmaapConsumer(); + consumer.processMsg("{\n" + + " \"input\" : { \n" + + " }\n" + + "}"); + } + + @Test + public void testProcessMsgInvalidEventType() throws Exception { + Properties props = new Properties(); + + String msg = "{\"cambria.partition\": \"AAI\",\r\n" + + " \"event-header\": {\"event-type\": \"TEST-EVENT\"}}"; + + SdncAaiDmaapConsumer consumer = new SdncAaiDmaapConsumer(); + consumer.processMsg(msg); + } + + + + } diff --git a/ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar b/ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar new file mode 100644 index 000000000..087d8c3d8 Binary files /dev/null and b/ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar differ -- cgit 1.2.3-korg From 7ee6690d42bdfbc1685b1ea1c40dc4015bd271e8 Mon Sep 17 00:00:00 2001 From: Serban Popescu Date: Wed, 28 Mar 2018 15:11:05 +0000 Subject: Add Aai event listener Add support for Aai generic-vnf incoming messages from Dmaap Change-Id: I6dcb3d935afdfee5a6e71398cfb2381265dfee92 Issue-ID: CCSDK-226 Signed-off-by: Serban Popescu --- dmaap-listener/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 3a75fef0b..9c0ced010 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -20,7 +20,7 @@ 1.2.0-SNAPSHOT 2.9.0.pr1 - 1.7 + 2.0 true /opt/app/dmaap-listener 1.1.0-SNAPSHOT @@ -70,7 +70,7 @@ org.apache.velocity - velocity + velocity-engine-core ${velocity.version} -- 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(-) 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 c50170bc44f192a7c8e7efdfc773342d8b5c0437 Mon Sep 17 00:00:00 2001 From: Jeremy Wolf Date: Wed, 28 Mar 2018 17:22:09 +0000 Subject: coverage sli-northbound adding junit test files for AsdcApiSliClient, AsdcApiUtil, DataChangeClient, SdncFlatJsonDmaapConsumer, SdncARModel, SdncNodeModel, SdncVFCModel, SdncVFModuleModel, SdncUebCallback Change-Id: Ia7fb307b84957292f9080654c7ae31992434317f Issue-ID: CCSDK-230 Signed-off-by: Jeremy Wolf --- .../northbound/asdcapi/AsdcApiSliClientTest.java | 59 ++++++++++++++++ .../sli/northbound/asdcapi/AsdcApiUtilTest.java | 15 ++++ .../dataChange/DataChangeClientTest.java | 56 +++++++++++++++ .../dmaapclient/SdncFlatJsonDmaapConsumerTest.java | 41 +++++++++++ .../sli/northbound/uebclient/SdncARModelTest.java | 21 ++++++ .../northbound/uebclient/SdncNodeModelTest.java | 49 +++++++++++++ .../sli/northbound/uebclient/SdncVFCModelTest.java | 36 ++++++++++ .../uebclient/SdncVFModuleModelTest.java | 20 ++++++ .../northbound/uebclient/TestSdncUebCallback.java | 82 +++++++++++++++++++++- 9 files changed, 378 insertions(+), 1 deletion(-) create mode 100644 asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClientTest.java create mode 100644 asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtilTest.java create mode 100644 dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/DataChangeClientTest.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java diff --git a/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClientTest.java b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClientTest.java new file mode 100644 index 000000000..5e6a9daf7 --- /dev/null +++ b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClientTest.java @@ -0,0 +1,59 @@ +package org.onap.ccsdk.sli.northbound.asdcapi; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import java.util.Properties; + +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; + +public class AsdcApiSliClientTest { + Properties mockProp; + Properties propReturn; + AsdcApiSliClient testAsdcApiSliClient; + + @Before + public void setup() { + SvcLogicService mockSvcLogic = mock(SvcLogicService.class); + mockProp = new Properties(); + mockProp.setProperty("test-value1", "value1"); + propReturn = new Properties(); + propReturn.setProperty("SvcLogic.status", "Success"); + propReturn.setProperty("Object1", "value1"); + try { + when(mockSvcLogic.hasGraph("TestModule", "TestRPC", "TestVersion", "TestMode")).thenReturn(true); + when(mockSvcLogic.hasGraph("NotExist", "TestRPC", "TestVersion", "TestMode")).thenReturn(false); + when(mockSvcLogic.execute("TestModule", "TestRPC", "TestVersion", "TestMode", mockProp)).thenReturn(propReturn); + } catch (Exception e) { + System.out.println(e); + } + + testAsdcApiSliClient = new AsdcApiSliClient(mockSvcLogic); + } + + @Test + public void testhasGraphGraphExsists() throws SvcLogicException { + assertTrue(testAsdcApiSliClient.hasGraph("TestModule", "TestRPC", "TestVersion", "TestMode")); + } + + @Test + public void testhasGraphnoGraph() throws SvcLogicException { + assertFalse(testAsdcApiSliClient.hasGraph("NotExist", "TestRPC", "TestVersion", "TestMode")); + } + + @Test + public void testExecutewithSvcLogicSuccess() throws SvcLogicException { + Properties result = testAsdcApiSliClient.execute("TestModule", "TestRPC", "TestVersion", "TestMode", mockProp); + assertEquals(result.getProperty("error-code"), "200"); + } + + @Test + public void testExecutewithSvcLogicFailure500() throws SvcLogicException { + propReturn.setProperty("SvcLogic.status", "failure"); + Properties result = testAsdcApiSliClient.execute("TestModule", "TestRPC", "TestVersion", "TestMode", mockProp); + assertEquals(result.getProperty("error-code"), "500"); + } +} \ No newline at end of file diff --git a/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtilTest.java b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtilTest.java new file mode 100644 index 000000000..463e5ea0b --- /dev/null +++ b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiUtilTest.java @@ -0,0 +1,15 @@ +package org.onap.ccsdk.sli.northbound.asdcapi; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class AsdcApiUtilTest { + + @Test + public void testAsdcApiUtilConstructor() { + AsdcApiUtil asdcApiUtilTest = new AsdcApiUtil(); + assertNotNull(asdcApiUtilTest); + } + +} \ No newline at end of file diff --git a/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/DataChangeClientTest.java b/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/DataChangeClientTest.java new file mode 100644 index 000000000..9ba6c8742 --- /dev/null +++ b/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/DataChangeClientTest.java @@ -0,0 +1,56 @@ +package org.onap.sdnc.northbound.dataChange; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import java.util.Properties; + +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.onap.ccsdk.sli.northbound.DataChangeClient; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationOutputBuilder; + +public class DataChangeClientTest { + + SvcLogicService mockSvcLogicService; + String module = "test-module"; + String rpc = "test-rpc"; + String version = "test-version"; + String mode = "test-mode"; + Properties localProp = new Properties(); + + @Before + public void setUp() throws Exception { + mockSvcLogicService = mock(SvcLogicService.class); + when(mockSvcLogicService.hasGraph(module, rpc, version, mode)).thenReturn(true); + } + + @Test + public void testDataChangeClientConstructor() { + DataChangeClient dataChangeClient = new DataChangeClient(mockSvcLogicService); + assertNotNull(dataChangeClient); + } + + @Test + public void testHasGraph() throws SvcLogicException { + DataChangeClient dataChangeClient = new DataChangeClient(mockSvcLogicService); + boolean result = dataChangeClient.hasGraph(module, rpc, version, mode); + assertTrue(result); + } + + @Test + public void testExecuteSvcLogicStatusFailure() throws SvcLogicException { + DataChangeNotificationOutputBuilder serviceData = mock(DataChangeNotificationOutputBuilder.class); + Properties parms = mock(Properties.class); + SvcLogicService svcLogicService = mock(SvcLogicService.class); + Properties properties = new Properties(); + properties.setProperty("SvcLogic.status", "failure"); + when(svcLogicService.execute(module, rpc, version, mode, properties)).thenReturn(properties); + DataChangeClient sliClient = new DataChangeClient(svcLogicService); + Properties prop = sliClient.execute(module, rpc, version, mode, serviceData, properties); + assertTrue(prop != null); + } +} \ No newline at end of file diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java new file mode 100644 index 000000000..d1aee634d --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java @@ -0,0 +1,41 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.*; + + +import java.io.File; + +import org.junit.Before; +import org.junit.Test; + +public class SdncFlatJsonDmaapConsumerTest { + + private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; + private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources"; + + SdncFlatJsonDmaapConsumer consumer; + + @Before + public void setUp() throws Exception { + consumer = new SdncFlatJsonDmaapConsumer(); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgString_NullInvalidMessageException() throws InvalidMessageException { + // expected = InvalidMessageException: Null message + consumer.processMsg(null); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgString_UnformatedMessageInvalidMessageException() throws InvalidMessageException { + // expected = InvalidMessageException: Cannot parse json object + consumer.processMsg("TESTING", null); + } + + @Test(expected = InvalidMessageException.class) + public void testing()throws InvalidMessageException { + // Expected = InvalidMessageException: Unable to process message - cannot load field mappings + String msg = "{\"test\":\"string\"}"; + consumer.processMsg(msg, null); + } +} \ No newline at end of file diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java new file mode 100644 index 000000000..0d152e5e0 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java @@ -0,0 +1,21 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + + import static org.junit.Assert.*; + import static org.mockito.Mockito.*; + + import org.junit.Test; + import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; + import org.openecomp.sdc.toscaparser.api.NodeTemplate; + + public class SdncARModelTest { + + @Test + public void testSdncARModelConstructor() { + ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + NodeTemplate nodeTemplate = mock(NodeTemplate.class); + SdncARModel testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate); + assertNotNull(testSdncARModel); + } + + } + diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java new file mode 100644 index 000000000..4a66c0201 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java @@ -0,0 +1,49 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; + +import static org.mockito.Mockito.*; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; + +public class SdncNodeModelTest { + + SdncNodeModel sdncNodeModel; + + @Before + public void setUp() throws Exception { + ISdcCsarHelper isdcCsarHelper = mock(ISdcCsarHelper.class); + NodeTemplate nodeTemplate = mock(NodeTemplate.class); + sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate); + sdncNodeModel.setServiceUUID("0e8d757f-1c80-40af-85de-31d64f1f5af8"); + sdncNodeModel.setEcompGeneratedNaming("hello-world"); + } + + @Test + public void testGetServiceUUID() { + String result = sdncNodeModel.getServiceUUID(); + assertNotNull(result != null); + } + + @Test + public void testGetEcompGeneratedNaming() { + String result = sdncNodeModel.getEcompGeneratedNaming(); + assertEquals("hello-world", result); + } + + @Test + public void testGetSqlString() { + String result = sdncNodeModel.getSql("TEST-HELLO"); + String test = "INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, ecomp_generated_naming) values (0e8d757f-1c80-40af-85de-31d64f1f5af8, \"\", \"TEST-HELLO\", \"hello-world\");"; + assertEquals(test, result); + } + + @Test + public void testGetVpnBindingsSql() { + String result = sdncNodeModel.getVpnBindingsSql(); + assertNotNull(result); + } +} \ No newline at end of file diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java new file mode 100644 index 000000000..d2bafbf42 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java @@ -0,0 +1,36 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; + +public class SdncVFCModelTest { + + SdncVFCModel testSdncVFCModel; + + @Before + public void setup() { + ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + NodeTemplate mockNodeTemplate = mock(NodeTemplate.class); + testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate); + testSdncVFCModel.setVmType("Test-type"); + testSdncVFCModel.setVmCount("5"); + + } + + @Test + public void testSdncVFCModelGetVmType() { + assertEquals(testSdncVFCModel.getVmType(), "Test-type"); + } + + @Test + public void testSdncVFCModelGetVmCount() { + assertEquals(testSdncVFCModel.getVmCount(), "5"); + } + +} \ No newline at end of file diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java new file mode 100644 index 000000000..218554357 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java @@ -0,0 +1,20 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; + +import org.junit.Test; +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.toscaparser.api.Group; + +public class SdncVFModuleModelTest { + + @Test + public void testSdncVFModuleModelConstructor() { + Group mockGroup = mock(Group.class); + ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockGroup); + assertNotNull(testSdncVFModel); + } + +} \ No newline at end of file diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index 79a598ce5..21854f990 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -1,6 +1,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import static org.mockito.Mockito.mock; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.*; import java.io.File; import java.io.InputStream; @@ -9,6 +10,8 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.List; import java.util.Properties; import org.junit.After; @@ -16,7 +19,9 @@ import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.openecomp.sdc.api.IDistributionClient; +import org.openecomp.sdc.api.notification.IArtifactInfo; import org.openecomp.sdc.api.notification.INotificationData; +import org.openecomp.sdc.api.notification.IResourceInstance; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -149,6 +154,15 @@ public class TestSdncUebCallback { SdncUebConfiguration config; DBResourceManager dblibSvc; DB db; + List processLevelArtifactList; + List serviceLevelArtifactList; + ArrayList resourceList; + IArtifactInfo mockProcessArtifact1; + IArtifactInfo mockProcessArtifact2; + IArtifactInfo mockProcessArtifact3; + IArtifactInfo mockServiceArtifact1; + IResourceInstance resource; + @Before public void setUp() throws Exception { @@ -186,6 +200,42 @@ public class TestSdncUebCallback { dblibSvc.writeData(CRTBL_VF_MODEL, null, null); dblibSvc.writeData(CRTBL_VF_MODULE_MODEL, null, null); dblibSvc.writeData(CRTBL_ALLOTTED_RESOURCE_MODEL, null, null); + + processLevelArtifactList = new ArrayList<>(); + serviceLevelArtifactList = new ArrayList<>(); + resourceList = new ArrayList<>(); + + + mockProcessArtifact1 = mock(IArtifactInfo.class); + when(mockProcessArtifact1.getArtifactName()).thenReturn("mockProcessArtifact1"); + when(mockProcessArtifact1.getArtifactType()).thenReturn("HEAT"); + when(mockProcessArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockProcessArtifact1.getArtifactChecksum()).thenReturn("123tfg123 1234ftg"); + when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); + + mockProcessArtifact2 = mock(IArtifactInfo.class); + when(mockProcessArtifact1.getArtifactName()).thenReturn("mockProcessArtifact2"); + when(mockProcessArtifact1.getArtifactType()).thenReturn("DG_XML"); + when(mockProcessArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockProcessArtifact1.getArtifactChecksum()).thenReturn("456jhgt 1234ftg"); + when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); + + mockProcessArtifact3 = mock(IArtifactInfo.class); + when(mockProcessArtifact1.getArtifactName()).thenReturn("mockProcessArtifact3"); + when(mockProcessArtifact1.getArtifactType()).thenReturn("HEAT"); + when(mockProcessArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockProcessArtifact1.getArtifactChecksum()).thenReturn("123tfg123 543gtd"); + when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); + + + mockServiceArtifact1 = mock(IArtifactInfo.class); + when(mockServiceArtifact1.getArtifactName()).thenReturn("mockProcessArtifact4"); + when(mockServiceArtifact1.getArtifactType()).thenReturn("HEAT"); + when(mockServiceArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockServiceArtifact1.getArtifactChecksum()).thenReturn("123t3455 543gtd"); + when(mockServiceArtifact1.getArtifactTimeout()).thenReturn(110); + + resource = mock(IResourceInstance.class); } @After @@ -219,5 +269,35 @@ public class TestSdncUebCallback { INotificationData iData = mock(INotificationData.class); cb.activateCallback(iData); } + + + + @Test + public void testServiceAndProcessArtifactsactivateCallback() { + + try { + processLevelArtifactList.add(mockProcessArtifact1); + processLevelArtifactList.add(mockProcessArtifact2); + processLevelArtifactList.add(mockProcessArtifact3); + + resourceList.add(resource); + serviceLevelArtifactList.add(mockServiceArtifact1); + when(resource.getArtifacts()).thenReturn(serviceLevelArtifactList); + when(resource.getResourceName()).thenReturn("Resource_service_name"); + + + IDistributionClient iDistClient1 = mock(IDistributionClient.class); + INotificationData mockData = mock(INotificationData.class); + when(mockData.getResources()).thenReturn(resourceList); + when(mockData.getServiceName()).thenReturn("Test_service_name"); + when(mockData.getServiceArtifacts()).thenReturn(processLevelArtifactList); + + SdncUebCallback cb1 = new SdncUebCallback(iDistClient1, config); + cb1.activateCallback(mockData); + assertTrue(true); + } catch (Exception e) { + assertTrue(false); + } + } } -- cgit 1.2.3-korg From d0bfc56359e3d5a9663ba6e48b7e1d187373d737 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 28 Mar 2018 19:01:21 -0400 Subject: Update versions to resolve security issues Update versions of sdc distribution client and jackson to address security issues. Issue-ID: CCSDK-164 Change-Id: Id02d879e87bb1a957968482578818928b6e3c281 Signed-off-by: Timoney, Dan (dt5972) --- .gitignore | 1 + dmaap-listener/pom.xml | 2 +- ueb-listener/pom.xml | 10 +++--- .../sli/northbound/uebclient/SdncARModel.java | 8 ++--- .../sli/northbound/uebclient/SdncBaseModel.java | 10 +++--- .../sli/northbound/uebclient/SdncNodeModel.java | 6 ++-- .../sli/northbound/uebclient/SdncServiceModel.java | 6 ++-- .../sli/northbound/uebclient/SdncUebCallback.java | 36 +++++++++++----------- .../sli/northbound/uebclient/SdncUebClient.java | 8 ++--- .../northbound/uebclient/SdncUebConfiguration.java | 18 ++++++++++- .../sli/northbound/uebclient/SdncVFCModel.java | 6 ++-- .../sli/northbound/uebclient/SdncVFModel.java | 8 ++--- .../northbound/uebclient/SdncVFModuleModel.java | 6 ++-- .../sli/northbound/uebclient/SdncARModelTest.java | 4 +-- .../northbound/uebclient/SdncNodeModelTest.java | 6 ++-- .../sli/northbound/uebclient/SdncVFCModelTest.java | 6 ++-- .../uebclient/SdncVFModuleModelTest.java | 6 ++-- .../uebclient/TestSdncOdlConnection.java | 4 +-- .../northbound/uebclient/TestSdncUebCallback.java | 8 ++--- 19 files changed, 88 insertions(+), 71 deletions(-) diff --git a/.gitignore b/.gitignore index 8b49fb2aa..d11ed581b 100755 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ MANIFEST.MF ## Misc Ignores (OS specific etc) ## bin/ +lib/ dist *~ *.ipr diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 9c0ced010..75157318f 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -19,7 +19,7 @@ 1.2.0-SNAPSHOT - 2.9.0.pr1 + 2.9.4 2.0 true /opt/app/dmaap-listener diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index b8ec986c1..4cb118045 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -17,9 +17,9 @@ UEB Listener - 1.1.32 - 1.1.32 - 2.9.0.pr1 + 1.3.0 + 1.3.0 + 2.9.4 true /opt/app/ueb-listener yyMMdd-HHmmss @@ -30,13 +30,13 @@ - org.openecomp.sdc.sdc-distribution-client + org.onap.sdc.sdc-distribution-client sdc-distribution-client ${sdc.client.version} compile - org.openecomp.sdc.sdc-tosca + org.onap.sdc.sdc-tosca sdc-tosca ${sdc.tosca.version} compile 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 65215593a..f285db162 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 @@ -21,10 +21,10 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 c77ad702a..315f3c381 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 @@ -24,11 +24,11 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.util.HashMap; import java.util.Map; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Group; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.Group; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 0a4931715..69f378796 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 @@ -21,9 +21,9 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.NodeTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 012c3d9e2..c1efadbdd 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 @@ -21,9 +21,9 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 cf6a2ab25..8ea041e61 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 @@ -62,24 +62,24 @@ import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.tuple.Pair; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.onap.ccsdk.sli.northbound.uebclient.SdncArtifactMap.SdncArtifactType; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.consumer.IDistributionStatusMessage; -import org.openecomp.sdc.api.consumer.INotificationCallback; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.notification.IResourceInstance; -import org.openecomp.sdc.api.results.IDistributionClientDownloadResult; -import org.openecomp.sdc.api.results.IDistributionClientResult; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory; -import org.openecomp.sdc.toscaparser.api.Group; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; -import org.openecomp.sdc.utils.ArtifactTypeEnum; -import org.openecomp.sdc.utils.DistributionActionResultEnum; -import org.openecomp.sdc.utils.DistributionStatusEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.IDistributionStatusMessage; +import org.onap.sdc.api.consumer.INotificationCallback; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.results.IDistributionClientDownloadResult; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory; +import org.onap.sdc.toscaparser.api.Group; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.utils.ArtifactTypeEnum; +import org.onap.sdc.utils.DistributionActionResultEnum; +import org.onap.sdc.utils.DistributionStatusEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; 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 0694a6da7..d37518f1b 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 @@ -21,10 +21,10 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.results.IDistributionClientResult; -import org.openecomp.sdc.impl.DistributionClientFactory; -import org.openecomp.sdc.utils.DistributionActionResultEnum; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.impl.DistributionClientFactory; +import org.onap.sdc.utils.DistributionActionResultEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 bf7dc88a5..0500954de 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 @@ -29,7 +29,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Properties; -import org.openecomp.sdc.api.consumer.IConfiguration; +import org.onap.sdc.api.consumer.IConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,6 +54,7 @@ public class SdncUebConfiguration implements IConfiguration{ private String sdncPasswd = null; private String asdcApiBaseUrl = null; private String asdcApiNamespace = null; + private List msgBusAddress = null; private SdncArtifactMap artifactMap = SdncArtifactMap.getInstance(); @@ -192,6 +193,16 @@ public class SdncUebConfiguration implements IConfiguration{ LOG.warn("artifact-map is unset"); } + msgBusAddress = new LinkedList<>(); + String msgBusAddressStr = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.msg-bus-address"); + if (msgBusAddressStr != null) { + String[] msgBusAddressArray = msgBusAddressStr.split(","); + for (int i = 0 ; i < msgBusAddressArray.length ; i++) { + msgBusAddress.add(msgBusAddressArray[i]); + } + } + + } @Override @@ -297,5 +308,10 @@ public class SdncUebConfiguration implements IConfiguration{ return false; } + @Override + public List getMsgBusAddress() { + return msgBusAddress; + } + } 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 55814ac3a..d7ed19ea6 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 @@ -21,9 +21,9 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.NodeTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 fd71527de..32f25c51d 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 @@ -21,10 +21,10 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 3663c97c3..60bc3c433 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 @@ -21,9 +21,9 @@ package org.onap.ccsdk.sli.northbound.uebclient; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames; -import org.openecomp.sdc.toscaparser.api.Group; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.Group; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java index 0d152e5e0..e8c7b1afd 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java @@ -4,8 +4,8 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.mockito.Mockito.*; import org.junit.Test; - import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; - import org.openecomp.sdc.toscaparser.api.NodeTemplate; + import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; + import org.onap.sdc.toscaparser.api.NodeTemplate; public class SdncARModelTest { diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java index 4a66c0201..9df89fb24 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java @@ -6,8 +6,8 @@ import static org.mockito.Mockito.*; import org.junit.Before; import org.junit.Test; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.NodeTemplate; public class SdncNodeModelTest { @@ -46,4 +46,4 @@ public class SdncNodeModelTest { String result = sdncNodeModel.getVpnBindingsSql(); assertNotNull(result); } -} \ No newline at end of file +} diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java index d2bafbf42..f03a09fcf 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java @@ -6,8 +6,8 @@ import static org.mockito.Mockito.*; import org.junit.Before; import org.junit.Test; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.NodeTemplate; public class SdncVFCModelTest { @@ -33,4 +33,4 @@ public class SdncVFCModelTest { assertEquals(testSdncVFCModel.getVmCount(), "5"); } -} \ No newline at end of file +} diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java index 218554357..881018ef6 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java @@ -4,8 +4,8 @@ import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import org.junit.Test; -import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; -import org.openecomp.sdc.toscaparser.api.Group; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.Group; public class SdncVFModuleModelTest { @@ -17,4 +17,4 @@ public class SdncVFModuleModelTest { assertNotNull(testSdncVFModel); } -} \ No newline at end of file +} diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java index 1fac0c299..1b4b22f42 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncOdlConnection.java @@ -6,8 +6,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.INotificationData; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.INotificationData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index 21854f990..b53bdb392 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -18,10 +18,10 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; -import org.openecomp.sdc.api.IDistributionClient; -import org.openecomp.sdc.api.notification.IArtifactInfo; -import org.openecomp.sdc.api.notification.INotificationData; -import org.openecomp.sdc.api.notification.IResourceInstance; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.notification.IResourceInstance; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -- cgit 1.2.3-korg From 0dfc4dc597a6274228a21921467c32c0b49321f3 Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Wed, 4 Apr 2018 18:26:08 -0700 Subject: Update docker tag convention Update docker tagging convention to use: v0.17.0-SNAPSHOT-YYYYMMDDTHHMMSSZ (for dev images) v0.17.0-STAGING-YYYYMMDDTHHMMSSZ (for staging images) Change-Id: I4065d25d11e6767903947ebee8c690a0c9ecc804 Issue-ID: CIMAN-132 Signed-off-by: Jessica Wagantall --- dmaap-listener/pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 9c0ced010..b7c1a2fb9 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -25,7 +25,7 @@ /opt/app/dmaap-listener 1.1.0-SNAPSHOT - yyMMdd-HHmmss + yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index b8ec986c1..3ec9f2a4a 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -22,7 +22,7 @@ 2.9.0.pr1 true /opt/app/ueb-listener - yyMMdd-HHmmss + yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} -- cgit 1.2.3-korg From b039682a6805507445139e2b2430144f92724b09 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 12 Apr 2018 19:13:59 -0400 Subject: Copy LCM interface from APP-C Change-Id: Idc18aa00bcbcee3f51473339b6b4ad90f6b4bffc Issue-ID: CCSDK-219 Signed-off-by: Timoney, Dan (dt5972) --- .gitignore | 2 + lcm/features/ccsdk-lcm/pom.xml | 47 + lcm/features/features-lcm/pom.xml | 29 + lcm/features/pom.xml | 23 + lcm/installer/pom.xml | 147 ++ .../src/assembly/assemble_installer_zip.xml | 59 + .../src/assembly/assemble_mvnrepo_zip.xml | 47 + .../src/main/resources/scripts/install-feature.sh | 39 + lcm/model/pom.xml | 32 + lcm/model/src/main/yang/lcm.yang | 1309 +++++++++++++++++ lcm/pom.xml | 27 + lcm/provider/pom.xml | 94 ++ .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 1037 ++++++++++++++ .../onap/ccsdk/sli/northbound/LcmResponseCode.java | 51 + .../sli/northbound/LcmRpcInvocationException.java | 25 + .../onap/ccsdk/sli/northbound/LcmSliClient.java | 96 ++ .../resources/org/onap/appc/default.properties | 58 + .../src/main/resources/org/onap/appc/logback.xml | 287 ++++ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 1514 ++++++++++++++++++++ .../test/resources/graphs/lcm/LCM_ActionStatus.xml | 30 + .../test/resources/graphs/lcm/LCM_AttachVolume.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Audit.xml | 30 + .../test/resources/graphs/lcm/LCM_CheckLock.xml | 30 + .../test/resources/graphs/lcm/LCM_ConfigBackup.xml | 30 + .../graphs/lcm/LCM_ConfigBackupDelete.xml | 30 + .../test/resources/graphs/lcm/LCM_ConfigExport.xml | 30 + .../test/resources/graphs/lcm/LCM_ConfigModify.xml | 30 + .../resources/graphs/lcm/LCM_ConfigRestore.xml | 30 + .../resources/graphs/lcm/LCM_ConfigScaleOut.xml | 30 + .../test/resources/graphs/lcm/LCM_Configure.xml | 30 + .../test/resources/graphs/lcm/LCM_DetachVolume.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Evacuate.xml | 30 + .../test/resources/graphs/lcm/LCM_HealthCheck.xml | 30 + .../test/resources/graphs/lcm/LCM_LiveUpgrade.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Lock.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Migrate.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Query.xml | 30 + .../resources/graphs/lcm/LCM_QuiesceTraffic.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Reboot.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Rebuild.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Restart.xml | 30 + .../resources/graphs/lcm/LCM_ResumeTraffic.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Rollback.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Snapshot.xml | 30 + .../resources/graphs/lcm/LCM_SoftwareUpload.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Start.xml | 30 + .../resources/graphs/lcm/LCM_StartApplication.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Stop.xml | 30 + .../resources/graphs/lcm/LCM_StopApplication.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Sync.xml | 30 + .../test/resources/graphs/lcm/LCM_Terminate.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Test.xml | 30 + .../src/test/resources/graphs/lcm/LCM_Unlock.xml | 30 + .../resources/graphs/lcm/LCM_UpgradeBackout.xml | 30 + .../resources/graphs/lcm/LCM_UpgradeBackup.xml | 30 + .../resources/graphs/lcm/LCM_UpgradePostCheck.xml | 30 + .../resources/graphs/lcm/LCM_UpgradePreCheck.xml | 30 + .../resources/graphs/lcm/LCM_UpgradeSoftware.xml | 30 + .../src/test/resources/graphs/lcm/graph.versions | 39 + .../src/test/resources/svclogic.properties | 27 + pom.xml | 1 + 61 files changed, 6160 insertions(+) create mode 100644 lcm/features/ccsdk-lcm/pom.xml create mode 100644 lcm/features/features-lcm/pom.xml create mode 100755 lcm/features/pom.xml create mode 100755 lcm/installer/pom.xml create mode 100644 lcm/installer/src/assembly/assemble_installer_zip.xml create mode 100644 lcm/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 lcm/installer/src/main/resources/scripts/install-feature.sh create mode 100755 lcm/model/pom.xml create mode 100644 lcm/model/src/main/yang/lcm.yang create mode 100755 lcm/pom.xml create mode 100755 lcm/provider/pom.xml create mode 100644 lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java create mode 100644 lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmResponseCode.java create mode 100644 lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmRpcInvocationException.java create mode 100644 lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java create mode 100644 lcm/provider/src/main/resources/org/onap/appc/default.properties create mode 100644 lcm/provider/src/main/resources/org/onap/appc/logback.xml create mode 100644 lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/graph.versions create mode 100644 lcm/provider/src/test/resources/svclogic.properties diff --git a/.gitignore b/.gitignore index d11ed581b..f9dd2d58a 100755 --- a/.gitignore +++ b/.gitignore @@ -26,12 +26,14 @@ dist *.ipr *.iml *.iws +*.log classes out/ .DS_STORE .metadata provider/src/main/java/META-INF/ provider/src/main/java/inventory/ +model/src/main/yang-gen-sal ## BlackDuck generated file sdnc-northbound_bdio.jsonld diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml new file mode 100644 index 000000000..e7440c6d8 --- /dev/null +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-lcm + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + lcm-model + ${project.version} + + + ${project.groupId} + lcm-provider + ${project.version} + + + + diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml new file mode 100644 index 000000000..6af726dc2 --- /dev/null +++ b/lcm/features/features-lcm/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + features-lcm + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-lcm + ${project.version} + xml + features + + + + diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml new file mode 100755 index 000000000..590d5aa29 --- /dev/null +++ b/lcm/features/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + org.onap.ccsdk.sli.northbound + lcm-features + 0.2.1-SNAPSHOT + pom + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + ccsdk-lcm + features-lcm + + diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml new file mode 100755 index 000000000..7c9c827d8 --- /dev/null +++ b/lcm/installer/pom.xml @@ -0,0 +1,147 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + lcm-installer + 0.2.1-SNAPSHOT + pom + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + ccsdk-lcm + ${application.name} + mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features + false + + + + + + org.onap.ccsdk.sli.northbound + ${application.name} + ${project.version} + xml + features + + + * + * + + + + + org.onap.ccsdk.sli.northbound + lcm-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-provider + ${project.version} + + + + + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + false + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + false + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.northbound + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + + diff --git a/lcm/installer/src/assembly/assemble_installer_zip.xml b/lcm/installer/src/assembly/assemble_installer_zip.xml new file mode 100644 index 000000000..3bed4b5ef --- /dev/null +++ b/lcm/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,59 @@ + + + + + + installer_zip + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + + + + diff --git a/lcm/installer/src/assembly/assemble_mvnrepo_zip.xml b/lcm/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100644 index 000000000..21e271d42 --- /dev/null +++ b/lcm/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,47 @@ + + + + + + mvnrepo_zip + + zip + + + + false + + + + target/assembly/ + . + + + + + + diff --git a/lcm/installer/src/main/resources/scripts/install-feature.sh b/lcm/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 000000000..cee4a4952 --- /dev/null +++ b/lcm/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +### +# ============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========================================================= +### + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} +INSTALLERDIR=$(dirname $0) + +REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip + +if [ -f ${REPOZIP} ] +then + unzip -d ${ODL_HOME} ${REPOZIP} +else + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 +fi + +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml new file mode 100755 index 000000000..6d8589e19 --- /dev/null +++ b/lcm/model/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + lcm-model + 0.2.1-SNAPSHOT + bundle + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + + + org.opendaylight.mdsal.model + ietf-inet-types + + + org.opendaylight.mdsal.model + ietf-yang-types + + + + + diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang new file mode 100644 index 000000000..9976dd9e5 --- /dev/null +++ b/lcm/model/src/main/yang/lcm.yang @@ -0,0 +1,1309 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : APPC + * ================================================================================ + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Copyright (C) 2017 Amdocs + * ============================================================================= + * 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. + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * ============LICENSE_END========================================================= + */ + +/* + * Yang model for the Application Controller (APP-C) component of ECOMP + * + * This model is used to define the data and services of the Application Controller + * component of ECOMP. The APP-C controller initiates the processing of directed + * graphs, which define the actual process implementations used. The name of the + * directed graph is set by properties and cannot be changed dynamically. + * + * The services exposed by this provider are: + * + * restart-vnf: + * Used to request a restart of a virtual network function (a VM). + * + * rebuild-vnf: + * Used to request a rebuild of a virtual network function (a VM). + * + */ + +module LCM { + + yang-version 1; + namespace "org:onap:ccsdk:sli:northbound:lcm"; + prefix lcm; + + description + "Defines the services and request/response requirements for the CCSDK LCM component."; + + /* + * Note, the revision changes the package name of the generated java code. Do not + * change the revision unless you also update all references to the bindings. + */ + revision "2018-03-29" { + description + "CCSDK LCM interface version 0.2.1"; + } + + /********************************************************************************** + * Data type definitions + * + * The following data type definitions are used to define common data structures, + * define constraints, or to impart special meanings to data objects related to the + * APP-C controller functions. + **********************************************************************************/ + + typedef ZULU { + description "Define a common definition of a time stamp (expressed as a formatted + string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ"; + type string { + length "16..28"; + pattern "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,6}Z"; + } + } + + typedef payload { + type string ; + description "The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value"; + } + + typedef action { + type enumeration { + enum "Restart"; + enum "Rebuild"; + enum "Migrate"; + enum "Evacuate"; + enum "Snapshot"; + enum "Rollback"; + enum "Sync"; + enum "Audit"; + enum "Stop"; + enum "Start"; + enum "Terminate"; + enum "SoftwareUpload"; + enum "HealthCheck"; + enum "LiveUpgrade"; + enum "Lock"; + enum "Unlock"; + enum "Test"; + enum "CheckLock"; + enum "Configure"; + enum "ConfigModify"; + enum "ConfigScaleOut"; + enum "ConfigRestore"; + enum "ConfigBackup"; + enum "ConfigBackupDelete"; + enum "ConfigExport"; + enum "StopApplication"; + enum "StartApplication"; + enum "QuiesceTraffic"; + enum "ResumeTraffic"; + enum "UpgradePreCheck"; + enum "UpgradeSoftware"; + enum "UpgradePostCheck"; + enum "UpgradeBackup"; + enum "UpgradeBackout"; + enum "ActionStatus"; + enum "Query"; + enum "Reboot"; + enum "AttachVolume"; + enum "DetachVolume"; + + } + description "The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate"; + } + + typedef vm-state { + description "The state of a VM"; + type enumeration { + enum "active"; + enum "standby"; + enum "inactive"; + enum "unknown"; + } + } + + typedef vm-status { + description "The status of a VM"; + type enumeration { + enum "healthy"; + enum "unhealthy"; + enum "unknown"; + } + } + + + /********************************************************************************** + * Basic manipulation of a VNF (or VM) will typically include querying the current + * state, restarting, rebuilding, stopping, starting, etc. In all of these basic + * "state"-type operations, the services require the identification of the VNF to + * be operated on, and the region or LCP that contains that resource. This + * information is used across all of these services, so it has been defined as a + * common structure here and is referenced in the appropriate RPC definitions. + **********************************************************************************/ + + + /********************************************************************************** + * All requests will include this standard header + * + * The standard request header is used to define a correlation identification for + * the request that is returned on all responses. This correlation identifier + * (called the service-request-id) is meaningful to the caller and is included on + * all responses from the services. + **********************************************************************************/ + + /********************************************************************************** + * All responses will include this standard header + * + * The standard response header includes the time of completion as well as a + * success|failure indication + **********************************************************************************/ + + grouping common-header { + description "A common header for all APP-C requests"; + container common-header { + description "A common header for all APP-C requests"; + leaf timestamp { + description "timestamp is in ISO 8601 timestamp format ZULU offset"; + type ZULU; + mandatory true; + } + + leaf api-ver { + description "api-ver is the API version identifier. A given release of APPC + should support all previous versions of APPC API (correlate with + general requirements)"; + type string { + pattern "[2]\.\d\d" { + error-message "API Version 2.XX is supported at this end point"; + } + } + mandatory true; + } + + leaf originator-id { + description "originator-id an identifier of the calling system which can be + used addressing purposes, i.e. returning asynchronous response + to the proper destination over DMaaP (especially in case of multiple + consumers of APP-C APIs)"; + type string; + mandatory true; + } + + leaf request-id { + description "UUID for the request ID. An OSS/BSS identifier for the request + that caused the current action. Multiple API calls may be made + with the same request-id The request-id shall be recorded throughout + the operations on a single request"; + type string; + mandatory true; + } + + leaf sub-request-id { + description "Uniquely identifies a specific LCM action. It is persistent over + the life-cycle of a single request"; + type string; + mandatory false; + } + + + /********************************************************************************** + * Flags are generic flags that apply to any and all commands, all are optional + * force = TRUE/FALSE - Execute command even if target is in unstable (i.e. locked, transiting, etc) + * state. Specific behaviour of forced commands varies, but implies cancellation + * of previous command and an override by the new command. The FALSE value is + * used by default. + * ttl = <0....N> - The timeout value for command execution, expressed in seconds + * mode = EXCLUSIVE/NORMAL - defines execution mode as follows: + * - EXCLUSIVE ? on encountering an exclusive command, the APP-C will: + * * Cease accepting additional command requests + * * Complete execution of outstanding commands + * * Execute the exclusive command to completion + * * Optionally report the result of the command + * * Optionally resume command acceptance and processing + * - NORMAL - Obverse of EXCLUSIVE, the default one. + **********************************************************************************/ + container flags { + description "Flags are generic flags that apply to any and all commands, all are optional"; + leaf mode { + type enumeration { + enum "EXCLUSIVE"; + enum "NORMAL"; + } + description "EXCLUSIVE (accept no queued requests on this VNF while processing) + or NORMAL (queue other requests until complete)"; + mandatory false; + } + leaf force { + type enumeration { + enum "TRUE"; + enum "FALSE"; + } + description "TRUE/FALSE - Execute action even if target is in unstable (i.e. + locked, transiting, etc.) state"; + mandatory false; + } + leaf ttl { + description "<0....N> - The timeout value (expressed in seconds) for action + execution, between action being received by APPC and action initiation"; + type uint16; + mandatory false; + } + } + } + } + + + grouping action-identifiers { + description "A block containing the action arguments. These are used to specify + the object upon which APP-C LCM command is to operate"; + container action-identifiers { + description "A block containing the action arguments. These are used to specify + the object upon which APP-C LCM command is to operate"; + leaf service-instance-id { + description "identifies a specific service the command refers to. When multiple + APP-C instances are used and applied to a subset of services, + this will become significant . The field is mandatory when the + vnf-id is empty"; + type string; + mandatory false; + } + leaf vnf-id { + description "identifies the VNF to which this action is to be applied(vnf-id + uniquely identifies the service-instance referred to). Note that + some actions are applied to multiple VNFs in the same service. + When this is the case, vnf-id may be left out, but service-instance-id + must appear. The field is mandatory when service-instance-id is + empty"; + type string; + mandatory false; + } + leaf vf-module-id { + description "identifies the VF module to which this action is to be applied."; + type string; + mandatory false; + } + leaf vnfc-name { + description "identifies the VNFC to which this action is to be applied. Some + actions apply only to a component within a VNF (e.g. RESTART is + sometimes applied to on VM only). In such a case, the name of + the VNFC is used to search for the component within the VNF"; + type string; + mandatory false; + } + leaf vserver-id { + description "identifies a specific VM within the given service/vnf to which + this action is to be applied"; + type string; + mandatory false; + } + } + } + + + grouping status { + description "The specific response codes are to be aligned with SDC reference doc + (main table removed to avoid duplication and digression from main table). + See SDC and ECOMP Distribution Consumer Interface Agreement"; + container status { + description "The specific response codes are to be aligned with SDC reference doc + (main table removed to avoid duplication and digression from main table). + See SDC and ECOMP Distribution Consumer Interface Agreement"; + leaf code { + description "Response code"; + type uint16; + mandatory true; + } + leaf message { + description "Response message"; + type string; + mandatory true; + } + } + } + + typedef lcm-action-status { + type enumeration { + enum "IN_PROGRESS"; + enum "SUCCESSFUL"; + enum "FAILED"; + enum "NOT_FOUND"; + enum "ABORTED"; + enum "MULTIPLE_REQUESTS_FOUND"; + } + description "The status of the requested LCM action"; + } + + /********************************************************************************** + * Define the restart service + **********************************************************************************/ + rpc restart { + description "An operation to restart a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the rebuild service + **********************************************************************************/ + rpc rebuild { + description "An operation to rebuild a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the migrate service + **********************************************************************************/ + rpc migrate { + description "An operation to migrate a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the evacuate service + **********************************************************************************/ + rpc evacuate { + description "An operation to evacuate a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the snapshot service + **********************************************************************************/ + rpc snapshot { + description "An operation to create a snapshot of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + leaf identity-url { + type string; + mandatory true; + } + } + output { + uses common-header; + uses status; + leaf snapshot-id { + type string; + } + } + } + /********************************************************************************** + * Define the VNF quiesce traffic service + **********************************************************************************/ + rpc quiesce-traffic { + description "An operation to stop traffic gracefully on the VF. + It stops traffic gracefully without stopping the application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF resume traffic service + **********************************************************************************/ + rpc resume-traffic { + description "An operation to resume traffic gracefully on the VF. + It resumes traffic gracefully without stopping the application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradePreCheck service + **********************************************************************************/ + rpc upgrade-pre-check { + description "An operation to check that the VNF has the correct software version needed for a software upgrade."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradeSoftware service + **********************************************************************************/ + rpc upgrade-software { + description "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status ."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradePostCheck service + **********************************************************************************/ + rpc upgrade-post-check { + description "An operation to check the VNF upgrade has been successful completed and all processes are running properly."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradeBackup service + **********************************************************************************/ + rpc upgrade-backup { + description "An operation to do full backup of the VNF data prior to an upgrade."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradeBackout service + **********************************************************************************/ + rpc upgrade-backout { + description "An operation does a backout after an UpgradeSoftware is completed (either successfully or unsuccessfully)."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the rollback service + **********************************************************************************/ + rpc rollback { + description "An operation to rollback to particular snapshot of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + leaf identity-url { + type string; + mandatory true; + } + leaf snapshot-id { + type string; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Additional RPCs added here... + **********************************************************************************/ + + + /********************************************************************************** + * Define the sync service + **********************************************************************************/ + rpc sync { + description "An operation to sync the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + /********************************************************************************** + * Define the terminate service + **********************************************************************************/ + rpc terminate { + description "An operation to terminate the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + rpc configure { + description "An operation to configure the configurations of a virtual network + function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-modify { + description "Use the ModifyConfig command when a full configuration cycle is either not required + or is considered too costly. The ModifyConfig LCM action affects only a subset of the + total configuration data of a VNF. The set of configuration parameters to be affected + is a subset of the total configuration data of the target VNF type. The payload Stop + Application must contain the configuration parameters to be modified and their values. + A successful modify returns a success response. A failed modify returns a failure + response and the specific failure messages in the response payload Stop Application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-scale-out { + description "An operation to Modify the configuration or other action to support + a ConfigScaleOut of a VNF."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-restore { + description "An operation to restore the configurations of a virtual network + function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + /********************************************************************************** + * Define the test service + **********************************************************************************/ + rpc test { + description "An operation to test the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the stop service + **********************************************************************************/ + rpc stop { + description "An operation to stop the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + rpc start { + description "An operation to start a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the audit service + **********************************************************************************/ + rpc audit { + description "An operation to audit the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + /********************************************************************************** + * Define the SoftwareUpload vSCP service + **********************************************************************************/ + rpc software-upload { + description "An operation to upload a new version of vSCP image to vSCP for updating it"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the PreHealthCheck vSCP service + **********************************************************************************/ + rpc health-check { + description "An operation to perform health check of vSCP prior its upgrading"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Define the Upgrade vSCP service + **********************************************************************************/ + rpc live-upgrade { + description "An operation to perform upgrade of vSCP"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Define the VNF lock service + **********************************************************************************/ + rpc lock { + description "An operation to perform VNF lock operation"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF unlock service + **********************************************************************************/ + rpc unlock { + description "An operation to perform VNF unlock operation"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF check lock service + **********************************************************************************/ + rpc check-lock { + description "An operation to check VNF lock status"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + leaf locked { + type enumeration { + enum "TRUE"; + enum "FALSE"; + } + description "TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE"; + mandatory false; + } + } + } + + + rpc config-backup { + description "An operation to Backup configurations of a virtual network function + (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-backup-delete { + description "An operation to Delete backup configurations of a virtual network + function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-export { + description "An operation to Export configurations of a virtual network function + (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + } + } + rpc stop-application { + description "An operation to Stop Application traffic to a virtual network function"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF Start Application service + **********************************************************************************/ + rpc start-application { + description "An operation to perform VNF Start Application operation"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Gets the current state of the previously submitted LCM request + **********************************************************************************/ + rpc action-status { + description "An operation to get the current state of the previously submitted LCM request"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + } + } + } + + /********************************************************************************** + * Define the VNF Query service + **********************************************************************************/ + rpc query { + description "An operation to query the status of a targe VNF. + Returns information on each VM, including state (active or standby) + and status (healthy or unhealthy)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + list query-results { + leaf vserver-id { + description "Identifier of a VM"; + type string; + mandatory true; + } + leaf vm-state { + description "The state of the VM"; + type vm-state; + mandatory true; + } + leaf vm-status { + description "the status of the VM"; + type vm-status; + mandatory true; + } + } + } + } + + /********************************************************************************** + * Define the Reboot service + **********************************************************************************/ + rpc reboot { + description "An operation to reboot a specified virtual machine (VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VM attach volume service + **********************************************************************************/ + rpc attach-volume { + description "An operation to attach a cinder volume to a VM"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VM detach volume service + **********************************************************************************/ + rpc detach-volume { + description "An operation to detach a cinder volume from a VM"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + + + /********************************************************************************** + * Additional RPCs added here... + **********************************************************************************/ +} diff --git a/lcm/pom.xml b/lcm/pom.xml new file mode 100755 index 000000000..6bf401f2e --- /dev/null +++ b/lcm/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + lcm + 0.2.1-SNAPSHOT + pom + + ccsdk-sli-northbound :: lcm + + + model + features + provider + installer + + + + diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml new file mode 100755 index 000000000..ce9e6eb91 --- /dev/null +++ b/lcm/provider/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + lcm-provider + 0.2.1-SNAPSHOT + bundle + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + + + org.opendaylight.controller + mdsal-artifacts + 1.6.1 + pom + import + + + + + + + org.onap.ccsdk.sli.northbound + lcm-model + ${project.version} + + + org.opendaylight.controller + sal-binding-config + + + + org.opendaylight.controller + sal-binding-api + + + + org.opendaylight.controller + sal-common-util + + + + org.onap.ccsdk.sli.core + sli-common + + + org.onap.ccsdk.sli.core + sli-provider + + + + org.opendaylight.controller + sal-core-api + + + org.opendaylight.yangtools + yang-data-impl + + + junit + junit + test + + + org.testng + testng + test + + + org.mockito + mockito-core + test + + + org.apache.derby + derby + 10.12.1.1 + test + + + + + diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java new file mode 100644 index 000000000..14d3d9e53 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -0,0 +1,1037 @@ +package org.onap.ccsdk.sli.northbound; +/*- + * ============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========================================================= + */ + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; +import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; +import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker; +import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.*; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.Status; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.StatusBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Optional; +import com.google.common.util.concurrent.CheckedFuture; +import com.google.common.util.concurrent.Futures; + +import org.onap.ccsdk.sli.northbound.LcmResponseCode.*; + +/** + * Defines a base implementation for your provider. This class extends from a + * helper class which provides storage for the most commonly used components of + * the MD-SAL. Additionally the base class provides some basic logging and + * initialization / clean up methods. + * + */ +public class LcmProvider implements AutoCloseable, LCMService { + + private class CommonLcmFields { + private StatusBuilder statusBuilder; + private CommonHeaderBuilder commonHeaderBuilder; + + public CommonLcmFields(StatusBuilder statusBuilder, CommonHeaderBuilder commonHeaderBuilder) { + this.statusBuilder = statusBuilder; + this.commonHeaderBuilder = commonHeaderBuilder; + } + + public StatusBuilder getStatusBuilder() { + return statusBuilder; + } + + public CommonHeaderBuilder getCommonHeaderBuilder() { + return commonHeaderBuilder; + } + } + + private static final Logger LOG = LoggerFactory.getLogger(LcmProvider.class); + + private static final String ACTIVE_VERSION = "active"; + + private static final String APPLICATION_NAME = "LCM"; + + private final ExecutorService executor; + protected DataBroker dataBroker; + protected DOMDataBroker domDataBroker; + protected NotificationPublishService notificationService; + protected RpcProviderRegistry rpcRegistry; + private final LcmSliClient lcmSliClient; + + protected BindingAwareBroker.RpcRegistration rpcRegistration; + + public LcmProvider(final DataBroker dataBroker, final NotificationPublishService notificationPublishService, + final RpcProviderRegistry rpcProviderRegistry, final LcmSliClient lcmSliClient) { + + LOG.info("Creating provider for {}", APPLICATION_NAME); + executor = Executors.newFixedThreadPool(1); + this.dataBroker = dataBroker; + if (dataBroker instanceof AbstractForwardedDataBroker) { + domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate(); + } + notificationService = notificationPublishService; + rpcRegistry = rpcProviderRegistry; + this.lcmSliClient = lcmSliClient; + initialize(); + } + + public void initialize() { + LOG.info("Initializing {} for {}", this.getClass().getName(), APPLICATION_NAME); + + if (rpcRegistration == null) { + if (rpcRegistry != null) { + rpcRegistration = rpcRegistry.addRpcImplementation(LCMService.class, this); + LOG.info("Initialization complete for {}", APPLICATION_NAME); + } else { + LOG.warn("Error initializing {} : rpcRegistry unset", APPLICATION_NAME); + } + } + } + + protected void initializeChild() { + // Override if you have custom initialization intelligence + } + + @Override + public void close() throws Exception { + LOG.info("Closing provider for " + APPLICATION_NAME); + executor.shutdown(); + rpcRegistration.close(); + LOG.info("Successfully closed provider for " + APPLICATION_NAME); + } + + + + @Override + public Future> checkLock(CheckLockInput input) { + CheckLockInputBuilder iBuilder = new CheckLockInputBuilder(input); + CheckLockOutputBuilder oBuilder = new CheckLockOutputBuilder(); + + try { + CommonLcmFields retval = callDG("CheckLock", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + + } + + @Override + public Future> reboot(RebootInput input) { + RebootInputBuilder iBuilder = new RebootInputBuilder(input); + RebootOutputBuilder oBuilder = new RebootOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Reboot", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> upgradeBackup(UpgradeBackupInput input) { + UpgradeBackupInputBuilder iBuilder = new UpgradeBackupInputBuilder(input); + UpgradeBackupOutputBuilder oBuilder = new UpgradeBackupOutputBuilder(); + + try { + CommonLcmFields retval = callDG("UpgradeBackup", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> rollback(RollbackInput input) { + RollbackInputBuilder iBuilder = new RollbackInputBuilder(input); + RollbackOutputBuilder oBuilder = new RollbackOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Rollback", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> sync(SyncInput input) { + SyncInputBuilder iBuilder = new SyncInputBuilder(input); + SyncOutputBuilder oBuilder = new SyncOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Sync", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> query(QueryInput input) { + QueryInputBuilder iBuilder = new QueryInputBuilder(input); + QueryOutputBuilder oBuilder = new QueryOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Query", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> configExport(ConfigExportInput input) { + ConfigExportInputBuilder iBuilder = new ConfigExportInputBuilder(input); + ConfigExportOutputBuilder oBuilder = new ConfigExportOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ConfigExport", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> stopApplication(StopApplicationInput input) { + StopApplicationInputBuilder iBuilder = new StopApplicationInputBuilder(input); + StopApplicationOutputBuilder oBuilder = new StopApplicationOutputBuilder(); + + try { + CommonLcmFields retval = callDG("StopApplication", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> softwareUpload(SoftwareUploadInput input) { + SoftwareUploadInputBuilder iBuilder = new SoftwareUploadInputBuilder(input); + SoftwareUploadOutputBuilder oBuilder = new SoftwareUploadOutputBuilder(); + + try { + CommonLcmFields retval = callDG("SoftwareUpload", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> resumeTraffic(ResumeTrafficInput input) { + ResumeTrafficInputBuilder iBuilder = new ResumeTrafficInputBuilder(input); + ResumeTrafficOutputBuilder oBuilder = new ResumeTrafficOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ResumeTraffic", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> configure(ConfigureInput input) { + ConfigureInputBuilder iBuilder = new ConfigureInputBuilder(input); + ConfigureOutputBuilder oBuilder = new ConfigureOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Configure", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> actionStatus(ActionStatusInput input) { + ActionStatusInputBuilder iBuilder = new ActionStatusInputBuilder(input); + ActionStatusOutputBuilder oBuilder = new ActionStatusOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ActionStatus", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> upgradePreCheck(UpgradePreCheckInput input) { + UpgradePreCheckInputBuilder iBuilder = new UpgradePreCheckInputBuilder(input); + UpgradePreCheckOutputBuilder oBuilder = new UpgradePreCheckOutputBuilder(); + + try { + CommonLcmFields retval = callDG("UpgradePreCheck", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> liveUpgrade(LiveUpgradeInput input) { + LiveUpgradeInputBuilder iBuilder = new LiveUpgradeInputBuilder(input); + LiveUpgradeOutputBuilder oBuilder = new LiveUpgradeOutputBuilder(); + + try { + CommonLcmFields retval = callDG("LiveUpgrade", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> configModify(ConfigModifyInput input) { + ConfigModifyInputBuilder iBuilder = new ConfigModifyInputBuilder(input); + ConfigModifyOutputBuilder oBuilder = new ConfigModifyOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ConfigModify", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> restart(RestartInput input) { + RestartInputBuilder iBuilder = new RestartInputBuilder(input); + RestartOutputBuilder oBuilder = new RestartOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Restart", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> healthCheck(HealthCheckInput input) { + HealthCheckInputBuilder iBuilder = new HealthCheckInputBuilder(input); + HealthCheckOutputBuilder oBuilder = new HealthCheckOutputBuilder(); + + try { + CommonLcmFields retval = callDG("HealthCheck", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> lock(LockInput input) { + LockInputBuilder iBuilder = new LockInputBuilder(input); + LockOutputBuilder oBuilder = new LockOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Lock", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> terminate(TerminateInput input) { + TerminateInputBuilder iBuilder = new TerminateInputBuilder(input); + TerminateOutputBuilder oBuilder = new TerminateOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Terminate", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> attachVolume(AttachVolumeInput input) { + AttachVolumeInputBuilder iBuilder = new AttachVolumeInputBuilder(input); + AttachVolumeOutputBuilder oBuilder = new AttachVolumeOutputBuilder(); + + try { + CommonLcmFields retval = callDG("AttachVolume", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> migrate(MigrateInput input) { + MigrateInputBuilder iBuilder = new MigrateInputBuilder(input); + MigrateOutputBuilder oBuilder = new MigrateOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Migrate", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> quiesceTraffic(QuiesceTrafficInput input) { + QuiesceTrafficInputBuilder iBuilder = new QuiesceTrafficInputBuilder(input); + QuiesceTrafficOutputBuilder oBuilder = new QuiesceTrafficOutputBuilder(); + + try { + CommonLcmFields retval = callDG("QuiesceTraffic", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> configRestore(ConfigRestoreInput input) { + ConfigRestoreInputBuilder iBuilder = new ConfigRestoreInputBuilder(input); + ConfigRestoreOutputBuilder oBuilder = new ConfigRestoreOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ConfigRestore", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> upgradeBackout(UpgradeBackoutInput input) { + UpgradeBackoutInputBuilder iBuilder = new UpgradeBackoutInputBuilder(input); + UpgradeBackoutOutputBuilder oBuilder = new UpgradeBackoutOutputBuilder(); + + try { + CommonLcmFields retval = callDG("UpgradeBackout", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> evacuate(EvacuateInput input) { + EvacuateInputBuilder iBuilder = new EvacuateInputBuilder(input); + EvacuateOutputBuilder oBuilder = new EvacuateOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Evacuate", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> unlock(UnlockInput input) { + UnlockInputBuilder iBuilder = new UnlockInputBuilder(input); + UnlockOutputBuilder oBuilder = new UnlockOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Unlock", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> configBackupDelete(ConfigBackupDeleteInput input) { + ConfigBackupDeleteInputBuilder iBuilder = new ConfigBackupDeleteInputBuilder(input); + ConfigBackupDeleteOutputBuilder oBuilder = new ConfigBackupDeleteOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ConfigBackupDelete", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> upgradeSoftware(UpgradeSoftwareInput input) { + UpgradeSoftwareInputBuilder iBuilder = new UpgradeSoftwareInputBuilder(input); + UpgradeSoftwareOutputBuilder oBuilder = new UpgradeSoftwareOutputBuilder(); + + try { + CommonLcmFields retval = callDG("UpgradeSoftware", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> stop(StopInput input) { + StopInputBuilder iBuilder = new StopInputBuilder(input); + StopOutputBuilder oBuilder = new StopOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Stop", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> detachVolume(DetachVolumeInput input) { + DetachVolumeInputBuilder iBuilder = new DetachVolumeInputBuilder(input); + DetachVolumeOutputBuilder oBuilder = new DetachVolumeOutputBuilder(); + + try { + CommonLcmFields retval = callDG("DetachVolume", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> configScaleOut(ConfigScaleOutInput input) { + ConfigScaleOutInputBuilder iBuilder = new ConfigScaleOutInputBuilder(input); + ConfigScaleOutOutputBuilder oBuilder = new ConfigScaleOutOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ConfigScaleOut", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> upgradePostCheck(UpgradePostCheckInput input) { + UpgradePostCheckInputBuilder iBuilder = new UpgradePostCheckInputBuilder(input); + UpgradePostCheckOutputBuilder oBuilder = new UpgradePostCheckOutputBuilder(); + + try { + CommonLcmFields retval = callDG("UpgradePostCheck", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> test(TestInput input) { + TestInputBuilder iBuilder = new TestInputBuilder(input); + TestOutputBuilder oBuilder = new TestOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Test", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> startApplication(StartApplicationInput input) { + StartApplicationInputBuilder iBuilder = new StartApplicationInputBuilder(input); + StartApplicationOutputBuilder oBuilder = new StartApplicationOutputBuilder(); + + try { + CommonLcmFields retval = callDG("StartApplication", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> configBackup(ConfigBackupInput input) { + ConfigBackupInputBuilder iBuilder = new ConfigBackupInputBuilder(input); + ConfigBackupOutputBuilder oBuilder = new ConfigBackupOutputBuilder(); + + try { + CommonLcmFields retval = callDG("ConfigBackup", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> rebuild(RebuildInput input) { + RebuildInputBuilder iBuilder = new RebuildInputBuilder(input); + RebuildOutputBuilder oBuilder = new RebuildOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Rebuild", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> audit(AuditInput input) { + AuditInputBuilder iBuilder = new AuditInputBuilder(input); + AuditOutputBuilder oBuilder = new AuditOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Audit", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> start(StartInput input) { + StartInputBuilder iBuilder = new StartInputBuilder(input); + StartOutputBuilder oBuilder = new StartOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Start", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public Future> snapshot(SnapshotInput input) { + SnapshotInputBuilder iBuilder = new SnapshotInputBuilder(input); + SnapshotOutputBuilder oBuilder = new SnapshotOutputBuilder(); + + try { + CommonLcmFields retval = callDG("Snapshot", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + private CommonLcmFields callDG(String rpcName, Object input) throws LcmRpcInvocationException { + + StatusBuilder statusBuilder = new StatusBuilder(); + + if (input == null) { + LOG.debug("Rejecting " +rpcName+ " because of invalid input"); + statusBuilder.setCode(LcmResponseCode.REJECT_INVALID_INPUT.getValue()); + statusBuilder.setMessage("REJECT - INVALID INPUT. Missing input"); + CommonHeaderBuilder hBuilder = new CommonHeaderBuilder(); + hBuilder.setApiVer("1"); + hBuilder.setOriginatorId("unknown"); + hBuilder.setRequestId("unset"); + hBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + + CommonHeaderBuilder hBuilder = new CommonHeaderBuilder(((CommonHeader)input).getCommonHeader()); + + // add input to parms + LOG.info("Adding INPUT data for "+ rpcName +" input: " + input.toString()); + Properties inputProps = new Properties(); + MdsalHelper.toProperties(inputProps, input); + + Properties respProps = new Properties(); + + // Call SLI sync method + try + { + if (lcmSliClient.hasGraph("LCM", rpcName , null, "sync")) + { + try + { + respProps = lcmSliClient.execute("LCM", rpcName, null, "sync", inputProps, domDataBroker); + } + catch (Exception e) + { + LOG.error("Caught exception executing service logic for "+ rpcName, e); + statusBuilder.setCode(LcmResponseCode.FAILURE_DG_FAILURE.getValue()); + statusBuilder.setMessage("FAILURE - DG FAILURE ("+e.getMessage()+")"); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + } else { + LOG.error("No service logic active for LCM: '" + rpcName + "'"); + + statusBuilder.setCode(LcmResponseCode.REJECT_DG_NOT_FOUND.getValue()); + statusBuilder.setMessage("FAILURE - DG not found for action "+rpcName); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + } + catch (Exception e) + { + LOG.error("Caught exception looking for service logic", e); + + statusBuilder.setCode(LcmResponseCode.FAILURE_DG_FAILURE.getValue()); + statusBuilder.setMessage("FAILURE - Unexpected error looking for DG ("+e.getMessage()+")"); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + + + StatusBuilder sBuilder = new StatusBuilder(); + MdsalHelper.toBuilder(respProps, sBuilder); + MdsalHelper.toBuilder(respProps, hBuilder); + + String statusCode = sBuilder.getCode().toString(); + + if (!"400".equals(statusCode)) { + LOG.error("Returned FAILED for "+rpcName+" error code: '" + statusCode + "'"); + } else { + LOG.info("Returned SUCCESS for "+rpcName+" "); + } + + return new CommonLcmFields(sBuilder,hBuilder); + + } + +} diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmResponseCode.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmResponseCode.java new file mode 100644 index 000000000..76001c860 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmResponseCode.java @@ -0,0 +1,51 @@ +package org.onap.ccsdk.sli.northbound; + +public enum LcmResponseCode { + + // Accepted category + ACCEPT_ACCEPTED(100), + // Error category + ERROR_UNEXPECTED_ERROR(200), + // Rejected category + REJECT_REJECTED(300), + REJECT_INVALID_INPUT(301), + REJECT_MISSING_PARAM(302), + REJECT_PARSING_FAILED(303), + REJECT_NO_TRANSITION(304), + REJECT_ACTION_NOT_SUPPORTED(305), + REJECT_VNF_NOT_FOUND(306), + REJECT_DG_NOT_FOUND(307), + REJECT_WORKFLOW_NOT_FOUND(308), + REJECT_UNSTABLE_VNF(309), + REJECT_LOCKING_FAILURE(310), + REJECT_EXPIRED_REQUEST(311), + REJECT_DUPLICATE_REQUEST(312), + REJECT_MISSING_AAI_DATA(313), + REJECT_MULTIPLE_REQUESTS_FOR_SEARCH(315), + REJECT_POLICY_VALIDATION_FAILURE(316), + // Success category + SUCCESS(400), + // Failure category + FAILURE_DG_FAILURE(401), + FAILURE_NO_TRANSITION(402), + FAILURE_AAI_FAILURE(403), + FAILURE_EXPIRED_REQUEST(404), + FAILURE_UNEXPECTED_FAILURE(405), + FAILURE_UNSTABLE_VNF(406), + FAILURE_REQUEST_NOT_SUPPORTED(450), + // Partial success + PARTIAL_SUCCESS(500); + + + + private int value; + private LcmResponseCode(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + + +} diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmRpcInvocationException.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmRpcInvocationException.java new file mode 100644 index 000000000..2ae2200a8 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmRpcInvocationException.java @@ -0,0 +1,25 @@ +package org.onap.ccsdk.sli.northbound; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeader; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.Status; + +public class LcmRpcInvocationException extends SvcLogicException { + + private Status status; + private CommonHeader commonHeader; + + public LcmRpcInvocationException(Status status, CommonHeader commonHeader) { + this.status = status; + this.commonHeader = commonHeader; + } + + public Status getStatus() { + return status; + } + + public CommonHeader getCommonHeader() { + return commonHeader; + } + +} diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java new file mode 100644 index 000000000..9fcc92c88 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java @@ -0,0 +1,96 @@ +package org.onap.ccsdk.sli.northbound; +/*- + * ============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========================================================= + */ + + + +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class LcmSliClient { + + private static final Logger LOG = LoggerFactory.getLogger(LcmSliClient.class); + + private final SvcLogicService svcLogicService; + + public LcmSliClient(final SvcLogicService svcLogicService) { + this.svcLogicService = svcLogicService; + } + + public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException + { + return svcLogicService.hasGraph(module, rpc, version, mode); + } + + + public Properties execute(String module, String rpc, String version, String mode, Properties parms, DOMDataBroker dataBroker) + throws SvcLogicException { + + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters passed to SLI"); + + for (Object key : parms.keySet()) { + String parmName = (String) key; + String parmValue = parms.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + Properties respProps = svcLogicService.execute(module, rpc, version, mode, parms, dataBroker); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters returned by SLI"); + + for (Object key : respProps.keySet()) { + String parmName = (String) key; + String parmValue = respProps.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { + + if (!respProps.containsKey("error-code")) { + respProps.setProperty("error-code", "500"); + } + } else { + if (!respProps.containsKey("error-code")) { + respProps.setProperty("error-code", "200"); + } + } + + + return respProps; + } + +} diff --git a/lcm/provider/src/main/resources/org/onap/appc/default.properties b/lcm/provider/src/main/resources/org/onap/appc/default.properties new file mode 100644 index 000000000..693cd37a8 --- /dev/null +++ b/lcm/provider/src/main/resources/org/onap/appc/default.properties @@ -0,0 +1,58 @@ +### +# ============LICENSE_START======================================================= +# ONAP : APPC +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Copyright (C) 2017 Amdocs +# ============================================================================= +# 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. +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# ============LICENSE_END========================================================= +### + +# +# This property file supplies the configuration defaults for the APP-C controller +# +# Default values are supplied so that all defined properties have well-known values and are +# valid even if a configuration file is not supplied. This is done to ensure that a runnable, +# stable, and defined configuration exists at all times. The reason the defaults are supplied +# via this property file and not in the code is so that the properties can be changed +# easily if needed in the future. Use of the "getProperty(name, default)" method is +# discouraged because if the default value needs to be changed, everywhere in the code it +# is used would have to be changed. By loading the defaults in this property file, all +# values can be defined in one place and support is easier. This does mean that all +# properties that are defined must have a default value supplied here. Which also means +# this file documents all defined properties (not a bad thing either). +# +#-------------------------------------------------------------------------------------------- +# The path and file used to load user-supplied configuration settings, if any +org.onap.appc.bootstrap.file=appc.properties +org.onap.appc.bootstrap.path=/opt/onap/appc/data/properties,${user.home},. + +appc.application.name=APPC + +# +# The path to search for logging configuration document, and the name of the document +# +org.onap.appc.logging.path=${user.home},etc,../etc,. +org.onap.appc.logging.file=logback.xml + +# +# The DG properties +# +appc.service.logic.module.name=APPC +appc.topology.dg.method=topology-operation-all +appc.topology.dg.version=2.0.0 + diff --git a/lcm/provider/src/main/resources/org/onap/appc/logback.xml b/lcm/provider/src/main/resources/org/onap/appc/logback.xml new file mode 100644 index 000000000..0dffe75e0 --- /dev/null +++ b/lcm/provider/src/main/resources/org/onap/appc/logback.xml @@ -0,0 +1,287 @@ + + + + + + + + + + %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level + %-36.36logger - %msg%n + + + + + + + + + + ${logDirectory}/cdp.log + + ${logDirectory}/cdp.%i.log.zip + + 1 + 9 + + + 5MB + + + + %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level + %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} + %X{Path}] - %msg%n + + + + 256 + + + + + + ${logDirectory}/cdp-security.log + + ${logDirectory}/cdp-security.%i.log.zip + + 1 + 9 + + + 5MB + + + + %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level + %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} + %X{Path}] - %msg%n + + + + 256 + 0 + + + + + + ${logDirectory}/cdp-performance.log + + ${logDirectory}/cdp-performance.%i.log.zip + + 1 + 9 + + + 5MB + + + true + %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level + %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} + %X{Path}] - %msg%n + + + + 256 + + + + + + ${logDirectory}/cdp-server.log + + ${logDirectory}/cdp-server.%i.log.zip + + 1 + 9 + + + 5MB + + + + %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level + %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} + %X{Path}] - %msg%n + + + + 256 + + + + + + ${logDirectory}/cdp-coordinator.log + + ${logDirectory}/cdp-coordinator.%i.log.zip + + 1 + 9 + + + 5MB + + + + %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level + %-36.36logger - %msg%n + + + + 256 + + + + + + ${logDirectory}/cdp-policy.log + + ${logDirectory}/cdp-policy.%i.log.zip + + 1 + 9 + + + 5MB + + + + %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level + %-36.36logger - %msg%n + + + + 256 + + + + ${debugLogDirectory}/appc-debug.log + + ${logDirectory}/command-executor.%i.log.zip + + 1 + 9 + + + 5MB + + + + + %d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName} - %X{bundle.id} - %X{bundle.name} - %X{bundle.version}|%X{InstanceUUID}|%-5.5p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|[%c{3}]|%m%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java new file mode 100644 index 000000000..38920e0ba --- /dev/null +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -0,0 +1,1514 @@ +package org.onap.ccsdk.sli.northbound; + +import static org.junit.Assert.*; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.InputStream; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicLoader; +import org.onap.ccsdk.sli.core.sli.SvcLogicParser; +import org.onap.ccsdk.sli.core.sli.SvcLogicStore; +import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; +import org.onap.ccsdk.sli.core.sli.provider.BlockNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.CallNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.ConfigureNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.DeleteNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.ExecuteNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.ExistsNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.ForNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.GetResourceNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.IsAvailableNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.NotifyNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.RecordNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.ReleaseNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.ReserveNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.ReturnNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.SaveNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.SetNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl; +import org.onap.ccsdk.sli.core.sli.provider.SwitchNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.UpdateNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.WhileNodeExecutor; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.Action; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActionStatusInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActionStatusOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AttachVolumeInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AttachVolumeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AuditInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AuditOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.CheckLockInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.CheckLockOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupDeleteInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupDeleteOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigExportInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigExportOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigModifyInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigModifyOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigRestoreInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigRestoreOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigScaleOutInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigScaleOutOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigureInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigureOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.HealthCheckInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.HealthCheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LCMService; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LiveUpgradeInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LiveUpgradeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LockInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LockOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.MigrateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.MigrateOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.Payload; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QueryInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QueryOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QuiesceTrafficInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QuiesceTrafficOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RebootInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RebootOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RestartInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RestartOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ResumeTrafficInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ResumeTrafficOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RollbackInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RollbackOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SnapshotInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SnapshotOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SoftwareUploadInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SoftwareUploadOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartApplicationInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartApplicationOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopApplicationInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopApplicationOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SyncInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SyncOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TerminateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TerminateOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TestInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TestOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UnlockInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UnlockOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackoutInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackoutOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackupInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackupOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePostCheckInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePostCheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestLcmProvider { + + Logger LOG = LoggerFactory.getLogger(LcmProvider.class); + private LcmProvider provider; + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + DataBroker dataBroker = mock(DataBroker.class); + NotificationPublishService notifyService = mock(NotificationPublishService.class); + RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class); + BindingAwareBroker.RpcRegistration rpcRegistration = (BindingAwareBroker.RpcRegistration) mock(BindingAwareBroker.RpcRegistration.class); + when(rpcRegistry.addRpcImplementation(any(Class.class), any(LCMService.class))).thenReturn(rpcRegistration); + + + // Load svclogic.properties and get a SvcLogicStore + InputStream propStr = TestLcmProvider.class.getResourceAsStream("/svclogic.properties"); + Properties svcprops = new Properties(); + svcprops.load(propStr); + + SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops); + + assertNotNull(store); + + URL graphUrl = TestLcmProvider.class.getClassLoader().getResource("graphs"); + + if (graphUrl == null) { + fail("Cannot find graphs directory"); + } + + SvcLogicLoader loader = new SvcLogicLoader(graphUrl.getPath(), store); + loader.loadAndActivate(); + + // Create a ServiceLogicService + SvcLogicServiceImpl svc = new SvcLogicServiceImpl(new SvcLogicPropertiesProviderImpl()); + + // Finally ready to create sliapiProvider + LcmSliClient client = new LcmSliClient(svc); + provider = new LcmProvider(dataBroker, notifyService, rpcRegistry, client); + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + provider.close(); + } + + + @Test + public void testCheckLock() { + CheckLockInputBuilder builder = new CheckLockInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.CheckLock); + + try { + CheckLockOutput results = provider.checkLock(builder.build()).get().getResult(); + LOG.info("CheckLock returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("CheckLock threw exception"); + } + + } + + @Test + public void testReboot() { + RebootInputBuilder builder = new RebootInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Reboot); + builder.setPayload(mock(Payload.class)); + + + try { + RebootOutput results = provider.reboot(builder.build()).get().getResult(); + LOG.info("Reboot returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Reboot threw exception"); + } + } + + @Test + public void testUpgradeBackup() { + UpgradeBackupInputBuilder builder = new UpgradeBackupInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradeBackup); + builder.setPayload(mock(Payload.class)); + + + + try { + UpgradeBackupOutput results = provider.upgradeBackup(builder.build()).get().getResult(); + LOG.info("UpgradeBackout returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("CheckLock threw exception"); + } + } + + @Test + public void testRollback() { + RollbackInputBuilder builder = new RollbackInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Rollback); + builder.setPayload(mock(Payload.class)); + + + try { + RollbackOutput results = provider.rollback(builder.build()).get().getResult(); + LOG.info("Rollback returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Rollback threw exception"); + } + } + + @Test + public void testSync() { + SyncInputBuilder builder = new SyncInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Sync); + builder.setPayload(mock(Payload.class)); + + + try { + SyncOutput results = provider.sync(builder.build()).get().getResult(); + LOG.info("Sync returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Sync threw exception"); + } + } + + @Test + public void testQuery() { + QueryInputBuilder builder = new QueryInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Query); + + + try { + QueryOutput results = provider.query(builder.build()).get().getResult(); + LOG.info("Query returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Query threw exception"); + } + + } + + @Test + public void testConfigExport() { + ConfigExportInputBuilder builder = new ConfigExportInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigExport); + + + try { + ConfigExportOutput results = provider.configExport(builder.build()).get().getResult(); + LOG.info("ConfigExport returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigExport threw exception"); + } + } + + @Test + public void testStopApplication() { + + StopApplicationInputBuilder builder = new StopApplicationInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.StopApplication); + builder.setPayload(mock(Payload.class)); + + + try { + StopApplicationOutput results = provider.stopApplication(builder.build()).get().getResult(); + LOG.info("StopApplication returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("StopApplication threw exception"); + } + } + + @Test + public void testSoftwareUpload() { + SoftwareUploadInputBuilder builder = new SoftwareUploadInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.SoftwareUpload); + builder.setPayload(mock(Payload.class)); + + + try { + SoftwareUploadOutput results = provider.softwareUpload(builder.build()).get().getResult(); + LOG.info("SoftwareUpload returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("SoftwareUpload threw exception"); + } + } + + @Test + public void testResumeTraffic() { + ResumeTrafficInputBuilder builder = new ResumeTrafficInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ResumeTraffic); + builder.setPayload(mock(Payload.class)); + + + try { + ResumeTrafficOutput results = provider.resumeTraffic(builder.build()).get().getResult(); + LOG.info("ResumeTraffic returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ResumeTraffic threw exception"); + } + } + + @Test + public void testConfigure() { + ConfigureInputBuilder builder = new ConfigureInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Configure); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigureOutput results = provider.configure(builder.build()).get().getResult(); + LOG.info("Configure returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Configure threw exception"); + } + } + + @Test + public void testActionStatus() { + ActionStatusInputBuilder builder = new ActionStatusInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ActionStatus); + builder.setPayload(mock(Payload.class)); + + + try { + ActionStatusOutput results = provider.actionStatus(builder.build()).get().getResult(); + LOG.info("ActionStatus returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ActionStatus threw exception"); + } + } + + @Test + public void testUpgradePreCheck() { + UpgradePreCheckInputBuilder builder = new UpgradePreCheckInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradePreCheck); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradePreCheckOutput results = provider.upgradePreCheck(builder.build()).get().getResult(); + LOG.info("UpgradePreCheck returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradePreCheck threw exception"); + } + } + + @Test + public void testLiveUpgrade() { + LiveUpgradeInputBuilder builder = new LiveUpgradeInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.LiveUpgrade); + builder.setPayload(mock(Payload.class)); + + + try { + LiveUpgradeOutput results = provider.liveUpgrade(builder.build()).get().getResult(); + LOG.info("LiveUpgrade returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("LiveUpgrade threw exception"); + } + } + + @Test + public void testConfigModify() { + ConfigModifyInputBuilder builder = new ConfigModifyInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigModify); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigModifyOutput results = provider.configModify(builder.build()).get().getResult(); + LOG.info("ConfigModify returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigModify threw exception"); + } + } + + @Test + public void testRestart() { + RestartInputBuilder builder = new RestartInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Restart); + builder.setPayload(mock(Payload.class)); + + + try { + RestartOutput results = provider.restart(builder.build()).get().getResult(); + LOG.info("Restart returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Restart threw exception"); + } + } + + @Test + public void testHealthCheck() { + HealthCheckInputBuilder builder = new HealthCheckInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.HealthCheck); + builder.setPayload(mock(Payload.class)); + + + try { + HealthCheckOutput results = provider.healthCheck(builder.build()).get().getResult(); + LOG.info("HealthCheck returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("HealthCheck threw exception"); + } + } + + @Test + public void testLock() { + LockInputBuilder builder = new LockInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Lock); + builder.setPayload(mock(Payload.class)); + + + try { + LockOutput results = provider.lock(builder.build()).get().getResult(); + LOG.info("Lock returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Lock threw exception"); + } + } + + @Test + public void testTerminate() { + TerminateInputBuilder builder = new TerminateInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Terminate); + builder.setPayload(mock(Payload.class)); + + + try { + TerminateOutput results = provider.terminate(builder.build()).get().getResult(); + LOG.info("Terminate returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Terminate threw exception"); + } + } + + @Test + public void testAttachVolume() { + AttachVolumeInputBuilder builder = new AttachVolumeInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.AttachVolume); + builder.setPayload(mock(Payload.class)); + + + try { + AttachVolumeOutput results = provider.attachVolume(builder.build()).get().getResult(); + LOG.info("AttachVolume returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("AttachVolume threw exception"); + } + } + + @Test + public void testMigrate() { + MigrateInputBuilder builder = new MigrateInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Migrate); + builder.setPayload(mock(Payload.class)); + + + try { + MigrateOutput results = provider.migrate(builder.build()).get().getResult(); + LOG.info("Migrate returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Migrate threw exception"); + } + } + + @Test + public void testQuiesceTraffic() { + QuiesceTrafficInputBuilder builder = new QuiesceTrafficInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.QuiesceTraffic); + builder.setPayload(mock(Payload.class)); + + + try { + QuiesceTrafficOutput results = provider.quiesceTraffic(builder.build()).get().getResult(); + LOG.info("QuiesceTraffic returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("QuiesceTraffic threw exception"); + } + } + + @Test + public void testConfigRestore() { + ConfigRestoreInputBuilder builder = new ConfigRestoreInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigRestore); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigRestoreOutput results = provider.configRestore(builder.build()).get().getResult(); + LOG.info("ConfigRestore returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigRestore threw exception"); + } + } + + @Test + public void testUpgradeBackout() { + UpgradeBackoutInputBuilder builder = new UpgradeBackoutInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradeBackout); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradeBackoutOutput results = provider.upgradeBackout(builder.build()).get().getResult(); + LOG.info("UpgradeBackout returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradeBackout threw exception"); + } + } + + @Test + public void testEvacuate() { + EvacuateInputBuilder builder = new EvacuateInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Evacuate); + builder.setPayload(mock(Payload.class)); + + + try { + EvacuateOutput results = provider.evacuate(builder.build()).get().getResult(); + LOG.info("Evacuate returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Evacuate threw exception"); + } + } + + @Test + public void testUnlock() { + UnlockInputBuilder builder = new UnlockInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Unlock); + builder.setPayload(mock(Payload.class)); + + + try { + UnlockOutput results = provider.unlock(builder.build()).get().getResult(); + LOG.info("Unlock returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Unlock threw exception"); + } + } + + @Test + public void testConfigBackupDelete() { + ConfigBackupDeleteInputBuilder builder = new ConfigBackupDeleteInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigBackupDelete); + + + try { + ConfigBackupDeleteOutput results = provider.configBackupDelete(builder.build()).get().getResult(); + LOG.info("ConfigBackupDelete returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigBackupDelete threw exception"); + } + } + + @Test + public void testUpgradeSoftware() { + UpgradeSoftwareInputBuilder builder = new UpgradeSoftwareInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradeSoftware); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradeSoftwareOutput results = provider.upgradeSoftware(builder.build()).get().getResult(); + LOG.info("UpgradeSoftware returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradeSoftware threw exception"); + } + } + + @Test + public void testStop() { + StopInputBuilder builder = new StopInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Stop); + builder.setPayload(mock(Payload.class)); + + + try { + StopOutput results = provider.stop(builder.build()).get().getResult(); + LOG.info("Stop returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Stop threw exception"); + } + } + + @Test + public void testDetachVolume() { + DetachVolumeInputBuilder builder = new DetachVolumeInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DetachVolume); + builder.setPayload(mock(Payload.class)); + + + try { + DetachVolumeOutput results = provider.detachVolume(builder.build()).get().getResult(); + LOG.info("DetachVolume returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DetachVolume threw exception"); + } + } + + @Test + public void testConfigScaleOut() { + ConfigScaleOutInputBuilder builder = new ConfigScaleOutInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigScaleOut); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigScaleOutOutput results = provider.configScaleOut(builder.build()).get().getResult(); + LOG.info("ConfigScaleOut returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigScaleOut threw exception"); + } + } + + @Test + public void testUpgradePostCheck() { + UpgradePostCheckInputBuilder builder = new UpgradePostCheckInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradePostCheck); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradePostCheckOutput results = provider.upgradePostCheck(builder.build()).get().getResult(); + LOG.info("UpgradePostCheck returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradePostCheck threw exception"); + } + } + + @Test + public void testTest() { + TestInputBuilder builder = new TestInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Test); + builder.setPayload(mock(Payload.class)); + + + try { + TestOutput results = provider.test(builder.build()).get().getResult(); + LOG.info("Test returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Test threw exception"); + } + } + + @Test + public void testStartApplication() { + StartApplicationInputBuilder builder = new StartApplicationInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.StartApplication); + builder.setPayload(mock(Payload.class)); + + + try { + StartApplicationOutput results = provider.startApplication(builder.build()).get().getResult(); + LOG.info("StartApplication returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("StartApplication threw exception"); + } + } + + @Test + public void testConfigBackup() { + ConfigBackupInputBuilder builder = new ConfigBackupInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigBackup); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigBackupOutput results = provider.configBackup(builder.build()).get().getResult(); + LOG.info("ConfigBackup returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigBackup threw exception"); + } + } + + @Test + public void testRebuild() { + ConfigBackupInputBuilder builder = new ConfigBackupInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigBackup); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigBackupOutput results = provider.configBackup(builder.build()).get().getResult(); + LOG.info("ConfigBackup returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigBackup threw exception"); + } + } + + @Test + public void testAudit() { + AuditInputBuilder builder = new AuditInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Audit); + builder.setPayload(mock(Payload.class)); + + + try { + AuditOutput results = provider.audit(builder.build()).get().getResult(); + LOG.info("Audit returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Audit threw exception"); + } + } + + @Test + public void testStart() { + StartInputBuilder builder = new StartInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Start); + builder.setPayload(mock(Payload.class)); + + + try { + StartOutput results = provider.start(builder.build()).get().getResult(); + LOG.info("Start returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Start threw exception"); + } + } + + @Test + public void testSnapshot() { + SnapshotInputBuilder builder = new SnapshotInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Snapshot); + builder.setPayload(mock(Payload.class)); + + + try { + SnapshotOutput results = provider.snapshot(builder.build()).get().getResult(); + LOG.info("Snapshot returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Snapshot threw exception"); + } + } + +} diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml new file mode 100644 index 000000000..831071c4d --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml new file mode 100644 index 000000000..ab95cf847 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml new file mode 100644 index 000000000..b122fe646 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml new file mode 100644 index 000000000..8fc467b50 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml new file mode 100644 index 000000000..42ae23561 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml new file mode 100644 index 000000000..d7758e800 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml new file mode 100644 index 000000000..f3b69b3ce --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml new file mode 100644 index 000000000..09e313e3e --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml new file mode 100644 index 000000000..6ed6d99fc --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml new file mode 100644 index 000000000..3fd12941b --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml new file mode 100644 index 000000000..13805e6d0 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml new file mode 100644 index 000000000..78644b745 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml new file mode 100644 index 000000000..ba1bdf1d3 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml new file mode 100644 index 000000000..6b362ce3b --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml new file mode 100644 index 000000000..88e850d5a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml new file mode 100644 index 000000000..f9eee0b04 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml new file mode 100644 index 000000000..c4620d899 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml new file mode 100644 index 000000000..8732b977e --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml new file mode 100644 index 000000000..e54eeff6c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml new file mode 100644 index 000000000..89b654dfa --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml new file mode 100644 index 000000000..90b7e23f0 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml new file mode 100644 index 000000000..c0d545fa3 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml new file mode 100644 index 000000000..fd7b979ed --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml new file mode 100644 index 000000000..980f263cd --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml new file mode 100644 index 000000000..1ef50c516 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml new file mode 100644 index 000000000..d372a370d --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml new file mode 100644 index 000000000..0e3ae889d --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml new file mode 100644 index 000000000..ff68805be --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml new file mode 100644 index 000000000..7e2da11bf --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml new file mode 100644 index 000000000..affecdd23 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml new file mode 100644 index 000000000..e33096542 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml new file mode 100644 index 000000000..32a800bdf --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml new file mode 100644 index 000000000..4f0e1f3ae --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml new file mode 100644 index 000000000..735d891f7 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml new file mode 100644 index 000000000..b12054ea0 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml new file mode 100644 index 000000000..c1f7afc84 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml new file mode 100644 index 000000000..89f3a3c02 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml new file mode 100644 index 000000000..e2ff7991d --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml new file mode 100644 index 000000000..98642de1e --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions new file mode 100644 index 000000000..e949f496a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -0,0 +1,39 @@ +LCM Restart 1.0.0 sync +LCM Rebuild 1.0.0 sync +LCM Migrate 1.0.0 sync +LCM Evacuate 1.0.0 sync +LCM Snapshot 1.0.0 sync +LCM Rollback 1.0.0 sync +LCM Sync 1.0.0 sync +LCM Audit 1.0.0 sync +LCM Stop 1.0.0 sync +LCM Start 1.0.0 sync +LCM Terminate 1.0.0 sync +LCM SoftwareUpload 1.0.0 sync +LCM HealthCheck 1.0.0 sync +LCM LiveUpgrade 1.0.0 sync +LCM Lock 1.0.0 sync +LCM Unlock 1.0.0 sync +LCM Test 1.0.0 sync +LCM CheckLock 1.0.0 sync +LCM Configure 1.0.0 sync +LCM ConfigModify 1.0.0 sync +LCM ConfigScaleOut 1.0.0 sync +LCM ConfigRestore 1.0.0 sync +LCM ConfigBackup 1.0.0 sync +LCM ConfigBackupDelete 1.0.0 sync +LCM ConfigExport 1.0.0 sync +LCM StopApplication 1.0.0 sync +LCM StartApplication 1.0.0 sync +LCM QuiesceTraffic 1.0.0 sync +LCM ResumeTraffic 1.0.0 sync +LCM UpgradePreCheck 1.0.0 sync +LCM UpgradeSoftware 1.0.0 sync +LCM UpgradePostCheck 1.0.0 sync +LCM UpgradeBackup 1.0.0 sync +LCM UpgradeBackout 1.0.0 sync +LCM ActionStatus 1.0.0 sync +LCM Query 1.0.0 sync +LCM Reboot 1.0.0 sync +LCM AttachVolume 1.0.0 sync +LCM DetachVolume 1.0.0 sync diff --git a/lcm/provider/src/test/resources/svclogic.properties b/lcm/provider/src/test/resources/svclogic.properties new file mode 100644 index 000000000..426960f76 --- /dev/null +++ b/lcm/provider/src/test/resources/svclogic.properties @@ -0,0 +1,27 @@ +### +# ============LICENSE_START======================================================= +# ONAP : CCSDK +# ================================================================================ +# 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========================================================= +### + +org.onap.ccsdk.sli.dbtype = jdbc +org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true +org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver +org.onap.ccsdk.sli.jdbc.database = sdnctl +org.onap.ccsdk.sli.jdbc.user = test +org.onap.ccsdk.sli.jdbc.password = test diff --git a/pom.xml b/pom.xml index 63bcb6ead..c83f83a20 100644 --- a/pom.xml +++ b/pom.xml @@ -106,6 +106,7 @@ asdcApi dataChange + lcm dmaap-listener ueb-listener -- cgit 1.2.3-korg From 00dc2e8bc3ee13eb28335dd491a30897a3256c77 Mon Sep 17 00:00:00 2001 From: Serban Popescu Date: Wed, 18 Apr 2018 17:15:37 -0400 Subject: Update the version for dmaapclient Add support for Aai and Pserver incoming messages from Dmaap Change-Id: I4da41ec13c6abcb42eb4044bee82b7db33880c51 Issue-ID: CCSDK-223 Signed-off-by: Serban Popescu --- dmaap-listener/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index cd6b67966..5d4041e8a 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -23,7 +23,7 @@ 2.0 true /opt/app/dmaap-listener - 1.1.0-SNAPSHOT + 1.1.5-SNAPSHOT yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} -- cgit 1.2.3-korg From 1d53aedef097d095ba87ae656369706ff7f3c64b Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 24 Apr 2018 14:56:41 -0400 Subject: Add missing LCM blueprint Added blueprint descriptor for LCM to register RPC properly. Change-Id: I65d38cd9151f6094479413e06a44da02a7da4c74 Issue-ID: CCSDK-252 Signed-off-by: Timoney, Dan (dt5972) --- .gitignore | 1 + dmaap-listener/pom.xml | 2 +- .../resources/org/onap/appc/default.properties | 58 ----- .../src/main/resources/org/onap/appc/logback.xml | 287 --------------------- .../org/opendaylight/blueprint/lcm-blueprint.xml | 34 +++ 5 files changed, 36 insertions(+), 346 deletions(-) delete mode 100644 lcm/provider/src/main/resources/org/onap/appc/default.properties delete mode 100644 lcm/provider/src/main/resources/org/onap/appc/logback.xml create mode 100644 lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml diff --git a/.gitignore b/.gitignore index f9dd2d58a..d66d73564 100755 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ out/ provider/src/main/java/META-INF/ provider/src/main/java/inventory/ model/src/main/yang-gen-sal +yang-gen-sal/ ## BlackDuck generated file sdnc-northbound_bdio.jsonld diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 5d4041e8a..afae113a8 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -23,7 +23,7 @@ 2.0 true /opt/app/dmaap-listener - 1.1.5-SNAPSHOT + 1.1.5 yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} diff --git a/lcm/provider/src/main/resources/org/onap/appc/default.properties b/lcm/provider/src/main/resources/org/onap/appc/default.properties deleted file mode 100644 index 693cd37a8..000000000 --- a/lcm/provider/src/main/resources/org/onap/appc/default.properties +++ /dev/null @@ -1,58 +0,0 @@ -### -# ============LICENSE_START======================================================= -# ONAP : APPC -# ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Copyright (C) 2017 Amdocs -# ============================================================================= -# 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. -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -# ============LICENSE_END========================================================= -### - -# -# This property file supplies the configuration defaults for the APP-C controller -# -# Default values are supplied so that all defined properties have well-known values and are -# valid even if a configuration file is not supplied. This is done to ensure that a runnable, -# stable, and defined configuration exists at all times. The reason the defaults are supplied -# via this property file and not in the code is so that the properties can be changed -# easily if needed in the future. Use of the "getProperty(name, default)" method is -# discouraged because if the default value needs to be changed, everywhere in the code it -# is used would have to be changed. By loading the defaults in this property file, all -# values can be defined in one place and support is easier. This does mean that all -# properties that are defined must have a default value supplied here. Which also means -# this file documents all defined properties (not a bad thing either). -# -#-------------------------------------------------------------------------------------------- -# The path and file used to load user-supplied configuration settings, if any -org.onap.appc.bootstrap.file=appc.properties -org.onap.appc.bootstrap.path=/opt/onap/appc/data/properties,${user.home},. - -appc.application.name=APPC - -# -# The path to search for logging configuration document, and the name of the document -# -org.onap.appc.logging.path=${user.home},etc,../etc,. -org.onap.appc.logging.file=logback.xml - -# -# The DG properties -# -appc.service.logic.module.name=APPC -appc.topology.dg.method=topology-operation-all -appc.topology.dg.version=2.0.0 - diff --git a/lcm/provider/src/main/resources/org/onap/appc/logback.xml b/lcm/provider/src/main/resources/org/onap/appc/logback.xml deleted file mode 100644 index 0dffe75e0..000000000 --- a/lcm/provider/src/main/resources/org/onap/appc/logback.xml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level - %-36.36logger - %msg%n - - - - - - - - - - ${logDirectory}/cdp.log - - ${logDirectory}/cdp.%i.log.zip - - 1 - 9 - - - 5MB - - - - %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level - %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} - %X{Path}] - %msg%n - - - - 256 - - - - - - ${logDirectory}/cdp-security.log - - ${logDirectory}/cdp-security.%i.log.zip - - 1 - 9 - - - 5MB - - - - %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level - %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} - %X{Path}] - %msg%n - - - - 256 - 0 - - - - - - ${logDirectory}/cdp-performance.log - - ${logDirectory}/cdp-performance.%i.log.zip - - 1 - 9 - - - 5MB - - - true - %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level - %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} - %X{Path}] - %msg%n - - - - 256 - - - - - - ${logDirectory}/cdp-server.log - - ${logDirectory}/cdp-server.%i.log.zip - - 1 - 9 - - - 5MB - - - - %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level - %-36.36logger [%X{User} %X{RemoteHost} %X{RequestId} %X{Method} - %X{Path}] - %msg%n - - - - 256 - - - - - - ${logDirectory}/cdp-coordinator.log - - ${logDirectory}/cdp-coordinator.%i.log.zip - - 1 - 9 - - - 5MB - - - - %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level - %-36.36logger - %msg%n - - - - 256 - - - - - - ${logDirectory}/cdp-policy.log - - ${logDirectory}/cdp-policy.%i.log.zip - - 1 - 9 - - - 5MB - - - - %d{MM/dd-HH:mm:ss.SSS} [%-16thread] %.-5level - %-36.36logger - %msg%n - - - - 256 - - - - ${debugLogDirectory}/appc-debug.log - - ${logDirectory}/command-executor.%i.log.zip - - 1 - 9 - - - 5MB - - - - - %d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName} - %X{bundle.id} - %X{bundle.name} - %X{bundle.version}|%X{InstanceUUID}|%-5.5p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|[%c{3}]|%m%n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml b/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml new file mode 100644 index 000000000..5597d0801 --- /dev/null +++ b/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit 1.2.3-korg From 6c328a8158c7d3d641da5e9237e917450a2bdf52 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Sun, 29 Apr 2018 19:19:06 -0400 Subject: Roll versions step 4 : sli/northbound poms Roll version for next release candidate. Change-Id: I5c564fd2119b3a97433cb03b5678465915d75128 Issue-ID: CCSDK-257 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 061e5edc8..755d29945 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 2ac8f59d8..dd81cb56f 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 5b940021c..e6cc81930 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index aac236bde..aba5abab0 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 27e5905b9..1fa0b450e 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 78c2fcb6b..5816a55c7 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 3f33af028..13e98f4df 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 5d38e33c2..f80a9301b 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 470f95bde..8dfc21a7e 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index c32e72ce7..b5a14fa49 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index f67669931..1a1bb772e 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 2b3851690..cfec92996 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index cd1cd9683..9f4abe79f 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 1722912ce..2d45b034f 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index afae113a8..40c6ee6cc 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index e7440c6d8..b2c6a5546 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 6af726dc2..36e7cdc8d 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 590d5aa29..17195079e 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 7c9c827d8..411847a80 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 6d8589e19..b3f9caa1b 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 6bf401f2e..78667eeb0 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index ce9e6eb91..b3a3c692f 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index c83f83a20..5dcaa7a8a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT 4.0.0 @@ -113,7 +113,7 @@ ONAP - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 9c49a85b2..7ac59bce2 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index ebb19b8f6..2242188bd 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=2 -feature_revision=1 +feature_revision=2 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From c0299b921494a59940ab8575a00f1fc11503f1e6 Mon Sep 17 00:00:00 2001 From: Ruchira Agarwal Date: Thu, 3 May 2018 15:27:29 +0000 Subject: LCM Comsumer for DmaapClient Add LCM Consumer to DmaapCient for Software-Upgrade Change-Id: I0bda76bcd324dda92a6ccb225fd5a059414661f0 Issue-ID: CCSDK-263 Signed-off-by: Ruchira Agarwal --- .../dmaapclient/SdncLcmDmaapConsumer.java | 104 +++++++++++++ .../dmaapclient/TestSdncLcmDmaapConsumer.java | 166 +++++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncLcmDmaapConsumer.java diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java new file mode 100644 index 000000000..eb29111dc --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncLcmDmaapConsumer extends SdncDmaapConsumer { + + private static final Logger LOG = LoggerFactory.getLogger(SdncLcmDmaapConsumer.class); + + private static final String PARTITION = "cambria.partition"; + private static final String PARTITION_VALUE = "SDNC"; + private static final String BODY = "body"; + private static final String RPC = "rpc-name"; + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null LCM message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode lcmRootNode; + try { + lcmRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse LCM json input", e); + } + + JsonNode partitionNode = lcmRootNode.get(PARTITION); + if (partitionNode != null) + { + String partition = partitionNode.textValue(); + if(PARTITION_VALUE.equals(partition) == false) { + LOG.warn("Unknown Partition in LCM message- " + partition); + return; + } + } + + JsonNode bodyNode = lcmRootNode.get(BODY); + if(bodyNode == null) { + LOG.warn("Missing body in LCM message"); + return; + } + String rpcMsgbody; + try { + ObjectMapper mapper = new ObjectMapper(); + rpcMsgbody = mapper.writeValueAsString(bodyNode); + + } catch (Exception e) { + LOG.error("Unable to parse body in LCM message", e); + return; + } + + JsonNode rpcNode = lcmRootNode.get(RPC); + if(rpcNode == null) { + LOG.warn("Missing node in LCM message- " + RPC); + return; + } + String rpc = rpcNode.textValue(); + String sdncEndpoint = "LCM:" + rpc; + + try { + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); + LOG.info("POST LCM Request " + rpcMsgbody); + if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword); + + conn.send("POST", "application/json", rpcMsgbody); + } else { + LOG.warn("Unable to POST LCM message. SDNC URL not available. body:\n" + rpcMsgbody); + } + } catch (Exception e) { + LOG.error("Unable to process message", e); + } + } +} + diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncLcmDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncLcmDmaapConsumer.java new file mode 100644 index 000000000..4073b5542 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncLcmDmaapConsumer.java @@ -0,0 +1,166 @@ +/* + * 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.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.Properties; + +import org.apache.commons.io.FileUtils; + +import org.junit.Before; +import org.junit.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class TestSdncLcmDmaapConsumer { + private static final String lcmInput = + "{\r\n" + + " \"version\": \"lcm-dmaap.version\",\r\n" + + " \"cambria.partition\": \"SDNC\",\r\n" + + " \"correlation-id\": \"lcm-dmaap.correlation-id\",\r\n" + + " \"rpc-name\": \"upgrade-software\",\r\n" + + " \"type\": \"lcm-dmaap.type\",\r\n" + + " \"body\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"lcm-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"lcm-dmaap.flags.mode\",\r\n" + + " \"force\": \"lcm-dmaap.flags.force\",\r\n" + + " \"mode\": \"lcm-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"lcm-dmaap.originator-id\",\r\n" + + " \"request-id\": \"lcm-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"lcm-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"lcm-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"lcm-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + + @Test + public void test() throws Exception { + Properties props = new Properties(); + + SdncLcmDmaapConsumer consumer = new SdncLcmDmaapConsumer(); + InputStream propStr = TestSdncLcmDmaapConsumer.class.getResourceAsStream("/dmaap-consumer-1.properties"); + props.load(propStr); + consumer.init(props, "src/test/resources/dmaap-consumer-1.properties"); + consumer.processMsg(lcmInput); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullMessage() throws Exception { + SdncLcmDmaapConsumer consumer = new SdncLcmDmaapConsumer(); + consumer.processMsg(null); + } + + @Test + public void testProcessMsgMissingBody() throws Exception { + String msg = "{\r\n" + + " \"version\": \"lcm-dmaap.version\",\r\n" + + " \"cambria.partition\": \"SDNC\",\r\n" + + " \"correlation-id\": \"lcm-dmaap.correlation-id\",\r\n" + + " \"rpc-name\": \"upgrade-software\",\r\n" + + " \"type\": \"lcm-dmaap.type\",\r\n" + + " \"body1\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"lcm-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"lcm-dmaap.flags.mode\",\r\n" + + " \"force\": \"lcm-dmaap.flags.force\",\r\n" + + " \"mode\": \"lcm-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"lcm-dmaap.originator-id\",\r\n" + + " \"request-id\": \"lcm-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"lcm-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"lcm-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"lcm-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + SdncLcmDmaapConsumer consumer = new SdncLcmDmaapConsumer(); + consumer.processMsg(msg); + } + + @Test + public void testProcessMsgInvalidRPC() throws Exception { + String msg = "{\r\n" + + " \"version\": \"lcm-dmaap.version\",\r\n" + + " \"cambria.partition\": \"SDNC\",\r\n" + + " \"correlation-id\": \"lcm-dmaap.correlation-id\",\r\n" + + " \"rpc-name1\": \"upgrade-software\",\r\n" + + " \"type\": \"lcm-dmaap.type\",\r\n" + + " \"body\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"lcm-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"lcm-dmaap.flags.mode\",\r\n" + + " \"force\": \"lcm-dmaap.flags.force\",\r\n" + + " \"mode\": \"lcm-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"lcm-dmaap.originator-id\",\r\n" + + " \"request-id\": \"lcm-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"lcm-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"lcm-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"lcm-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + SdncLcmDmaapConsumer consumer = new SdncLcmDmaapConsumer(); + consumer.processMsg(msg); + } + + @Test + public void testProcessMsgInvalidPartition() throws Exception { + String msg = "{\r\n" + + " \"version\": \"lcm-dmaap.version\",\r\n" + + " \"cambria.partition\": \"BAD\",\r\n" + + " \"correlation-id\": \"lcm-dmaap.correlation-id\",\r\n" + + " \"rpc-name\": \"upgrade-software\",\r\n" + + " \"type\": \"lcm-dmaap.type\",\r\n" + + " \"body\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"lcm-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"lcm-dmaap.flags.mode\",\r\n" + + " \"force\": \"lcm-dmaap.flags.force\",\r\n" + + " \"mode\": \"lcm-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"lcm-dmaap.originator-id\",\r\n" + + " \"request-id\": \"lcm-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"lcm-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"lcm-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"lcm-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + + SdncLcmDmaapConsumer consumer = new SdncLcmDmaapConsumer(); + consumer.processMsg(msg); + } +} -- cgit 1.2.3-korg From 3afd9abafa26a57f9e7bba57b46c36752aac0280 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 8 May 2018 11:28:38 -0400 Subject: Remove unneeded document from csar Removed unnecessary document with proprietary marking from CSAR test file. Change-Id: I75e3ca5ab75f80bcd9fc21fb9460d833a3c9edb7 Issue-ID: CCSDK-270 Signed-off-by: Timoney, Dan (dt5972) --- .../incoming/src_test_resources_csars_nsepc.csar | Bin 42569 -> 43966 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar b/ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar index 087d8c3d8..bb09f1c2f 100644 Binary files a/ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar and b/ueb-listener/src/test/resources/incoming/src_test_resources_csars_nsepc.csar differ -- cgit 1.2.3-korg From 1562a37d9b0e5a58cb162c9480f5292ce94f866f Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 9 May 2018 16:27:29 -0400 Subject: Add mapping for vm_type_tag If vm_type is not found in CSAR, use vm_type_tag value instead. Change-Id: Ifd73029446d465aad2d9d995559be837f29b97a4 Issue-ID: SDNC-305 Signed-off-by: Timoney, Dan (dt5972) --- .../onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java index d7ed19ea6..a3345c168 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 @@ -8,9 +8,9 @@ * 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. @@ -28,19 +28,22 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncVFCModel extends SdncBaseModel { - + private static final Logger LOG = LoggerFactory .getLogger(SdncVFCModel.class); - + private String vmType = null; private String vmCount = null; public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { super(sdcCsarHelper, nodeTemplate); - + // extract properties vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPE); + if ((vmType == null) || (vmType.length() == 0)) { + vmType = extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); + } //vmCount = extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMCOUNT); - need path to vm_count vmCount = "1"; addParameter("vm_type", vmType); -- cgit 1.2.3-korg From 150f54ebb48c8edba140f7f9093c8a27d0fd8feb Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Thu, 3 May 2018 17:27:26 -0700 Subject: Add INFO.yaml file Add INFO.yaml to list: - Project description - Properties - PTL information - Meeting information - Committer information Change-Id: I2ef1f7bca8959c6a3f45b279d51473b5722dbe99 Issue-ID: CIMAN-134 Signed-off-by: Jessica Wagantall --- INFO.yaml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 INFO.yaml diff --git a/INFO.yaml b/INFO.yaml new file mode 100644 index 000000000..c9a300684 --- /dev/null +++ b/INFO.yaml @@ -0,0 +1,42 @@ +--- +project: 'ccsdk-sli-northbound' +project_creation_date: '2017-06-27' +lifecycle_state: 'Incubation' +project_lead: &onap_releng_ptl + name: 'Dan Timoney' + email: 'dtimoney@att.com' + id: 'djtimoney' + company: 'ATT' + timezone: 'America/New York' +primary_contact: *onap_releng_ptl +issue_tracking: + type: 'jira' + url: 'https://jira.onap.org/projects/CCSDK' + key: 'CCDSK' +meetings: + - type: 'zoom' + agenda: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project' + url: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project#CommonControllerSDKProject-MeetingMinutes' + server: 'n/a' + channel: 'n/a' + repeats: 'weekly' + time: '13:00 UTC' +committers: + - <<: *onap_releng_ptl + - name: 'Jack Lucas' + email: 'jflucas@research.att.com' + company: 'ATT' + id: 'jackl' + timezone: 'America/New York' + - name: 'Jun (Nicolas) Hu' + email: 'jh245g@att.com' + company: 'ATT' + id: 'jh245g' + timezone: 'America/New York' + - name: 'Ryan Goulding' + email: 'ryandgoulding@gmail.com' + company: 'Inocybe Technologies' + id: 'rgoulding' + timezone: 'America/New York' +tsc: + approval: 'https://lists.onap.org/pipermail/onap-tsc' -- cgit 1.2.3-korg From abb39c5b6cd92d50b72be2fcdaff26ad47313eef Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 10 May 2018 17:10:22 -0400 Subject: Fix DG calls to use correct rpc name DG calls should expect the name of the DG to be the same as the name of the rpc as defined in the Yang model. LCM was incorrectly expecting names in upper camelcase (e.g. UpgradeSoftware) when the Yang model defines them in lowercase hyphenated (e.g. upgrade-software). Either LCM or DGs need to change, so changed LCM since to be consistent with other MD-SAL applications. Change-Id: I034bc2d93c2f918c807fec7f342d6197f78be7ad Issue-ID: CCSDK-272 Signed-off-by: Timoney, Dan (dt5972) --- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 78 +++++++++++----------- .../test/resources/graphs/lcm/LCM_ActionStatus.xml | 30 --------- .../test/resources/graphs/lcm/LCM_AttachVolume.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Audit.xml | 2 +- .../test/resources/graphs/lcm/LCM_CheckLock.xml | 30 --------- .../test/resources/graphs/lcm/LCM_ConfigBackup.xml | 30 --------- .../graphs/lcm/LCM_ConfigBackupDelete.xml | 30 --------- .../test/resources/graphs/lcm/LCM_ConfigExport.xml | 30 --------- .../test/resources/graphs/lcm/LCM_ConfigModify.xml | 30 --------- .../resources/graphs/lcm/LCM_ConfigRestore.xml | 30 --------- .../resources/graphs/lcm/LCM_ConfigScaleOut.xml | 30 --------- .../test/resources/graphs/lcm/LCM_Configure.xml | 2 +- .../test/resources/graphs/lcm/LCM_DetachVolume.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Evacuate.xml | 2 +- .../test/resources/graphs/lcm/LCM_HealthCheck.xml | 30 --------- .../test/resources/graphs/lcm/LCM_LiveUpgrade.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Lock.xml | 2 +- .../src/test/resources/graphs/lcm/LCM_Migrate.xml | 2 +- .../src/test/resources/graphs/lcm/LCM_Query.xml | 2 +- .../resources/graphs/lcm/LCM_QuiesceTraffic.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Reboot.xml | 2 +- .../src/test/resources/graphs/lcm/LCM_Rebuild.xml | 2 +- .../src/test/resources/graphs/lcm/LCM_Restart.xml | 2 +- .../resources/graphs/lcm/LCM_ResumeTraffic.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Rollback.xml | 2 +- .../src/test/resources/graphs/lcm/LCM_Snapshot.xml | 2 +- .../resources/graphs/lcm/LCM_SoftwareUpload.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Start.xml | 2 +- .../resources/graphs/lcm/LCM_StartApplication.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Stop.xml | 2 +- .../resources/graphs/lcm/LCM_StopApplication.xml | 30 --------- .../src/test/resources/graphs/lcm/LCM_Sync.xml | 2 +- .../test/resources/graphs/lcm/LCM_Terminate.xml | 2 +- .../src/test/resources/graphs/lcm/LCM_Test.xml | 2 +- .../src/test/resources/graphs/lcm/LCM_Unlock.xml | 2 +- .../resources/graphs/lcm/LCM_UpgradeBackout.xml | 30 --------- .../resources/graphs/lcm/LCM_UpgradeBackup.xml | 30 --------- .../resources/graphs/lcm/LCM_UpgradePostCheck.xml | 30 --------- .../resources/graphs/lcm/LCM_UpgradePreCheck.xml | 30 --------- .../resources/graphs/lcm/LCM_UpgradeSoftware.xml | 30 --------- .../resources/graphs/lcm/LCM_action-status.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_attach-volume.xml | 30 +++++++++ .../test/resources/graphs/lcm/LCM_check-lock.xml | 30 +++++++++ .../graphs/lcm/LCM_config-backup-delete.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_config-backup.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_config-export.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_config-modify.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_config-restore.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_config-scale-out.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_detach-volume.xml | 30 +++++++++ .../test/resources/graphs/lcm/LCM_health-check.xml | 30 +++++++++ .../test/resources/graphs/lcm/LCM_live-upgrade.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_quiesce-traffic.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_resume-traffic.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_software-upload.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_start-application.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_stop-application.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_update-software.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_upgrade-backout.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_upgrade-backup.xml | 30 +++++++++ .../graphs/lcm/LCM_upgrade-post-check.xml | 30 +++++++++ .../resources/graphs/lcm/LCM_upgrade-pre-check.xml | 30 +++++++++ .../src/test/resources/graphs/lcm/graph.versions | 78 +++++++++++----------- 63 files changed, 755 insertions(+), 755 deletions(-) delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_action-status.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_attach-volume.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_check-lock.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup-delete.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_config-export.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_config-modify.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_config-restore.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_config-scale-out.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_detach-volume.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_health-check.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_live-upgrade.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_quiesce-traffic.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_resume-traffic.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_software-upload.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_start-application.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_stop-application.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_update-software.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backout.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backup.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-post-check.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-pre-check.xml diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 14d3d9e53..787a94e2b 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -144,7 +144,7 @@ public class LcmProvider implements AutoCloseable, LCMService { CheckLockOutputBuilder oBuilder = new CheckLockOutputBuilder(); try { - CommonLcmFields retval = callDG("CheckLock", iBuilder.build()); + CommonLcmFields retval = callDG("check-lock", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -166,7 +166,7 @@ public class LcmProvider implements AutoCloseable, LCMService { RebootOutputBuilder oBuilder = new RebootOutputBuilder(); try { - CommonLcmFields retval = callDG("Reboot", iBuilder.build()); + CommonLcmFields retval = callDG("reboot", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -187,7 +187,7 @@ public class LcmProvider implements AutoCloseable, LCMService { UpgradeBackupOutputBuilder oBuilder = new UpgradeBackupOutputBuilder(); try { - CommonLcmFields retval = callDG("UpgradeBackup", iBuilder.build()); + CommonLcmFields retval = callDG("upgrade-backup", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); @@ -209,7 +209,7 @@ public class LcmProvider implements AutoCloseable, LCMService { RollbackOutputBuilder oBuilder = new RollbackOutputBuilder(); try { - CommonLcmFields retval = callDG("Rollback", iBuilder.build()); + CommonLcmFields retval = callDG("rollback", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -230,7 +230,7 @@ public class LcmProvider implements AutoCloseable, LCMService { SyncOutputBuilder oBuilder = new SyncOutputBuilder(); try { - CommonLcmFields retval = callDG("Sync", iBuilder.build()); + CommonLcmFields retval = callDG("sync", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -251,7 +251,7 @@ public class LcmProvider implements AutoCloseable, LCMService { QueryOutputBuilder oBuilder = new QueryOutputBuilder(); try { - CommonLcmFields retval = callDG("Query", iBuilder.build()); + CommonLcmFields retval = callDG("query", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -272,7 +272,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ConfigExportOutputBuilder oBuilder = new ConfigExportOutputBuilder(); try { - CommonLcmFields retval = callDG("ConfigExport", iBuilder.build()); + CommonLcmFields retval = callDG("config-export", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -293,7 +293,7 @@ public class LcmProvider implements AutoCloseable, LCMService { StopApplicationOutputBuilder oBuilder = new StopApplicationOutputBuilder(); try { - CommonLcmFields retval = callDG("StopApplication", iBuilder.build()); + CommonLcmFields retval = callDG("stop-application", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -314,7 +314,7 @@ public class LcmProvider implements AutoCloseable, LCMService { SoftwareUploadOutputBuilder oBuilder = new SoftwareUploadOutputBuilder(); try { - CommonLcmFields retval = callDG("SoftwareUpload", iBuilder.build()); + CommonLcmFields retval = callDG("software-upload", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -335,7 +335,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ResumeTrafficOutputBuilder oBuilder = new ResumeTrafficOutputBuilder(); try { - CommonLcmFields retval = callDG("ResumeTraffic", iBuilder.build()); + CommonLcmFields retval = callDG("resume-traffic", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -356,7 +356,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ConfigureOutputBuilder oBuilder = new ConfigureOutputBuilder(); try { - CommonLcmFields retval = callDG("Configure", iBuilder.build()); + CommonLcmFields retval = callDG("configure", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -377,7 +377,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ActionStatusOutputBuilder oBuilder = new ActionStatusOutputBuilder(); try { - CommonLcmFields retval = callDG("ActionStatus", iBuilder.build()); + CommonLcmFields retval = callDG("action-status", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -398,7 +398,7 @@ public class LcmProvider implements AutoCloseable, LCMService { UpgradePreCheckOutputBuilder oBuilder = new UpgradePreCheckOutputBuilder(); try { - CommonLcmFields retval = callDG("UpgradePreCheck", iBuilder.build()); + CommonLcmFields retval = callDG("upgrade-pre-check", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -419,7 +419,7 @@ public class LcmProvider implements AutoCloseable, LCMService { LiveUpgradeOutputBuilder oBuilder = new LiveUpgradeOutputBuilder(); try { - CommonLcmFields retval = callDG("LiveUpgrade", iBuilder.build()); + CommonLcmFields retval = callDG("live-upgrade", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -440,7 +440,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ConfigModifyOutputBuilder oBuilder = new ConfigModifyOutputBuilder(); try { - CommonLcmFields retval = callDG("ConfigModify", iBuilder.build()); + CommonLcmFields retval = callDG("config-modify", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -461,7 +461,7 @@ public class LcmProvider implements AutoCloseable, LCMService { RestartOutputBuilder oBuilder = new RestartOutputBuilder(); try { - CommonLcmFields retval = callDG("Restart", iBuilder.build()); + CommonLcmFields retval = callDG("restart", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -482,7 +482,7 @@ public class LcmProvider implements AutoCloseable, LCMService { HealthCheckOutputBuilder oBuilder = new HealthCheckOutputBuilder(); try { - CommonLcmFields retval = callDG("HealthCheck", iBuilder.build()); + CommonLcmFields retval = callDG("health-check", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -503,7 +503,7 @@ public class LcmProvider implements AutoCloseable, LCMService { LockOutputBuilder oBuilder = new LockOutputBuilder(); try { - CommonLcmFields retval = callDG("Lock", iBuilder.build()); + CommonLcmFields retval = callDG("lock", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -524,7 +524,7 @@ public class LcmProvider implements AutoCloseable, LCMService { TerminateOutputBuilder oBuilder = new TerminateOutputBuilder(); try { - CommonLcmFields retval = callDG("Terminate", iBuilder.build()); + CommonLcmFields retval = callDG("terminate", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -545,7 +545,7 @@ public class LcmProvider implements AutoCloseable, LCMService { AttachVolumeOutputBuilder oBuilder = new AttachVolumeOutputBuilder(); try { - CommonLcmFields retval = callDG("AttachVolume", iBuilder.build()); + CommonLcmFields retval = callDG("attach-volume", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -566,7 +566,7 @@ public class LcmProvider implements AutoCloseable, LCMService { MigrateOutputBuilder oBuilder = new MigrateOutputBuilder(); try { - CommonLcmFields retval = callDG("Migrate", iBuilder.build()); + CommonLcmFields retval = callDG("migrate", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -587,7 +587,7 @@ public class LcmProvider implements AutoCloseable, LCMService { QuiesceTrafficOutputBuilder oBuilder = new QuiesceTrafficOutputBuilder(); try { - CommonLcmFields retval = callDG("QuiesceTraffic", iBuilder.build()); + CommonLcmFields retval = callDG("quiesce-traffic", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -608,7 +608,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ConfigRestoreOutputBuilder oBuilder = new ConfigRestoreOutputBuilder(); try { - CommonLcmFields retval = callDG("ConfigRestore", iBuilder.build()); + CommonLcmFields retval = callDG("config-restore", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -629,7 +629,7 @@ public class LcmProvider implements AutoCloseable, LCMService { UpgradeBackoutOutputBuilder oBuilder = new UpgradeBackoutOutputBuilder(); try { - CommonLcmFields retval = callDG("UpgradeBackout", iBuilder.build()); + CommonLcmFields retval = callDG("upgrade-backout", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -650,7 +650,7 @@ public class LcmProvider implements AutoCloseable, LCMService { EvacuateOutputBuilder oBuilder = new EvacuateOutputBuilder(); try { - CommonLcmFields retval = callDG("Evacuate", iBuilder.build()); + CommonLcmFields retval = callDG("evacuate", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -671,7 +671,7 @@ public class LcmProvider implements AutoCloseable, LCMService { UnlockOutputBuilder oBuilder = new UnlockOutputBuilder(); try { - CommonLcmFields retval = callDG("Unlock", iBuilder.build()); + CommonLcmFields retval = callDG("unlock", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -692,7 +692,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ConfigBackupDeleteOutputBuilder oBuilder = new ConfigBackupDeleteOutputBuilder(); try { - CommonLcmFields retval = callDG("ConfigBackupDelete", iBuilder.build()); + CommonLcmFields retval = callDG("config-backup-delete", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -713,7 +713,7 @@ public class LcmProvider implements AutoCloseable, LCMService { UpgradeSoftwareOutputBuilder oBuilder = new UpgradeSoftwareOutputBuilder(); try { - CommonLcmFields retval = callDG("UpgradeSoftware", iBuilder.build()); + CommonLcmFields retval = callDG("upgrade-software", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -734,7 +734,7 @@ public class LcmProvider implements AutoCloseable, LCMService { StopOutputBuilder oBuilder = new StopOutputBuilder(); try { - CommonLcmFields retval = callDG("Stop", iBuilder.build()); + CommonLcmFields retval = callDG("stop", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -755,7 +755,7 @@ public class LcmProvider implements AutoCloseable, LCMService { DetachVolumeOutputBuilder oBuilder = new DetachVolumeOutputBuilder(); try { - CommonLcmFields retval = callDG("DetachVolume", iBuilder.build()); + CommonLcmFields retval = callDG("detach-volume", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -776,7 +776,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ConfigScaleOutOutputBuilder oBuilder = new ConfigScaleOutOutputBuilder(); try { - CommonLcmFields retval = callDG("ConfigScaleOut", iBuilder.build()); + CommonLcmFields retval = callDG("config-scale-out", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -797,7 +797,7 @@ public class LcmProvider implements AutoCloseable, LCMService { UpgradePostCheckOutputBuilder oBuilder = new UpgradePostCheckOutputBuilder(); try { - CommonLcmFields retval = callDG("UpgradePostCheck", iBuilder.build()); + CommonLcmFields retval = callDG("upgrade-post-check", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -818,7 +818,7 @@ public class LcmProvider implements AutoCloseable, LCMService { TestOutputBuilder oBuilder = new TestOutputBuilder(); try { - CommonLcmFields retval = callDG("Test", iBuilder.build()); + CommonLcmFields retval = callDG("test", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -839,7 +839,7 @@ public class LcmProvider implements AutoCloseable, LCMService { StartApplicationOutputBuilder oBuilder = new StartApplicationOutputBuilder(); try { - CommonLcmFields retval = callDG("StartApplication", iBuilder.build()); + CommonLcmFields retval = callDG("start-application", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -860,7 +860,7 @@ public class LcmProvider implements AutoCloseable, LCMService { ConfigBackupOutputBuilder oBuilder = new ConfigBackupOutputBuilder(); try { - CommonLcmFields retval = callDG("ConfigBackup", iBuilder.build()); + CommonLcmFields retval = callDG("config-backup", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -881,7 +881,7 @@ public class LcmProvider implements AutoCloseable, LCMService { RebuildOutputBuilder oBuilder = new RebuildOutputBuilder(); try { - CommonLcmFields retval = callDG("Rebuild", iBuilder.build()); + CommonLcmFields retval = callDG("rebuild", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -902,7 +902,7 @@ public class LcmProvider implements AutoCloseable, LCMService { AuditOutputBuilder oBuilder = new AuditOutputBuilder(); try { - CommonLcmFields retval = callDG("Audit", iBuilder.build()); + CommonLcmFields retval = callDG("audit", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -923,7 +923,7 @@ public class LcmProvider implements AutoCloseable, LCMService { StartOutputBuilder oBuilder = new StartOutputBuilder(); try { - CommonLcmFields retval = callDG("Start", iBuilder.build()); + CommonLcmFields retval = callDG("start", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { @@ -944,7 +944,7 @@ public class LcmProvider implements AutoCloseable, LCMService { SnapshotOutputBuilder oBuilder = new SnapshotOutputBuilder(); try { - CommonLcmFields retval = callDG("Snapshot", iBuilder.build()); + CommonLcmFields retval = callDG("snapshot", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml deleted file mode 100644 index 831071c4d..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ActionStatus.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml deleted file mode 100644 index ab95cf847..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_AttachVolume.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml index b122fe646..34c84ed9a 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml deleted file mode 100644 index 8fc467b50..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_CheckLock.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml deleted file mode 100644 index 42ae23561..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackup.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml deleted file mode 100644 index d7758e800..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigBackupDelete.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml deleted file mode 100644 index f3b69b3ce..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigExport.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml deleted file mode 100644 index 09e313e3e..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigModify.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml deleted file mode 100644 index 6ed6d99fc..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigRestore.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml deleted file mode 100644 index 3fd12941b..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ConfigScaleOut.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml index 13805e6d0..a37f0675a 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml deleted file mode 100644 index 78644b745..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_DetachVolume.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml index ba1bdf1d3..216bd418b 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml deleted file mode 100644 index 6b362ce3b..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_HealthCheck.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml deleted file mode 100644 index 88e850d5a..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_LiveUpgrade.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml index f9eee0b04..6479d3ec5 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml index c4620d899..9c8959681 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml index 8732b977e..5d0312292 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml deleted file mode 100644 index e54eeff6c..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_QuiesceTraffic.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml index 89b654dfa..f117f9606 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml index 90b7e23f0..e721bc5a7 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml index c0d545fa3..b47091af2 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml deleted file mode 100644 index fd7b979ed..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_ResumeTraffic.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml index 980f263cd..6844d0482 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml index 1ef50c516..6d0f8b039 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml deleted file mode 100644 index d372a370d..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_SoftwareUpload.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml index 0e3ae889d..5998614ab 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml deleted file mode 100644 index ff68805be..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_StartApplication.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml index 7e2da11bf..f752725de 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml deleted file mode 100644 index affecdd23..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_StopApplication.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml index e33096542..5741175cf 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml index 32a800bdf..0f2758a89 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml index 4f0e1f3ae..5ce002d0c 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml index 735d891f7..d506c2fd5 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml deleted file mode 100644 index b12054ea0..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackout.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml deleted file mode 100644 index c1f7afc84..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeBackup.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml deleted file mode 100644 index 89f3a3c02..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePostCheck.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml deleted file mode 100644 index e2ff7991d..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradePreCheck.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml deleted file mode 100644 index 98642de1e..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_UpgradeSoftware.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_action-status.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_action-status.xml new file mode 100644 index 000000000..435a62d95 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_action-status.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_attach-volume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_attach-volume.xml new file mode 100644 index 000000000..b073f9b7e --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_attach-volume.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_check-lock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_check-lock.xml new file mode 100644 index 000000000..e07bf133d --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_check-lock.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup-delete.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup-delete.xml new file mode 100644 index 000000000..5366c30a0 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup-delete.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup.xml new file mode 100644 index 000000000..e32e5fe5b --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-export.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-export.xml new file mode 100644 index 000000000..fd6596bac --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-export.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-modify.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-modify.xml new file mode 100644 index 000000000..76782f432 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-modify.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-restore.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-restore.xml new file mode 100644 index 000000000..e0ed71b8a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-restore.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-scale-out.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-scale-out.xml new file mode 100644 index 000000000..5200feb8a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-scale-out.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_detach-volume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_detach-volume.xml new file mode 100644 index 000000000..117a3e31a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_detach-volume.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_health-check.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_health-check.xml new file mode 100644 index 000000000..cf0f773e6 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_health-check.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_live-upgrade.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_live-upgrade.xml new file mode 100644 index 000000000..02fb050f8 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_live-upgrade.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_quiesce-traffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_quiesce-traffic.xml new file mode 100644 index 000000000..0770b3dfc --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_quiesce-traffic.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_resume-traffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_resume-traffic.xml new file mode 100644 index 000000000..7e0f1d6b3 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_resume-traffic.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_software-upload.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_software-upload.xml new file mode 100644 index 000000000..a9eb58ac4 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_software-upload.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_start-application.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_start-application.xml new file mode 100644 index 000000000..9b422a83c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_start-application.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_stop-application.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_stop-application.xml new file mode 100644 index 000000000..91dc4fca6 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_stop-application.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_update-software.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_update-software.xml new file mode 100644 index 000000000..75440c2a0 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_update-software.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backout.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backout.xml new file mode 100644 index 000000000..d48d6817a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backout.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backup.xml new file mode 100644 index 000000000..d81651a83 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backup.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-post-check.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-post-check.xml new file mode 100644 index 000000000..ba2798a41 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-post-check.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-pre-check.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-pre-check.xml new file mode 100644 index 000000000..1aaf18fff --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-pre-check.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index e949f496a..4ca21daf3 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -1,39 +1,39 @@ -LCM Restart 1.0.0 sync -LCM Rebuild 1.0.0 sync -LCM Migrate 1.0.0 sync -LCM Evacuate 1.0.0 sync -LCM Snapshot 1.0.0 sync -LCM Rollback 1.0.0 sync -LCM Sync 1.0.0 sync -LCM Audit 1.0.0 sync -LCM Stop 1.0.0 sync -LCM Start 1.0.0 sync -LCM Terminate 1.0.0 sync -LCM SoftwareUpload 1.0.0 sync -LCM HealthCheck 1.0.0 sync -LCM LiveUpgrade 1.0.0 sync -LCM Lock 1.0.0 sync -LCM Unlock 1.0.0 sync -LCM Test 1.0.0 sync -LCM CheckLock 1.0.0 sync -LCM Configure 1.0.0 sync -LCM ConfigModify 1.0.0 sync -LCM ConfigScaleOut 1.0.0 sync -LCM ConfigRestore 1.0.0 sync -LCM ConfigBackup 1.0.0 sync -LCM ConfigBackupDelete 1.0.0 sync -LCM ConfigExport 1.0.0 sync -LCM StopApplication 1.0.0 sync -LCM StartApplication 1.0.0 sync -LCM QuiesceTraffic 1.0.0 sync -LCM ResumeTraffic 1.0.0 sync -LCM UpgradePreCheck 1.0.0 sync -LCM UpgradeSoftware 1.0.0 sync -LCM UpgradePostCheck 1.0.0 sync -LCM UpgradeBackup 1.0.0 sync -LCM UpgradeBackout 1.0.0 sync -LCM ActionStatus 1.0.0 sync -LCM Query 1.0.0 sync -LCM Reboot 1.0.0 sync -LCM AttachVolume 1.0.0 sync -LCM DetachVolume 1.0.0 sync +LCM restart 1.0.0 sync +LCM rebuild 1.0.0 sync +LCM migrate 1.0.0 sync +LCM evacuate 1.0.0 sync +LCM snapshot 1.0.0 sync +LCM rollback 1.0.0 sync +LCM sync 1.0.0 sync +LCM audit 1.0.0 sync +LCM stop 1.0.0 sync +LCM start 1.0.0 sync +LCM terminate 1.0.0 sync +LCM software-upload 1.0.0 sync +LCM health-check 1.0.0 sync +LCM live-upgrade 1.0.0 sync +LCM lock 1.0.0 sync +LCM unlock 1.0.0 sync +LCM test 1.0.0 sync +LCM check-lock 1.0.0 sync +LCM configure 1.0.0 sync +LCM config-modify 1.0.0 sync +LCM config-scale-out 1.0.0 sync +LCM config-restore 1.0.0 sync +LCM config-backup 1.0.0 sync +LCM config-backup-delete 1.0.0 sync +LCM config-export 1.0.0 sync +LCM stop-application 1.0.0 sync +LCM start-application 1.0.0 sync +LCM quiesce-traffic 1.0.0 sync +LCM resume-traffic 1.0.0 sync +LCM upgrade-pre-check 1.0.0 sync +LCM upgrade-software 1.0.0 sync +LCM upgrade-post-check 1.0.0 sync +LCM upgrade-backup 1.0.0 sync +LCM upgrade-backout 1.0.0 sync +LCM action-status 1.0.0 sync +LCM query 1.0.0 sync +LCM reboot 1.0.0 sync +LCM attach-volume 1.0.0 sync +LCM detach-volume 1.0.0 sync -- cgit 1.2.3-korg From 17ace0efb1445bfb1239222b3e1249e66e677cc0 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 17 May 2018 18:58:12 -0400 Subject: Update sli/northbound to use 1.0.2 parent Update pom.xmls to use released 1.0.2 version of parent pom Change-Id: Iccb3d5fbc92fd4177220f307178ac8a95ce0e7d5 Issue-ID: CCSDK-286 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 755d29945..697ac1315 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index dd81cb56f..6f363251a 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index e6cc81930..1adde8276 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index aba5abab0..16c6ace23 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 1fa0b450e..ac825aeab 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 5816a55c7..8fcef91fa 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 13e98f4df..b3a08b1b9 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index f80a9301b..b1bed1b13 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 8dfc21a7e..79927ba09 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index b5a14fa49..4d2a36c39 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 1a1bb772e..6e57a01d6 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index cfec92996..34ccc0932 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 9f4abe79f..ea747422e 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 2d45b034f..f62139d27 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 40c6ee6cc..2bb6dcf0f 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.northbound diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index b2c6a5546..ea76bcafe 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 36e7cdc8d..a9c1a8201 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 17195079e..550a00947 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 411847a80..8df9f98f3 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index b3f9caa1b..fc0c984ef 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/lcm/pom.xml b/lcm/pom.xml index 78667eeb0..eb1fb7ef2 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index b3a3c692f..7738cd8ff 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/pom.xml b/pom.xml index 5dcaa7a8a..15f3d6bf0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 7ac59bce2..1190d5d1f 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From 202e3a705381883acc89bf62159493fbaf8d1da8 Mon Sep 17 00:00:00 2001 From: "Stilwell, David (stilwelld)" Date: Wed, 23 May 2018 12:44:08 -0400 Subject: Roll to next snapshot version Roll to version 0.2.3-SNAPSHOT and update parent to 1.0.3-SNAPSHOT Change-Id: I88e11e78f61099f5b2e69b2161cf7c65b5a860e1 Issue-ID: CCSDK-290 Signed-off-by: Stilwell, David (stilwelld) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 697ac1315..3331a0590 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 6f363251a..fc3bfd823 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 1adde8276..2e83324f1 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 16c6ace23..08fce1957 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index ac825aeab..057d839fd 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 8fcef91fa..0fd87994a 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index b3a08b1b9..0bb695fad 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index b1bed1b13..e0994244d 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 79927ba09..fbd361ac4 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 4d2a36c39..002c9a614 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 6e57a01d6..19aa8289d 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 34ccc0932..2a7a2f821 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index ea747422e..8b631c66a 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index f62139d27..48aeecd21 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 2bb6dcf0f..b700b5c96 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index ea76bcafe..af6882bdc 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index a9c1a8201..c52debcc5 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 550a00947..e3352ff3d 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 8df9f98f3..63891ebec 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index fc0c984ef..19a483cda 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index eb1fb7ef2..18c808e9f 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 7738cd8ff..eb95e6b05 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 15f3d6bf0..a6af9870d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 @@ -113,7 +113,7 @@ ONAP - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 1190d5d1f..05e1d38d6 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 2242188bd..5d5ee0480 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=2 -feature_revision=2 +feature_revision=3 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From b05d1c70707af00ec6a5bc7e9b121503a4e1d9d0 Mon Sep 17 00:00:00 2001 From: "Stilwell, David (stilwelld)" Date: Wed, 23 May 2018 17:14:33 -0400 Subject: Update to release version parent 1.0.3 Update parent version to remove -SNAPSHOT (1.0.3) Change-Id: I22f2cdbdc194e343dd6b04a371e298294f569477 Issue-ID: CCSDK-290 Signed-off-by: Stilwell, David (stilwelld) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 3331a0590..9de855881 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index fc3bfd823..3848cc5de 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 2e83324f1..3179285e6 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 08fce1957..8a98ec708 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 057d839fd..883738512 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 0fd87994a..3da1104b2 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 0bb695fad..4ab40a1b2 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index e0994244d..2cdd7e448 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index fbd361ac4..3097e09af 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 002c9a614..ee855aac3 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 19aa8289d..a5a43230b 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 2a7a2f821..478086b62 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 8b631c66a..b3c719f62 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 48aeecd21..03fb4a442 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index b700b5c96..0771bf2c5 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.northbound diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index af6882bdc..8aa21f973 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index c52debcc5..1a8dbc688 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index e3352ff3d..d41436f89 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 63891ebec..051394e0c 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 19a483cda..cfcda0199 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/lcm/pom.xml b/lcm/pom.xml index 18c808e9f..571121b58 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index eb95e6b05..13ea2384d 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/pom.xml b/pom.xml index a6af9870d..75c1d4846 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 05e1d38d6..259ed06a2 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From 12e42ca015ef09b84925cc39a20320ee330bf267 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Fri, 25 May 2018 11:25:37 -0400 Subject: Update ueb-listener VF Model extraction Changes made: Changed the location of extraction for ecomp_generated_naming when populating VF_MOEL table. Change-Id: I14982b4081013702c5e0023205363015199459f6 Issue-ID: SDNC-325 Signed-off-by: lalena.aria --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 32f25c51d..41b43c4c9 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 @@ -44,8 +44,8 @@ public class SdncVFModel extends SdncBaseModel { addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); // extract properties - addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_ECOMPGENERATEDNAMING)); - addParameter("naming_policy", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_NAMINGPOLICY)); + addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, "nf_naming#ecomp_generated_naming")); + addParameter("naming_policy", extractValue(nodeTemplate, "nf_naming#naming_policy")); addParameter("nf_type", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); addParameter("nf_role", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)); addParameter("nf_code", extractValue( nodeTemplate, "nf_naming_code")); -- cgit 1.2.3-korg From e377e0205a7448af0c8c04dd349c018069d96ddf Mon Sep 17 00:00:00 2001 From: Ruchira Agarwal Date: Wed, 30 May 2018 21:39:35 +0000 Subject: LCMConsumer fix Remove partition edit Change-Id: Id4861a7c4bb46775b770d3511b7cf50f8c49637f Issue-ID: CCSDK-292 Signed-off-by: Ruchira Agarwal --- .../ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java index eb29111dc..53fb6db0f 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java @@ -50,16 +50,6 @@ public class SdncLcmDmaapConsumer extends SdncDmaapConsumer { } catch (Exception e) { throw new InvalidMessageException("Cannot parse LCM json input", e); } - - JsonNode partitionNode = lcmRootNode.get(PARTITION); - if (partitionNode != null) - { - String partition = partitionNode.textValue(); - if(PARTITION_VALUE.equals(partition) == false) { - LOG.warn("Unknown Partition in LCM message- " + partition); - return; - } - } JsonNode bodyNode = lcmRootNode.get(BODY); if(bodyNode == null) { -- cgit 1.2.3-korg From 08ce0be92bae13a44287a9d05cc395ea75a74ccd Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 30 May 2018 18:12:11 -0400 Subject: Roll version to 0.2.4 Roll version to 0.2.4-SNAPSHOT and version 1.0.4-SNAPSHOT of parent Change-Id: I7b4ad7a2f69e821d91603d2e2a1ae28e0f8e0558 Issue-ID: CCSDK-291 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 9de855881..3739ee920 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 3848cc5de..3864e139a 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 3179285e6..d02608004 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 8a98ec708..86bf6a2c5 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 883738512..70d6d22fc 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 3da1104b2..27575f3d9 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 4ab40a1b2..405ede6a8 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 2cdd7e448..15825e6f2 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 3097e09af..26ddd013f 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index ee855aac3..82744b03a 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index a5a43230b..4edac1d48 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 478086b62..d5ecb3319 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index b3c719f62..906205257 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 03fb4a442..ab388b1bc 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 0771bf2c5..4b3b0a79b 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 8aa21f973..a9cb09e37 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 1a8dbc688..660f18fbb 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index d41436f89..7b16e1dd6 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 051394e0c..d08118614 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index cfcda0199..fa942b428 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 571121b58..43fa4c0a5 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 13ea2384d..9f2b8d50c 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 75c1d4846..8e093b2f7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT 4.0.0 @@ -113,7 +113,7 @@ ONAP - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 259ed06a2..142be5260 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 5d5ee0480..de7eeb4b6 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=2 -feature_revision=3 +feature_revision=4 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 0f3fdfae6226b86ffc49e39b365eb149fce0e35f Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 31 May 2018 14:25:35 -0400 Subject: Use released parent pom Update to use release parent pom version 1.0.4 Change-Id: I654a95992e0740cfda9339098ed7eb4f32aaab4f Issue-ID: CCSDK-291 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 3739ee920..e72b924f3 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 3864e139a..abd7d234a 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index d02608004..2b207e696 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 86bf6a2c5..58f1ee864 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 70d6d22fc..4d18f8e89 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 27575f3d9..3f37d6717 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 405ede6a8..0cae44f90 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 15825e6f2..c5ce3ee5b 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 26ddd013f..ce6db8f06 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 82744b03a..75a694246 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 4edac1d48..e7dbcbe0e 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index d5ecb3319..2407d36bc 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 906205257..324431d2f 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index ab388b1bc..4c5c8bb12 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 4b3b0a79b..6e8b2c051 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.northbound diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index a9cb09e37..c32e9927e 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 660f18fbb..4784a1cf3 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 7b16e1dd6..d53e28601 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index d08118614..3328b89d8 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index fa942b428..d24d45ef1 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/lcm/pom.xml b/lcm/pom.xml index 43fa4c0a5..70a45321d 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 9f2b8d50c..39ab9f07f 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/pom.xml b/pom.xml index 8e093b2f7..435c833ae 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 142be5260..c1797628d 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From f1b7fecfbe875059793a6ece34b3743f379bb030 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Tue, 5 Jun 2018 15:57:12 +0000 Subject: Introduce new dmaapClient for use with ccsdk Create an interface and turn existing class into impl file. Write new client which implements the new interface Change-Id: I127bef09bd7f07556a18b753e428e3cd75f5f498 Issue-ID: CCSDK-294 Signed-off-by: Smokowski, Kevin (ks6305) --- dmaap-listener/pom.xml | 15 +- .../northbound/dmaapclient/DummyDmaapConsumer.java | 2 +- .../dmaapclient/MessageRouterHttpClient.java | 194 +++++++++++++++++++++ .../dmaapclient/SdncAaiDmaapConsumer.java | 8 +- .../dmaapclient/SdncDhcpEventConsumer.java | 7 +- .../northbound/dmaapclient/SdncDmaapConsumer.java | 134 +------------- .../dmaapclient/SdncDmaapConsumerImpl.java | 159 +++++++++++++++++ .../dmaapclient/SdncFlatJsonDmaapConsumer.java | 8 +- .../dmaapclient/SdncLcmDmaapConsumer.java | 2 +- 9 files changed, 383 insertions(+), 146 deletions(-) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 6e8b2c051..85f3028fa 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -30,6 +30,17 @@ ${project.version}-${build.number} + + + + + javax.ws.rs + javax.ws.rs-api + 2.1 + + + + @@ -105,8 +116,8 @@ 2.5.1 true - 1.7 - 1.7 + 1.8 + 1.8 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 a8336342f..57fcd8809 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 @@ -24,7 +24,7 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class DummyDmaapConsumer extends SdncDmaapConsumer { +public class DummyDmaapConsumer extends SdncDmaapConsumerImpl { private static final Logger LOG = LoggerFactory .getLogger(DummyDmaapConsumer.class); diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java new file mode 100644 index 000000000..234a2026b --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java @@ -0,0 +1,194 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 - 2018 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.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.URI; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.Properties; +import java.util.concurrent.TimeUnit; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.Invocation.Builder; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/* + * jax-rs based client to build message router consumers + */ +public class MessageRouterHttpClient implements SdncDmaapConsumer { + private static final Logger Log = LoggerFactory.getLogger(MessageRouterHttpClient.class); + + protected Boolean isReady = false; + protected Boolean isRunning = false; + protected Client client; + protected URI uri; + protected Invocation getMessages; + protected Integer fetchPause; + protected Properties properties; + protected final String DEFAULT_CONNECT_TIMEOUT_SECONDS = "30"; + protected final String DEFAULT_READ_TIMEOUT_MINUTES = "3"; + protected final String DEFAULT_TIMEOUT_QUERY_PARAM_VALUE = "15000"; + protected final String DEFAULT_LIMIT = null; + + public MessageRouterHttpClient() { + + } + + @Override + public void run() { + if (isReady) { + isRunning = true; + while (isRunning) { + try { + Response response = getMessages.invoke(); + Log.info("GET " + uri + " returned http status " + response.getStatus()); + String entity = response.readEntity(String.class); + if (entity.contains("{")) { + // Get rid of opening [" + entity = entity.substring(2); + // Get rid of closing "] + entity = entity.substring(0, entity.length() - 2); + // This replacement effectively un-escapes the JSON + for (String message : entity.split("\",\"")) { + try { + processMsg(message.replace("\\\"", "\"")); + } catch (InvalidMessageException e) { + Log.error("Message could not be processed", e); + } + } + } else { + Log.info("Entity doesn't appear to contain JSON elements"); + } + } catch (Exception e) { + Log.error("GET " + uri + " failed.", e); + } finally { + Log.info("Pausing " + fetchPause + " milliseconds before fetching from " + uri + " again."); + try { + Thread.sleep(fetchPause); + } catch (InterruptedException e) { + Log.error("Could not sleep thread", e); + } + } + } + } + } + + @Override + public void init(Properties baseProperties, String consumerPropertiesPath) { + try { + baseProperties.load(new FileInputStream(new File(consumerPropertiesPath))); + this.properties = baseProperties; + String username = baseProperties.getProperty("username"); + String password = baseProperties.getProperty("password"); + String topic = baseProperties.getProperty("topic"); + String group = baseProperties.getProperty("group"); + String host = baseProperties.getProperty("host"); + String id = baseProperties.getProperty("id"); + + String filter = baseProperties.getProperty("filter"); + if (filter != null) { + if (filter.length() > 0) { + filter = URLEncoder.encode(filter, StandardCharsets.UTF_8.name()); + } else { + filter = null; + } + } + + String limitString = baseProperties.getProperty("limit", DEFAULT_LIMIT); + Integer limit = null; + if (limitString != null && limitString.length() > 0) { + limit = Integer.valueOf(limitString); + } + + Integer timeoutQueryParamValue = + Integer.valueOf(baseProperties.getProperty("timeout", DEFAULT_TIMEOUT_QUERY_PARAM_VALUE)); + Integer connectTimeoutSeconds = Integer + .valueOf(baseProperties.getProperty("connectTimeoutSeconds", DEFAULT_CONNECT_TIMEOUT_SECONDS)); + Integer readTimeoutMinutes = + Integer.valueOf(baseProperties.getProperty("readTimeoutMinutes", DEFAULT_READ_TIMEOUT_MINUTES)); + + String authorizationString = buildAuthorizationString(username, password); + this.uri = buildUri(topic, group, id, host, timeoutQueryParamValue, limit, filter); + this.client = getClient(connectTimeoutSeconds, readTimeoutMinutes); + Builder builder = + client.target(uri).request("application/json").header("Authorization", authorizationString); + this.getMessages = builder.buildGet(); + this.fetchPause = Integer.valueOf(baseProperties.getProperty("fetchPause")); + this.isReady = true; + } catch (FileNotFoundException e) { + Log.error("FileNotFoundException while reading consumer properties", e); + } catch (IOException e) { + Log.error("IOException while reading consumer properties", e); + } + } + + @Override + public void processMsg(String msg) throws InvalidMessageException { + System.out.println(msg); + } + + @Override + public boolean isReady() { + return isReady; + } + + @Override + public boolean isRunning() { + return isRunning; + } + + protected String buildAuthorizationString(String userName, String password) { + String basicAuthString = userName + ":" + password; + basicAuthString = Base64.getEncoder().encodeToString(basicAuthString.getBytes()); + return "Basic " + basicAuthString; + } + + protected Client getClient(Integer connectTimeoutSeconds, Integer readTimeoutMinutes) { + ClientBuilder clientBuilder = ClientBuilder.newBuilder(); + clientBuilder.connectTimeout(connectTimeoutSeconds, TimeUnit.SECONDS); + clientBuilder.readTimeout(readTimeoutMinutes, TimeUnit.MINUTES); + return clientBuilder.build(); + } + + protected URI buildUri(String topic, String consumerGroup, String consumerId, String host, Integer timeout, + Integer limit, String filter) { + UriBuilder builder = UriBuilder.fromPath("http://" + host + "/events/{topic}/{consumerGroup}/{consumderId}"); + builder.queryParam("timeout", timeout); + if (limit != null) { + builder.queryParam("limit", limit); + } + if (filter != null) { + builder.queryParam("filter", filter); + } + return builder.build(topic, consumerGroup, consumerId); + } + +} 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 0e12dfa2e..2c4de7104 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 @@ -21,9 +21,6 @@ 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; @@ -34,14 +31,15 @@ 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; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; -public class SdncAaiDmaapConsumer extends SdncDmaapConsumer { +public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { private static final Logger LOG = LoggerFactory.getLogger(SdncAaiDmaapConsumer.class); private static final String SDNC_ENDPOINT = "SDNC.endpoint"; diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java index 03560d309..7b68ceb63 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java @@ -5,19 +5,14 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.SQLException; -import java.util.Iterator; -import java.util.Map; import java.util.Properties; - import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -public class SdncDhcpEventConsumer extends SdncDmaapConsumer { +public class SdncDhcpEventConsumer extends SdncDmaapConsumerImpl { private static final Logger LOG = LoggerFactory.getLogger(SdncDhcpEventConsumer.class); private static final String MAC_ADDR_TAG = "macaddr"; 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 2b416e7db..3fc769d35 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 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 - 2018 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. @@ -21,134 +21,14 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; -import com.att.nsa.mr.client.MRClientFactory; -import com.att.nsa.mr.client.MRConsumer; -import com.att.nsa.mr.client.response.MRConsumerResponse; -import java.io.File; -import java.io.FileInputStream; import java.util.Properties; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -public abstract class SdncDmaapConsumer implements Runnable { +public abstract interface SdncDmaapConsumer extends Runnable { + public abstract void init(Properties baseProperties, String consumerPropertiesPath); - private static final Logger LOG = LoggerFactory - .getLogger(SdncDmaapConsumer.class); + public abstract void processMsg(String msg) throws InvalidMessageException; - private Properties properties = null; - private MRConsumer consumer = null; - private MRConsumerResponse consumerResponse = null; - private boolean running = false; - private boolean ready = false; - private int fetchPause = 5000; // Default pause between fetch - 5 seconds - private int timeout = 15000; // Default timeout - 15 seconds + public abstract boolean isReady(); - public SdncDmaapConsumer() { - - } - - public SdncDmaapConsumer(Properties properties, String propertiesPath) { - init(properties, propertiesPath); - } - - public boolean isReady() { - return ready; - } - - public boolean isRunning() { - return running; - } - - public String getProperty(String name) { - return properties.getProperty(name, ""); - } - - public void init(Properties properties, String propertiesPath) { - - try (FileInputStream in = new FileInputStream(new File(propertiesPath))) { - - LOG.debug("propertiesPath: " + propertiesPath); - this.properties = (Properties) properties.clone(); - this.properties.load(in); - - - String timeoutStr = this.properties.getProperty("timeout"); - LOG.debug("timeoutStr: " + timeoutStr); - - if ((timeoutStr != null) && (timeoutStr.length() > 0)) { - timeout = parseTimeOutValue(timeoutStr); - } - - String fetchPauseStr = this.properties.getProperty("fetchPause"); - LOG.debug("fetchPause(Str): " + fetchPauseStr); - if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { - fetchPause = parseFetchPause(fetchPauseStr); - } - LOG.debug("fetchPause: " + fetchPause); - - - this.consumer = MRClientFactory.createConsumer(propertiesPath); - ready = true; - } catch (Exception e) { - LOG.error("Error initializing DMaaP consumer from file " + propertiesPath, e); - } - } - - private int parseTimeOutValue(String timeoutStr) { - try { - return Integer.parseInt(timeoutStr); - } catch (NumberFormatException e) { - LOG.error("Non-numeric value specified for timeout (" + timeoutStr + ")"); - } - return timeout; - } - - private int parseFetchPause(String fetchPauseStr) { - try { - return Integer.parseInt(fetchPauseStr); - } catch (NumberFormatException e) { - LOG.error("Non-numeric value specified for fetchPause (" + fetchPauseStr + ")"); - } - return fetchPause; - } - - - @Override - public void run() { - if (ready) { - - running = true; - - while (running) { - - try { - boolean noData = true; - consumerResponse = consumer.fetchWithReturnConsumerResponse(timeout, -1); - for (String msg : consumerResponse.getActualMessages()) { - noData = false; - LOG.info("Received message from DMaaP:\n" + msg); - processMsg(msg); - } - - if (noData) { - pauseThread(); - } - } catch (Exception e) { - LOG.error("Caught exception reading from DMaaP", e); - running = false; - } - } - } - } - - private void pauseThread() throws InterruptedException { - if (fetchPause > 0) { - LOG.info(String.format("No data received from fetch. Pausing %d ms before retry", fetchPause)); - Thread.sleep(fetchPause); - } else { - LOG.info("No data received from fetch. No fetch pause specified - retrying immediately"); - } - } - - abstract public void processMsg(String msg) throws InvalidMessageException; + public abstract boolean isRunning(); } diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java new file mode 100644 index 000000000..ddd871327 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java @@ -0,0 +1,159 @@ +/*- + * ============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.File; +import java.io.FileInputStream; +import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.att.nsa.mr.client.MRClientFactory; +import com.att.nsa.mr.client.MRConsumer; +import com.att.nsa.mr.client.response.MRConsumerResponse; + +public abstract class SdncDmaapConsumerImpl implements SdncDmaapConsumer { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncDmaapConsumer.class); + + private final String name = this.getClass().getSimpleName(); + private Properties properties = null; + private MRConsumer consumer = null; + private MRConsumerResponse consumerResponse = null; + private boolean running = false; + private boolean ready = false; + private int fetchPause = 5000; // Default pause between fetch - 5 seconds + private int timeout = 15000; // Default timeout - 15 seconds + + public SdncDmaapConsumerImpl() { + + } + + public SdncDmaapConsumerImpl(Properties properties, String propertiesPath) { + init(properties, propertiesPath); + } + + public boolean isReady() { + return ready; + } + + public boolean isRunning() { + return running; + } + + public String getProperty(String name) { + return properties.getProperty(name, ""); + } + + public void init(Properties properties, String propertiesPath) { + + try (FileInputStream in = new FileInputStream(new File(propertiesPath))) { + + LOG.debug("propertiesPath: " + propertiesPath); + this.properties = (Properties) properties.clone(); + this.properties.load(in); + + + String timeoutStr = this.properties.getProperty("timeout"); + LOG.debug("timeoutStr: " + timeoutStr); + + if ((timeoutStr != null) && (timeoutStr.length() > 0)) { + timeout = parseTimeOutValue(timeoutStr); + } + + String fetchPauseStr = this.properties.getProperty("fetchPause"); + LOG.debug("fetchPause(Str): " + fetchPauseStr); + if ((fetchPauseStr != null) && (fetchPauseStr.length() > 0)) { + fetchPause = parseFetchPause(fetchPauseStr); + } + LOG.debug("fetchPause: " + fetchPause); + + + this.consumer = MRClientFactory.createConsumer(propertiesPath); + ready = true; + } catch (Exception e) { + LOG.error("Error initializing DMaaP consumer from file " + propertiesPath, e); + } + } + + private int parseTimeOutValue(String timeoutStr) { + try { + return Integer.parseInt(timeoutStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric value specified for timeout (" + timeoutStr + ")"); + } + return timeout; + } + + private int parseFetchPause(String fetchPauseStr) { + try { + return Integer.parseInt(fetchPauseStr); + } catch (NumberFormatException e) { + LOG.error("Non-numeric value specified for fetchPause (" + fetchPauseStr + ")"); + } + return fetchPause; + } + + + @Override + public void run() { + if (ready) { + + running = true; + + while (running) { + + try { + boolean noData = true; + consumerResponse = consumer.fetchWithReturnConsumerResponse(timeout, -1); + for (String msg : consumerResponse.getActualMessages()) { + noData = false; + LOG.info(name + " received ActualMessage from DMaaP:\n"+msg); + processMsg(msg); + } + + if (noData) { + LOG.info(name + " received ResponseCode: " + consumerResponse.getResponseCode()); + LOG.info(name + " received ResponseMessage: " + consumerResponse.getResponseMessage()); + pauseThread(); + } + } catch (Exception e) { + LOG.error("Caught exception reading from DMaaP", e); + running = false; + } + + + } + } + } + + private void pauseThread() throws InterruptedException { + if (fetchPause > 0) { + LOG.info(String.format("No data received from fetch. Pausing %d ms before retry", fetchPause)); + Thread.sleep(fetchPause); + } else { + LOG.info("No data received from fetch. No fetch pause specified - retrying immediately"); + } + } + + abstract public void processMsg(String msg) throws InvalidMessageException; +} 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 06e8ebe95..6c90c7199 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 @@ -21,9 +21,6 @@ package org.onap.ccsdk.sli.northbound.dmaapclient; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @@ -32,9 +29,12 @@ import java.util.Iterator; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; -public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumer { +public class SdncFlatJsonDmaapConsumer extends SdncDmaapConsumerImpl { private static final Logger LOG = LoggerFactory.getLogger(SdncFlatJsonDmaapConsumer.class); diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java index 53fb6db0f..04f520bd9 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java @@ -27,7 +27,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class SdncLcmDmaapConsumer extends SdncDmaapConsumer { +public class SdncLcmDmaapConsumer extends SdncDmaapConsumerImpl { private static final Logger LOG = LoggerFactory.getLogger(SdncLcmDmaapConsumer.class); -- cgit 1.2.3-korg From 751d50b2b5b668355ddf22d007610cac700b41b1 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 6 Jun 2018 14:03:24 -0400 Subject: Roll versions for Casablanca - sli/northbound Roll version to 0.3.0-SNAPSHOT for Casablanca development Change-Id: If71c3945b2da6f64f9eb1b1fdc92ba62c11f1886 Issue-ID: CCSDK-295 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 6 +++--- 25 files changed, 51 insertions(+), 51 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index e72b924f3..c4c7b7fad 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index abd7d234a..6b6ac64dc 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 2b207e696..a8a493591 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 58f1ee864..f3e3b44d8 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 4d18f8e89..1cb8af920 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 3f37d6717..292a4f363 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 0cae44f90..d52c702ba 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index c5ce3ee5b..bbe3e417d 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index ce6db8f06..bc673fddb 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 75a694246..a9543ab2a 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index e7dbcbe0e..007a34e96 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 2407d36bc..26134c3e8 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 324431d2f..6c23fc48f 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 4c5c8bb12..59d58ac43 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 6e8b2c051..4dc121565 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index c32e9927e..9a0e0806a 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 4784a1cf3..71e729284 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index d53e28601..705360200 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 3328b89d8..92e04bc69 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index d24d45ef1..afa844ae6 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 70a45321d..2bc81749b 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 39ab9f07f..23efb6e4e 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 435c833ae..979b78173 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT 4.0.0 @@ -113,7 +113,7 @@ ONAP - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index c1797628d..205c5c907 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index de7eeb4b6..f9fd33500 100644 --- a/version.properties +++ b/version.properties @@ -4,11 +4,11 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=2 -feature_revision=4 +sprint_number=3 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version} +release_version=${base_version}-STAGING snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From a63bbe21b7394951d782b6f8f0769dfcbc616dd0 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Mon, 18 Jun 2018 10:49:42 -0400 Subject: Update sli/northbound to ODL Oxygen Updated features poms to get clean compile with ODL Oxygen-based parent poms. Change-Id: I812ad71ff07117baf62b6111011ce52229ebe6e0 Issue-ID: CCSDK-282 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 27 ++++++++++++++++++++------- asdcApi/provider/pom.xml | 6 +----- dataChange/features/ccsdk-dataChange/pom.xml | 27 ++++++++++++++++++++------- dataChange/provider/pom.xml | 6 +----- lcm/features/ccsdk-lcm/pom.xml | 27 ++++++++++++++++++++------- 5 files changed, 62 insertions(+), 31 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index c4c7b7fad..d26c9485a 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -16,15 +16,28 @@ feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + - - org.opendaylight.controller - odl-mdsal-broker - xml - features - org.onap.ccsdk.sli.core ccsdk-sli diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index d52c702ba..1098160b6 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -53,11 +53,7 @@ sal-test-model test - - org.opendaylight.netconf - sal-rest-connector - test - + org.opendaylight.controller diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index bbe3e417d..9ed0ac73c 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -17,14 +17,27 @@ ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + - - org.opendaylight.controller - odl-mdsal-broker - xml - features - + org.onap.ccsdk.sli.core ccsdk-sli diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 59d58ac43..29a832449 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -46,11 +46,7 @@ sal-test-model test - - org.opendaylight.netconf - sal-rest-connector - test - + org.opendaylight.controller diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 9a0e0806a..5ea28878b 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -17,14 +17,27 @@ ccsdk-sli-northbound :: lcm :: ${project.artifactId} - + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + - - org.opendaylight.controller - odl-mdsal-broker - xml - features - + org.onap.ccsdk.sli.core ccsdk-sli -- cgit 1.2.3-korg From a07b57086dd5c9c04f2b20a092da9935c7c5f817 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Fri, 22 Jun 2018 18:32:27 +0000 Subject: check for null usernamd and password only populate auth header if credentials are provided, this support was requested by a client Change-Id: I2fb60995260506a29482d340a031dfad72348b8c Issue-ID: CCSDK-310 Signed-off-by: Smokowski, Kevin (ks6305) --- .../sli/northbound/dmaapclient/MessageRouterHttpClient.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java index 234a2026b..d261d1c49 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java @@ -135,11 +135,14 @@ public class MessageRouterHttpClient implements SdncDmaapConsumer { Integer readTimeoutMinutes = Integer.valueOf(baseProperties.getProperty("readTimeoutMinutes", DEFAULT_READ_TIMEOUT_MINUTES)); - String authorizationString = buildAuthorizationString(username, password); + Builder builder = client.target(uri).request("application/json"); + if (username != null && password != null && username.length() > 0 && password.length() > 0) { + String authorizationString = buildAuthorizationString(username, password); + builder.header("Authorization", authorizationString); + } this.uri = buildUri(topic, group, id, host, timeoutQueryParamValue, limit, filter); this.client = getClient(connectTimeoutSeconds, readTimeoutMinutes); - Builder builder = - client.target(uri).request("application/json").header("Authorization", authorizationString); + this.getMessages = builder.buildGet(); this.fetchPause = Integer.valueOf(baseProperties.getProperty("fetchPause")); this.isReady = true; -- cgit 1.2.3-korg From cd11ecb3d0216e4e81be4964a4bc6a50aa29bbe7 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 22 Jun 2018 15:51:57 -0400 Subject: Add feature aggregator Add feature aggregator ccsdk-sli-northbound-all so that all sli-northbound karaf features can be added as one feature. Change-Id: I5133215c8df472e189d1b24f5b747927f305ac28 Issue-ID: CCSDK-282 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/installer/pom.xml | 4 +- .../src/assembly/assemble_mvnrepo_zip.xml | 2 +- dataChange/installer/pom.xml | 4 +- .../src/assembly/assemble_mvnrepo_zip.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 64 ++++++++++ features/features-sli-northbound/pom.xml | 29 +++++ features/installer/pom.xml | 137 +++++++++++++++++++++ .../src/assembly/assemble_installer_zip.xml | 39 ++++++ .../src/assembly/assemble_mvnrepo_zip.xml | 29 +++++ .../src/main/resources/scripts/install-feature.sh | 18 +++ features/pom.xml | 24 ++++ lcm/installer/pom.xml | 4 +- .../src/assembly/assemble_mvnrepo_zip.xml | 2 +- pom.xml | 1 + 14 files changed, 350 insertions(+), 9 deletions(-) create mode 100644 features/ccsdk-sli-northbound-all/pom.xml create mode 100644 features/features-sli-northbound/pom.xml create mode 100755 features/installer/pom.xml create mode 100755 features/installer/src/assembly/assemble_installer_zip.xml create mode 100755 features/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 features/installer/src/main/resources/scripts/install-feature.sh create mode 100755 features/pom.xml diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index f3e3b44d8..37ec67679 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -65,12 +65,12 @@ package - false + true stage/${application.name}-${project.version} src/assembly/assemble_mvnrepo_zip.xml - false + true diff --git a/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml index 21e271d42..479896182 100644 --- a/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/asdcApi/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -25,7 +25,7 @@ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> - mvnrepo_zip + repo zip diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 007a34e96..7f100ec05 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -67,12 +67,12 @@ package - false + true stage/${application.name}-${project.version} src/assembly/assemble_mvnrepo_zip.xml - false + true diff --git a/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml index 21e271d42..479896182 100644 --- a/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/dataChange/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -25,7 +25,7 @@ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> - mvnrepo_zip + repo zip diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml new file mode 100644 index 000000000..ad1a578e4 --- /dev/null +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-sli-northbound-all + 0.3.0-SNAPSHOT + feature + + ccsdk-sli-northbound :: features :: ${project.artifactId} + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + + + + ${project.groupId} + ccsdk-asdcApi + ${project.version} + xml + features + + + ${project.groupId} + ccsdk-dataChange + ${project.version} + xml + features + + + ${project.groupId} + ccsdk-lcm + ${project.version} + xml + features + + + + + diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml new file mode 100644 index 000000000..6372c7ea0 --- /dev/null +++ b/features/features-sli-northbound/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + features-sli-northbound + 0.3.0-SNAPSHOT + feature + + ccsdk-sli-northbound :: features :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-sli-northbound-all + ${project.version} + xml + features + + + + diff --git a/features/installer/pom.xml b/features/installer/pom.xml new file mode 100755 index 000000000..4e3cdae03 --- /dev/null +++ b/features/installer/pom.xml @@ -0,0 +1,137 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + slinorthbound-features-installer + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-northbound :: features :: ${project.artifactId} + + + ccsdk-sli-northbound-all + ${application.name} + mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features + false + + + + + + org.onap.ccsdk.sli.northbound + ${application.name} + ${project.version} + xml + features + + + * + * + + + + + + + + + + + maven-assembly-plugin + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.northbound + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + + diff --git a/features/installer/src/assembly/assemble_installer_zip.xml b/features/installer/src/assembly/assemble_installer_zip.xml new file mode 100755 index 000000000..a6a22a9ba --- /dev/null +++ b/features/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,39 @@ + + + + bin + + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + + + + diff --git a/features/installer/src/assembly/assemble_mvnrepo_zip.xml b/features/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100755 index 000000000..86b07f1f3 --- /dev/null +++ b/features/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,29 @@ + + + + repo + + + zip + + + + false + + + + target/assembly/ + . + + + + + + + + diff --git a/features/installer/src/main/resources/scripts/install-feature.sh b/features/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 000000000..e16e79a12 --- /dev/null +++ b/features/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} +INSTALLERDIR=$(dirname $0) + +REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip + +if [ -f ${REPOZIP} ] +then + unzip -d ${ODL_HOME} ${REPOZIP} +else + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 +fi + +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/features/pom.xml b/features/pom.xml new file mode 100755 index 000000000..7a5e2e6a8 --- /dev/null +++ b/features/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + slinorthbound-feature-aggregator + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-northbound :: features + + + ccsdk-sli-northbound-all + features-sli-northbound + installer + + diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 92e04bc69..22d7fafdd 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -65,12 +65,12 @@ package - false + true stage/${application.name}-${project.version} src/assembly/assemble_mvnrepo_zip.xml - false + true diff --git a/lcm/installer/src/assembly/assemble_mvnrepo_zip.xml b/lcm/installer/src/assembly/assemble_mvnrepo_zip.xml index 21e271d42..479896182 100644 --- a/lcm/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/lcm/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -25,7 +25,7 @@ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> - mvnrepo_zip + repo zip diff --git a/pom.xml b/pom.xml index 979b78173..8c8f1c924 100644 --- a/pom.xml +++ b/pom.xml @@ -109,6 +109,7 @@ lcm dmaap-listener ueb-listener + features ONAP -- cgit 1.2.3-korg From bef4edce8d51394a33fb0de4e57de6f1a39c3b39 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Thu, 28 Jun 2018 20:56:05 +0000 Subject: additional mr client additional mr client, fewer dependencies Change-Id: I36168fd6e82846a889cd9a01aadf2462bb767723 Issue-ID: CCSDK-327 Signed-off-by: Smokowski, Kevin (ks6305) --- .../dmaapclient/MessageRouterHttpClientJdk.java | 211 +++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java new file mode 100644 index 000000000..d720e5fcd --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java @@ -0,0 +1,211 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 - 2018 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.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.net.HttpURLConnection; + +/* + * java.net based client to build message router consumers + */ +public class MessageRouterHttpClientJdk implements SdncDmaapConsumer { + private static final Logger Log = LoggerFactory.getLogger(MessageRouterHttpClientJdk.class); + + protected Boolean isReady = false; + protected Boolean isRunning = false; + protected URL url; + protected Integer fetchPause; + protected Properties properties; + protected final String DEFAULT_CONNECT_TIMEOUT = "30000"; + protected final String DEFAULT_READ_TIMEOUT = "180000"; + protected final String DEFAULT_TIMEOUT_QUERY_PARAM_VALUE = "15000"; + protected final String DEFAULT_LIMIT = null; + private String authorizationString; + protected Integer connectTimeout; + protected Integer readTimeout; + protected String topic; + + public MessageRouterHttpClientJdk() {} + + @Override + public void run() { + if (isReady) { + isRunning = true; + while (isRunning) { + HttpURLConnection httpUrlConnection = null; + try { + httpUrlConnection = (HttpURLConnection) url.openConnection(); + if (authorizationString != null) { + httpUrlConnection.addRequestProperty("Authorization", authorizationString); + } + httpUrlConnection.setRequestMethod("GET"); + httpUrlConnection.setRequestProperty("Accept", "application/json"); + httpUrlConnection.setUseCaches(false); + httpUrlConnection.setConnectTimeout(connectTimeout); + httpUrlConnection.setReadTimeout(readTimeout); + httpUrlConnection.connect(); + int status = httpUrlConnection.getResponseCode(); + Log.info("GET " + url + " returned http status " + status); + if (status < 300) { + BufferedReader br = + new BufferedReader(new InputStreamReader(httpUrlConnection.getInputStream())); + StringBuilder sb = new StringBuilder(); + String line; + while ((line = br.readLine()) != null) { + sb.append(line + "\n"); + } + br.close(); + String responseBody = sb.toString(); + if (responseBody.contains("{")) { + // Get rid of opening [" entity = + responseBody = responseBody.substring(2); + // Get rid of closing "] + responseBody = responseBody.substring(0, responseBody.length() - 2); + // Split the json array into individual elements to process + for (String message : responseBody.split("\",\"")) { + // unescape the json + message = message.replace("\\\"", "\""); + // Topic names cannot contain periods + processMsg(message); + } + } else { + Log.info("Entity doesn't appear to contain JSON elements, logging body"); + Log.info(responseBody); + } + } + } catch (Exception e) { + Log.error("GET " + url + " failed.", e); + } finally { + if (httpUrlConnection != null) { + httpUrlConnection.disconnect(); + } + Log.info("Pausing " + fetchPause + " milliseconds before fetching from " + url + " again."); + try { + Thread.sleep(fetchPause); + } catch (InterruptedException e) { + Log.error("Could not sleep thread", e); + } + } + } + } + } + + @Override + public void init(Properties baseProperties, String consumerPropertiesPath) { + try { + baseProperties.load(new FileInputStream(new File(consumerPropertiesPath))); + + this.properties = baseProperties; + String username = properties.getProperty("username"); + String password = properties.getProperty("password"); + topic = properties.getProperty("topic"); + String group = properties.getProperty("group"); + String host = properties.getProperty("host"); + String id = properties.getProperty("id"); + + String filter = properties.getProperty("filter"); + if (filter != null) { + if (filter.length() > 0) { + try { + filter = URLEncoder.encode(filter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + Log.error("Couldn't encode filter string", e); + } + } else { + filter = null; + } + } + + String limitString = properties.getProperty("limit", DEFAULT_LIMIT); + Integer limit = null; + if (limitString != null && limitString.length() > 0) { + limit = Integer.valueOf(limitString); + } + + Integer timeoutQueryParamValue = + Integer.valueOf(properties.getProperty("timeout", DEFAULT_TIMEOUT_QUERY_PARAM_VALUE)); + connectTimeout = Integer.valueOf(properties.getProperty("connectTimeoutSeconds", DEFAULT_CONNECT_TIMEOUT)); + readTimeout = Integer.valueOf(properties.getProperty("readTimeoutMinutes", DEFAULT_READ_TIMEOUT)); + if (username != null && password != null && username.length() > 0 && password.length() > 0) { + authorizationString = buildAuthorizationString(username, password); + } + String urlString = buildlUrlString(topic, group, id, host, timeoutQueryParamValue, limit, filter); + this.url = new URL(urlString); + this.fetchPause = Integer.valueOf(properties.getProperty("fetchPause")); + this.isReady = true; + } catch (FileNotFoundException e) { + Log.error("FileNotFoundException while reading consumer properties", e); + } catch (IOException e) { + Log.error("IOException while reading consumer properties", e); + } + } + + public void processMsg(String msg) { + Log.info(msg); + } + + protected String buildAuthorizationString(String userName, String password) { + String basicAuthString = userName + ":" + password; + basicAuthString = Base64.getEncoder().encodeToString(basicAuthString.getBytes()); + return "Basic " + basicAuthString; + } + + protected String buildlUrlString(String topic, String consumerGroup, String consumerId, String host, + Integer timeout, Integer limit, String filter) { + StringBuilder sb = new StringBuilder(); + sb.append("http://" + host + "/events/" + topic + "/" + consumerGroup + "/" + consumerId); + sb.append("?timeout=" + timeout); + + if (limit != null) { + sb.append("&limit=" + limit); + } + if (filter != null) { + sb.append("&filter=" + filter); + } + return sb.toString(); + } + + @Override + public boolean isReady() { + return isReady; + } + + @Override + public boolean isRunning() { + return isRunning; + } + +} -- cgit 1.2.3-korg From b13fc8a9b134c43a437d7a48ceb509295df4713a Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Mon, 2 Jul 2018 20:01:02 +0000 Subject: Increase code coverage for MR clients Increase code coverage for MR clients Change-Id: I4493b13070f967bc6b20e6770fa16c4df97c2b8c Issue-ID: CCSDK-328 Signed-off-by: Smokowski, Kevin (ks6305) --- .../dmaapclient/MessageRouterHttpClient.java | 88 +++-- .../dmaapclient/MessageRouterHttpClientJdk.java | 432 +++++++++++---------- .../MessageRouterHttpClientJdkTest.java | 100 +++++ .../dmaapclient/MessageRouterHttpClientTest.java | 97 +++++ 4 files changed, 467 insertions(+), 250 deletions(-) create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdkTest.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientTest.java diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java index d261d1c49..13146e4ec 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java @@ -25,6 +25,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; @@ -57,6 +58,7 @@ public class MessageRouterHttpClient implements SdncDmaapConsumer { protected final String DEFAULT_READ_TIMEOUT_MINUTES = "3"; protected final String DEFAULT_TIMEOUT_QUERY_PARAM_VALUE = "15000"; protected final String DEFAULT_LIMIT = null; + protected final String DEFAULT_FETCH_PAUSE = "5000"; public MessageRouterHttpClient() { @@ -105,52 +107,60 @@ public class MessageRouterHttpClient implements SdncDmaapConsumer { public void init(Properties baseProperties, String consumerPropertiesPath) { try { baseProperties.load(new FileInputStream(new File(consumerPropertiesPath))); - this.properties = baseProperties; - String username = baseProperties.getProperty("username"); - String password = baseProperties.getProperty("password"); - String topic = baseProperties.getProperty("topic"); - String group = baseProperties.getProperty("group"); - String host = baseProperties.getProperty("host"); - String id = baseProperties.getProperty("id"); - - String filter = baseProperties.getProperty("filter"); - if (filter != null) { - if (filter.length() > 0) { + processProperties(baseProperties); + } catch (FileNotFoundException e) { + Log.error("FileNotFoundException while reading consumer properties", e); + } catch (IOException e) { + Log.error("IOException while reading consumer properties", e); + } + } + + protected void processProperties(Properties properties) { + this.properties = properties; + String username = properties.getProperty("username"); + String password = properties.getProperty("password"); + String topic = properties.getProperty("topic"); + String group = properties.getProperty("group"); + String host = properties.getProperty("host"); + String id = properties.getProperty("id"); + + String filter = properties.getProperty("filter"); + if (filter != null) { + if (filter.length() > 0) { + try { filter = URLEncoder.encode(filter, StandardCharsets.UTF_8.name()); - } else { + } catch (UnsupportedEncodingException e) { + Log.error("Filter could not be encoded, setting to null", e); filter = null; } + } else { + filter = null; } + } - String limitString = baseProperties.getProperty("limit", DEFAULT_LIMIT); - Integer limit = null; - if (limitString != null && limitString.length() > 0) { - limit = Integer.valueOf(limitString); - } - - Integer timeoutQueryParamValue = - Integer.valueOf(baseProperties.getProperty("timeout", DEFAULT_TIMEOUT_QUERY_PARAM_VALUE)); - Integer connectTimeoutSeconds = Integer - .valueOf(baseProperties.getProperty("connectTimeoutSeconds", DEFAULT_CONNECT_TIMEOUT_SECONDS)); - Integer readTimeoutMinutes = - Integer.valueOf(baseProperties.getProperty("readTimeoutMinutes", DEFAULT_READ_TIMEOUT_MINUTES)); - - Builder builder = client.target(uri).request("application/json"); - if (username != null && password != null && username.length() > 0 && password.length() > 0) { - String authorizationString = buildAuthorizationString(username, password); - builder.header("Authorization", authorizationString); - } - this.uri = buildUri(topic, group, id, host, timeoutQueryParamValue, limit, filter); - this.client = getClient(connectTimeoutSeconds, readTimeoutMinutes); + String limitString = properties.getProperty("limit", DEFAULT_LIMIT); + Integer limit = null; + if (limitString != null && limitString.length() > 0) { + limit = Integer.valueOf(limitString); + } - this.getMessages = builder.buildGet(); - this.fetchPause = Integer.valueOf(baseProperties.getProperty("fetchPause")); - this.isReady = true; - } catch (FileNotFoundException e) { - Log.error("FileNotFoundException while reading consumer properties", e); - } catch (IOException e) { - Log.error("IOException while reading consumer properties", e); + Integer timeoutQueryParamValue = + Integer.valueOf(properties.getProperty("timeout", DEFAULT_TIMEOUT_QUERY_PARAM_VALUE)); + Integer connectTimeoutSeconds = Integer + .valueOf(properties.getProperty("connectTimeoutSeconds", DEFAULT_CONNECT_TIMEOUT_SECONDS)); + Integer readTimeoutMinutes = + Integer.valueOf(properties.getProperty("readTimeoutMinutes", DEFAULT_READ_TIMEOUT_MINUTES)); + this.client = getClient(connectTimeoutSeconds, readTimeoutMinutes); + this.uri = buildUri(topic, group, id, host, timeoutQueryParamValue, limit, filter); + Builder builder = client.target(uri).request("application/json"); + if (username != null && password != null && username.length() > 0 && password.length() > 0) { + String authorizationString = buildAuthorizationString(username, password); + builder.header("Authorization", authorizationString); } + + this.getMessages = builder.buildGet(); + this.fetchPause = Integer.valueOf(properties.getProperty("fetchPause",DEFAULT_FETCH_PAUSE)); + this.isReady = true; } @Override diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java index d720e5fcd..3336b81f6 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java @@ -1,211 +1,221 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 - 2018 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.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.Properties; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.net.HttpURLConnection; - -/* - * java.net based client to build message router consumers - */ -public class MessageRouterHttpClientJdk implements SdncDmaapConsumer { - private static final Logger Log = LoggerFactory.getLogger(MessageRouterHttpClientJdk.class); - - protected Boolean isReady = false; - protected Boolean isRunning = false; - protected URL url; - protected Integer fetchPause; - protected Properties properties; - protected final String DEFAULT_CONNECT_TIMEOUT = "30000"; - protected final String DEFAULT_READ_TIMEOUT = "180000"; - protected final String DEFAULT_TIMEOUT_QUERY_PARAM_VALUE = "15000"; - protected final String DEFAULT_LIMIT = null; - private String authorizationString; - protected Integer connectTimeout; - protected Integer readTimeout; - protected String topic; - - public MessageRouterHttpClientJdk() {} - - @Override - public void run() { - if (isReady) { - isRunning = true; - while (isRunning) { - HttpURLConnection httpUrlConnection = null; - try { - httpUrlConnection = (HttpURLConnection) url.openConnection(); - if (authorizationString != null) { - httpUrlConnection.addRequestProperty("Authorization", authorizationString); - } - httpUrlConnection.setRequestMethod("GET"); - httpUrlConnection.setRequestProperty("Accept", "application/json"); - httpUrlConnection.setUseCaches(false); - httpUrlConnection.setConnectTimeout(connectTimeout); - httpUrlConnection.setReadTimeout(readTimeout); - httpUrlConnection.connect(); - int status = httpUrlConnection.getResponseCode(); - Log.info("GET " + url + " returned http status " + status); - if (status < 300) { - BufferedReader br = - new BufferedReader(new InputStreamReader(httpUrlConnection.getInputStream())); - StringBuilder sb = new StringBuilder(); - String line; - while ((line = br.readLine()) != null) { - sb.append(line + "\n"); - } - br.close(); - String responseBody = sb.toString(); - if (responseBody.contains("{")) { - // Get rid of opening [" entity = - responseBody = responseBody.substring(2); - // Get rid of closing "] - responseBody = responseBody.substring(0, responseBody.length() - 2); - // Split the json array into individual elements to process - for (String message : responseBody.split("\",\"")) { - // unescape the json - message = message.replace("\\\"", "\""); - // Topic names cannot contain periods - processMsg(message); - } - } else { - Log.info("Entity doesn't appear to contain JSON elements, logging body"); - Log.info(responseBody); - } - } - } catch (Exception e) { - Log.error("GET " + url + " failed.", e); - } finally { - if (httpUrlConnection != null) { - httpUrlConnection.disconnect(); - } - Log.info("Pausing " + fetchPause + " milliseconds before fetching from " + url + " again."); - try { - Thread.sleep(fetchPause); - } catch (InterruptedException e) { - Log.error("Could not sleep thread", e); - } - } - } - } - } - - @Override - public void init(Properties baseProperties, String consumerPropertiesPath) { - try { - baseProperties.load(new FileInputStream(new File(consumerPropertiesPath))); - - this.properties = baseProperties; - String username = properties.getProperty("username"); - String password = properties.getProperty("password"); - topic = properties.getProperty("topic"); - String group = properties.getProperty("group"); - String host = properties.getProperty("host"); - String id = properties.getProperty("id"); - - String filter = properties.getProperty("filter"); - if (filter != null) { - if (filter.length() > 0) { - try { - filter = URLEncoder.encode(filter, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - Log.error("Couldn't encode filter string", e); - } - } else { - filter = null; - } - } - - String limitString = properties.getProperty("limit", DEFAULT_LIMIT); - Integer limit = null; - if (limitString != null && limitString.length() > 0) { - limit = Integer.valueOf(limitString); - } - - Integer timeoutQueryParamValue = - Integer.valueOf(properties.getProperty("timeout", DEFAULT_TIMEOUT_QUERY_PARAM_VALUE)); - connectTimeout = Integer.valueOf(properties.getProperty("connectTimeoutSeconds", DEFAULT_CONNECT_TIMEOUT)); - readTimeout = Integer.valueOf(properties.getProperty("readTimeoutMinutes", DEFAULT_READ_TIMEOUT)); - if (username != null && password != null && username.length() > 0 && password.length() > 0) { - authorizationString = buildAuthorizationString(username, password); - } - String urlString = buildlUrlString(topic, group, id, host, timeoutQueryParamValue, limit, filter); - this.url = new URL(urlString); - this.fetchPause = Integer.valueOf(properties.getProperty("fetchPause")); - this.isReady = true; - } catch (FileNotFoundException e) { - Log.error("FileNotFoundException while reading consumer properties", e); - } catch (IOException e) { - Log.error("IOException while reading consumer properties", e); - } - } - - public void processMsg(String msg) { - Log.info(msg); - } - - protected String buildAuthorizationString(String userName, String password) { - String basicAuthString = userName + ":" + password; - basicAuthString = Base64.getEncoder().encodeToString(basicAuthString.getBytes()); - return "Basic " + basicAuthString; - } - - protected String buildlUrlString(String topic, String consumerGroup, String consumerId, String host, - Integer timeout, Integer limit, String filter) { - StringBuilder sb = new StringBuilder(); - sb.append("http://" + host + "/events/" + topic + "/" + consumerGroup + "/" + consumerId); - sb.append("?timeout=" + timeout); - - if (limit != null) { - sb.append("&limit=" + limit); - } - if (filter != null) { - sb.append("&filter=" + filter); - } - return sb.toString(); - } - - @Override - public boolean isReady() { - return isReady; - } - - @Override - public boolean isRunning() { - return isRunning; - } - -} +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 - 2018 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.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/* + * java.net based client to build message router consumers + */ +public class MessageRouterHttpClientJdk implements SdncDmaapConsumer { + private static final Logger Log = LoggerFactory.getLogger(MessageRouterHttpClientJdk.class); + + protected Boolean isReady = false; + protected Boolean isRunning = false; + protected URL url; + protected Integer fetchPause; + protected Properties properties; + protected final String DEFAULT_CONNECT_TIMEOUT = "30000"; + protected final String DEFAULT_READ_TIMEOUT = "180000"; + protected final String DEFAULT_TIMEOUT_QUERY_PARAM_VALUE = "15000"; + protected final String DEFAULT_LIMIT = null; + protected final String DEFAULT_FETCH_PAUSE = "5000"; + + private String authorizationString; + protected Integer connectTimeout; + protected Integer readTimeout; + protected String topic; + + public MessageRouterHttpClientJdk() {} + + @Override + public void run() { + if (isReady) { + isRunning = true; + while (isRunning) { + HttpURLConnection httpUrlConnection = null; + try { + httpUrlConnection = buildHttpURLConnection(); + httpUrlConnection.connect(); + int status = httpUrlConnection.getResponseCode(); + Log.info("GET " + url + " returned http status " + status); + if (status < 300) { + BufferedReader br = + new BufferedReader(new InputStreamReader(httpUrlConnection.getInputStream())); + StringBuilder sb = new StringBuilder(); + String line; + while ((line = br.readLine()) != null) { + sb.append(line + "\n"); + } + br.close(); + String responseBody = sb.toString(); + if (responseBody.contains("{")) { + // Get rid of opening [" entity = + responseBody = responseBody.substring(2); + // Get rid of closing "] + responseBody = responseBody.substring(0, responseBody.length() - 2); + // Split the json array into individual elements to process + for (String message : responseBody.split("\",\"")) { + // unescape the json + message = message.replace("\\\"", "\""); + // Topic names cannot contain periods + processMsg(message); + } + } else { + Log.info("Entity doesn't appear to contain JSON elements, logging body"); + Log.info(responseBody); + } + } + } catch (Exception e) { + Log.error("GET " + url + " failed.", e); + } finally { + if (httpUrlConnection != null) { + httpUrlConnection.disconnect(); + } + Log.info("Pausing " + fetchPause + " milliseconds before fetching from " + url + " again."); + try { + Thread.sleep(fetchPause); + } catch (InterruptedException e) { + Log.error("Could not sleep thread", e); + } + } + } + } + } + + @Override + public void init(Properties baseProperties, String consumerPropertiesPath) { + try { + baseProperties.load(new FileInputStream(new File(consumerPropertiesPath))); + processProperties(baseProperties); + } catch (FileNotFoundException e) { + Log.error("FileNotFoundException while reading consumer properties", e); + } catch (IOException e) { + Log.error("IOException while reading consumer properties", e); + } + } + + protected void processProperties(Properties properties) throws MalformedURLException { + this.properties = properties; + String username = properties.getProperty("username"); + String password = properties.getProperty("password"); + topic = properties.getProperty("topic"); + String group = properties.getProperty("group"); + String host = properties.getProperty("host"); + String id = properties.getProperty("id"); + + String filter = properties.getProperty("filter"); + if (filter != null) { + if (filter.length() > 0) { + try { + filter = URLEncoder.encode(filter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + Log.error("Couldn't encode filter string", e); + } + } else { + filter = null; + } + } + + String limitString = properties.getProperty("limit", DEFAULT_LIMIT); + Integer limit = null; + if (limitString != null && limitString.length() > 0) { + limit = Integer.valueOf(limitString); + } + + Integer timeoutQueryParamValue = + Integer.valueOf(properties.getProperty("timeout", DEFAULT_TIMEOUT_QUERY_PARAM_VALUE)); + connectTimeout = Integer.valueOf(properties.getProperty("connectTimeoutSeconds", DEFAULT_CONNECT_TIMEOUT)); + readTimeout = Integer.valueOf(properties.getProperty("readTimeoutMinutes", DEFAULT_READ_TIMEOUT)); + if (username != null && password != null && username.length() > 0 && password.length() > 0) { + authorizationString = buildAuthorizationString(username, password); + } + String urlString = buildlUrlString(topic, group, id, host, timeoutQueryParamValue, limit, filter); + this.url = new URL(urlString); + this.fetchPause = Integer.valueOf(properties.getProperty("fetchPause", DEFAULT_FETCH_PAUSE)); + this.isReady = true; + } + + public void processMsg(String msg) { + Log.info(msg); + } + + protected String buildAuthorizationString(String userName, String password) { + String basicAuthString = userName + ":" + password; + basicAuthString = Base64.getEncoder().encodeToString(basicAuthString.getBytes()); + return "Basic " + basicAuthString; + } + + protected String buildlUrlString(String topic, String consumerGroup, String consumerId, String host, + Integer timeout, Integer limit, String filter) { + StringBuilder sb = new StringBuilder(); + sb.append("http://" + host + "/events/" + topic + "/" + consumerGroup + "/" + consumerId); + sb.append("?timeout=" + timeout); + + if (limit != null) { + sb.append("&limit=" + limit); + } + if (filter != null) { + sb.append("&filter=" + filter); + } + return sb.toString(); + } + + @Override + public boolean isReady() { + return isReady; + } + + @Override + public boolean isRunning() { + return isRunning; + } + + protected HttpURLConnection buildHttpURLConnection() throws IOException { + HttpURLConnection httpUrlConnection = (HttpURLConnection) url.openConnection(); + if (authorizationString != null) { + httpUrlConnection.setRequestProperty("Authorization", authorizationString); + } + httpUrlConnection.setRequestMethod("GET"); + httpUrlConnection.setRequestProperty("Accept", "application/json"); + httpUrlConnection.setUseCaches(false); + httpUrlConnection.setConnectTimeout(connectTimeout); + httpUrlConnection.setReadTimeout(readTimeout); + return httpUrlConnection; + } + +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdkTest.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdkTest.java new file mode 100644 index 000000000..03f832801 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdkTest.java @@ -0,0 +1,100 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; +import org.junit.Test; + +public class MessageRouterHttpClientJdkTest { + public MessageRouterHttpClientJdk getClient() throws MalformedURLException { + Properties properties = new Properties(); + properties.put("username", "my_user"); + properties.put("password", "my_password"); + properties.put("topic", "network_automation"); + properties.put("group", "message_processors"); + properties.put("host", "dmaap-server.com"); + properties.put("id", "machine_one"); + properties.put("fetchPause", "3000"); + MessageRouterHttpClientJdk client = new MessageRouterHttpClientJdk(); + client.processProperties(properties); + return client; + } + + @Test + public void processMsg() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClientJdk client = getClient(); + client.processMsg(null); + } + + @Test + public void isReady() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClientJdk client = getClient(); + assertEquals(true, client.isReady()); + } + + @Test + public void isRunning() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClientJdk client = getClient(); + assertEquals(false, client.isRunning()); + } + + @Test + public void buidUrl() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClientJdk client = getClient(); + assertEquals(new URL( + "http://dmaap-server.com/events/network_automation/message_processors/machine_one?timeout=15000"), + client.url); + } + + @Test + public void buidUrlWithFilter() throws InvalidMessageException, MalformedURLException { + Properties properties = new Properties(); + properties.put("username", "my_user"); + properties.put("password", "my_password"); + properties.put("topic", "network_automation"); + properties.put("group", "message_processors"); + properties.put("host", "dmaap-server.com"); + properties.put("id", "machine_one"); + properties.put("filter", "{\"class\":\"Contains\",\"string\":\"hello\",\"value\":\"world\"}"); + properties.put("fetchPause", "3000"); + MessageRouterHttpClientJdk client = new MessageRouterHttpClientJdk(); + client.processProperties(properties); + assertEquals(new URL( + "http://dmaap-server.com/events/network_automation/message_processors/machine_one?timeout=15000&filter=%7B%22class%22%3A%22Contains%22%2C%22string%22%3A%22hello%22%2C%22value%22%3A%22world%22%7D"), + client.url); + } + + @Test + public void buildAuthorizationString() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClientJdk client = getClient(); + String authString = client.buildAuthorizationString("Hello", "World"); + assertEquals("Basic SGVsbG86V29ybGQ=", authString); + } + + @Test + public void clientFromProperties() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClientJdk client = new MessageRouterHttpClientJdk(); + Properties props = new Properties(); + client.init(props, "src/test/resources/dmaap-consumer-1.properties"); + assertEquals(new URL( + "http://localhost:3904/events/ccsdk-topic/ccsdk-unittest/ccsdk_unittest?timeout=15000&limit=1000"), + client.url); + } + + @Test + public void buildHttpURLConnection() throws InvalidMessageException, IOException { + MessageRouterHttpClientJdk client = getClient(); + HttpURLConnection connection = client.buildHttpURLConnection(); + assertEquals("GET", connection.getRequestMethod()); + assertTrue(connection.getRequestProperties().get("Accept").contains("application/json")); + assertEquals(false, connection.getUseCaches()); + Integer defaultConnectTimeout = Integer.valueOf(client.DEFAULT_CONNECT_TIMEOUT); + Integer defaultReadTimeout = Integer.valueOf(client.DEFAULT_READ_TIMEOUT); + assertEquals(defaultConnectTimeout.intValue(), connection.getConnectTimeout()); + assertEquals(defaultReadTimeout.intValue(), connection.getReadTimeout()); + } +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientTest.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientTest.java new file mode 100644 index 000000000..7567e2a9e --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientTest.java @@ -0,0 +1,97 @@ +package org.onap.ccsdk.sli.northbound.dmaapclient; + +import static org.junit.Assert.assertEquals; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Properties; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import org.junit.Test; + +public class MessageRouterHttpClientTest { + + class MockMessageRouterHttpClient extends MessageRouterHttpClient { + protected Client getClient(Integer connectTimeoutSeconds, Integer readTimeoutMinutes) { + ClientBuilder clientBuilder = ClientBuilder.newBuilder(); + return clientBuilder.build(); + } + } + + public MessageRouterHttpClient getClient() { + Properties properties = new Properties(); + properties.put("username", "my_user"); + properties.put("password", "my_password"); + properties.put("topic", "network_automation"); + properties.put("group", "message_processors"); + properties.put("host", "dmaap-server.com"); + properties.put("id", "machine_one"); + properties.put("fetch", "machine_one"); + + MockMessageRouterHttpClient client = new MockMessageRouterHttpClient(); + client.processProperties(properties); + return client; + } + + @Test + public void processMsg() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClient client = getClient(); + client.processMsg(null); + } + + @Test + public void isReady() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClient client = getClient(); + assertEquals(true, client.isReady()); + } + + @Test + public void isRunning() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClient client = getClient(); + assertEquals(false, client.isRunning()); + } + + @Test + public void buidUrl() throws InvalidMessageException, MalformedURLException, URISyntaxException { + MessageRouterHttpClient client = getClient(); + assertEquals(new URI( + "http://dmaap-server.com/events/network_automation/message_processors/machine_one?timeout=15000"), + client.uri); + } + + @Test + public void buidUrlWithFilter() throws InvalidMessageException, MalformedURLException, URISyntaxException { + Properties properties = new Properties(); + properties.put("username", "my_user"); + properties.put("password", "my_password"); + properties.put("topic", "network_automation"); + properties.put("group", "message_processors"); + properties.put("host", "dmaap-server.com"); + properties.put("id", "machine_one"); + properties.put("filter", "{\"class\":\"Contains\",\"string\":\"hello\",\"value\":\"world\"}"); + properties.put("fetchPause", "3000"); + MessageRouterHttpClient client = new MockMessageRouterHttpClient(); + client.processProperties(properties); + assertEquals(new URI( + "http://dmaap-server.com/events/network_automation/message_processors/machine_one?timeout=15000&filter=%7B%22class%22%3A%22Contains%22%2C%22string%22%3A%22hello%22%2C%22value%22%3A%22world%22%7D"), + client.uri); + } + + @Test + public void buildAuthorizationString() throws InvalidMessageException, MalformedURLException { + MessageRouterHttpClient client = getClient(); + String authString = client.buildAuthorizationString("Hello", "World"); + assertEquals("Basic SGVsbG86V29ybGQ=", authString); + } + + @Test + public void clientFromProperties() throws InvalidMessageException, MalformedURLException, URISyntaxException { + MessageRouterHttpClient client = new MockMessageRouterHttpClient(); + Properties props = new Properties(); + client.init(props, "src/test/resources/dmaap-consumer-1.properties"); + assertEquals(new URI( + "http://localhost:3904/events/ccsdk-topic/ccsdk-unittest/ccsdk_unittest?timeout=15000&limit=1000"), + client.uri); + } + +} -- cgit 1.2.3-korg From 16ecee44bc14dcb0a128cfdabf0ae8b17f1db057 Mon Sep 17 00:00:00 2001 From: Arindam Mondal Date: Tue, 10 Jul 2018 15:11:38 +0900 Subject: Sonar issue fix blocker, critical Issue-ID: CCSDK-332 Change-Id: I8741cb5bf68d71f0376105d2b1683ac05534a001 Signed-off-by: Arindam Mondal --- .../ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java | 1 + .../sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java | 1 + .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 6 ++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java index 13146e4ec..c02ec5df3 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java @@ -97,6 +97,7 @@ public class MessageRouterHttpClient implements SdncDmaapConsumer { Thread.sleep(fetchPause); } catch (InterruptedException e) { Log.error("Could not sleep thread", e); + Thread.currentThread().interrupt(); } } } diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java index 3336b81f6..a6744045d 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClientJdk.java @@ -111,6 +111,7 @@ public class MessageRouterHttpClientJdk implements SdncDmaapConsumer { Thread.sleep(fetchPause); } catch (InterruptedException e) { Log.error("Could not sleep thread", e); + Thread.currentThread().interrupt(); } } } 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 8ea041e61..4ae5acd99 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 @@ -399,8 +399,7 @@ public class SdncUebCallback implements INotificationCallback { // Save zip if TOSCA_CSAR if (artifact.getArtifactType().contains("TOSCA_CSAR") || artifact.getArtifactName().contains(".csar")) { - try { - FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); + try(FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName())) { outFile.write(payloadBytes, 0, payloadBytes.length); outFile.close(); writeSucceeded = true; @@ -411,8 +410,7 @@ public class SdncUebCallback implements INotificationCallback { } else { String payload = new String(payloadBytes); - try { - FileWriter spoolFileWriter = new FileWriter(spoolFile); + try(FileWriter spoolFileWriter = new FileWriter(spoolFile)) { spoolFileWriter.write(payload); spoolFileWriter.close(); writeSucceeded = true; -- cgit 1.2.3-korg From 18cc5f6913e7a71df1945e5e29f394b285867cb3 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Wed, 18 Jul 2018 16:16:58 -0400 Subject: Refactor for CCSDK UEB Listener Changes made: Moved DB insertions into model classes. Added SdncGroupModel object. Added policy ingestion in SdncBaseModel. Cleanup in SdncUebCallback. Changed sdc.tosca.version to 1.3.5 in pom.xml. Issue-ID: CCSDK-360 Change-Id: If965c38275a1dc7fc63847d3aa944aed1a6bd1f9 Signed-off-by: lalena.aria --- ueb-listener/pom.xml | 2 +- .../sli/northbound/uebclient/SdncARModel.java | 35 +- .../sli/northbound/uebclient/SdncBaseModel.java | 822 ++++++++++++++++++++- .../sli/northbound/uebclient/SdncGroupModel.java | 81 ++ .../sli/northbound/uebclient/SdncNodeModel.java | 30 +- .../sli/northbound/uebclient/SdncServiceModel.java | 35 +- .../sli/northbound/uebclient/SdncUebCallback.java | 665 ++++++++++------- .../sli/northbound/uebclient/SdncVFCModel.java | 271 ++++++- .../sli/northbound/uebclient/SdncVFModel.java | 280 ++++++- .../northbound/uebclient/SdncVFModuleModel.java | 8 +- .../src/main/resources/normalizeTagNames.xslt | 1 - .../sli/northbound/uebclient/SdncARModelTest.java | 4 +- .../northbound/uebclient/SdncNodeModelTest.java | 4 +- .../sli/northbound/uebclient/SdncVFCModelTest.java | 4 +- .../uebclient/SdncVFModuleModelTest.java | 4 +- .../northbound/uebclient/TestSdncUebCallback.java | 39 +- 16 files changed, 1931 insertions(+), 354 deletions(-) create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 205c5c907..f0315a138 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -18,7 +18,7 @@ 1.3.0 - 1.3.0 + 1.3.5 2.9.4 true /opt/app/ueb-listener 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 f285db162..adb82c6dd 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 @@ -21,21 +21,33 @@ package org.onap.ccsdk.sli.northbound.uebclient; +import java.io.IOException; +import java.util.List; + import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncARModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncARModel.class); - public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + private String type = null; + private String subcategory = null; - super(sdcCsarHelper, nodeTemplate); + public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate,DBResourceManager jdbcDataSource) { + super(sdcCsarHelper, nodeTemplate, jdbcDataSource); + // extract metadata Metadata metadata = nodeTemplate.getMetaData(); + type = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE); + subcategory = extractValue (metadata, "subcategory"); addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); // extract properties @@ -45,4 +57,23 @@ public class SdncARModel extends SdncBaseModel { addParameter("naming_policy", extractValue (nodeTemplate, "nf_naming#naming_policy")); } + public void insertAllottedResourceModelData () throws IOException { + try { + cleanUpExistingToscaData("ALLOTTED_RESOURCE_MODEL", "customization_uuid", getCustomizationUUID()); + LOG.info("Call insertToscaData for ALLOTTED_RESOURCE_MODEL where customization_uuid = " + getCustomizationUUID()); + insertToscaData(buildSql("ALLOTTED_RESOURCE_MODEL", model_yaml), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the ALLOTTED_RESOURCE_MODEL table"); + throw new IOException (e); + } + } + + public String getSubcategory() { + return subcategory; + } + + public void setSubcategory(String subcategory) { + this.subcategory = subcategory; + } + } 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 315f3c381..fd5a29637 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 @@ -21,41 +21,78 @@ package org.onap.ccsdk.sli.northbound.uebclient; +import java.io.IOException; +import java.sql.SQLException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; +import javax.sql.rowset.CachedRowSet; + import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.CapabilityAssignment; +import org.onap.sdc.toscaparser.api.CapabilityAssignments; import org.onap.sdc.toscaparser.api.Group; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.Policy; +import org.onap.sdc.toscaparser.api.Property; import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncBaseModel { - + + private static final Logger LOG = LoggerFactory + .getLogger(SdncBaseModel.class); + protected String customizationUUID = null; protected String invariantUUID = null; - protected String model_yaml = null; - protected String version = null; + protected String UUID = null; + protected String model_yaml = null; + protected String version = null; + protected String name = null; protected Map params = null; + protected Map attributeValueParams = null; protected ISdcCsarHelper sdcCsarHelper = null; + protected static DBResourceManager jdbcDataSource = null; + protected static SdncUebConfiguration config = null; + protected NodeTemplate nodeTemplate = null; + + public SdncBaseModel(DBResourceManager jdbcDataSource) { + this.jdbcDataSource = jdbcDataSource; + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) { + this (sdcCsarHelper, nodeTemplate); + this.sdcCsarHelper = sdcCsarHelper; + this.nodeTemplate = nodeTemplate; + this.jdbcDataSource = jdbcDataSource; + } - public SdncBaseModel() { - + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { + this (sdcCsarHelper, nodeTemplate); + this.sdcCsarHelper = sdcCsarHelper; + this.nodeTemplate = nodeTemplate; + this.jdbcDataSource = jdbcDataSource; + this.config = config; } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { - params = new HashMap<>(); + params = new HashMap(); this.sdcCsarHelper = sdcCsarHelper; // extract service metadata invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); addParameter("invariant_uuid",invariantUUID); addParameter("version",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); - addParameter("name",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); + name = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME); + addParameter("name",name); addParameter("description",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); addParameter("type",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); addParameter("category",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY)); @@ -63,34 +100,415 @@ public class SdncBaseModel { public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - params = new HashMap<>(); + params = new HashMap(); + attributeValueParams = new HashMap(); this.sdcCsarHelper = sdcCsarHelper; + this.nodeTemplate = nodeTemplate; - // extract nodeTemplate metadata + // extract common nodeTemplate metadata Metadata metadata = nodeTemplate.getMetaData(); customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); - addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID)); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + invariantUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); + addParameter("invariant_uuid", invariantUUID); + UUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID); + addParameter("uuid", UUID); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + + // extract common nodeTemplate properties + //addParameter("ecomp_generated_naming", extractValue (nodeTemplate, "naming#ecompnaming")); // should be extractBooleanValue? + //addParameter("naming_policy", extractValue (nodeTemplate, "naming#namingpolicy")); + + } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { + this (sdcCsarHelper, group); + this.sdcCsarHelper = sdcCsarHelper; + this.config = config; + this.jdbcDataSource = jdbcDataSource; } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) { - params = new HashMap<>(); + params = new HashMap(); this.sdcCsarHelper = sdcCsarHelper; + attributeValueParams = new HashMap(); // extract group metadata Metadata metadata = group.getMetadata(); //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID"); - addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); - addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); + addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); + addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); + } + +/* This is the generic approach Shoujit attempted for 18.06 but can't be implemented without parser API to + * get properties with substring match on the name + * protected void extractRelevantAttributeData(List propList, SdncUebConfiguration config) { + + //List propList = nodeTemplate.getPropertiesObjects(); + for (Property prop : propList) { + String propName = prop.getName(); + Object propValue = prop.getValue(); + + if (propValue instanceof Map) + + LOG.info("Property: propertyName: " + propName + " propertyValue: " + propValue.toString()); + + // Compare this property name with each config.relevant-attribute-name + List attributeNames = config.getRelevantAttributeNames(); + for (String attributeName : attributeNames) { + if (prop.getName().contains(attributeName)) + addParameter(prop.getName(), prop.getValue().toString(), attributeValueParams); + } + + } + + }*/ + + protected void insertRelevantAttributeData() throws IOException{ + + insertRelevantAttributeData(""); + } + + protected void insertRelevantAttributeData(String type) throws IOException{ + + // type can be passed as "group" or taken from the nodeTemplate + String metadataType = ""; + if (!type.isEmpty()) metadataType = type; + else { + Metadata metadata = nodeTemplate.getMetaData(); + metadataType = sdcCsarHelper.getMetadataPropertyValue(metadata, "type"); + } + + // Clean up all attributes for this resource + try { + cleanUpExistingToscaData("ATTRIBUTE_VALUE_PAIR", "resource_uuid", getUUID(), "resource_type", "\"" + metadataType + "\""); + } catch (IOException e) { + LOG.error("Could not cleanup Tosca CSAR data from the ATTRIBUTE_VALUE_PAIR table"); + throw new IOException (e); + } + + for (String paramName : attributeValueParams.keySet()) { + String paramValue = attributeValueParams.get(paramName); + + Map attributeParams = new HashMap(); + addParameter("attribute_name", paramName, attributeParams); + addParameter("attribute_value", paramValue, attributeParams); + addParameter("resource_type", metadataType, attributeParams); + addParameter("resource_customization_uuid", getCustomizationUUID(), attributeParams); + + LOG.info("Call insertToscaData for ATTRIBUTE_VALUE_PAIR where resource_uuid = " + getUUID() + " and attriubute_name = " + paramName); + try { + insertToscaData(buildSql("ATTRIBUTE_VALUE_PAIR", "resource_uuid", getUUID(), model_yaml, attributeParams), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the ATTRIBUTE_VALUE_PAIR table"); + throw new IOException (e); + } + } + } + + protected void insertGroupData (NodeTemplate nodeTemplate, NodeTemplate targetNode, String groupType) throws IOException { + + // Get the NetworkCollection groups of the node + Map groupParams = new HashMap(); + List groupList = sdcCsarHelper.getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate, groupType); + //List groupList2 = sdcCsarHelper.getGroupsOfTopologyTemplateByToscaGroupType(groupType); // returns nothing + + for (Group group : groupList) { + + // Insert into RESOURCE_GROUP/ATTRIBUTE_VALUE_PAIR and RESOURCE_GROUP_TO_TARGET_NODE_MAPPING + // RESOURCE_GROUP (group metadata): resource_uuid (CR node UUID), uuid, customization_uuid, invariant_uuid, name, version + // ATTRIBUTE_VALUE_PAIR (group properties): group_type, group_role, group_function + // RESOURCE_GROUP_TO_TARGET_NODE_MAPPING: group_uuid, parent_uuid (CR node UUID), target_node_uuid, target_type, table_name + + SdncGroupModel groupModel = new SdncGroupModel (sdcCsarHelper, group, nodeTemplate, config, jdbcDataSource); + groupModel.insertGroupData(nodeTemplate); + + // insert RESOURCE_GROUP_TO_TARGET_NODE_MAPPING + try { + Map mappingCleanupParams = new HashMap(); + addParameter("group_uuid", groupModel.getUUID(), mappingCleanupParams); + addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), "UUID"), mappingCleanupParams); + addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), "UUID"), mappingCleanupParams); + cleanupExistingToscaData("RESOURCE_GROUP_TO_TARGET_NODE_MAPPING", mappingCleanupParams); + + Map mappingParams = new HashMap(); + addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), "UUID"), mappingParams); + addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), "UUID"), mappingParams); + String targetType = extractValue(targetNode.getMetaData(), "type"); + addParameter("target_type", targetType, mappingParams); + String tableName = ""; + switch (targetType) { + case "CVFC": + tableName = "VFC_MODEL"; + break; + case "VL": + tableName = "NETWORK_MODEL"; + break; + } + addParameter("table_name", tableName, mappingParams); + LOG.info("Call insertToscaData for RESOURCE_GROUP_TO_TARGET_NODE_MAPPING where group_uuid = " + groupModel.getUUID()); + insertToscaData(buildSql("RESOURCE_GROUP_TO_TARGET_NODE_MAPPING", "group_uuid", groupModel.getUUID(), model_yaml, mappingParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_GROUP_TO_TARGET_NODE_MAPPING"); + throw new IOException (e); + } + } + } + + protected void insertPolicyData (NodeTemplate nodeTemplate, NodeTemplate targetNode, String policyType) throws IOException { + + // Get External policies of the node + List policyList = sdcCsarHelper.getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(nodeTemplate, policyType); + //List policyList2 = sdcCsarHelper.getPoliciesOfTopologyTemplateByToscaPolicyType(policyType); // returns nothing + //List policyList3 = sdcCsarHelper.getPoliciesOfTargetByToscaPolicyType(nodeTemplate, policyType); // returns nothing + + for (Policy policy : policyList) { + + String resourceUuid = getUUID(); + // extract metadata + //policy.getmetadata(); - NPE + //Metadata metadata = policy.getMetadata(); + + //String policyUuid = extractValue(metadata, "UUID"); + String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); + //String policyInvariantUuid = extractValue(metadata, "invariantUUID"); + String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); + //String policyCustomizationUuid = extractValue(metadata, "customizationUUID"); + String policyCustomizationUuid = policy.getMetaData().getOrDefault("customizationUUID", "").toString(); + + Map cleanupParams = new HashMap(); + addParameter("resource_uuid", resourceUuid, cleanupParams); + addParameter("policy_uuid", policyUuid, cleanupParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + + Map policyParams = new HashMap(); + addParameter("policy_uuid", policyUuid, policyParams); + addParameter("policy_customization_uuid", policyCustomizationUuid, policyParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); + //addParameter("policy_name", extractValue(metadata, "name"), policyParams); + addParameter("policy_name", policy.getMetaData().getOrDefault("name", "").toString(), policyParams); + //addParameter("version", extractValue(metadata, "version"), policyParams); + addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); + //addParameter("policy_type", extractValue(metadata, "type"), policyParams); + addParameter("policy_type", policy.getMetaData().getOrDefault("type", "").toString(), policyParams); + + // extract properties + addParameter("property_type", extractValue(policy, "type"), policyParams); + addParameter("property_source", extractValue(policy, "source"), policyParams); + addParameter("property_name", extractValue(policy, "name"), policyParams); + + // Insert into RESOURCE_POLICY and RESOURCE_POLICY_TO_TARGET_NODE_MAPPING + // RESOURCE_POLICY: resource_uuid (CR node UUID), uuid, customization_uuid, invariant_uuid, name, version, policy_type, + // property_type, property_source, property_name + + try { + + // insert into RESOURCE_POLICY + cleanupExistingToscaData("RESOURCE_POLICY", cleanupParams); + LOG.info("Call insertToscaData for RESOURCE_POLICY where resource_uuid = " + resourceUuid + " and policy_uuid = " + policyUuid); + insertToscaData(buildSql("RESOURCE_POLICY", "resource_uuid", resourceUuid, model_yaml, policyParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY table"); + throw new IOException (e); + } + + // insert RESOURCE_POLICY_TO_TARGET_NODE_MAPPING: policy_uuid, parent_uuid (CR node UUID), target_node_uuid, target_type, table_name + try { + Map mappingCleanupParams = new HashMap(); + addParameter("policy_uuid", policyUuid, mappingCleanupParams); + addParameter("parent_uuid", nodeTemplate.getMetaData().getValue("UUID"), mappingCleanupParams); + addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingCleanupParams); + cleanupExistingToscaData("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", mappingCleanupParams); + + Map mappingParams = new HashMap(); + addParameter("parent_uuid", nodeTemplate.getMetaData().getValue("UUID"), mappingParams); + addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); + addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); + addParameter("policy_customization_uuid", policyCustomizationUuid, mappingParams); + addParameter("target_type", targetNode.getMetaData().getValue("type"), mappingParams); + LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid); + insertToscaData(buildSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", model_yaml, mappingParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY_TO_TARGET_NODE_MAPPING"); + throw new IOException (e); + } + } + } + + public static void insertPolicyData (ISdcCsarHelper sdcCsarHelper, DBResourceManager jdbcDataSource, String resourceUuid, String parentUuid, String policyType) throws IOException { + + // Get External policies of the node + List policyList = sdcCsarHelper.getPoliciesOfTopologyTemplateByToscaPolicyType(policyType); + + for (Policy policy : policyList) { + + // extract policy metadata + String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); + String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); + + // insert into RESOURCE_POLICY + Map cleanupParams = new HashMap(); + SdncBaseModel.addParameter("resource_uuid", resourceUuid, cleanupParams); + SdncBaseModel.addParameter("policy_uuid", policyUuid, cleanupParams); + SdncBaseModel.addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + + Map policyParams = new HashMap(); + SdncBaseModel.addParameter("policy_uuid", policyUuid, policyParams); + SdncBaseModel.addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); + SdncBaseModel.addParameter("policy_name", policy.getMetaData().getOrDefault("name", "").toString(), policyParams); + SdncBaseModel.addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); + SdncBaseModel.addParameter("policy_type", policy.getType(), policyParams); + + SdncBaseModel.addParameter("property_type", extractValueStatic(policy, "type"), policyParams); + SdncBaseModel.addParameter("property_source", extractValueStatic(policy, "source"), policyParams); + SdncBaseModel.addParameter("property_name", extractValueStatic(policy, "name"), policyParams); + + try { + + // insert into RESOURCE_POLICY + SdncBaseModel.cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY", cleanupParams); + LOG.info("Call insertToscaData for RESOURCE_POLICY where resource_uuid = " + resourceUuid); + insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY", "resource_uuid", resourceUuid, "", policyParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY table"); + throw new IOException (e); + } + + // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING + List policyTargetNameList = policy.getTargets(); + for (String targetName : policyTargetNameList) { + NodeTemplate targetNode = sdcCsarHelper.getNodeTemplateByName(targetName); + + // extract targetNode metadata UUID and customizationUUID + + // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING + try { + Map mappingCleanupParams = new HashMap(); + addParameter("policy_uuid", policyUuid, mappingCleanupParams); + addParameter("parent_uuid", parentUuid, mappingCleanupParams); + addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingCleanupParams); + SdncBaseModel.cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", mappingCleanupParams); + + Map mappingParams = new HashMap(); + addParameter("parent_uuid", parentUuid, mappingParams); + addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); + addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); + addParameter("target_type", targetNode.getMetaData().getValue("type"), mappingParams); // type of the target node + LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid + " and target_node_uuid = " + targetNode.getMetaData().getValue("UUID")); + SdncBaseModel.insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", "", mappingParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY_TO_TARGET_NODE_MAPPING"); + throw new IOException (e); + } + + } + } + } + + protected void insertNodeCapabilitiesData (CapabilityAssignments capabilities) throws IOException { + + // Process the capabilities on the node template + + List capabilityList = capabilities.getAll(); + + for (CapabilityAssignment capability : capabilities.getAll()) { + + // Insert into NODE_CAPABILITY: + // capability_id (generated) + // capability_provider_uuid - UUID of this node + // capability_provider_customization_uuid - customization UUID of this node + // capability_name - capability.getName() + // capability_type - ? + + // Check capability name against relevant capabilities + boolean capabilityIsRelevant = false; + /*List relevantCapabilities = config.getRelevantCapabilityNames(); + for (String relevantCapabilityName : relevantCapabilities ) { + + if (capability.getName().toLowerCase().contains(relevantCapabilityName.toLowerCase())) { + capabilityIsRelevant = true; + } + }*/ + + if (capabilityIsRelevant == false){ + continue; + } + + String capabilityProviderUuid = getUUID(); + + Map cleanupParams = new HashMap(); + addParameter("capability_provider_uuid", capabilityProviderUuid, cleanupParams); // node customization UUID + addParameter("capability_provider_customization_uuid", getCustomizationUUIDNoQuotes(), cleanupParams); // node customization UUID + addParameter("capability_name", capability.getName(), cleanupParams); + + Map nodeCapabilityParams = new HashMap(); + addParameter("capability_provider_customization_uuid", getCustomizationUUIDNoQuotes(), nodeCapabilityParams); // node customization UUID + addParameter("capability_name", capability.getName(), nodeCapabilityParams); + addParameter("capability_type", extractValue(capability, "type"), nodeCapabilityParams); + + // Insert NODE_CAPABILITY data for each capability + String capabilityId = ""; + try { + + cleanupExistingToscaData("NODE_CAPABILITY", cleanupParams); // will also delete NODE_CAPABILITY_PROPERTY with same capability_id + LOG.info("Call insertToscaData for NODE_CAPABILITY where capability_provider_uuid = " + capabilityProviderUuid + " and capability_name = " + capability.getName()); + insertToscaData(buildSql("NODE_CAPABILITY", "capability_provider_uuid", capabilityProviderUuid, model_yaml, nodeCapabilityParams), null); + + // Get capabilityId for capability just inserted + CachedRowSet rowData = getToscaData("NODE_CAPABILITY", nodeCapabilityParams); + rowData.first(); + int capabilityIdint = rowData.getInt("capability_id"); + capabilityId = capabilityId.valueOf(capabilityIdint); + + } catch (IOException | SQLException e) { + LOG.error("Could not insert Tosca CSAR data into the NODE_CAPABILITY table"); + throw new IOException (e); + } + + insertNodeCapabilityPropertyData (capability, capabilityId); + } + } + + protected void insertNodeCapabilityPropertyData(CapabilityAssignment capability, String capabilityId) throws IOException { + + // Insert property name / value into NODE_CAPABILITY_PROPERTY + LinkedHashMap propertiesMap = capability.getProperties(); + Map nodeCapabilityPropertyParams = new HashMap(); + + for (String propertyMapKey : propertiesMap.keySet() ) { + //LOG.info("property map key = " + propertyMapKey); + Property property = propertiesMap.get(propertyMapKey); + + addParameter ("capability_property_name", property.getName(), nodeCapabilityPropertyParams); + addParameter ("capability_property_type", property.getValue().toString(), nodeCapabilityPropertyParams); + + try { + // Data from NODE_CAPABILITY_PROPERTY is cleaned up via cascade delete on NODE_CAPABILITY + LOG.info("Call insertToscaData for NODE_CAPABILITY_PROPERTY where capability_id = " + capabilityId + " and property_name = " + property.getName() + ", property_value: " + property.getValue().toString()); + insertToscaData(buildSql("NODE_CAPABILITY_PROPERTY", "capability_id", capabilityId, model_yaml, nodeCapabilityPropertyParams), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the NODE_CAPABILITY_PROPERTY table"); + throw new IOException (e); + } + } + } protected void addParameter (String name, String value) { if (value != null && !value.isEmpty()) { - params.put(name, "\"" + value + "\""); + // check if value already contain quotes + if (value.startsWith("\"", 0) && value.endsWith("\"")) { + params.put(name, value); + } else { + params.put(name, "\"" + value + "\""); + } } } @@ -108,7 +526,15 @@ public class SdncBaseModel { public static void addParameter (String name, String value, Map params) { if (value != null && !value.isEmpty()) { - params.put(name, "\"" + value + "\""); + // remove any quotes within the string + String strippedValue = value.replace("\"",""); + + // check if value already contain quotes + if (strippedValue.startsWith("\"", 0) && value.endsWith("\"")) { + params.put(name, strippedValue); + } else { + params.put(name, "\"" + strippedValue + "\""); + } } } @@ -118,6 +544,15 @@ public class SdncBaseModel { return value; } else { return ""; + } + } + + protected String extractBooleanValue (Metadata metadata, String name) { + String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; } } @@ -139,6 +574,78 @@ public class SdncBaseModel { } } + protected String extractGetInputValue (Group group, NodeTemplate nodeTemplate, String name) { + + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (group, name)); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractGetInputName (Group group, String name) { + + String getInputName = name; + String groupProperty = sdcCsarHelper.getGroupPropertyLeafValue(group, name); + if (groupProperty != null) { + int getInputIndex = groupProperty.indexOf("{get_input="); + if (getInputIndex > -1) { + getInputName = groupProperty.substring(getInputIndex+11, groupProperty.length()-1); + } + } + + return getInputName; + + } + + protected String extractGetInputValue (Policy policy, NodeTemplate nodeTemplate, String name) { + + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (policy, name)); + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractGetInputName (Policy policy, String name) { + + String getInputName = name; + //String groupProperty = sdcCsarHelper.getPolicyPropertyLeafValue(policy, name); + Map propMap = policy.getPolicyProperties(); + String groupProperty = nullCheck(propMap.get(name)); + if (!groupProperty.isEmpty()) { + int getInputIndex = groupProperty.indexOf("{get_input="); + if (getInputIndex > -1) { + getInputName = groupProperty.substring(getInputIndex+11, groupProperty.length()-1); + } + } + + return getInputName; + + } + + protected String extractValue (Policy policy, String name) { + + Map propMap = policy.getPolicyProperties(); + if (propMap == null) { + return ""; + } else { + return nullCheck(propMap.get(name)); + } + } + + protected static String extractValueStatic (Policy policy, String name) { + + Map propMap = policy.getPolicyProperties(); + if (propMap == null) { + return ""; + } else { + return nullCheckStatic(propMap.get(name)); + } + } + public static String extractValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); if (value != null) { @@ -148,6 +655,15 @@ public class SdncBaseModel { } } + protected String extractValue (CapabilityAssignment capability, String name) { + String value = sdcCsarHelper.getCapabilityPropertyLeafValue(capability, name); + if (value != null) { + return value; + } else { + return ""; + } + } + protected String extractBooleanValue (NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); if (value != null && !value.isEmpty()) { @@ -166,6 +682,15 @@ public class SdncBaseModel { } } + protected Object extractObjectValue (NodeTemplate nodeTemplate, String name) { + Object value = sdcCsarHelper.getNodeTemplatePropertyAsObject(nodeTemplate, name); + if (value != null) { + return value; + } else { + return ""; + } + } + protected String extractValue (Group group, String name) { String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); if (value != null) { @@ -229,18 +754,27 @@ public class SdncBaseModel { } } + protected String getUUID() { + return ("\"" + UUID + "\""); + } + public String getInvariantUUID() { + return ("\"" + invariantUUID + "\""); + } public String getCustomizationUUID() { - return "\"" + customizationUUID + "\""; + return ("\"" + customizationUUID + "\""); } public String getCustomizationUUIDNoQuotes() { - return customizationUUID; + return (customizationUUID); } public void setCustomizationUUID(String customizationUUID) { this.customizationUUID = customizationUUID; } - - public String getSql(String tableName, String model_yaml) { - + public String getName() { + return name; + } + + public String buildSql(String tableName, String model_yaml) { + StringBuilder sb = new StringBuilder(); sb.append("INSERT into " + tableName + " (customization_uuid, model_yaml, "); @@ -254,9 +788,9 @@ public class SdncBaseModel { sb.append(") values (" + getCustomizationUUID() + ", \"" + model_yaml + "\", "); paramCount = 0; - for (Map.Entry entry : params.entrySet()) { + for (String paramKey : params.keySet()) { paramCount++; - String paramValue = entry.getValue(); + String paramValue = params.get(paramKey); sb.append(paramValue); if (paramCount < params.size()) sb.append(", "); } @@ -264,7 +798,33 @@ public class SdncBaseModel { sb.append(");"); return sb.toString(); } + + public String buildSql(String tableName, String keyName, String keyValue, String model_yaml, Map params) { + + StringBuilder sb = new StringBuilder(); + sb.append("INSERT into " + tableName + " (" + keyName + ", "); + + int paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + sb.append(paramKey); + if (paramCount < params.size()) sb.append(", "); + } + + sb.append(") values (" + keyValue + ", "); + + paramCount = 0; + for (String paramKey : params.keySet()) { + paramCount++; + String paramValue = params.get(paramKey); + sb.append(paramValue); + if (paramCount < params.size()) sb.append(", "); + } + sb.append(");"); + return sb.toString(); + } + public static String getSql(String tableName, String keyName, String keyValue, String model_yaml, Map params) { StringBuilder sb = new StringBuilder(); @@ -280,9 +840,9 @@ public class SdncBaseModel { sb.append(") values (" + keyValue + ", "); paramCount = 0; - for (Map.Entry entry : params.entrySet()) { + for (String paramKey : params.keySet()) { paramCount++; - String paramValue = entry.getValue(); + String paramValue = params.get(paramKey); sb.append(paramValue); if (paramCount < params.size()) sb.append(", "); } @@ -290,5 +850,213 @@ public class SdncBaseModel { sb.append(");"); return sb.toString(); } + + protected void insertToscaData(String toscaDataString, ArrayList arguments) throws IOException + { + LOG.debug("insertToscaData: " + toscaDataString); + + try { + + jdbcDataSource.writeData(toscaDataString, arguments, null); + + } catch (SQLException e) { + LOG.error("Could not insert Tosca data into the database"); + throw new IOException (e); + } + + } + + protected static void insertToscaData(DBResourceManager jdbcDataSource, String toscaDataString, ArrayList arguments) throws IOException + { + LOG.debug("insertToscaData: " + toscaDataString); + + try { + + jdbcDataSource.writeData(toscaDataString, arguments, null); + + } catch (SQLException e) { + LOG.error("Could not insert Tosca data into the database"); + throw new IOException (e); + } + + } + + protected void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException + { + + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount != 0) { + LOG.debug("cleanUpExistingToscaData from: " + tableName + " for " + keyValue); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); + } + + } catch (SQLException e) { + LOG.error("Could not clean up existing " + tableName + " for " + keyValue, e); + } + + } + + protected void cleanUpExistingToscaData(String tableName, String key1Name, String key1Value, String key2Name, String key2Value) throws IOException + { + + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount != 0) { + LOG.debug("cleanUpExistingToscaData from : " + tableName + " for " + key1Value + " and " + key2Value); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, null); + } + + } catch (SQLException e) { + LOG.error("Could not clean up existing " + tableName + " for " + key1Value + " and " + key2Value, e); + } + + } + + protected boolean cleanupExistingToscaData(String tableName, Map keyParams) throws IOException + { + return SdncBaseModel.cleanupExistingToscaData(this.jdbcDataSource, tableName, keyParams); + } + + public static boolean cleanupExistingToscaData(DBResourceManager jdbcDataSource, String tableName, Map keyParams) throws IOException + { + boolean dataExists = false; + StringBuilder sb = new StringBuilder(); + sb.append("SELECT * from " + tableName + " where "); + + int paramCount = 0; + for (String paramKey : keyParams.keySet()) { + paramCount++; + String paramValue = keyParams.get(paramKey); + sb.append(paramKey); + sb.append(" = "); + sb.append(paramValue); + if (paramCount < keyParams.size()) sb.append(" AND "); + } + + sb.append(";"); + + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData(sb.toString(), null, ""); + while(data.next()) { + rowCount ++; + data.deleteRow(); + } + if (rowCount != 0) { + LOG.debug("cleanupExistingToscaData in " + tableName + ": Data FOUND"); + String deleteStmt = sb.replace(sb.indexOf("SELECT *"), sb.indexOf("SELECT")+8, "DELETE").toString(); + jdbcDataSource.writeData(deleteStmt, null, null); + dataExists = true; + } + + } catch (SQLException e) { + LOG.error("Could not get data in " + tableName, e); + } + + return dataExists; + } + + protected boolean checkForExistingToscaData(String tableName, Map keyParams) throws IOException + { + boolean dataExists = false; + StringBuilder sb = new StringBuilder(); + sb.append("SELECT * from " + tableName + " where "); + + int paramCount = 0; + for (String paramKey : keyParams.keySet()) { + paramCount++; + String paramValue = keyParams.get(paramKey); + sb.append(paramKey); + sb.append(" = "); + sb.append(paramValue); + if (paramCount < keyParams.size()) sb.append(" AND "); + } + + sb.append(";"); + + try { + int rowCount = 0; + CachedRowSet data = jdbcDataSource.getData(sb.toString(), null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount != 0) { + LOG.info("checkForExistingToscaData in " + tableName + ": Data FOUND"); + dataExists = true; + } + + } catch (SQLException e) { + LOG.error("Could not get data in " + tableName, e); + } + + return dataExists; + } + + protected CachedRowSet getToscaData(String tableName, Map keyParams) throws IOException + { + StringBuilder sb = new StringBuilder(); + sb.append("SELECT * from " + tableName + " where "); + + int paramCount = 0; + for (String paramKey : keyParams.keySet()) { + paramCount++; + String paramValue = keyParams.get(paramKey); + sb.append(paramKey); + sb.append(" = "); + sb.append(paramValue); + if (paramCount < keyParams.size()) sb.append(" AND "); + } + + sb.append(";"); + + CachedRowSet data = null; + try { + int rowCount = 0; + data = jdbcDataSource.getData(sb.toString(), null, ""); + while(data.next()) { + rowCount ++; + } + if (rowCount == 0) { + LOG.info("getToscaData in " + tableName + ": Data NOT found"); + } + + } catch (SQLException e) { + LOG.error("Could not get data in " + tableName, e); + } + + return data; + } + protected void addParamsToMap (Map fromMap, Map toMap) { + for (String key : fromMap.keySet()) { + if (!toMap.containsKey(key)) { + toMap.put(key, fromMap.get(key)); + } + } + } + + protected String nullCheck (Object extractedObject) { + String stringValue = ""; + if (extractedObject != null) { + return extractedObject.toString(); + } + return stringValue; + } + + protected static String nullCheckStatic (Object extractedObject) { + String stringValue = ""; + if (extractedObject != null) { + return extractedObject.toString(); + } + return stringValue; + } } diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java new file mode 100644 index 000000000..95d1fcd20 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java @@ -0,0 +1,81 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 - 2018 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.uebclient; + +import java.io.IOException; + +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.Group; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncGroupModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFModuleModel.class); + + public SdncGroupModel(ISdcCsarHelper sdcCsarHelper, Group group, NodeTemplate nodeTemplate, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { + + super(sdcCsarHelper, group); + + // Metadata for Resource group is not extracted in base class due to inconsistency in TOSCA model Group object + Metadata metadata = group.getMetadata(); + invariantUUID = extractValue (metadata, "invariantUUID"); + addParameter("group_invariant_uuid", invariantUUID); + UUID = extractValue (metadata, "UUID"); + addParameter("group_uuid", UUID); + addParameter("group_name", extractValue (metadata, "name")); + addParameter("group_type", group.getType()); + addParameter("version", extractValue (metadata, "version")); + + // extract properties + addParameter("vfc_parent_port_role", extractValue(group, "vfc_parent_port_role"), attributeValueParams); + addParameter("subinterface_role", extractValue(group, "subinterface_role"), attributeValueParams); + + // relevant complex group properties are extracted and inserted into ATTRIBUTE_VALUE_PAIR + addParameter(extractGetInputName (group, "group_type"), extractGetInputValue(group, nodeTemplate, "group_type"), attributeValueParams); + addParameter(extractGetInputName (group, "group_role"), extractGetInputValue(group, nodeTemplate, "group_role"), attributeValueParams); + addParameter(extractGetInputName (group, "group_function"), extractGetInputValue(group, nodeTemplate, "group_function"), attributeValueParams); + } + + public void insertGroupData(NodeTemplate resourceNodeTemplate) throws IOException { + + try { + + // insert into RESOURCE_GROUP/ATTRIBUTE_VALUE_PAIR + String resourceNodeUuid = "\"" + extractValue (resourceNodeTemplate.getMetaData(), "UUID") + "\""; + cleanUpExistingToscaData("RESOURCE_GROUP", "resource_uuid", resourceNodeUuid, "group_uuid", getUUID()) ; + LOG.info("Call insertToscaData for RESOURCE_GROUP where group_uuid = " + getUUID() + " and resource_uuid = " + resourceNodeUuid); + insertToscaData(buildSql("RESOURCE_GROUP", "resource_uuid", resourceNodeUuid, model_yaml, params), null); + insertRelevantAttributeData("group"); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_GROUP table"); + throw new IOException (e); + } + + } + +} 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 69f378796..d4b3344ca 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 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 - 2018 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. @@ -21,22 +21,28 @@ package org.onap.ccsdk.sli.northbound.uebclient; +import java.io.IOException; + import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncNodeModel extends SdncBaseModel { - + + private static final Logger LOG = LoggerFactory + .getLogger(SdncNodeModel.class); + private String serviceUUID = null; private String ecompGeneratedNaming = null; private String [] bindingUuids = null; // Using ASDC TOSCA Parser 17.07 - public SdncNodeModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + public SdncNodeModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) { - super(sdcCsarHelper, nodeTemplate); + super(sdcCsarHelper, nodeTemplate, jdbcDataSource); // extract inpuecompGeneratedNamingts String ecompGeneratedNaming = extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING); @@ -103,6 +109,20 @@ public class SdncNodeModel extends SdncBaseModel { } } + public void insertNetworkModelData () throws IOException { + try { + // Clean up NETWORK_MODEL data for this customization_uuid and service_uuid? + cleanUpExistingToscaData("NETWORK_MODEL", "customization_uuid", getCustomizationUUID()); + cleanUpExistingToscaData("VPN_BINDINGS", "network_customization_uuid", getCustomizationUUID()); + LOG.info("Call insertToscaData for NETWORK_MODEL customizationUUID = " + getCustomizationUUID()); + insertToscaData(getSql(model_yaml), null); + insertToscaData(getVpnBindingsSql(), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the NETWORK_MODEL table"); + throw new IOException (e); + } + } + public String getSql(String model_yaml) { StringBuilder sb = new StringBuilder(); 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 c1efadbdd..4bed2fe76 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 @@ -30,6 +30,8 @@ import org.slf4j.LoggerFactory; public class SdncServiceModel extends SdncBaseModel { private String UUID = null; + private String resourceVendor = null; + private String resourceVendorRelease = null; private String serviceInstanceNamePrefix = null; private String filename = null; @@ -39,9 +41,17 @@ public class SdncServiceModel extends SdncBaseModel { UUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_UUID); - // extract service topology template input data - addParameter("ecomp_naming",extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING)); - addParameter("naming_policy",extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); + // extract ecompGeneratedNaming and namingPolicy from Service Metadata + addParameter("ecomp_naming",extractBooleanValue(metadata, "ecompGeneratedNaming")); + addParameter("naming_policy",extractValue(metadata, "namingPolicy")); + + // extract service topology template input data - ecompGeneratedNaming and namingPolicy moved to Service Metadata + //addParameter("ecomp_naming",extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING)); + //addParameter("naming_policy",extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); + + // extract resourceVendor and resourceVendorRelease for use in SdncServiceProxy class + resourceVendor = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR); + resourceVendorRelease = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE); } public String getServiceUUID() { @@ -50,6 +60,9 @@ public class SdncServiceModel extends SdncBaseModel { public void setServiceUUID(String serviceUUID) { this.UUID = serviceUUID; } + public String getServiceInvariantUUID() { + return "\"" + invariantUUID + "\""; + } public String getServiceInstanceNamePrefix() { return serviceInstanceNamePrefix; } @@ -92,4 +105,20 @@ public class SdncServiceModel extends SdncBaseModel { return sb.toString(); } + public String getResourceVendor() { + return resourceVendor; + } + + public void setResourceVendor(String resourceVendor) { + this.resourceVendor = resourceVendor; + } + + public String getResourceVendorRelease() { + return resourceVendorRelease; + } + + public void setResourceVendorRelease(String resourceVendorRelease) { + this.resourceVendorRelease = resourceVendorRelease; + } + } 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 4ae5acd99..866fd14d7 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,15 +2,15 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 - 2018 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. @@ -40,6 +40,7 @@ import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.sql.SQLException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.LinkedList; @@ -57,12 +58,11 @@ import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathFactory; +import javax.xml.XMLConstants; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.tuple.Pair; -import org.onap.ccsdk.sli.core.dblib.DBResourceManager; -import org.onap.ccsdk.sli.northbound.uebclient.SdncArtifactMap.SdncArtifactType; import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.IComponentDoneStatusMessage; import org.onap.sdc.api.consumer.IDistributionStatusMessage; import org.onap.sdc.api.consumer.INotificationCallback; import org.onap.sdc.api.notification.IArtifactInfo; @@ -72,27 +72,37 @@ import org.onap.sdc.api.results.IDistributionClientDownloadResult; import org.onap.sdc.api.results.IDistributionClientResult; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException; -import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory; -import org.onap.sdc.toscaparser.api.Group; +import org.onap.sdc.tosca.parser.impl.SdcTypes; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.Policy; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.sdc.utils.ArtifactTypeEnum; import org.onap.sdc.utils.DistributionActionResultEnum; import org.onap.sdc.utils.DistributionStatusEnum; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.onap.ccsdk.sli.northbound.uebclient.SdncArtifactMap.SdncArtifactType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; + public class SdncUebCallback implements INotificationCallback { private static final Logger LOG = LoggerFactory .getLogger(SdncUebCallback.class); - private static DBResourceManager jdbcDataSource = null; + protected static DBResourceManager jdbcDataSource = null; private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; - + private static final String COMPONENT_NAME = "SDNC"; + private static final int NUM_PASSES = 2; + + // If any ASDC artifact in a distribution fails to download or deploy send SDC event COMPONENT_DONE_ERROR + // once after the entire distribution is processed. Otherwise, send COMPONENT_DONE_OK. + private static boolean COMPONENT_DOWNLOAD_ERROR = false; + private static boolean COMPONENT_DEPLOY_ERROR = false; + private static boolean CSAR_ARTIFACT_DEPLOY_ERROR = false; private class SdncAuthenticator extends Authenticator { @@ -188,11 +198,13 @@ public class SdncUebCallback implements INotificationCallback { private LinkedList deployList[]; + private static void setJdbcDataSource() throws IOException { - String propPath; + String propPath = null; String propDir = System.getenv(SDNC_CONFIG_DIR); if (propDir == null) { + propDir = "/opt/sdnc/data/properties"; } propPath = propDir + "/dblib.properties"; @@ -209,7 +221,6 @@ public class SdncUebCallback implements INotificationCallback { props.load(new FileInputStream(propFile)); setJdbcDataSource(new DBResourceManager(props)); - } static void setJdbcDataSource(DBResourceManager dbMgr) { @@ -223,10 +234,19 @@ public class SdncUebCallback implements INotificationCallback { } } + private static void loadArtifactMap() { + + } + public SdncUebCallback(IDistributionClient client, SdncUebConfiguration config) { this.client = client; this.config = config; + this.deployList = new LinkedList[NUM_PASSES]; + + for (int i = 0 ; i < NUM_PASSES ; i++) { + this.deployList[i] = new LinkedList(); + } } @Override @@ -234,14 +254,30 @@ public class SdncUebCallback implements INotificationCallback { LOG.info("Received notification : ("+data.getDistributionID()+","+data.getServiceName()+","+data.getServiceVersion()+ ","+data.getServiceDescription() + ")"); + + COMPONENT_DOWNLOAD_ERROR = false; + COMPONENT_DEPLOY_ERROR = false; + CSAR_ARTIFACT_DEPLOY_ERROR = false; + + // TOSCA_TEMPLATE artifact should only be downloaded if TOSCA_CSAR artifact fails due to version non-compliance + IArtifactInfo toscaTemplateArtifact = null; String incomingDirName = config.getIncomingDir(); String archiveDirName = config.getArchiveDir(); - File incomingDir = null; - File archiveDir = null; + File incomingDir = new File(incomingDirName); + File archiveDir = new File(archiveDirName); + + LOG.debug("IncomingDirName is {}", incomingDirName); + + if (!incomingDir.exists()) { + incomingDir.mkdirs(); + } + - LOG.debug("IncomingDirName is {}", incomingDirName); + if (!archiveDir.exists()) { + archiveDir.mkdirs(); + } // Process service level artifacts List artifactList = data.getServiceArtifacts(); @@ -261,8 +297,20 @@ public class SdncUebCallback implements INotificationCallback { { LOG.info("Received artifact " + curArtifact.getArtifactName()); - - handleArtifact(data, data.getServiceName(), null, curArtifact, incomingDir, archiveDir); + + // If artifact is TOSCA_TEMPLATE, don't handle it. We will handle if last TOSCA_CSAR ingestion fails. + if (curArtifact.getArtifactType().contains("TOSCA_TEMPLATE") || curArtifact.getArtifactName().contains(".yml")) { + toscaTemplateArtifact = curArtifact; + } else { + + handleArtifact(data, data.getServiceName(), null, null, curArtifact, incomingDir, archiveDir); + } + } + + // After all artifacts have been processed if CSAR_ARTIFACT_DEPLOY_ERROR is true, download and deploy the TOSCA_TEMPLATE artifact + if (CSAR_ARTIFACT_DEPLOY_ERROR == true) { + LOG.info("TOSCA_CSAR artifact deploy error encountered, downloading TOSCA_TEMPLATE artifact: " + toscaTemplateArtifact.getArtifactName()); + handleArtifact(data, data.getServiceName(), null, null, toscaTemplateArtifact, incomingDir, archiveDir); } } @@ -275,14 +323,12 @@ public class SdncUebCallback implements INotificationCallback { if (artifactList != null) { - incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName()) + "/" - + escapeFilename(curResource.getResourceName())); + incomingDir = new File(incomingDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); if (!incomingDir.exists()) { incomingDir.mkdirs(); } - archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName()) + "/" - + escapeFilename(curResource.getResourceName())); + archiveDir = new File(archiveDirName + "/" + escapeFilename(data.getServiceName()) + "/" + escapeFilename(curResource.getResourceName())); if (!archiveDir.exists()) { archiveDir.mkdirs(); } @@ -291,19 +337,42 @@ public class SdncUebCallback implements INotificationCallback { LOG.info("Received artifact " + curArtifact.getArtifactName()); - handleArtifact(data, data.getServiceName(), curResource.getResourceName(), curArtifact, incomingDir, archiveDir); + handleArtifact(data, data.getServiceName(), curResource.getResourceName(), curResource.getResourceType(), curArtifact, incomingDir, archiveDir); } } } deployDownloadedFiles(incomingDir, archiveDir, data); + + // Send Component Status: COMPONENT_DONE_ERROR or COMPONENT_DONE_OK + LOG.info("Sending Component Status for Distribution: ("+data.getDistributionID()+","+data.getServiceName()+","+data.getServiceVersion()+ + ","+data.getServiceDescription() + ")"); + IDistributionClientResult result = null; + if (COMPONENT_DOWNLOAD_ERROR == true || COMPONENT_DEPLOY_ERROR == true) { + + String errorReason = (COMPONENT_DEPLOY_ERROR == true ? "SDN-C encountered an error deploying an artifact in this distribution" : ""); + errorReason = (COMPONENT_DOWNLOAD_ERROR == true ? "SDN-C encountered an error downloading an artifact in this distribution" : errorReason); + result = client.sendComponentDoneStatus(buildComponentStatusMessage( + client, data, DistributionStatusEnum.COMPONENT_DONE_ERROR), errorReason); + if (result != null) { + LOG.info("Sending Component Status COMPONENT_DONE_ERROR for Distribution result: " + result.getDistributionMessageResult()); + } + } else { + + result = client.sendComponentDoneStatus(buildComponentStatusMessage( + client, data, DistributionStatusEnum.COMPONENT_DONE_OK)); + if (result != null) { + LOG.info("Sending Component Status COMPONENT_DONE_OK for Distribution result: " + result.getDistributionMessageResult()); + } + } + } public void deployDownloadedFiles(File incomingDir, File archiveDir, INotificationData data) { if (incomingDir == null) { - LOG.debug("incomingDir is null - using {}", config.getIncomingDir()); + LOG.debug("incomingDir is null - using {}", config.getIncomingDir()); incomingDir = new File(config.getIncomingDir()); if (!incomingDir.exists()) { @@ -311,8 +380,8 @@ public class SdncUebCallback implements INotificationCallback { } } else { - LOG.debug("incomingDir is not null - it is {}", incomingDir.getPath()); - } + LOG.debug("incomingDir is not null - it is {}", incomingDir.getPath()); + } if (archiveDir == null) { archiveDir = new File(config.getArchiveDir()); @@ -321,27 +390,40 @@ public class SdncUebCallback implements INotificationCallback { archiveDir.mkdirs(); } } - - // Deploy scheduled deployments - int numPasses = config.getMaxPasses(); - - deployList = new LinkedList[numPasses]; - - for (int i = 0 ; i < numPasses ; i++) { - deployList[i] = new LinkedList<>(); - } - LOG.debug("Scanning {} - {} for downloaded files", incomingDir.getPath(), incomingDir.toPath()); + String curFileName = ""; try (DirectoryStream stream = Files.newDirectoryStream(incomingDir.toPath())) { for (Path file: stream) { - handleSuccessfulDownload(null,null, null, null, file.toFile(), archiveDir); + curFileName = file.toString(); + // Skip TOSCA files (csar and yml) if we are deploying files that were downloaded from ASDC (data is not NULL), + // they have already been deployed. If they are still in the incoming directory there was an error during ingestion. + if (data != null && (curFileName.contains(".csar") || curFileName.contains(".yml"))) { + LOG.info("Skipping deploy of file TOSCA file: "+ curFileName + " it has already been handled"); + continue; + } + + try { + handleSuccessfulDownload(null,null, null, null, file.toFile(), archiveDir); + } catch (Exception x) { + COMPONENT_DEPLOY_ERROR = true; + LOG.error("Exception in handleSuccessfulDownload: Cannot process spool file "+ curFileName, x); + } + } - } catch (IOException x) { + } catch (Exception x) { // IOException can never be thrown by the iteration. // In this snippet, it can only be thrown by newDirectoryStream. - LOG.warn("Cannot process spool file", x); + LOG.warn("Cannot process spool file "+ curFileName, x); } + // Deploy scheduled deployments + /*int numPasses = config.getMaxPasses(); + + deployList = new LinkedList[numPasses]; + + for (int i = 0 ; i < numPasses ; i++) { + deployList[i] = new LinkedList(); + }*/ for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) { if (deployList[pass] != null) { @@ -362,9 +444,13 @@ public class SdncUebCallback implements INotificationCallback { IArtifactInfo artifactInfo = artifact.getArtifactInfo(); if ((artifactInfo != null) && (data != null)) { - client.sendDeploymentStatus(buildStatusMessage( + IDistributionClientResult deploymentStatus; + deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( client, data, artifactInfo, deployResult)); + if (deployResult == DistributionStatusEnum.DEPLOY_ERROR) { + COMPONENT_DEPLOY_ERROR = true; + } } } @@ -372,9 +458,8 @@ public class SdncUebCallback implements INotificationCallback { } } - private void handleArtifact(INotificationData data, String svcName, String resourceName, - IArtifactInfo artifact, File incomingDir, File archiveDir) { - + private void handleArtifact(INotificationData data, String svcName, String resourceName, String resourceType, IArtifactInfo artifact, File incomingDir, File archiveDir) { + // Download Artifact IDistributionClientDownloadResult downloadResult = client.download(artifact); @@ -391,26 +476,28 @@ public class SdncUebCallback implements INotificationCallback { return; } - - File spoolFile = new File(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); - boolean writeSucceeded = false; - + File spoolFile = new File(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); + // Save zip if TOSCA_CSAR if (artifact.getArtifactType().contains("TOSCA_CSAR") || artifact.getArtifactName().contains(".csar")) { - try(FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName())) { - outFile.write(payloadBytes, 0, payloadBytes.length); - outFile.close(); + try { + + FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); + outFile.write(payloadBytes, 0, payloadBytes.length); + outFile.close(); writeSucceeded = true; } catch (Exception e) { LOG.error("Unable to save downloaded zip file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); } } else { - String payload = new String(payloadBytes); + + String payload = new String(payloadBytes); - try(FileWriter spoolFileWriter = new FileWriter(spoolFile)) { + try { + FileWriter spoolFileWriter = new FileWriter(spoolFile); spoolFileWriter.write(payload); spoolFileWriter.close(); writeSucceeded = true; @@ -419,8 +506,11 @@ public class SdncUebCallback implements INotificationCallback { } } + if (writeSucceeded && (downloadResult.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS)) { handleSuccessfulDownload(data, svcName, resourceName, artifact, spoolFile, archiveDir); + + } else { handleFailedDownload(data, artifact); } @@ -430,33 +520,22 @@ public class SdncUebCallback implements INotificationCallback { private void handleFailedDownload(INotificationData data, IArtifactInfo relevantArtifact) { // Send Download Status - client.sendDownloadStatus(buildStatusMessage(client, data, - relevantArtifact, DistributionStatusEnum.DOWNLOAD_ERROR)); + client.sendDownloadStatus(buildStatusMessage(client, data, relevantArtifact, DistributionStatusEnum.DOWNLOAD_ERROR)); + COMPONENT_DOWNLOAD_ERROR = true; } private void handleSuccessfulDownload(INotificationData data, String svcName, String resourceName, - IArtifactInfo artifact, File inpSpoolFile, File archiveDir) { + IArtifactInfo artifact, File spoolFile, File archiveDir) { if ((data != null) && (artifact != null)) { // Send Download Status - client.sendDownloadStatus(buildStatusMessage(client, data, artifact, DistributionStatusEnum.DOWNLOAD_OK)); + IDistributionClientResult sendDownloadStatus = client + .sendDownloadStatus(buildStatusMessage(client, data, artifact, DistributionStatusEnum.DOWNLOAD_OK)); } // If an override file exists, read that instead of the file we just downloaded ArtifactTypeEnum artifactEnum = ArtifactTypeEnum.YANG_XML; - File spoolFile = inpSpoolFile; - boolean toscaCsarType = false; - if (artifact != null) { - String artifactTypeString = artifact.getArtifactType(); - if (artifactTypeString.contains("TOSCA_CSAR")) { - toscaCsarType = true; - } - } else { - if (spoolFile.toString().contains(".csar")) { - toscaCsarType = true; - } - } String overrideFileName = config.getOverrideFile(); if ((overrideFileName != null) && (overrideFileName.length() > 0)) { File overrideFile = new File(overrideFileName); @@ -468,21 +547,20 @@ public class SdncUebCallback implements INotificationCallback { } - if (toscaCsarType) { - processToscaCsar (data, artifact, spoolFile, archiveDir); - - try { - Path source = spoolFile.toPath(); - Path targetDir = archiveDir.toPath(); - - Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); - } - + // If the artifact is a TOSCA artifact, don't schedule a deployment to SDN-C REST intfc, process it in ueb-listener + if (artifactIsTosca(artifact, spoolFile) == true) + { + handleToscaArtifact (data, svcName, resourceName, artifact, spoolFile, archiveDir); return; } + + processSpoolFile (data, svcName, resourceName, artifact, spoolFile, archiveDir); + } + + protected void processSpoolFile(INotificationData data, String svcName, String resourceName, + IArtifactInfo artifact, File spoolFile, File archiveDir) { + // Process spool file Document spoolDoc = null; File transformedFile = null; @@ -498,20 +576,33 @@ public class SdncUebCallback implements INotificationCallback { if (transformedFile != null) { try { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - DocumentBuilder db = dbf.newDocumentBuilder(); - spoolDoc = db.parse(transformedFile); + try { + + DocumentBuilderFactory dbf = DocumentBuilderFactory + .newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + DocumentBuilder db = dbf.newDocumentBuilder(); + + spoolDoc = db.parse(transformedFile); + } catch (Exception e) { + LOG.error( + "Caught exception trying to parse transformed XML file " + + transformedFile.getAbsolutePath(), e); + } + } catch (Exception e) { - LOG.error("Caught exception trying to parse transformed XML file {}", - transformedFile.getAbsolutePath(), e); + LOG.error("Caught exception trying to deploy file", e); } } - + ArtifactTypeEnum artifactEnum = ArtifactTypeEnum.YANG_XML; if (spoolDoc != null) { // Analyze file type - SdncArtifactType artifactType = analyzeFileType(artifactEnum, spoolFile, spoolDoc); + SdncArtifactType artifactType = analyzeFileType(artifactEnum, + spoolFile, spoolDoc); if (artifactType != null) { @@ -530,79 +621,115 @@ public class SdncUebCallback implements INotificationCallback { LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); } } + + } + private void handleToscaArtifact (INotificationData data, String svcName, String resourceName, IArtifactInfo artifact, + File spoolFile, File archiveDir) { + + DistributionStatusEnum deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + if ((artifact != null && artifact.getArtifactType().contains("TOSCA_TEMPLATE")) || spoolFile.toString().contains(".yml")) { + deployStatus = processToscaYaml (spoolFile); + } else if ((artifact != null && artifact.getArtifactType().contains("TOSCA_CSAR")) || spoolFile.toString().contains(".csar")) { + deployStatus = processToscaCsar (data, svcName, resourceName, artifact, spoolFile, archiveDir); + // if parser error on CSAR, process the TOSCA_TEMPLATE artifact last + if (deployStatus.equals(DistributionStatusEnum.DEPLOY_ERROR)) { + CSAR_ARTIFACT_DEPLOY_ERROR = true; + } + + } else { + LOG.error("handleToscaArtifact: Encountered unknown TOSCA artifact"); + } + + if (deployStatus.equals(DistributionStatusEnum.DEPLOY_OK)) { + LOG.info("Update to SDN-C succeeded"); + + try { + Path source = spoolFile.toPath(); + Path targetDir = archiveDir.toPath(); + Files.move(source, targetDir.resolve(source.getFileName()), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + LOG.warn("Could not move "+spoolFile.getAbsolutePath()+" to "+archiveDir.getAbsolutePath(), e); + } + + } else { + LOG.info("Update to SDN-C failed"); + COMPONENT_DEPLOY_ERROR = true; + } + + // Send deployment status for ingestion + if ((artifact != null) && (data != null)) { + client.sendDeploymentStatus(buildStatusMessage(client, data, artifact,deployStatus)); + } } + + protected DistributionStatusEnum processToscaYaml(File spoolFile) { + return DistributionStatusEnum.DEPLOY_OK; + } - private void processToscaCsar(INotificationData data, - IArtifactInfo artifact, File spoolFile, File archiveDir) { + private DistributionStatusEnum processToscaCsar(INotificationData data, String svcName, String resourceName, IArtifactInfo artifact, + File spoolFile, File archiveDir) { + // Use ASDC Dist Client 1.1.5 with TOSCA parsing APIs to extract relevant TOSCA model data // TOSCA data extraction flow 1707: // Use ASDC dist-client to get yaml string - not yet available String model_yaml = null; LOG.info("Process TOSCA CSAR file: "+spoolFile.toString()); - - SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); ISdcCsarHelper sdcCsarHelper = null; + DistributionStatusEnum deployStatus = DistributionStatusEnum.DEPLOY_OK; + try { + SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath()); } catch (SdcToscaParserException e) { LOG.error("Could not create SDC TOSCA Parser ", e); - return; - } + return DistributionStatusEnum.DEPLOY_ERROR; + } // Ingest Service Data - 1707 Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata(); SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata); - serviceModel.setFilename(spoolFile.toString().substring(spoolFile - .toString().lastIndexOf('/')+1)); // will be csar file name + serviceModel.setFilename(spoolFile.toString().substring(spoolFile.toString().lastIndexOf("/")+1)); // will be csar file name serviceModel.setServiceInstanceNamePrefix(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).substring(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).lastIndexOf(".")+1)); try { cleanUpExistingToscaServiceData(serviceModel.getServiceUUID()); - LOG.info("Call insertToscaData for SERVICE_MODEL serviceUUID = " + serviceModel.getServiceUUID()); - insertToscaData(serviceModel.getSql(model_yaml)); + LOG.info("Call insertToscaData for SERVICE_MODEL where service_uuid = " + serviceModel.getServiceUUID()); + insertToscaData(serviceModel.getSql(model_yaml), null); } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e); - + LOG.error("Could not insert Tosca CSAR data into the SERVICE_MODEL table ", e); + return DistributionStatusEnum.DEPLOY_ERROR; + } - + // Ingest Network (VL) Data - 1707 List vlNodeTemplatesList = sdcCsarHelper.getServiceVlList(); for (NodeTemplate nodeTemplate : vlNodeTemplatesList) { - SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, nodeTemplate); + SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, nodeTemplate, jdbcDataSource); nodeModel.setServiceUUID(serviceModel.getServiceUUID()); - nodeModel.setEcompGeneratedNaming(SdncBaseModel.extractBooleanInputDefaultValue(sdcCsarHelper, SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING));//service_naming#default#ecomp_generated_naming try { - cleanUpExistingToscaData("NETWORK_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); - cleanUpExistingToscaData("VPN_BINDINGS", "network_customization_uuid", nodeModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for NETWORK_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); - // using ASDC dist-client use method for get yaml string - insertToscaData(nodeModel.getSql(model_yaml)); - insertToscaData(nodeModel.getVpnBindingsSql()); + nodeModel.insertNetworkModelData(); } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; } } - + // Ingest Allotted Resource Data - 1707 List arNodeTemplatesList = sdcCsarHelper.getAllottedResources(); for (NodeTemplate nodeTemplate : arNodeTemplatesList) { - SdncARModel nodeModel = new SdncARModel (sdcCsarHelper, nodeTemplate); - + try { - cleanUpExistingToscaData("ALLOTTED_RESOURCE_MODEL", "customization_uuid", nodeModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for ALLOTTED_RESOURCE_MODEL customizationUUID = " + nodeModel.getCustomizationUUID()); - // using ASDC dist-client use method for get yaml string - insertToscaData(nodeModel.getSql("ALLOTTED_RESOURCE_MODEL", model_yaml)); + SdncARModel nodeModel = new SdncARModel (sdcCsarHelper, nodeTemplate, jdbcDataSource); + nodeModel.insertAllottedResourceModelData (); } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the NETWORK_MODEL table ", e); + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; } } @@ -610,133 +737,47 @@ public class SdncUebCallback implements INotificationCallback { List vfNodeTemplatesList = sdcCsarHelper.getServiceVfList(); for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { - SdncVFModel vfNodeModel = new SdncVFModel (sdcCsarHelper, nodeTemplate); - + + SdncVFModel vfNodeModel = null; try { - cleanUpExistingToscaData("VF_MODEL", "customization_uuid", vfNodeModel.getCustomizationUUID()) ; - LOG.info("Call insertToscaData for VF_MODEL customizationUUID = " + vfNodeModel.getCustomizationUUID()); - insertToscaData(vfNodeModel.getSql("VF_MODEL", model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_MODEL table ", e); - } - - // For each VF, insert VF_MODULE_MODEL data - List vfModules = sdcCsarHelper.getVfModulesByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); - for (Group group : vfModules){ - SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, group); - - try { - cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_MODULE_MODEL customizationUUID = " + vfModuleModel.getCustomizationUUID()); - insertToscaData(vfModuleModel.getSql("VF_MODULE_MODEL", model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_MODULE_MODEL table ", e); - } - - // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data - // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. - // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING - List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); // not yet available - for (NodeTemplate vfcNode : groupMembers){ - SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); - - try { - cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING customizationUUID = " + vfModuleModel.getCustomizationUUID()); - insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + - vfModuleModel.getCustomizationUUID() + ", " + vfcModel.getCustomizationUUID() + ", \"" + vfcModel.getVmType() + "\", \"" + vfcModel.getVmCount() + "\")"); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_MODULE_TO_VFC_MAPPING table ", e); - } - - } - - } - - // For each VF, insert VFC_MODEL data - List vfcNodes = sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); - for (NodeTemplate vfcNode : vfcNodes){ - SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode); - - try { - cleanUpExistingToscaData("VFC_MODEL", "customization_uuid", vfcModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VFC_MODEL customizationUUID = " + vfcModel.getCustomizationUUID()); - insertToscaData(vfcModel.getSql("VFC_MODEL", model_yaml)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VFC_MODEL table ", e); - } + vfNodeModel = new SdncVFModel (sdcCsarHelper, nodeTemplate, jdbcDataSource, config); + vfNodeModel.setServiceUUID(serviceModel.getServiceUUID()); + vfNodeModel.setServiceInvariantUUID(serviceModel.getServiceInvariantUUID()); + vfNodeModel.insertData(); + } catch (IOException e) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + } + + // For each VF, insert VNF Configuration data + DistributionStatusEnum vnfConfigDeployStatus = customProcessVnfConfig(sdcCsarHelper, vfNodeModel, jdbcDataSource); + if (vnfConfigDeployStatus == DistributionStatusEnum.DEPLOY_ERROR) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; } - // For each VF, insert VF_TO_NETWORK_ROLE_MAPPING data - List cpNodes = sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()); - for (NodeTemplate cpNode : cpNodes){ - - // Insert into VF_TO_NETWORK_ROLE_MAPPING vf_customization_uuid and network_role - String cpNetworkRole = sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, "network_role_tag"); - - try { - cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", vfNodeModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING vfCustomizationUUID = " + vfNodeModel.getCustomizationUUID()); - insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + - vfNodeModel.getCustomizationUUID() + ", \"" + cpNetworkRole + "\")"); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VF_TO_NETWORK_ROLE_MAPPING table ", e); - } - - // Insert VFC_TO_NETWORK_ROLE_MAPPING data - Map mappingParams = new HashMap<>(); - //String cpNetworkRoleTag = "\"" + sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLETAG) + "\""; - // extract network_role, network_role_tag and virtual_binding from this cpNode - SdncBaseModel.addParameter("network_role", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role"), mappingParams); - SdncBaseModel.addParameter("network_role_tag", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role_tag"), mappingParams); - String virtualBinding = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "requirements#virtualBinding") + "\""; - - // get list of cpNodes and vfcNodes with matching virtualBinding - List> matchList = sdcCsarHelper.getNodeTemplatePairsByReqName(sdcCsarHelper.getCpListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), sdcCsarHelper.getVfcListByVf(vfNodeModel.getCustomizationUUIDNoQuotes()), virtualBinding); - for (Pair match : matchList) { // should be 1 match? - - // extract values from the left "CP" Node - SdncBaseModel.addParameter("ipv4_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); - - SdncBaseModel.addParameter("ipv4_ip_version", "dummy_ipv4_vers", mappingParams); - SdncBaseModel.addParameter("ipv6_use_dhcp", SdncBaseModel.extractBooleanValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_DHCPENABLED), mappingParams); - - SdncBaseModel.addParameter("ipv6_ip_version", "dummy_ipv6_vers", mappingParams); - - // extract values from the right "VFC" Node - String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetaData(), "customization_uuid") + "\""; - SdncBaseModel.addParameter("vm_type", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_VMTYPE), mappingParams); - SdncBaseModel.addIntParameter("ipv4_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); - SdncBaseModel.addIntParameter("ipv6_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams); - - try { - cleanUpExistingToscaData("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid); - LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING vfcCustomizationUUID = " + vfcCustomizationUuid); - insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", vfcCustomizationUuid, "", mappingParams)); - } catch (IOException e) { - LOG.error("Could not insert Tosca YAML data into the VFC_TO_NETWORK_ROLE_MAPPING table ", e); - } - - } - - } // CP loop - } // VF loop - - - - if ((artifact != null) && (data != null)) { - LOG.info("Update to SDN-C succeeded"); - IDistributionClientResult deploymentStatus; - deploymentStatus = client.sendDeploymentStatus(buildStatusMessage( - client, data, artifact, - DistributionStatusEnum.DEPLOY_OK)); + + DistributionStatusEnum complexToscaDeployStatus = customProcessComplexTosca(sdcCsarHelper, config, jdbcDataSource, serviceModel, + data, svcName, resourceName, artifact, archiveDir); + if (complexToscaDeployStatus == DistributionStatusEnum.DEPLOY_ERROR) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; } - + + return deployStatus; } - private void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException + protected DistributionStatusEnum customProcessVnfConfig(ISdcCsarHelper sdcCsarHelper, + SdncVFModel vfNodeModel, DBResourceManager jdbcDataSource2) { + return DistributionStatusEnum.DEPLOY_OK; + } + + protected DistributionStatusEnum customProcessComplexTosca(ISdcCsarHelper sdcCsarHelper, + SdncUebConfiguration config, DBResourceManager jdbcDataSource2, SdncServiceModel serviceModelINotification, + INotificationData data, String svcName, String resourceName, IArtifactInfo artifact, File archiveDir) { + return DistributionStatusEnum.DEPLOY_OK; + } + + protected void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException { if (jdbcDataSource == null) { @@ -760,7 +801,7 @@ public class SdncUebCallback implements INotificationCallback { } - private void cleanUpExistingToscaServiceData(String serviceUUID) throws IOException + protected void cleanUpExistingToscaServiceData(String serviceUUID) throws IOException { if (jdbcDataSource == null) { @@ -785,7 +826,7 @@ public class SdncUebCallback implements INotificationCallback { } - private void insertToscaData(String toscaDataString) throws IOException + protected void insertToscaData(String toscaDataString, ArrayList arguments) throws IOException { LOG.debug("insertToscaData: " + toscaDataString); @@ -794,10 +835,11 @@ public class SdncUebCallback implements INotificationCallback { } try { - jdbcDataSource.writeData(toscaDataString, null, null); + jdbcDataSource.writeData(toscaDataString, arguments, null); } catch (SQLException e) { - LOG.error("Could not insert Tosca YAML data into the database ", e); + LOG.error("Could not insert Tosca YAML data into the database "); + throw new IOException (e); } } @@ -845,37 +887,39 @@ public class SdncUebCallback implements INotificationCallback { } private void scheduleDeployment(SdncArtifactType type, String svcName, String resourceName, IArtifactInfo artifactInfo, String spoolFileName, File spoolFile) { + if (type.getPass() < deployList.length) { if (artifactInfo != null) { - LOG.debug("Scheduling " + artifactInfo.getArtifactName() + " version " + artifactInfo.getArtifactVersion() + " for deployment"); + LOG.debug("Scheduling "+artifactInfo.getArtifactName()+" version "+artifactInfo.getArtifactVersion()+" for deployment"); - deployList[type.getPass()].add(new org.onap.ccsdk.sli.northbound.uebclient.SdncUebCallback.DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactInfo, spoolFile)); } else { SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS");//dd/MM/yyyy Date now = new Date(); String artifactVersion = sdfDate.format(now); - LOG.debug("Scheduling " + spoolFileName + " version " + artifactVersion + " for deployment"); - deployList[type.getPass()].add(new org.onap.ccsdk.sli.northbound.uebclient.SdncUebCallback.DeployableArtifact(type, svcName, resourceName, spoolFileName, - artifactVersion, spoolFile)); + LOG.debug("Scheduling "+spoolFileName+" version "+artifactVersion+" for deployment"); + String artifactName = spoolFileName; + if (artifactInfo != null) { + artifactName = artifactInfo.getArtifactName(); + } + deployList[type.getPass()].add(new DeployableArtifact(type, svcName, resourceName, artifactName, artifactVersion, spoolFile)); } } else { - LOG.info("Pass for type " + type.getTag() + " is " + type.getPass() + " which is not <= " + deployList.length); + LOG.info("Pass for type "+type.getTag()+" is "+type.getPass()+" which is not <= "+deployList.length); } } private DistributionStatusEnum deploySpoolFile(DeployableArtifact artifact) { - DistributionStatusEnum deployResult; + DistributionStatusEnum deployResult = DistributionStatusEnum.DEPLOY_OK; - StringBuilder msgBuffer = new StringBuilder(); + StringBuffer msgBuffer = new StringBuffer(); String namespace = config.getAsdcApiNamespace(); - if ((namespace == null) || (namespace.length() == 0)) { - namespace="com:att:sdnctl:asdcapi"; - } + //String namespace = artifact.getType().getNamespace(); msgBuffer.append(""+artifactName+"\n"); + msgBuffer.append(""+artifact.getArtifactVersion()+"\n"); + } + + try { + BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile())); - try (BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile()))){ String curLine = rdr.readLine(); - while (curLine != null) { + while (curLine != null) { + if (!curLine.startsWith("") || curLine.contains("")) { + skipThisLine = true; + } + } + + if (!skipThisLine) { + msgBuffer.append(curLine+"\n"); + } } curLine = rdr.readLine(); } + rdr.close(); + } catch (Exception e) { LOG.error("Could not process spool file "+artifact.getFile().getName(), e); - return DistributionStatusEnum.DEPLOY_ERROR; + return(DistributionStatusEnum.DEPLOY_ERROR); } msgBuffer.append("\n"); @@ -963,11 +1025,12 @@ public class SdncUebCallback implements INotificationCallback { final IDistributionClient client, final INotificationData data, final IArtifactInfo relevantArtifact, final DistributionStatusEnum status) { - IDistributionStatusMessage statusMessage = new IDistributionStatusMessage() { + IDistributionStatusMessage statusMessage = new IDistributionStatusMessage() { @Override public long getTimestamp() { - return System.currentTimeMillis(); + long currentTimeMillis = System.currentTimeMillis(); + return currentTimeMillis; } @Override @@ -994,6 +1057,42 @@ public class SdncUebCallback implements INotificationCallback { } + public static IComponentDoneStatusMessage buildComponentStatusMessage( + final IDistributionClient client, final INotificationData data, + final DistributionStatusEnum status) { + IComponentDoneStatusMessage statusMessage = new IComponentDoneStatusMessage() { + + @Override + public long getTimestamp() { + long currentTimeMillis = System.currentTimeMillis(); + return currentTimeMillis; + } + + @Override + public DistributionStatusEnum getStatus() { + return status; + } + + @Override + public String getDistributionID() { + return data.getDistributionID(); + } + + @Override + public String getConsumerID() { + return client.getConfiguration().getConsumerID(); + } + + @Override + public String getComponentName() { + // TODO Auto-generated method stub + return COMPONENT_NAME; + } + }; + return statusMessage; + + } + private HttpURLConnection getRestXmlConnection(String urlString, String method) throws IOException { URL sdncUrl = new URL(urlString); @@ -1027,20 +1126,27 @@ public class SdncUebCallback implements INotificationCallback { String sdncResp = odlConn.send("POST", "application/xml", new String(msgBytes)); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + DocumentBuilder db = dbf.newDocumentBuilder(); - response = db.parse(new ByteArrayInputStream(sdncResp.getBytes())); } catch (Exception e) { LOG.error("Caught exception posting to ODL tier", e); } - return response; + return(response); } private File applyXslts(File srcFile) { + Document doc = null; + + File inFile = srcFile; File outFile = null; @@ -1057,6 +1163,9 @@ public class SdncUebCallback implements INotificationCallback { outFile = File.createTempFile("tmp", "xml"); TransformerFactory factory = TransformerFactory.newInstance(); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + //factory.setFeature("http://xml.org/sax/features/external-general-entities", false); -- breaks transform + //factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); Source xslt = new StreamSource(new File(xsltPath)); Transformer transformer = factory.newTransformer(xslt); Source text = new StreamSource(inFile); @@ -1081,12 +1190,12 @@ public class SdncUebCallback implements INotificationCallback { } private String escapeFilename(String str) { + if (str == null) { + str = ""; + } - if (str == null) { - str = ""; - } - StringBuilder retval = new StringBuilder(); - + StringBuffer retval = new StringBuffer(); + for (int i = 0 ; i < str.length() ; i++) { char curchar = str.charAt(i); if (Character.isJavaIdentifierPart(curchar)) { @@ -1098,4 +1207,26 @@ public class SdncUebCallback implements INotificationCallback { } + private boolean artifactIsTosca(IArtifactInfo artifact, File spoolFile) { + + boolean toscaYamlType = false; + boolean toscaCsarType = false; + if (artifact != null) { + String artifactTypeString = artifact.getArtifactType(); + if (artifactTypeString.contains("TOSCA_TEMPLATE")) { + toscaYamlType = true; + } else if (artifactTypeString.contains("TOSCA_CSAR")) { + toscaCsarType = true; + } + } else { + if (spoolFile.toString().contains(".yml")) { + toscaYamlType = true; + } else if (spoolFile.toString().contains(".csar")) { + toscaCsarType = true; + } + } + + return (toscaYamlType||toscaCsarType ? true : false); + } + } 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 a3345c168..35639b366 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,15 +2,15 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 - 2018 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. @@ -21,38 +21,271 @@ package org.onap.ccsdk.sli.northbound.uebclient; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncVFCModel extends SdncBaseModel { - + private static final Logger LOG = LoggerFactory .getLogger(SdncVFCModel.class); - + private String vmType = null; private String vmCount = null; - public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - - super(sdcCsarHelper, nodeTemplate); + public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) { + super(sdcCsarHelper, nodeTemplate, jdbcDataSource); + // extract properties - vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPE); - if ((vmType == null) || (vmType.length() == 0)) { - vmType = extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); + addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, "nfc_naming#ecomp_generated_naming")); + addParameter("naming_policy", extractValue (nodeTemplate, "nfc_naming#naming_policy")); + vmCount = extractValue (nodeTemplate, "service_template_filter#count"); // need path to vm_count, extracted as service_template_filter#count + if (vmCount.isEmpty()) { + vmCount = "0"; // vm_count can not be null } - //vmCount = extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMCOUNT); - need path to vm_count - vmCount = "1"; - addParameter("vm_type", vmType); - addParameter("vm_type_tag", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG)); - addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_ECOMPGENERATEDNAMING)); - addParameter("naming_policy", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VFCNAMING_NAMINGPOLICY)); - addParameter("nfc_naming_code", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFCCODE)); + vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); + addParameter("vm_type", vmType); // populate vm_type with vm_type_tag value + addParameter("vm_type_tag", vmType); + addParameter("nfc_naming_code", extractValue (nodeTemplate, "nfc_naming_code")); + addParameter("nfc_function", extractValue (nodeTemplate, "nfc_function")); + addParameter("high_availability", extractValue (nodeTemplate, "high_availablity")); + addParameter("vm_image_name", extractValue (nodeTemplate, "vm_image_name")); + addParameter("vm_flavor_name", extractValue (nodeTemplate, "vm_flavor_name")); + addParameter("nfc_naming", extractValue (nodeTemplate, "nfc_naming")); + addParameter("min_instances", extractValue (nodeTemplate, "min_instances")); + addParameter("max_instances", extractValue (nodeTemplate, "max_instances")); } + public void insertVFCModelData () throws IOException { + try { + cleanUpExistingToscaData("VFC_MODEL", "customization_uuid", getCustomizationUUID()); + LOG.info("Call insertToscaData for VFC_MODEL where customization_uuid = " + getCustomizationUUID()); + insertToscaData(buildSql("VFC_MODEL", model_yaml), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VFC_MODEL table"); + throw new IOException (e); + } + + } + + public void insertVFCtoNetworkRoleMappingData (NodeTemplate vfcNode) throws IOException { + + // For each VFC node, get CP properties to insert into VFC_TO_NETWORK_ROLE_MAPPING + // VFC_TO_NETWORK_ROLE_MAPPING: vfc_customization_uuid, network_role, network_role_tag, vm_type, ipv4_count, ipv6_count, + // ipv4_use_dhcp, ipv6_use_dhcp, ipv4_ip_version, ipv6_ip_version, extcp_subnetpool_id + Map> cpPropertiesMap = sdcCsarHelper.getCpPropertiesFromVfcAsObject(vfcNode); + + // DEBUG only + if (cpPropertiesMap != null && !cpPropertiesMap.toString().contentEquals("{}")) { + LOG.info("getCpPropertiesFromVfcAsObject for vfc_customization_uuid " + this.getCustomizationUUID() + ": " + cpPropertiesMap.toString()); + } + + // Clean up all VFC_TO_NETWORK_ROLE_MAPPING data for this VFC node + try { + cleanUpExistingToscaData("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", getCustomizationUUID()); + } catch (IOException e) { + LOG.error("Could not clean up data in VFC_TO_NETWORK_ROLE_MAPPING table ", e); + } + + // There will be a cpPropertiesMap entry for each CP which will contain a map of properties to be inserted into VFC_TO_NETWORK_ROLE_MAPPING + // There can be multiple insertions per CP: + // Insert once for each unique IP Version / Subnet Role combination per CP (network_role) + // If there are IPV4 and IPV6 ip_requirements elements that have the same subnet_role (within a CP) combine those parameters for one insert + for (String nodeMapKey : cpPropertiesMap.keySet()) { // there will be one entry in this map per CP (network_role) + LOG.debug("node key = " + nodeMapKey); + Map propsMap = cpPropertiesMap.get(nodeMapKey); + Map commonParams = new HashMap(); // non-IP Version specific parameters + + // Get vm_type from VFC node + SdncBaseModel.addParameter("vm_type", getVmType(), commonParams); + + // Extract non-IP Version specific parameters + String networkRole = nullCheck(propsMap.get("network_role")).isEmpty() ? "default-network-role" : nullCheck(propsMap.get("network_role")); + SdncBaseModel.addParameter("network_role", networkRole, commonParams); // can not be null + SdncBaseModel.addParameter("network_role_tag", nullCheck(propsMap.get("network_role_tag")), commonParams); + SdncBaseModel.addParameter("extcp_subnetpool_id", nullCheck(propsMap.get("subnetpoolid")), commonParams); + String subinterfaceIndicator = nullCheck(propsMap.get("subinterface_indicator")); + if (!subinterfaceIndicator.isEmpty()) { + SdncBaseModel.addParameter("subinterface_indicator", subinterfaceIndicator.contains("true") ? "Y" : "N", commonParams); // boolean Y|N + } + + // Extract IP Version specific parameters + String ipRequirementsString = nullCheck(propsMap.get("ip_requirements")); + //ArrayList> ipPropsList = (ArrayList>) propsMap.get("ip_requirements"); + ArrayList> ipPropsList = new ArrayList>(); + + if (!ipRequirementsString.equals("{}")) { + ipPropsList = (ArrayList>) propsMap.get("ip_requirements"); + } + + // Build lists of all IPV4 and IPV6 ip_requirements elements + ArrayList> ipv4PropParamsList = new ArrayList>(); + ArrayList> ipv6PropParamsList = new ArrayList>(); + + if (ipPropsList != null) { + for (Map ipPropMap : ipPropsList) { + //LOG.info("ip_requirements prop map = " + nullCheck(ipPropMap)); + + String ipVersion = nullCheck(ipPropMap.get("ip_version")); + if (ipVersion == null) { + LOG.error("SdncVFCModel: ipVersion not included in ip_requirements element"); + continue; + } + + String subnetRole = nullCheck(ipPropMap.get("subnet_role")); + + if (ipVersion.contains("4")) { + + // If we have already encountered this subnetRole for IPV4, skip this ip_requirements element + if (!ipPropParamsMapContainsSubnetRole (ipv4PropParamsList, subnetRole)) { + + Map ipv4PropParams = new HashMap(); + SdncBaseModel.addParameter("ipv4_ip_version", ipVersion, ipv4PropParams); + SdncBaseModel.addParameter("ipv4_use_dhcp", nullCheck(ipPropMap.get("dhcp_enabled")).contains("true") ? "Y" : "N", ipv4PropParams); + Map ipCountRequired = (Map)ipPropMap.get("ip_count_required"); + if (ipCountRequired != null && ipCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv4_count", nullCheck(ipCountRequired.get("count")), ipv4PropParams); + } + Map floatingIpCountRequired = (Map)ipPropMap.get("floating_ip_count_required"); + if (floatingIpCountRequired != null && floatingIpCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv4_floating_count", nullCheck(floatingIpCountRequired.get("count")), ipv4PropParams); + } + SdncBaseModel.addParameter("ipv4_address_plan_name", nullCheck(ipPropMap.get("ip_address_plan_name")), ipv4PropParams); + SdncBaseModel.addParameter("ipv4_vrf_name", nullCheck(ipPropMap.get("vrf_name")), ipv4PropParams); + SdncBaseModel.addParameter("subnet_role", nullCheck(ipPropMap.get("subnet_role")), ipv4PropParams); + + ipv4PropParamsList.add(ipv4PropParams); + + } else { + LOG.error("SdncVFCModel: Additional V4 ip-requirements element encountered for this subnet_role: ", subnetRole); + } + + } else if (ipVersion.contains("6")) { + + // If we have already encountered this subnetRole for IPV6, skip this ip_requirements element + if (!ipPropParamsMapContainsSubnetRole (ipv6PropParamsList, subnetRole)) { + + Map ipv6PropParams = new HashMap(); + SdncBaseModel.addParameter("ipv6_ip_version", ipVersion, ipv6PropParams); + SdncBaseModel.addParameter("ipv6_use_dhcp", nullCheck(ipPropMap.get("dhcp_enabled")).contains("true") ? "Y" : "N", ipv6PropParams); + Map ipCountRequired = (Map)ipPropMap.get("ip_count_required"); + if (ipCountRequired != null && ipCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv6_count", nullCheck(ipCountRequired.get("count")), ipv6PropParams); + } + Map floatingIpCountRequired = (Map)ipPropMap.get("floating_ip_count_required"); + if (floatingIpCountRequired != null && floatingIpCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv6_floating_count", nullCheck(floatingIpCountRequired.get("count")), ipv6PropParams); + } + SdncBaseModel.addParameter("ipv6_address_plan_name", nullCheck(ipPropMap.get("ip_address_plan_name")), ipv6PropParams); + SdncBaseModel.addParameter("ipv6_vrf_name", nullCheck(ipPropMap.get("vrf_name")), ipv6PropParams); + SdncBaseModel.addParameter("subnet_role", nullCheck(ipPropMap.get("subnet_role")), ipv6PropParams); + + ipv6PropParamsList.add(ipv6PropParams); + + } else { + LOG.error("SdncVFCModel: Additional V6 ip-requirements element encountered for this subnetRole: ", subnetRole); + } + + } else { + LOG.error("SdncVFCModel: invalid IP version encountered: ", ipVersion); + } + + } // for each ip-requirements element + + } // ipPropsList null check + + // After all Common and IP Version specific parameters are extracted, insert IPV4 and IPV6 data separately + // Insert IPV4 data + for (Map ipv4PropParams: ipv4PropParamsList) { + + Map mappingParams = new HashMap(); // final list for single insertion + addParamsToMap(commonParams, mappingParams); + addParamsToMap(ipv4PropParams, mappingParams); + + // Insert ipv4PropParams into VFC_TO_NETWORK_ROLE_MAPPING + try { + LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING where vfc_customization_uuid = " + getCustomizationUUID()); + addRequiredParameters(mappingParams); + insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", getCustomizationUUID(), "", mappingParams), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VFC_TO_NETWORK_ROLE_MAPPING table"); + throw new IOException (e); + } + + } + + // Insert IPV6 data + for (Map ipv6PropParams: ipv6PropParamsList) { + + Map mappingParams = new HashMap(); // final list for single insertion + addParamsToMap(commonParams, mappingParams); + addParamsToMap(ipv6PropParams, mappingParams); + + // Insert ipv6PropParams into VFC_TO_NETWORK_ROLE_MAPPING + try { + LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING where vfc_customization_uuid = " + getCustomizationUUID()); + addRequiredParameters(mappingParams); + insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", getCustomizationUUID(), "", mappingParams), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VFC_TO_NETWORK_ROLE_MAPPING table"); + throw new IOException (e); + } + + } + + } // Outer map loop - one per ExtCP + + } + + protected boolean ipPropParamsMapContainsSubnetRole (ArrayList> ipPropParamsList, String subnetRole) { + + boolean subnetRoleFound = false; + + if (subnetRole != null && !subnetRole.isEmpty()) { + for (Map ipPropMap : ipPropParamsList) { + if (ipPropMap.get("subnet_role").contentEquals(subnetRole)) { + return true; + } + } + } + return subnetRoleFound; + } + + private Map getIpPropMapWithMatchingSubnetRole (ArrayList> ipPropParamsList, String subnetRole) { + + Map ipPropMapMatch = new HashMap(); + + if (subnetRole != null) { + for (Map ipPropMap : ipPropParamsList) { + if (nullCheck(ipPropMap.get("subnet_role")) == subnetRole) { + return ipPropMap; + } + } + } + return ipPropMapMatch; + } + + private void addRequiredParameters (Map mappingParams) { + + // Add parameters which can not be null if they have not already been added - network_role, ipv4_count, ipv6_count + String ipvCountDefault = "0"; + if (!mappingParams.containsKey("ipv4_count")) { + SdncBaseModel.addParameter("ipv4_count", ipvCountDefault, mappingParams); + } + if (!mappingParams.containsKey("ipv6_count")) { + SdncBaseModel.addParameter("ipv6_count", ipvCountDefault, mappingParams); + } + } + public String getVmType() { return vmType; } 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 41b43c4c9..95f9a0d31 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,15 +2,15 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 - 2018 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. @@ -21,36 +21,292 @@ package org.onap.ccsdk.sli.northbound.uebclient; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.Group; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.Policy; import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SdncVFModel extends SdncBaseModel { - + private static final Logger LOG = LoggerFactory .getLogger(SdncVFModel.class); - public SdncVFModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { + private String vendor = null; + private String vendorModelDescription = null; + private String nfNamingCode = null; + private String serviceUUID = null; + private String serviceInvariantUUID = null; + + public SdncVFModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { - super(sdcCsarHelper, nodeTemplate); + super(sdcCsarHelper, nodeTemplate, jdbcDataSource, config); // extract metadata Metadata metadata = nodeTemplate.getMetaData(); addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); - addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR)); - addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); - + vendor = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR); + addParameter("vendor", vendor); + vendorModelDescription = extractValue (metadata, "description"); + addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); + // extract properties addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, "nf_naming#ecomp_generated_naming")); addParameter("naming_policy", extractValue(nodeTemplate, "nf_naming#naming_policy")); addParameter("nf_type", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); addParameter("nf_role", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)); - addParameter("nf_code", extractValue( nodeTemplate, "nf_naming_code")); + nfNamingCode = extractValue(nodeTemplate, "nf_naming_code"); + addParameter("nf_code", nfNamingCode); addParameter("nf_function", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); - addParameter("avail_zone_max_count", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); + addIntParameter("avail_zone_max_count", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); + addParameter("sdnc_model_name", extractValue(nodeTemplate, "sdnc_model_name")); + addParameter("sdnc_model_version", extractValue(nodeTemplate, "sdnc_model_version")); + addParameter("sdnc_artifact_name", extractValue(nodeTemplate, "sdnc_artifact_name")); + + // store additional properties in ATTRIBUTE_VALUE_PAIR + // additional complex properties are extracted via VfcInstanceGroup + + List vfcInstanceGroupListForVf = sdcCsarHelper.getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate, "org.openecomp.groups.VfcInstanceGroup"); + for (Group group : vfcInstanceGroupListForVf){ + + String vfcInstanceGroupFunction = extractGetInputValue(group, nodeTemplate, "vfc_instance_group_function"); + addParameter(extractGetInputName (group, "vfc_instance_group_function"), vfcInstanceGroupFunction, attributeValueParams); + String networkCollectionFunction = extractGetInputValue(group, nodeTemplate, "network_collection_function"); + addParameter(extractGetInputName (group, "network_collection_function"), networkCollectionFunction, attributeValueParams); + String initSubinterfaceQuantity = extractGetInputValue(group, nodeTemplate, "init_subinterface_quantity"); + addParameter(extractGetInputName (group, "init_subinterface_quantity"), initSubinterfaceQuantity, attributeValueParams); + } + } + + public void insertData() throws IOException { + + insertVFModelData(); + insertVFModuleData(nodeTemplate, jdbcDataSource); + insertVFtoNetworkRoleMappingData(); + insertVFCData(); + insertVFCInstanceGroupData(); + //insertVFPolicyData(); - insert Policy data for VF? + } + + private void insertVFModelData () throws IOException { + + try { + cleanUpExistingToscaData("VF_MODEL", "customization_uuid", getCustomizationUUID()) ; + //cleanUpExistingToscaData("SERVICE_MODEL_TO_VF_MODEL_MAPPING", "service_uuid", serviceUUID, "vf_uuid", getUUID()); + + // insert into VF_MODEL/ATTRIBUTE_VALUE_PAIR and SERVICE_MODEL_TO_VF_MODEL_MAPPING + LOG.info("Call insertToscaData for VF_MODEL where customization_uuid = " + getCustomizationUUID()); + insertToscaData(buildSql("VF_MODEL", model_yaml), null); + //insertRelevantAttributeData(); + + Map mappingParams = new HashMap(); + addParameter("service_invariant_uuid", serviceInvariantUUID, mappingParams); + addParameter("vf_uuid", getUUID(), mappingParams); + addParameter("vf_customization_uuid", getCustomizationUUIDNoQuotes(), mappingParams); + //insertToscaData(buildSql("SERVICE_MODEL_TO_VF_MODEL_MAPPING", "service_uuid", serviceUUID, model_yaml, mappingParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_MODEL table"); + throw new IOException (e); + } + + } + + private void insertVFModuleData (NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) throws IOException { + + List vfModules = sdcCsarHelper.getVfModulesByVf(getCustomizationUUIDNoQuotes()); + for (Group group : vfModules){ + SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, group, this); + + try { + cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); + cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_MODULE_MODEL where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); + insertToscaData(vfModuleModel.buildSql("VF_MODULE_MODEL", model_yaml), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_MODEL table "); + throw new IOException (e); + } + + // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data + // List groupMembers = sdcCsarHelper.getMembersOfGroup(group); - old version + // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. + // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING + List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); + for (NodeTemplate vfcNode : groupMembers){ + SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode, jdbcDataSource); + + try { + LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); + insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + + vfModuleModel.getCustomizationUUID() + ", " + vfcModel.getCustomizationUUID() + ", \"" + vfcModel.getVmType() + "\", \"" + vfcModel.getVmCount() + "\")", null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); + throw new IOException (e); + } + + } + + } + + } + + private void insertVFtoNetworkRoleMappingData () throws IOException { + + // For each VF, insert VF_TO_NETWORK_ROLE_MAPPING data + List cpNodes = sdcCsarHelper.getCpListByVf(getCustomizationUUIDNoQuotes()); + for (NodeTemplate cpNode : cpNodes){ + + // Insert into VF_TO_NETWORK_ROLE_MAPPING vf_customization_uuid and network_role + String cpNetworkRole = sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, "network_role"); + + try { + cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING where vf_customization_uuid = " + getCustomizationUUID()); + insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + + getCustomizationUUID() + ", \"" + cpNetworkRole + "\")", null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_TO_NETWORK_ROLE_MAPPING table"); + throw new IOException (e); + } + + } // CP loop + + } + + private void insertVFCData() throws IOException { + + // For each VF, insert VFC_MODEL data + List vfcNodes = sdcCsarHelper.getVfcListByVf(getCustomizationUUIDNoQuotes()); + for (NodeTemplate vfcNode : vfcNodes){ + + try { + SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode, jdbcDataSource); + + vfcModel.insertVFCModelData(); + vfcModel.insertVFCtoNetworkRoleMappingData(vfcNode); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR VFC data"); + throw new IOException (e); + } + } + } + + public void insertVFCInstanceGroupData () throws IOException { + + // Insert Group data in RESOURCE_GROUP + // Store group capabilities and capability properties in NODE_CAPABILITY and NODE_CAPABILITY_PROPERTY table + + // For each VF, insert CFVC data - 1806 + List vfcInstanceGroupListForVf = sdcCsarHelper.getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate, "org.openecomp.groups.VfcInstanceGroup"); + for (Group group : vfcInstanceGroupListForVf){ + + SdncGroupModel groupModel = new SdncGroupModel (sdcCsarHelper, group, nodeTemplate, config, jdbcDataSource); + groupModel.insertGroupData(nodeTemplate); + + // For each group, populate NODE_CAPABILITY/NODE_CAPABILITY_PROPERTY + insertNodeCapabilitiesData(group.getCapabilities()); + + // Store relationship between VfcInstanceGroup and node-type=VFC in RESOURCE_GROUP_TO_TARGET_NODE_MAPPING table + // target is each VFC in targets section of group + List targetNodeList = group.getMemberNodes(); + for (NodeTemplate targetNode : targetNodeList) { + + String targetNodeUuid = targetNode.getMetaData().getValue("UUID"); + + // insert RESOURCE_GROUP_TO_TARGET_NODE_MAPPING + try { + Map mappingCleanupParams = new HashMap(); + addParameter("group_uuid", groupModel.getUUID(), mappingCleanupParams); + addParameter("parent_uuid", getUUID(), mappingCleanupParams); + addParameter("target_node_uuid", targetNodeUuid, mappingCleanupParams); + cleanupExistingToscaData("RESOURCE_GROUP_TO_TARGET_NODE_MAPPING", mappingCleanupParams); + + Map mappingParams = new HashMap(); + addParameter("parent_uuid", getUUID(), mappingParams); + addParameter("target_node_uuid", targetNodeUuid, mappingParams); + String targetType = extractValue(targetNode.getMetaData(), "type"); + addParameter("target_type", targetType, mappingParams); + String tableName = ""; + switch (targetType) { + case "CVFC": + tableName = "VFC_MODEL"; + break; + case "VL": + tableName = "NETWORK_MODEL"; + break; + } + addParameter("table_name", tableName, mappingParams); + LOG.info("Call insertToscaData for RESOURCE_GROUP_TO_TARGET_NODE_MAPPING where group_uuid = " + groupModel.getUUID() + " and target_node_uuid = " + targetNodeUuid); + insertToscaData(buildSql("RESOURCE_GROUP_TO_TARGET_NODE_MAPPING", "group_uuid", groupModel.getUUID(), model_yaml, mappingParams), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_GROUP_TO_TARGET_NODE_MAPPING"); + throw new IOException (e); + } + + // For each target node, get External policies + insertPolicyData(nodeTemplate, targetNode, "org.openecomp.policies.External"); + } + } + } + + private void insertVFPolicyData() throws IOException { + + // For each VF node, get Policy data (is VFC the origin or target?) + List policyList = sdcCsarHelper.getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(nodeTemplate, "org.openecomp.policies.External"); + for (Policy policy : policyList){ + + policy.getmetadata(); + Map propMap = policy.getPolicyProperties(); + } + } + + public String getVendor() { + return vendor; + } + + public void setVendor(String vendor) { + this.vendor = vendor; + } + + public String getVendorModelDescription() { + return vendorModelDescription; + } + + public void setVendorModelDescription(String vendorModelDescription) { + this.vendorModelDescription = vendorModelDescription; + } + + public String getNfNamingCode() { + return nfNamingCode; + } + + public void setNfNamingCode(String nfNamingCode) { + this.nfNamingCode = nfNamingCode; + } + + public String getServiceUUID() { + return serviceUUID; + } + public void setServiceUUID(String serviceUUID) { + this.serviceUUID = serviceUUID; + } + + public String getServiceInvariantUUID() { + return serviceInvariantUUID; + } + + public void setServiceInvariantUUID(String serviceInvariantUUID) { + this.serviceInvariantUUID = serviceInvariantUUID; } } 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 60bc3c433..64bceb8cd 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 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 - 2018 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. @@ -32,12 +32,14 @@ public class SdncVFModuleModel extends SdncBaseModel { private static final Logger LOG = LoggerFactory .getLogger(SdncVFModuleModel.class); - public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group) { + public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group, SdncVFModel vfNodeModel) { super(sdcCsarHelper, group); + //addParameter("vf_customization_uuid", vfNodeModel.getCustomizationUUIDNoQuotes()); // extract properties addParameter("vf_module_type", extractValue(group, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); + //addParameter("vf_module_label", extractValue(group, "vf_module_label")); addIntParameter("availability_zone_count", extractValue(group, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)); addParameter("ecomp_generated_vm_assignments", extractBooleanValue(group, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS)); } diff --git a/ueb-listener/src/main/resources/normalizeTagNames.xslt b/ueb-listener/src/main/resources/normalizeTagNames.xslt index 6594ccfa0..c37a5e049 100755 --- a/ueb-listener/src/main/resources/normalizeTagNames.xslt +++ b/ueb-listener/src/main/resources/normalizeTagNames.xslt @@ -11,4 +11,3 @@ num of software instances - diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java index e8c7b1afd..360c36c9f 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java @@ -6,6 +6,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; + import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncARModelTest { @@ -13,7 +14,8 @@ package org.onap.ccsdk.sli.northbound.uebclient; public void testSdncARModelConstructor() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); - SdncARModel testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + SdncARModel testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate,mockDBResourceManager); assertNotNull(testSdncARModel); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java index 9df89fb24..d50c47a40 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java @@ -8,6 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncNodeModelTest { @@ -17,7 +18,8 @@ public class SdncNodeModelTest { public void setUp() throws Exception { ISdcCsarHelper isdcCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); - sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate, mockDBResourceManager); sdncNodeModel.setServiceUUID("0e8d757f-1c80-40af-85de-31d64f1f5af8"); sdncNodeModel.setEcompGeneratedNaming("hello-world"); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java index f03a09fcf..a09c5a2ba 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java @@ -8,6 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncVFCModelTest { @@ -17,7 +18,8 @@ public class SdncVFCModelTest { public void setup() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate mockNodeTemplate = mock(NodeTemplate.class); - testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate, mockDBResourceManager); testSdncVFCModel.setVmType("Test-type"); testSdncVFCModel.setVmCount("5"); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java index 881018ef6..1fd10104c 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java @@ -6,6 +6,7 @@ import static org.mockito.Mockito.mock; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.Group; +import org.onap.ccsdk.sli.northbound.uebclient.SdncVFModel; public class SdncVFModuleModelTest { @@ -13,7 +14,8 @@ public class SdncVFModuleModelTest { public void testSdncVFModuleModelConstructor() { Group mockGroup = mock(Group.class); ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); - SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockGroup); + SdncVFModel mockSdncVFModel = mock(SdncVFModel.class); + SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockGroup, mockSdncVFModel); assertNotNull(testSdncVFModel); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index b53bdb392..d0a94d4bd 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -214,18 +214,18 @@ public class TestSdncUebCallback { when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); mockProcessArtifact2 = mock(IArtifactInfo.class); - when(mockProcessArtifact1.getArtifactName()).thenReturn("mockProcessArtifact2"); - when(mockProcessArtifact1.getArtifactType()).thenReturn("DG_XML"); - when(mockProcessArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); - when(mockProcessArtifact1.getArtifactChecksum()).thenReturn("456jhgt 1234ftg"); - when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); + when(mockProcessArtifact2.getArtifactName()).thenReturn("mockProcessArtifact2"); + when(mockProcessArtifact2.getArtifactType()).thenReturn("DG_XML"); + when(mockProcessArtifact2.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockProcessArtifact2.getArtifactChecksum()).thenReturn("456jhgt 1234ftg"); + when(mockProcessArtifact2.getArtifactTimeout()).thenReturn(110); mockProcessArtifact3 = mock(IArtifactInfo.class); - when(mockProcessArtifact1.getArtifactName()).thenReturn("mockProcessArtifact3"); - when(mockProcessArtifact1.getArtifactType()).thenReturn("HEAT"); - when(mockProcessArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); - when(mockProcessArtifact1.getArtifactChecksum()).thenReturn("123tfg123 543gtd"); - when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); + when(mockProcessArtifact3.getArtifactName()).thenReturn("mockProcessArtifact3"); + when(mockProcessArtifact3.getArtifactType()).thenReturn("HEAT"); + when(mockProcessArtifact3.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockProcessArtifact3.getArtifactChecksum()).thenReturn("123tfg123 543gtd"); + when(mockProcessArtifact3.getArtifactTimeout()).thenReturn(110); mockServiceArtifact1 = mock(IArtifactInfo.class); @@ -267,7 +267,16 @@ public class TestSdncUebCallback { cb.setJdbcDataSource(dblibSvc); INotificationData iData = mock(INotificationData.class); + /*IArtifactInfo iArtifactInfo = mock(IArtifactInfo.class); + when(iArtifactInfo.getArtifactName()).thenReturn("testArtifact1"); + when(iArtifactInfo.getArtifactType()).thenReturn("TOSCA_CSAR"); + List artifactInfoList = new ArrayList(); + artifactInfoList.add(iArtifactInfo);*/ + + when(iData.getServiceName()).thenReturn("testServiceName"); + //when(iData.getServiceArtifacts()).thenReturn(artifactInfoList); cb.activateCallback(iData); + } @@ -292,6 +301,16 @@ public class TestSdncUebCallback { when(mockData.getServiceName()).thenReturn("Test_service_name"); when(mockData.getServiceArtifacts()).thenReturn(processLevelArtifactList); + /*IArtifactInfo iArtifactInfo = mock(IArtifactInfo.class); + when(iArtifactInfo.getArtifactName()).thenReturn("testArtifact1"); + when(iArtifactInfo.getArtifactType()).thenReturn("TOSCA_CSAR"); + List artifactInfoList = new ArrayList(); + artifactInfoList.add(iArtifactInfo); + + //when(mockData.getServiceName()).thenReturn("testServiceName"); + when(mockData.getServiceArtifacts()).thenReturn(artifactInfoList);*/ + + SdncUebCallback cb1 = new SdncUebCallback(iDistClient1, config); cb1.activateCallback(mockData); assertTrue(true); -- 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 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 7e6d57e2c6dcf22567b7ef130d2a3c3a6866fe5f Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 24 Jul 2018 09:28:47 -0400 Subject: Adding junits for refactored UEB Listener Changes made: Added null check in SdncBaseModel.java Cleaned up in SdncVFCModel.java Added tests in SdncARModelTest.java, SdncNodeModelTest and SdncVFCModelTest Added files SdncGroupModelTest, SdncServiceModelTest and SdncVFModelTest Change-Id: If0261c94d67a61b0b19db51cbbbff7ae32912d06 Issue-ID: CCSDK-360 Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncBaseModel.java | 28 ++++--- .../sli/northbound/uebclient/SdncVFCModel.java | 14 ---- .../sli/northbound/uebclient/SdncARModelTest.java | 33 ++++++-- .../northbound/uebclient/SdncGroupModelTest.java | 34 ++++++++ .../northbound/uebclient/SdncNodeModelTest.java | 28 ++++++- .../northbound/uebclient/SdncServiceModelTest.java | 77 ++++++++++++++++++ .../sli/northbound/uebclient/SdncVFCModelTest.java | 79 ++++++++++++++++-- .../sli/northbound/uebclient/SdncVFModelTest.java | 95 ++++++++++++++++++++++ 8 files changed, 343 insertions(+), 45 deletions(-) create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java 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 fd5a29637..7f0e9398f 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 @@ -887,13 +887,15 @@ public class SdncBaseModel { try { int rowCount = 0; CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, ""); - while(data.next()) { + if (data != null) { + while(data.next()) { rowCount ++; - } - if (rowCount != 0) { - LOG.debug("cleanUpExistingToscaData from: " + tableName + " for " + keyValue); - jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); - } + } + if (rowCount != 0) { + LOG.debug("cleanUpExistingToscaData from: " + tableName + " for " + keyValue); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); + } + } } catch (SQLException e) { LOG.error("Could not clean up existing " + tableName + " for " + keyValue, e); @@ -907,13 +909,15 @@ public class SdncBaseModel { try { int rowCount = 0; CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, ""); - while(data.next()) { + if (data != null) { + while(data.next()) { rowCount ++; - } - if (rowCount != 0) { - LOG.debug("cleanUpExistingToscaData from : " + tableName + " for " + key1Value + " and " + key2Value); - jdbcDataSource.writeData("DELETE from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, null); - } + } + if (rowCount != 0) { + LOG.debug("cleanUpExistingToscaData from : " + tableName + " for " + key1Value + " and " + key2Value); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, null); + } + } } catch (SQLException e) { LOG.error("Could not clean up existing " + tableName + " for " + key1Value + " and " + key2Value, e); 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 35639b366..5977e2888 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 @@ -260,20 +260,6 @@ public class SdncVFCModel extends SdncBaseModel { return subnetRoleFound; } - private Map getIpPropMapWithMatchingSubnetRole (ArrayList> ipPropParamsList, String subnetRole) { - - Map ipPropMapMatch = new HashMap(); - - if (subnetRole != null) { - for (Map ipPropMap : ipPropParamsList) { - if (nullCheck(ipPropMap.get("subnet_role")) == subnetRole) { - return ipPropMap; - } - } - } - return ipPropMapMatch; - } - private void addRequiredParameters (Map mappingParams) { // Add parameters which can not be null if they have not already been added - network_role, ipv4_count, ipv6_count diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java index 360c36c9f..ea6499cd3 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java @@ -2,22 +2,43 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.junit.Assert.*; import static org.mockito.Mockito.*; - - import org.junit.Test; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncARModelTest { - @Test - public void testSdncARModelConstructor() { + SdncARModel testSdncARModel = null; + + @Before + public void setUp() throws Exception { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); - SdncARModel testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate,mockDBResourceManager); + testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate,mockDBResourceManager); assertNotNull(testSdncARModel); } + @Test + public void testSetGetSubcategory() { + String subcategory = "test-subcategory"; + testSdncARModel.setSubcategory(subcategory); + String result = testSdncARModel.getSubcategory(); + assertEquals(subcategory, result); + } + + @Test + public void testInsertAllottedResourceModelData() { + try { + testSdncARModel.insertAllottedResourceModelData(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } - diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java new file mode 100644 index 000000000..0c6030b44 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java @@ -0,0 +1,34 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import java.io.IOException; + +import org.junit.Test; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.Group; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; + + public class SdncGroupModelTest { + + @Test + public void testSdncGroupModelConstructor() { + ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + NodeTemplate nodeTemplate = mock(NodeTemplate.class); + Group group = mock(Group.class); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); + SdncGroupModel testSdncGroupModel = null; + try { + testSdncGroupModel = new SdncGroupModel(mockCsarHelper,group,nodeTemplate,mockSdncUebConfiguration,mockDBResourceManager); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + assertNotNull(testSdncGroupModel); + } + + } + diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java index d50c47a40..a77c5adbf 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java @@ -2,12 +2,15 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.junit.Assert.*; -import static org.mockito.Mockito.*; - +import static org.mockito.Mockito.*; + +import java.io.IOException; + import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncNodeModelTest { @@ -18,7 +21,13 @@ public class SdncNodeModelTest { public void setUp() throws Exception { ISdcCsarHelper isdcCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); + Metadata mockMetadata = mock(Metadata.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + + when(nodeTemplate.getMetaData()).thenReturn(mockMetadata); + when(isdcCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(isdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "network_type")).thenReturn("test-network-type"); + sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate, mockDBResourceManager); sdncNodeModel.setServiceUUID("0e8d757f-1c80-40af-85de-31d64f1f5af8"); sdncNodeModel.setEcompGeneratedNaming("hello-world"); @@ -39,7 +48,7 @@ public class SdncNodeModelTest { @Test public void testGetSqlString() { String result = sdncNodeModel.getSql("TEST-HELLO"); - String test = "INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, ecomp_generated_naming) values (0e8d757f-1c80-40af-85de-31d64f1f5af8, \"\", \"TEST-HELLO\", \"hello-world\");"; + String test = "INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, ecomp_generated_naming, network_type) values (0e8d757f-1c80-40af-85de-31d64f1f5af8, \"aaaa-bbbb-cccc-dddd\", \"TEST-HELLO\", \"hello-world\", \"test-network-type\");"; assertEquals(test, result); } @@ -48,4 +57,15 @@ public class SdncNodeModelTest { String result = sdncNodeModel.getVpnBindingsSql(); assertNotNull(result); } + + @Test + public void testInsertNetworkModelData() { + try { + sdncNodeModel.insertNetworkModelData(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java new file mode 100644 index 000000000..95f5a75ec --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java @@ -0,0 +1,77 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.elements.Metadata; + + public class SdncServiceModelTest { + + SdncServiceModel testSdncServiceModel = null; + + @Before + public void setUp() throws Exception { + ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + Metadata mockMetadata = mock(Metadata.class); + + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "UUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "invariantUUID")).thenReturn("bbbb-cccc-dddd-eeee"); + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "namingPolicy")).thenReturn("test-naming-policy"); + + testSdncServiceModel = new SdncServiceModel(mockCsarHelper,mockMetadata); + + assertNotNull(testSdncServiceModel); + } + + @Test + public void testSetGetServiceUUID() { + String newServiceUuid = "cccc-dddd-eeee-ffff"; + testSdncServiceModel.setServiceUUID(newServiceUuid); + String result = testSdncServiceModel.getServiceUUID(); + assertEquals("\"" + newServiceUuid + "\"", result); + } + + @Test + public void testSetGetServiceInvariantUUID() { + String result = testSdncServiceModel.getServiceInvariantUUID(); + assertEquals(result, "\"bbbb-cccc-dddd-eeee\""); + } + + @Test + public void testSetGeServiceInstanceNamePrefix() { + String serviceInstanceNamePrefix = "test-service-instance-name-prefix"; + testSdncServiceModel.setServiceInstanceNamePrefix(serviceInstanceNamePrefix); + String result = testSdncServiceModel.getServiceInstanceNamePrefix(); + assertEquals(serviceInstanceNamePrefix, result); + } + + @Test + public void testSetGetResourceVendor() { + String resourceVendor = "Fortinet"; + testSdncServiceModel.setResourceVendor(resourceVendor); + String result = testSdncServiceModel.getResourceVendor(); + assertEquals(resourceVendor, result); + } + + @Test + public void testSetGetResourceVendorRelease() { + String resourceVendorRelease = "1.0.0"; + testSdncServiceModel.setResourceVendorRelease(resourceVendorRelease); + String result = testSdncServiceModel.getResourceVendorRelease(); + assertEquals(resourceVendorRelease, result); + } + + @Test + public void testGetSqlString() { + String result = testSdncServiceModel.getSql("TEST-HELLO"); + String test = "INSERT into SERVICE_MODEL (service_uuid, model_yaml, filename, naming_policy, invariant_uuid) values (\"aaaa-bbbb-cccc-dddd\", \"TEST-HELLO\", \"null\", \"test-naming-policy\", \"bbbb-cccc-dddd-eeee\");"; + assertEquals(test, result); + } + + + } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java index a09c5a2ba..469312359 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java @@ -1,24 +1,55 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.junit.Assert.*; -import static org.mockito.Mockito.*; - - +import static org.mockito.Mockito.*; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.ArrayList; + import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncVFCModelTest { SdncVFCModel testSdncVFCModel; + NodeTemplate mockVFCNodeTemplate = null; @Before public void setup() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate mockNodeTemplate = mock(NodeTemplate.class); + mockVFCNodeTemplate = mock(NodeTemplate.class); + Metadata mockMetadata = mock(Metadata.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + + when(mockNodeTemplate.getMetaData()).thenReturn(mockMetadata); + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockCsarHelper.getNodeTemplatePropertyLeafValue(mockNodeTemplate, "nfc_naming_code")).thenReturn("test-nfc-naming-code"); + + Map> cpPropertiesMap = new HashMap>(); + Map propertiesMap = new HashMap(); + propertiesMap.put("network-role", "test-network-role"); + propertiesMap.put("network-role-tag", "test-network-role-tag"); + + ArrayList> ipRequirementsList = new ArrayList>(); + Map ip4Prop = new HashMap(); + ip4Prop.put("ip_version", "4"); + ipRequirementsList.add(ip4Prop); + Map ip6Prop = new HashMap(); + ip4Prop.put("ip_version", "6"); + ipRequirementsList.add(ip4Prop); + + propertiesMap.put("ip_requirements", ipRequirementsList); + cpPropertiesMap.put("cp-node-1", propertiesMap); + when(mockCsarHelper.getCpPropertiesFromVfcAsObject(mockVFCNodeTemplate)).thenReturn(cpPropertiesMap); + testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate, mockDBResourceManager); testSdncVFCModel.setVmType("Test-type"); testSdncVFCModel.setVmCount("5"); @@ -26,13 +57,43 @@ public class SdncVFCModelTest { } @Test - public void testSdncVFCModelGetVmType() { - assertEquals(testSdncVFCModel.getVmType(), "Test-type"); + public void testSdncVFCModelSetGetVmType() { + String newVMtype = "new-vm-type"; + testSdncVFCModel.setVmType(newVMtype); + assertEquals(testSdncVFCModel.getVmType(), "new-vm-type"); } @Test - public void testSdncVFCModelGetVmCount() { - assertEquals(testSdncVFCModel.getVmCount(), "5"); + public void testSdncVFCModelSetGetVmCount() { + String newVMcount = "4"; + testSdncVFCModel.setVmCount(newVMcount); + assertEquals(testSdncVFCModel.getVmCount(), "4"); } - + + @Test + public void testInsertVFCModelData() { + try { + testSdncVFCModel.insertVFCModelData(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @Test + public void testInsertVFCtoNetworkRoleMappingData() { + try { + testSdncVFCModel.insertVFCtoNetworkRoleMappingData(mockVFCNodeTemplate); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @Test + public void testIpPropParamsMapContainsSubnetRole() { + ArrayList> testList = new ArrayList>(); + testSdncVFCModel.ipPropParamsMapContainsSubnetRole(testList, "test-subnet-role"); + } + } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java new file mode 100644 index 000000000..3f795a354 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java @@ -0,0 +1,95 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; + + public class SdncVFModelTest { + + SdncVFModel testSdncVFModel = null; + + @Before + public void setUp() throws Exception { + ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + NodeTemplate nodeTemplate = mock(NodeTemplate.class); + Metadata mockMetadata = mock(Metadata.class); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); + + when(nodeTemplate.getMetaData()).thenReturn(mockMetadata); + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "nf_naming_code")).thenReturn("test-nf-naming-code"); + + try { + testSdncVFModel = new SdncVFModel(mockCsarHelper,nodeTemplate,mockDBResourceManager,mockSdncUebConfiguration); + testSdncVFModel.setServiceUUID("bbbb-cccc-dddd-eeee"); + testSdncVFModel.setServiceInvariantUUID("cccc-dddd-eeee-ffff"); + testSdncVFModel.setVendor("Cisco"); + testSdncVFModel.setVendorModelDescription("Cisco Equipment Model"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + assertNotNull(testSdncVFModel); + } + + @Test + public void testSetGetVendor() { + String newVendorModel = "new-vendor-model"; + testSdncVFModel.setVendor(newVendorModel); + String result = testSdncVFModel.getVendor(); + assertEquals(result, newVendorModel); + } + + @Test + public void testSetGetVendorModelDescription() { + String newVendorModelDescription = "new-vendor-model-description"; + testSdncVFModel.setVendorModelDescription(newVendorModelDescription); + String result = testSdncVFModel.getVendorModelDescription(); + assertEquals(result, newVendorModelDescription); + } + + @Test + public void testSetGetNfNamingCode() { + String newNfNamingCode = "new-nf-naming-code"; + testSdncVFModel.setNfNamingCode(newNfNamingCode); + String result = testSdncVFModel.getNfNamingCode(); + assertEquals(result, newNfNamingCode); + } + + @Test + public void testSetGetServiceUUID() { + String newServiceUuid = "cccc-dddd-eeee-ffff"; + testSdncVFModel.setServiceUUID(newServiceUuid); + String result = testSdncVFModel.getServiceUUID(); + assertEquals(newServiceUuid, result); + } + + @Test + public void testSetGetServiceInvariantUUID() { + String newServiceInvariantUuid = "dddd-eeee-ffff-eeee"; + testSdncVFModel.setServiceInvariantUUID(newServiceInvariantUuid); + String result = testSdncVFModel.getServiceInvariantUUID(); + assertEquals(result, newServiceInvariantUuid); + } + + @Test + public void testInsertData() { + try { + testSdncVFModel.insertData(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + } -- cgit 1.2.3-korg From 75a7aa446b04504739cc2249d81116811a136111 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Tue, 24 Jul 2018 19:58:14 +0900 Subject: Fix sonar issues Fix use try-with-resources issues in ccsdk/sli/northbound Issue-ID: CCSDK-332 Change-Id: Ibc61e6b3ec81e774556172c63c0ca062b6bd6a26 Signed-off-by: Parshad Patel --- .../sli/northbound/asdcapi/AsdcApiProvider.java | 4 +--- .../sli/northbound/uebclient/SdncUebCallback.java | 26 ++++++++-------------- 2 files changed, 10 insertions(+), 20 deletions(-) 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 0c2ce2fc2..27280d2d3 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 @@ -179,14 +179,12 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { InstanceIdentifier artifactInstanceId = InstanceIdentifier.builder(Artifacts.class) .child(Artifact.class, new ArtifactKey(aName, aVersion)).build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional data = null; - try { + try(ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) { data = (Optional) readTx.read(LogicalDatastoreType.CONFIGURATION, artifactInstanceId).get(); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught Exception reading MD-SAL for ["+aName+","+ aVersion+"] " ,e); return false; - } return data.isPresent(); 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 866fd14d7..224a51998 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 @@ -482,24 +482,19 @@ public class SdncUebCallback implements INotificationCallback { // Save zip if TOSCA_CSAR if (artifact.getArtifactType().contains("TOSCA_CSAR") || artifact.getArtifactName().contains(".csar")) { - try { - - FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); - outFile.write(payloadBytes, 0, payloadBytes.length); - outFile.close(); - writeSucceeded = true; - } catch (Exception e) { - LOG.error("Unable to save downloaded zip file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); - } + try(FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName())) { + outFile.write(payloadBytes, 0, payloadBytes.length); + writeSucceeded = true; + } catch (Exception e) { + LOG.error("Unable to save downloaded zip file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); + } } else { String payload = new String(payloadBytes); - try { - FileWriter spoolFileWriter = new FileWriter(spoolFile); + try(FileWriter spoolFileWriter = new FileWriter(spoolFile)) { spoolFileWriter.write(payload); - spoolFileWriter.close(); writeSucceeded = true; } catch (Exception e) { LOG.error("Unable to save downloaded file to spool directory ("+ incomingDir.getAbsolutePath() +")", e); @@ -943,9 +938,8 @@ public class SdncUebCallback implements INotificationCallback { msgBuffer.append(""+artifact.getArtifactVersion()+"\n"); } - try { - BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile())); - + try(BufferedReader rdr = new BufferedReader(new FileReader(artifact.getFile()))) { + String curLine = rdr.readLine(); while (curLine != null) { @@ -966,8 +960,6 @@ public class SdncUebCallback implements INotificationCallback { } curLine = rdr.readLine(); } - rdr.close(); - } catch (Exception e) { LOG.error("Could not process spool file "+artifact.getFile().getName(), e); return(DistributionStatusEnum.DEPLOY_ERROR); -- cgit 1.2.3-korg From f6e8db81573312f7b1085f6b55ad2bd4b7eba20d Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Mon, 30 Jul 2018 14:55:25 -0400 Subject: Add external policy ingestion for VF nodes Changes made: Added SdncBaseModel.insertPolicyData for VF nodes. Added call to insertPolicyData from VF node ingestion. Change-Id: I0df1217352354068f11b0cc01923b564c730a149 Issue-ID: CCSDK-404 Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncBaseModel.java | 124 ++++++++++++++++----- .../sli/northbound/uebclient/SdncVFModel.java | 11 +- 2 files changed, 101 insertions(+), 34 deletions(-) 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 7f0e9398f..57be926bc 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 @@ -264,35 +264,29 @@ public class SdncBaseModel { List policyList = sdcCsarHelper.getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(nodeTemplate, policyType); //List policyList2 = sdcCsarHelper.getPoliciesOfTopologyTemplateByToscaPolicyType(policyType); // returns nothing //List policyList3 = sdcCsarHelper.getPoliciesOfTargetByToscaPolicyType(nodeTemplate, policyType); // returns nothing - + + String resourceUuid = getUUID(); + for (Policy policy : policyList) { - String resourceUuid = getUUID(); - // extract metadata - //policy.getmetadata(); - NPE - //Metadata metadata = policy.getMetadata(); - - //String policyUuid = extractValue(metadata, "UUID"); + // extract policy metadata String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); - //String policyInvariantUuid = extractValue(metadata, "invariantUUID"); String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); - //String policyCustomizationUuid = extractValue(metadata, "customizationUUID"); String policyCustomizationUuid = policy.getMetaData().getOrDefault("customizationUUID", "").toString(); + // cleanup existing RESOURCE_POLICY data Map cleanupParams = new HashMap(); addParameter("resource_uuid", resourceUuid, cleanupParams); addParameter("policy_uuid", policyUuid, cleanupParams); addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + // insert into RESOURCE_POLICY Map policyParams = new HashMap(); addParameter("policy_uuid", policyUuid, policyParams); addParameter("policy_customization_uuid", policyCustomizationUuid, policyParams); addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - //addParameter("policy_name", extractValue(metadata, "name"), policyParams); addParameter("policy_name", policy.getMetaData().getOrDefault("name", "").toString(), policyParams); - //addParameter("version", extractValue(metadata, "version"), policyParams); addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); - //addParameter("policy_type", extractValue(metadata, "type"), policyParams); addParameter("policy_type", policy.getMetaData().getOrDefault("type", "").toString(), policyParams); // extract properties @@ -351,22 +345,24 @@ public class SdncBaseModel { String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); - // insert into RESOURCE_POLICY + // cleanup existing RESOURCE_POLICY data Map cleanupParams = new HashMap(); - SdncBaseModel.addParameter("resource_uuid", resourceUuid, cleanupParams); - SdncBaseModel.addParameter("policy_uuid", policyUuid, cleanupParams); - SdncBaseModel.addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + addParameter("resource_uuid", resourceUuid, cleanupParams); + addParameter("policy_uuid", policyUuid, cleanupParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + // insert into RESOURCE_POLICY Map policyParams = new HashMap(); - SdncBaseModel.addParameter("policy_uuid", policyUuid, policyParams); - SdncBaseModel.addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - SdncBaseModel.addParameter("policy_name", policy.getMetaData().getOrDefault("name", "").toString(), policyParams); - SdncBaseModel.addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); - SdncBaseModel.addParameter("policy_type", policy.getType(), policyParams); + addParameter("policy_uuid", policyUuid, policyParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); + addParameter("policy_name", policy.getMetaData().getOrDefault("name", "").toString(), policyParams); + addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); + addParameter("policy_type", policy.getType(), policyParams); - SdncBaseModel.addParameter("property_type", extractValueStatic(policy, "type"), policyParams); - SdncBaseModel.addParameter("property_source", extractValueStatic(policy, "source"), policyParams); - SdncBaseModel.addParameter("property_name", extractValueStatic(policy, "name"), policyParams); + // extract properties + addParameter("property_type", extractValueStatic(policy, "type"), policyParams); + addParameter("property_source", extractValueStatic(policy, "source"), policyParams); + addParameter("property_name", extractValueStatic(policy, "name"), policyParams); try { @@ -385,8 +381,6 @@ public class SdncBaseModel { for (String targetName : policyTargetNameList) { NodeTemplate targetNode = sdcCsarHelper.getNodeTemplateByName(targetName); - // extract targetNode metadata UUID and customizationUUID - // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING try { Map mappingCleanupParams = new HashMap(); @@ -412,6 +406,84 @@ public class SdncBaseModel { } } + protected void insertPolicyData (NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource, String parentUuid, String policyType) throws IOException { + + // Get External policies of the node + List policyList = sdcCsarHelper.getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(nodeTemplate, policyType); + String resourceUuid = "\"" + extractValue (nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID) + "\""; + + for (Policy policy : policyList) { + + // extract policy metadata + String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); + String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); + + // cleanup existing RESOURCE_POLICY data + Map cleanupParams = new HashMap(); + addParameter("resource_uuid", resourceUuid, cleanupParams); + addParameter("policy_uuid", policyUuid, cleanupParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + + // insert into RESOURCE_POLICY + Map policyParams = new HashMap(); + addParameter("policy_uuid", policyUuid, policyParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); + String policyName = policy.getMetaData().getOrDefault("name", "").toString(); + addParameter("policy_name", policyName, policyParams); + addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); + addParameter("policy_type", policy.getType(), policyParams); + + // extract properties + addParameter("property_type", extractValue(policy, "type"), policyParams); + addParameter("property_source", extractValue(policy, "source"), policyParams); + addParameter("property_name", extractValue(policy, "name"), policyParams); + + try { + + // insert into RESOURCE_POLICY + cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY", cleanupParams); + LOG.info("Call insertToscaData for RESOURCE_POLICY where resource_uuid = " + resourceUuid); + insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY", "resource_uuid", resourceUuid, "", policyParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY table"); + throw new IOException (e); + } + + // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING + List targetNodeList = sdcCsarHelper.getPolicyTargetsFromOrigin(nodeTemplate, policyName); + for (NodeTemplate targetNode : targetNodeList) { + //NodeTemplate targetNode = sdcCsarHelper.getNodeTemplateByName(targetName); + if (targetNode == null) { + LOG.error("Target node for policy " + policyName + " is NULL. Can't insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING"); + continue; + } + + // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING + try { + Map mappingCleanupParams = new HashMap(); + addParameter("policy_uuid", policyUuid, mappingCleanupParams); + addParameter("parent_uuid", parentUuid, mappingCleanupParams); + addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingCleanupParams); + SdncBaseModel.cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", mappingCleanupParams); + + Map mappingParams = new HashMap(); + addParameter("parent_uuid", parentUuid, mappingParams); + addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); + addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); + addParameter("target_type", targetNode.getMetaData().getValue("type"), mappingParams); // type of the target node + LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid + " and target_node_uuid = " + targetNode.getMetaData().getValue("UUID")); + SdncBaseModel.insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", "", mappingParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY_TO_TARGET_NODE_MAPPING table"); + throw new IOException (e); + } + + } + } + } + protected void insertNodeCapabilitiesData (CapabilityAssignments capabilities) throws IOException { // Process the capabilities on the node template 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 95f9a0d31..84f8296c9 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 @@ -94,7 +94,7 @@ public class SdncVFModel extends SdncBaseModel { insertVFtoNetworkRoleMappingData(); insertVFCData(); insertVFCInstanceGroupData(); - //insertVFPolicyData(); - insert Policy data for VF? + insertVFPolicyData(); } private void insertVFModelData () throws IOException { @@ -261,13 +261,8 @@ public class SdncVFModel extends SdncBaseModel { private void insertVFPolicyData() throws IOException { - // For each VF node, get Policy data (is VFC the origin or target?) - List policyList = sdcCsarHelper.getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(nodeTemplate, "org.openecomp.policies.External"); - for (Policy policy : policyList){ - - policy.getmetadata(); - Map propMap = policy.getPolicyProperties(); - } + // For each VF node, ingest External Policy data + insertPolicyData (nodeTemplate, jdbcDataSource, serviceUUID, "org.openecomp.policies.External"); } public String getVendor() { -- cgit 1.2.3-korg From 3c5a179495b00b2e832d304083885aa93e8cdab7 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Tue, 7 Aug 2018 21:26:44 +0000 Subject: update configuration for onap look for properties in common folder, use java 8 Change-Id: I8a04126d8ac1db0781af9b6a015477e0fc3608dd Issue-ID: CCSDK-448 Signed-off-by: Smokowski, Kevin (ks6305) --- .../org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java | 2 +- dmaap-listener/src/main/scripts/start-dmaap-listener.sh | 6 +++--- dmaap-listener/src/main/scripts/stop-dmaap-listener.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 2be08cb8b..7e257a125 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 @@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory; public class DmaapListener { private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; - private static final String DMAAP_LISTENER_PROPERTIES_DIR = "/opt/sdnc/data/properties"; + private static final String DMAAP_LISTENER_PROPERTIES_DIR = "/opt/onap/ccsdk/data/properties"; private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; private static final Logger LOG = LoggerFactory.getLogger(DmaapListener.class); diff --git a/dmaap-listener/src/main/scripts/start-dmaap-listener.sh b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh index 164ade332..f767d3cd1 100644 --- a/dmaap-listener/src/main/scripts/start-dmaap-listener.sh +++ b/dmaap-listener/src/main/scripts/start-dmaap-listener.sh @@ -21,15 +21,15 @@ # ============LICENSE_END========================================================= ### -PROPERTY_DIR=${PROPERTY_DIR:-/opt/sdnc/data/properties} +PROPERTY_DIR=${PROPERTY_DIR:-/opt/onap/ccsdk/data/properties} LISTENER=dmaap-listener PIDFILE=/tmp/.${LISTENER}-pid -UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/dmaap-listener} -JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-oracle} +UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/onap/dmaap-listener} +JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-8-oracle} JAVA_OPTS=${JAVA_OPTS:--Dhttps.protocols=TLSv1.1,TLSv1.2} JAVA=${JAVA:-${JAVA_HOME}/bin/java} diff --git a/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh b/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh index 61be1a141..ab242044f 100644 --- a/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh +++ b/dmaap-listener/src/main/scripts/stop-dmaap-listener.sh @@ -21,13 +21,13 @@ # ============LICENSE_END========================================================= ### -PROPERTY_DIR=${PROPERTY_DIR:-/opt/sdnc/data/properties} +PROPERTY_DIR=${PROPERTY_DIR:-/opt/onap/ccsdk/data/properties} LISTENER=dmaap-listener PIDFILE=/tmp/.${LISTENER}-pid -UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/dmaap-listener} +UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/onap/dmaap-listener} if [ -f $PIDFILE ] then -- cgit 1.2.3-korg From 553f0e97f4c22ce3ea66b59160eb29836fb6b7d3 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Thu, 9 Aug 2018 14:16:39 -0400 Subject: Update sdc-tosca version to 1.4.1 Changes made: Update sdc-tosca dependency version to 1.4.1 in pom.xml. This change will allow new models to pass conformance check. Change-Id: I3e45126839fb2cb1052240afe94d72bbaab3df15 Issue-ID: CCSDK-451 Signed-off-by: lalena.aria --- ueb-listener/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index f0315a138..2fff94e8e 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -18,7 +18,7 @@ 1.3.0 - 1.3.5 + 1.4.1 2.9.4 true /opt/app/ueb-listener -- cgit 1.2.3-korg From 117b08faba226c79484572516efe3b6e861c1e48 Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Fri, 17 Aug 2018 14:15:59 +0900 Subject: Increase coverage and quality Issue-ID: CCSDK-470 Change-Id: Id847c9a79af795dd80a5fc22341ed2e385e53943 Signed-off-by: Ganesh Chandrasekaran --- .../northbound/TestLcmRpcInvocationException.java | 20 +++++++ .../sli/northbound/uebclient/SdncBaseModel.java | 64 ++++++++++++---------- 2 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmRpcInvocationException.java diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmRpcInvocationException.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmRpcInvocationException.java new file mode 100644 index 000000000..f95e83250 --- /dev/null +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmRpcInvocationException.java @@ -0,0 +1,20 @@ +package org.onap.ccsdk.sli.northbound; + +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeader; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.Status; + +public class TestLcmRpcInvocationException { + + @Test(expected = SvcLogicException.class) + public void testLcmRpcInvocationException() throws SvcLogicException{ + Status status = null; + CommonHeader commonHeader = null; + LcmRpcInvocationException exception = new LcmRpcInvocationException(status, commonHeader); + assert(exception.getStatus() == status); + assert(exception.getCommonHeader() == commonHeader); + throw exception; + } +} 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 57be926bc..b1e065e25 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 @@ -54,7 +54,15 @@ public class SdncBaseModel { protected String UUID = null; protected String model_yaml = null; protected String version = null; - protected String name = null; + protected String name = null; + + protected String PARAM_INVARIANT_UUID_KEY = "invariant_uuid"; + protected String PARAM_UUID_KEY = "uuid"; + protected String PARAM_VERSION_KEY = "version"; + protected String PARAM_NAME_KEY = "name"; + protected String PARAM_DESCRIPTION_KEY = "description"; + protected String PARAM_TYPE_KEY = "type"; + protected String PARAM_CATEGORY_KEY = "category"; protected Map params = null; protected Map attributeValueParams = null; @@ -89,13 +97,13 @@ public class SdncBaseModel { // extract service metadata invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); - addParameter("invariant_uuid",invariantUUID); - addParameter("version",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + addParameter(PARAM_INVARIANT_UUID_KEY,invariantUUID); + addParameter(PARAM_VERSION_KEY,extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); name = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME); - addParameter("name",name); - addParameter("description",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); - addParameter("type",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); - addParameter("category",extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY)); + addParameter(PARAM_NAME_KEY,name); + addParameter(PARAM_DESCRIPTION_KEY,extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); + addParameter(PARAM_TYPE_KEY,extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); + addParameter(PARAM_CATEGORY_KEY,extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY)); } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { @@ -109,10 +117,10 @@ public class SdncBaseModel { Metadata metadata = nodeTemplate.getMetaData(); customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); invariantUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); - addParameter("invariant_uuid", invariantUUID); + addParameter(PARAM_INVARIANT_UUID_KEY, invariantUUID); UUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID); - addParameter("uuid", UUID); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + addParameter(PARAM_UUID_KEY, UUID); + addParameter(PARAM_VERSION_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); // extract common nodeTemplate properties //addParameter("ecomp_generated_naming", extractValue (nodeTemplate, "naming#ecompnaming")); // should be extractBooleanValue? @@ -137,9 +145,9 @@ public class SdncBaseModel { Metadata metadata = group.getMetadata(); //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID"); - addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); - addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); - addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); + addParameter(PARAM_INVARIANT_UUID_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); + addParameter(PARAM_UUID_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + addParameter(PARAM_VERSION_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); } /* This is the generic approach Shoujit attempted for 18.06 but can't be implemented without parser API to @@ -178,7 +186,7 @@ public class SdncBaseModel { if (!type.isEmpty()) metadataType = type; else { Metadata metadata = nodeTemplate.getMetaData(); - metadataType = sdcCsarHelper.getMetadataPropertyValue(metadata, "type"); + metadataType = sdcCsarHelper.getMetadataPropertyValue(metadata, PARAM_TYPE_KEY); } // Clean up all attributes for this resource @@ -236,7 +244,7 @@ public class SdncBaseModel { Map mappingParams = new HashMap(); addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), "UUID"), mappingParams); addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), "UUID"), mappingParams); - String targetType = extractValue(targetNode.getMetaData(), "type"); + String targetType = extractValue(targetNode.getMetaData(), PARAM_TYPE_KEY); addParameter("target_type", targetType, mappingParams); String tableName = ""; switch (targetType) { @@ -285,14 +293,14 @@ public class SdncBaseModel { addParameter("policy_uuid", policyUuid, policyParams); addParameter("policy_customization_uuid", policyCustomizationUuid, policyParams); addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - addParameter("policy_name", policy.getMetaData().getOrDefault("name", "").toString(), policyParams); - addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); - addParameter("policy_type", policy.getMetaData().getOrDefault("type", "").toString(), policyParams); + addParameter("policy_name", policy.getMetaData().getOrDefault(PARAM_NAME_KEY, "").toString(), policyParams); + addParameter(PARAM_VERSION_KEY, policy.getMetaData().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); + addParameter("policy_type", policy.getMetaData().getOrDefault(PARAM_TYPE_KEY, "").toString(), policyParams); // extract properties - addParameter("property_type", extractValue(policy, "type"), policyParams); + addParameter("property_type", extractValue(policy, PARAM_TYPE_KEY), policyParams); addParameter("property_source", extractValue(policy, "source"), policyParams); - addParameter("property_name", extractValue(policy, "name"), policyParams); + addParameter("property_name", extractValue(policy, PARAM_NAME_KEY), policyParams); // Insert into RESOURCE_POLICY and RESOURCE_POLICY_TO_TARGET_NODE_MAPPING // RESOURCE_POLICY: resource_uuid (CR node UUID), uuid, customization_uuid, invariant_uuid, name, version, policy_type, @@ -323,7 +331,7 @@ public class SdncBaseModel { addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); addParameter("policy_customization_uuid", policyCustomizationUuid, mappingParams); - addParameter("target_type", targetNode.getMetaData().getValue("type"), mappingParams); + addParameter("target_type", targetNode.getMetaData().getValue(PARAM_TYPE_KEY), mappingParams); LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid); insertToscaData(buildSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", model_yaml, mappingParams), null); @@ -362,7 +370,7 @@ public class SdncBaseModel { // extract properties addParameter("property_type", extractValueStatic(policy, "type"), policyParams); addParameter("property_source", extractValueStatic(policy, "source"), policyParams); - addParameter("property_name", extractValueStatic(policy, "name"), policyParams); + addParameter("property_name", extractValueStatic(policy, "name"), policyParams); try { @@ -428,15 +436,15 @@ public class SdncBaseModel { Map policyParams = new HashMap(); addParameter("policy_uuid", policyUuid, policyParams); addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - String policyName = policy.getMetaData().getOrDefault("name", "").toString(); + String policyName = policy.getMetaData().getOrDefault(PARAM_NAME_KEY, "").toString(); addParameter("policy_name", policyName, policyParams); - addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); + addParameter(PARAM_VERSION_KEY, policy.getMetaData().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); addParameter("policy_type", policy.getType(), policyParams); // extract properties - addParameter("property_type", extractValue(policy, "type"), policyParams); + addParameter("property_type", extractValue(policy, PARAM_TYPE_KEY), policyParams); addParameter("property_source", extractValue(policy, "source"), policyParams); - addParameter("property_name", extractValue(policy, "name"), policyParams); + addParameter("property_name", extractValue(policy, PARAM_NAME_KEY), policyParams); try { @@ -471,7 +479,7 @@ public class SdncBaseModel { addParameter("parent_uuid", parentUuid, mappingParams); addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); - addParameter("target_type", targetNode.getMetaData().getValue("type"), mappingParams); // type of the target node + addParameter("target_type", targetNode.getMetaData().getValue(PARAM_TYPE_KEY), mappingParams); // type of the target node LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid + " and target_node_uuid = " + targetNode.getMetaData().getValue("UUID")); SdncBaseModel.insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", "", mappingParams), null); @@ -523,7 +531,7 @@ public class SdncBaseModel { Map nodeCapabilityParams = new HashMap(); addParameter("capability_provider_customization_uuid", getCustomizationUUIDNoQuotes(), nodeCapabilityParams); // node customization UUID addParameter("capability_name", capability.getName(), nodeCapabilityParams); - addParameter("capability_type", extractValue(capability, "type"), nodeCapabilityParams); + addParameter("capability_type", extractValue(capability, PARAM_TYPE_KEY), nodeCapabilityParams); // Insert NODE_CAPABILITY data for each capability String capabilityId = ""; -- cgit 1.2.3-korg From 634b640f2aa3779b94ab54ebf959030b563fb072 Mon Sep 17 00:00:00 2001 From: "Agarwal, Ruchira(ra1926)" Date: Mon, 20 Aug 2018 16:13:20 +0000 Subject: add LCM DistributeTraffic LCM API for DistributeTraffic Change-Id: I4b3c323d46bd088421d0d6d66fc23982bf086679 Issue-ID: CCSDK-477 Signed-off-by: Agarwal, Ruchira(ra1926) --- lcm/model/src/main/yang/lcm.yang | 25 +++++++++++++++ .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 21 +++++++++++++ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 36 ++++++++++++++++++++++ .../graphs/lcm/LCM_distribute-traffic.xml | 30 ++++++++++++++++++ .../src/test/resources/graphs/lcm/graph.versions | 1 + 5 files changed, 113 insertions(+) create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index 9976dd9e5..a03fff607 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -111,6 +111,7 @@ module LCM { enum "StartApplication"; enum "QuiesceTraffic"; enum "ResumeTraffic"; + enum "DistributeTraffic"; enum "UpgradePreCheck"; enum "UpgradeSoftware"; enum "UpgradePostCheck"; @@ -516,6 +517,30 @@ module LCM { } } + /********************************************************************************** + * Define the VNF distribute traffic service + **********************************************************************************/ + rpc distribute-traffic { + description "An operation to distribute traffic gracefully on the VF. + It distributes traffic gracefully without stopping the application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + /********************************************************************************** * Define the VNF UpgradePreCheck service **********************************************************************************/ diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 787a94e2b..939836bed 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -350,6 +350,27 @@ public class LcmProvider implements AutoCloseable, LCMService { return Futures.immediateFuture(rpcResult); } + @Override + public Future> distributeTraffic(DistributeTrafficInput input) { + DistributeTrafficInputBuilder iBuilder = new DistributeTrafficInputBuilder(input); + DistributeTrafficOutputBuilder oBuilder = new DistributeTrafficOutputBuilder(); + + try { + CommonLcmFields retval = callDG("distribute-traffic", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + @Override public Future> configure(ConfigureInput input) { ConfigureInputBuilder iBuilder = new ConfigureInputBuilder(input); diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 38920e0ba..234eb615f 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -73,6 +73,8 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigureOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DistributeTrafficInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DistributeTrafficOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.HealthCheckInputBuilder; @@ -526,6 +528,40 @@ public class TestLcmProvider { } } + @Test + public void testDistributeTraffic() { + DistributeTrafficInputBuilder builder = new DistributeTrafficInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DistributeTraffic); + builder.setPayload(mock(Payload.class)); + + + try { + DistributeTrafficOutput results = provider.distributeTraffic(builder.build()).get().getResult(); + LOG.info("DistributeTraffic returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DistributeTraffic threw exception"); + } + } + @Test public void testConfigure() { ConfigureInputBuilder builder = new ConfigureInputBuilder(); diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml new file mode 100644 index 000000000..14ff1134c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index 4ca21daf3..233aa459f 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -27,6 +27,7 @@ LCM stop-application 1.0.0 sync LCM start-application 1.0.0 sync LCM quiesce-traffic 1.0.0 sync LCM resume-traffic 1.0.0 sync +LCM distribute-traffic 1.0.0 sync LCM upgrade-pre-check 1.0.0 sync LCM upgrade-software 1.0.0 sync LCM upgrade-post-check 1.0.0 sync -- cgit 1.2.3-korg From a3f39cee1edbae8c17d96a735a6e2581dd2c7908 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Mon, 20 Aug 2018 11:02:12 -0400 Subject: Update swagger documentation Re-generated converted swagger doc. Note: ideally, it would be good to generate this on the fly based on Yang model. However, ODL yangtools generates swagger 1.2, and readthedocs needs version 2. Currently we convert this using api-spec-converter tool and store converted version. Tried automating this conversion, which works fine in local compiles but does not work on ONAP Jenkins (tool is node.js based). Change-Id: I3843787ed7cb11f119b2c706305c478fdb223680 Issue-ID: CCSDK-476 Signed-off-by: Timoney, Dan (dt5972) --- .../src/main/resources/asdc-api.20170201.json | 401 +- .../src/main/resources/dataChange.20150519.json | 22 +- lcm/model/src/main/resources/lcm.20180329.json | 4299 ++++++++++++++++++++ 3 files changed, 4428 insertions(+), 294 deletions(-) create mode 100644 lcm/model/src/main/resources/lcm.20180329.json diff --git a/asdcApi/model/src/main/resources/asdc-api.20170201.json b/asdcApi/model/src/main/resources/asdc-api.20170201.json index c82c75159..7bf27da82 100644 --- a/asdcApi/model/src/main/resources/asdc-api.20170201.json +++ b/asdcApi/model/src/main/resources/asdc-api.20170201.json @@ -1009,26 +1009,26 @@ }, { "in": "body", - "name": "**(config)time", + "name": "**(config)threshold-value", "required": false, "schema": { - "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time-TOP" + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value-TOP" } }, { "in": "body", - "name": "**(config)operational-scope", + "name": "**(config)time", "required": false, "schema": { - "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope-TOP" + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time-TOP" } }, { "in": "body", - "name": "**(config)threshold-value", + "name": "**(config)operational-scope", "required": false, "schema": { - "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value-TOP" + "$ref": "#/definitions/ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope-TOP" } }, { @@ -1946,17 +1946,12 @@ "(config)aggregation-functionPOST": { "properties": { "other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "value": { - "$ref": "#/definitions/Peak", - "description": "xxxx", - "enum": [ - "Peak", - "Average", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -1964,11 +1959,11 @@ "(config)artifactPOST": { "properties": { "artifact-name": { - "$ref": "#/definitions/Some artifact-name", + "$ref": "#/definitions/Optional.empty", "description": "Name of artifact" }, "artifact-version": { - "$ref": "#/definitions/Some artifact-version", + "$ref": "#/definitions/Optional.empty", "description": "Version of artifact" } }, @@ -1988,27 +1983,12 @@ "(config)entitlement-metricPOST": { "properties": { "other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "value": { - "$ref": "#/definitions/Software_Instances_Count", - "description": "xxxx", - "enum": [ - "Software_Instances_Count", - "CPU", - "Core", - "Trunks", - "User", - "Subscribers", - "Tenants", - "Tokens", - "Seats", - "Units_TB", - "Units_GB", - "Units_MB", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2033,7 +2013,7 @@ "type": "object" }, "description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "entitlement-metric": { @@ -2043,19 +2023,19 @@ "type": "object" }, "entitlement-pool-uuid": { - "$ref": "#/definitions/Some entitlement-pool-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "increments": { - "$ref": "#/definitions/Some increments", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "manufacturer-reference-number": { - "$ref": "#/definitions/Some manufacturer-reference-number", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "operational-scope": { @@ -2093,11 +2073,11 @@ "(config)feature-groupPOST": { "properties": { "att-part-number": { - "$ref": "#/definitions/Some att-part-number", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "entitlement-pool-list": { @@ -2107,7 +2087,7 @@ "type": "object" }, "feature-group-uuid": { - "$ref": "#/definitions/Some feature-group-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "license-key-group-list": { @@ -2117,7 +2097,7 @@ "type": "object" }, "name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2132,7 +2112,7 @@ "type": "array" }, "name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2141,15 +2121,15 @@ "(config)license-key-groupPOST": { "properties": { "description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "license-key-group-uuid": { - "$ref": "#/definitions/Some license-key-group-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "operational-scope": { @@ -2159,13 +2139,8 @@ "type": "object" }, "type": { - "$ref": "#/definitions/Universal", - "description": "xxxx", - "enum": [ - "Universal", - "Unique", - "One_Time" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2173,22 +2148,12 @@ "(config)operational-scopePOST": { "properties": { "other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "value": { - "$ref": "#/definitions/Network_Wide", - "description": "xxxx", - "enum": [ - "Network_Wide", - "Availability_Zone", - "Data_Center", - "Tenant", - "VM", - "CPU", - "Core", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2196,15 +2161,11 @@ "(config)threshold-valuePOST": { "properties": { "unit": { - "$ref": "#/definitions/Absolute", - "description": "xxxx", - "enum": [ - "Absolute", - "Percentage" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" }, "value": { - "$ref": "#/definitions/0", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2213,20 +2174,12 @@ "(config)timePOST": { "properties": { "other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "value": { - "$ref": "#/definitions/Hour", - "description": "xxxx", - "enum": [ - "Hour", - "Day", - "Month", - "Quarter", - "Year", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2234,11 +2187,11 @@ "(config)vf-license-model-versionPOST": { "properties": { "artifact-name": { - "$ref": "#/definitions/Some artifact-name", + "$ref": "#/definitions/Optional.empty", "description": "Name of artifact" }, "artifact-version": { - "$ref": "#/definitions/Some artifact-version", + "$ref": "#/definitions/Optional.empty", "description": "Version of artifact" }, "vf-license-model": { @@ -2270,11 +2223,11 @@ "type": "object" }, "vendor-name": { - "$ref": "#/definitions/Some vendor-name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "vf-id": { - "$ref": "#/definitions/Some vf-id", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2283,11 +2236,11 @@ "(vf-license-model-update)input": { "properties": { "ASDC-API:artifact-name": { - "$ref": "#/definitions/Some artifact-name", + "$ref": "#/definitions/Optional.empty", "description": "Name of artifact" }, "ASDC-API:artifact-version": { - "$ref": "#/definitions/Some artifact-version", + "$ref": "#/definitions/Optional.empty", "description": "Version of artifact" }, "ASDC-API:vf-license-model": { @@ -2314,11 +2267,11 @@ "(vf-license-model-update)output": { "properties": { "ASDC-API:asdc-api-response-code": { - "$ref": "#/definitions/Some asdc-api-response-code", + "$ref": "#/definitions/Optional.empty", "description": "Code indicating success/failure" }, "ASDC-API:asdc-api-response-text": { - "$ref": "#/definitions/Some asdc-api-response-text", + "$ref": "#/definitions/Optional.empty", "description": "Text indicating reason for failure" } }, @@ -2367,11 +2320,11 @@ "type": "object" }, "ASDC-API:vendor-name": { - "$ref": "#/definitions/Some vendor-name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:vf-id": { - "$ref": "#/definitions/Some vf-id", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2442,11 +2395,11 @@ "ASDC-API/artifacts(config)artifact": { "properties": { "ASDC-API:artifact-name": { - "$ref": "#/definitions/Some artifact-name", + "$ref": "#/definitions/Optional.empty", "description": "Name of artifact" }, "ASDC-API:artifact-version": { - "$ref": "#/definitions/Some artifact-version", + "$ref": "#/definitions/Optional.empty", "description": "Version of artifact" } }, @@ -2490,11 +2443,11 @@ "ASDC-API/vf-license-model-versions(config)vf-license-model-version": { "properties": { "ASDC-API:artifact-name": { - "$ref": "#/definitions/Some artifact-name", + "$ref": "#/definitions/Optional.empty", "description": "Name of artifact" }, "ASDC-API:artifact-version": { - "$ref": "#/definitions/Some artifact-version", + "$ref": "#/definitions/Optional.empty", "description": "Version of artifact" }, "ASDC-API:vf-license-model": { @@ -2528,11 +2481,11 @@ "type": "object" }, "ASDC-API:vendor-name": { - "$ref": "#/definitions/Some vendor-name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:vf-id": { - "$ref": "#/definitions/Some vf-id", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2577,11 +2530,11 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list(config)feature-group": { "properties": { "ASDC-API:att-part-number": { - "$ref": "#/definitions/Some att-part-number", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:entitlement-pool-list": { @@ -2592,7 +2545,7 @@ "type": "object" }, "ASDC-API:feature-group-uuid": { - "$ref": "#/definitions/Some feature-group-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:license-key-group-list": { @@ -2603,7 +2556,7 @@ "type": "object" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2655,7 +2608,7 @@ "type": "array" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2683,7 +2636,7 @@ "type": "object" }, "ASDC-API:description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:entitlement-metric": { @@ -2694,19 +2647,19 @@ "type": "object" }, "ASDC-API:entitlement-pool-uuid": { - "$ref": "#/definitions/Some entitlement-pool-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:increments": { - "$ref": "#/definitions/Some increments", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:manufacturer-reference-number": { - "$ref": "#/definitions/Some manufacturer-reference-number", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:operational-scope": { @@ -2748,17 +2701,12 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Peak", - "description": "xxxx", - "enum": [ - "Peak", - "Average", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2778,27 +2726,12 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Software_Instances_Count", - "description": "xxxx", - "enum": [ - "Software_Instances_Count", - "CPU", - "Core", - "Trunks", - "User", - "Subscribers", - "Tenants", - "Tokens", - "Seats", - "Units_TB", - "Units_GB", - "Units_MB", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2818,22 +2751,12 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Network_Wide", - "description": "xxxx", - "enum": [ - "Network_Wide", - "Availability_Zone", - "Data_Center", - "Tenant", - "VM", - "CPU", - "Core", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2853,15 +2776,11 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value": { "properties": { "ASDC-API:unit": { - "$ref": "#/definitions/Absolute", - "description": "xxxx", - "enum": [ - "Absolute", - "Percentage" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/0", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -2882,20 +2801,12 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Hour", - "description": "xxxx", - "enum": [ - "Hour", - "Day", - "Month", - "Quarter", - "Year", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2915,15 +2826,15 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group": { "properties": { "ASDC-API:description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:license-key-group-uuid": { - "$ref": "#/definitions/Some license-key-group-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:operational-scope": { @@ -2934,13 +2845,8 @@ "type": "object" }, "ASDC-API:type": { - "$ref": "#/definitions/Universal", - "description": "xxxx", - "enum": [ - "Universal", - "Unique", - "One_Time" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2960,22 +2866,12 @@ "ASDC-API/vf-license-model-versions/vf-license-model-version/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Network_Wide", - "description": "xxxx", - "enum": [ - "Network_Wide", - "Availability_Zone", - "Data_Center", - "Tenant", - "VM", - "CPU", - "Core", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -2995,11 +2891,11 @@ "ASDC-API/vf-license-model/feature-group-list(config)feature-group": { "properties": { "ASDC-API:att-part-number": { - "$ref": "#/definitions/Some att-part-number", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:entitlement-pool-list": { @@ -3010,7 +2906,7 @@ "type": "object" }, "ASDC-API:feature-group-uuid": { - "$ref": "#/definitions/Some feature-group-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:license-key-group-list": { @@ -3021,7 +2917,7 @@ "type": "object" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -3073,7 +2969,7 @@ "type": "array" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -3101,7 +2997,7 @@ "type": "object" }, "ASDC-API:description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:entitlement-metric": { @@ -3112,19 +3008,19 @@ "type": "object" }, "ASDC-API:entitlement-pool-uuid": { - "$ref": "#/definitions/Some entitlement-pool-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:increments": { - "$ref": "#/definitions/Some increments", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:manufacturer-reference-number": { - "$ref": "#/definitions/Some manufacturer-reference-number", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:operational-scope": { @@ -3166,17 +3062,12 @@ "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)aggregation-function": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Peak", - "description": "xxxx", - "enum": [ - "Peak", - "Average", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -3196,27 +3087,12 @@ "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)entitlement-metric": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Software_Instances_Count", - "description": "xxxx", - "enum": [ - "Software_Instances_Count", - "CPU", - "Core", - "Trunks", - "User", - "Subscribers", - "Tenants", - "Tokens", - "Seats", - "Units_TB", - "Units_GB", - "Units_MB", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -3236,22 +3112,12 @@ "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)operational-scope": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Network_Wide", - "description": "xxxx", - "enum": [ - "Network_Wide", - "Availability_Zone", - "Data_Center", - "Tenant", - "VM", - "CPU", - "Core", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -3271,15 +3137,11 @@ "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)threshold-value": { "properties": { "ASDC-API:unit": { - "$ref": "#/definitions/Absolute", - "description": "xxxx", - "enum": [ - "Absolute", - "Percentage" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/0", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" } }, @@ -3300,20 +3162,12 @@ "ASDC-API/vf-license-model/feature-group-list/feature-group/entitlement-pool-list/entitlement-pool(config)time": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Hour", - "description": "xxxx", - "enum": [ - "Hour", - "Day", - "Month", - "Quarter", - "Year", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -3333,15 +3187,15 @@ "ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list(config)license-key-group": { "properties": { "ASDC-API:description": { - "$ref": "#/definitions/Some description", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:license-key-group-uuid": { - "$ref": "#/definitions/Some license-key-group-uuid", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:name": { - "$ref": "#/definitions/Some name", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:operational-scope": { @@ -3352,13 +3206,8 @@ "type": "object" }, "ASDC-API:type": { - "$ref": "#/definitions/Universal", - "description": "xxxx", - "enum": [ - "Universal", - "Unique", - "One_Time" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" @@ -3378,22 +3227,12 @@ "ASDC-API/vf-license-model/feature-group-list/feature-group/license-key-group-list/license-key-group(config)operational-scope": { "properties": { "ASDC-API:other": { - "$ref": "#/definitions/Some other", + "$ref": "#/definitions/Optional.empty", "description": "xxxx" }, "ASDC-API:value": { - "$ref": "#/definitions/Network_Wide", - "description": "xxxx", - "enum": [ - "Network_Wide", - "Availability_Zone", - "Data_Center", - "Tenant", - "VM", - "CPU", - "Core", - "Other" - ] + "$ref": "#/definitions/Optional.empty", + "description": "xxxx" } }, "type": "object" diff --git a/dataChange/model/src/main/resources/dataChange.20150519.json b/dataChange/model/src/main/resources/dataChange.20150519.json index 128195b52..be17d564b 100644 --- a/dataChange/model/src/main/resources/dataChange.20150519.json +++ b/dataChange/model/src/main/resources/dataChange.20150519.json @@ -44,10 +44,10 @@ "(config)key-dataPOST": { "properties": { "key-name": { - "$ref": "#/definitions/Some key-name" + "$ref": "#/definitions/Optional.empty" }, "key-value": { - "$ref": "#/definitions/Some key-value" + "$ref": "#/definitions/Optional.empty" } }, "type": "object" @@ -55,17 +55,13 @@ "(data-change-notification)input": { "properties": { "DataChange:aai-event-id": { - "$ref": "#/definitions/Some aai-event-id" + "$ref": "#/definitions/Optional.empty" }, "DataChange:aai-event-trigger": { - "$ref": "#/definitions/Update", - "enum": [ - "Update", - "Delete" - ] + "$ref": "#/definitions/Optional.empty" }, "DataChange:aai-node-type": { - "$ref": "#/definitions/Some aai-node-type" + "$ref": "#/definitions/Optional.empty" }, "DataChange:key-data": { "items": { @@ -74,7 +70,7 @@ "type": "array" }, "DataChange:selflink": { - "$ref": "#/definitions/Some selflink" + "$ref": "#/definitions/Optional.empty" } }, "type": "object" @@ -93,7 +89,7 @@ "(data-change-notification)output": { "properties": { "DataChange:data-change-response-code": { - "$ref": "#/definitions/Some data-change-response-code" + "$ref": "#/definitions/Optional.empty" } }, "type": "object" @@ -112,10 +108,10 @@ "DataChange(config)key-data": { "properties": { "DataChange:key-name": { - "$ref": "#/definitions/Some key-name" + "$ref": "#/definitions/Optional.empty" }, "DataChange:key-value": { - "$ref": "#/definitions/Some key-value" + "$ref": "#/definitions/Optional.empty" } }, "type": "object" diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json new file mode 100644 index 000000000..291e18fb1 --- /dev/null +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -0,0 +1,4299 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0" + }, + "basePath": "/restconf", + "paths": { + "/operations/LCM:action-status": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(action-status)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(action-status)output-TOP" + } + } + }, + "description": "An operation to get the current state of the previously submitted LCM request", + "operationId": "action-status" + } + }, + "/operations/LCM:attach-volume": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(attach-volume)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(attach-volume)output-TOP" + } + } + }, + "description": "An operation to attach a cinder volume to a VM", + "operationId": "attach-volume" + } + }, + "/operations/LCM:audit": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(audit)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(audit)output-TOP" + } + } + }, + "description": "An operation to audit the configurations of a virtual network function (or VM)", + "operationId": "audit" + } + }, + "/operations/LCM:check-lock": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(check-lock)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(check-lock)output-TOP" + } + } + }, + "description": "An operation to check VNF lock status", + "operationId": "check-lock" + } + }, + "/operations/LCM:config-backup": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(config-backup)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config-backup)output-TOP" + } + } + }, + "description": "An operation to Backup configurations of a virtual network function\\n(or VM)", + "operationId": "config-backup" + } + }, + "/operations/LCM:config-backup-delete": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(config-backup-delete)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config-backup-delete)output-TOP" + } + } + }, + "description": "An operation to Delete backup configurations of a virtual network\\nfunction (or VM)", + "operationId": "config-backup-delete" + } + }, + "/operations/LCM:config-export": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(config-export)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config-export)output-TOP" + } + } + }, + "description": "An operation to Export configurations of a virtual network function\\n(or VM)", + "operationId": "config-export" + } + }, + "/operations/LCM:config-modify": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(config-modify)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config-modify)output-TOP" + } + } + }, + "description": "Use the ModifyConfig command when a full configuration cycle is either not required\\nor is considered too costly. The ModifyConfig LCM action affects only a subset of the\\ntotal configuration data of a VNF. The set of configuration parameters to be affected\\nis a subset of the total configuration data of the target VNF type. The payload Stop\\nApplication must contain the configuration parameters to be modified and their values.\\nA successful modify returns a success response. A failed modify returns a failure\\nresponse and the specific failure messages in the response payload Stop Application", + "operationId": "config-modify" + } + }, + "/operations/LCM:config-restore": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(config-restore)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config-restore)output-TOP" + } + } + }, + "description": "An operation to restore the configurations of a virtual network\\nfunction (or VM)", + "operationId": "config-restore" + } + }, + "/operations/LCM:config-scale-out": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(config-scale-out)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(config-scale-out)output-TOP" + } + } + }, + "description": "An operation to Modify the configuration or other action to support\\na ConfigScaleOut of a VNF.", + "operationId": "config-scale-out" + } + }, + "/operations/LCM:configure": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(configure)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(configure)output-TOP" + } + } + }, + "description": "An operation to configure the configurations of a virtual network\\nfunction (or VM)", + "operationId": "configure" + } + }, + "/operations/LCM:detach-volume": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(detach-volume)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(detach-volume)output-TOP" + } + } + }, + "description": "An operation to detach a cinder volume from a VM", + "operationId": "detach-volume" + } + }, + "/operations/LCM:evacuate": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(evacuate)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(evacuate)output-TOP" + } + } + }, + "description": "An operation to evacuate a virtual network function (or VM)", + "operationId": "evacuate" + } + }, + "/operations/LCM:health-check": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(health-check)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(health-check)output-TOP" + } + } + }, + "description": "An operation to perform health check of vSCP prior its upgrading", + "operationId": "health-check" + } + }, + "/operations/LCM:live-upgrade": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(live-upgrade)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(live-upgrade)output-TOP" + } + } + }, + "description": "An operation to perform upgrade of vSCP", + "operationId": "live-upgrade" + } + }, + "/operations/LCM:lock": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(lock)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(lock)output-TOP" + } + } + }, + "description": "An operation to perform VNF lock operation", + "operationId": "lock" + } + }, + "/operations/LCM:migrate": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(migrate)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(migrate)output-TOP" + } + } + }, + "description": "An operation to migrate a virtual network function (or VM)", + "operationId": "migrate" + } + }, + "/operations/LCM:query": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(query)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(query)output-TOP" + } + } + }, + "description": "An operation to query the status of a targe VNF.\\nReturns information on each VM, including state (active or standby)\\nand status (healthy or unhealthy)", + "operationId": "query" + } + }, + "/operations/LCM:quiesce-traffic": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(quiesce-traffic)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(quiesce-traffic)output-TOP" + } + } + }, + "description": "An operation to stop traffic gracefully on the VF.\\nIt stops traffic gracefully without stopping the application", + "operationId": "quiesce-traffic" + } + }, + "/operations/LCM:reboot": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(reboot)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(reboot)output-TOP" + } + } + }, + "description": "An operation to reboot a specified virtual machine (VM)", + "operationId": "reboot" + } + }, + "/operations/LCM:rebuild": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(rebuild)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(rebuild)output-TOP" + } + } + }, + "description": "An operation to rebuild a virtual network function (or VM)", + "operationId": "rebuild" + } + }, + "/operations/LCM:restart": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(restart)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(restart)output-TOP" + } + } + }, + "description": "An operation to restart a virtual network function (or VM)", + "operationId": "restart" + } + }, + "/operations/LCM:resume-traffic": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(resume-traffic)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(resume-traffic)output-TOP" + } + } + }, + "description": "An operation to resume traffic gracefully on the VF.\\nIt resumes traffic gracefully without stopping the application", + "operationId": "resume-traffic" + } + }, + "/operations/LCM:rollback": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(rollback)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(rollback)output-TOP" + } + } + }, + "description": "An operation to rollback to particular snapshot of a virtual network function (or VM)", + "operationId": "rollback" + } + }, + "/operations/LCM:snapshot": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(snapshot)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(snapshot)output-TOP" + } + } + }, + "description": "An operation to create a snapshot of a virtual network function (or VM)", + "operationId": "snapshot" + } + }, + "/operations/LCM:software-upload": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(software-upload)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(software-upload)output-TOP" + } + } + }, + "description": "An operation to upload a new version of vSCP image to vSCP for updating it", + "operationId": "software-upload" + } + }, + "/operations/LCM:start": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(start)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(start)output-TOP" + } + } + }, + "description": "An operation to start a virtual network function (or VM)", + "operationId": "start" + } + }, + "/operations/LCM:start-application": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(start-application)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(start-application)output-TOP" + } + } + }, + "description": "An operation to perform VNF Start Application operation", + "operationId": "start-application" + } + }, + "/operations/LCM:stop": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(stop)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(stop)output-TOP" + } + } + }, + "description": "An operation to stop the configurations of a virtual network function (or VM)", + "operationId": "stop" + } + }, + "/operations/LCM:stop-application": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(stop-application)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(stop-application)output-TOP" + } + } + }, + "description": "An operation to Stop Application traffic to a virtual network function", + "operationId": "stop-application" + } + }, + "/operations/LCM:sync": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(sync)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(sync)output-TOP" + } + } + }, + "description": "An operation to sync the configurations of a virtual network function (or VM)", + "operationId": "sync" + } + }, + "/operations/LCM:terminate": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(terminate)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(terminate)output-TOP" + } + } + }, + "description": "An operation to terminate the configurations of a virtual network function (or VM)", + "operationId": "terminate" + } + }, + "/operations/LCM:test": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(test)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(test)output-TOP" + } + } + }, + "description": "An operation to test the configurations of a virtual network function (or VM)", + "operationId": "test" + } + }, + "/operations/LCM:unlock": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(unlock)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(unlock)output-TOP" + } + } + }, + "description": "An operation to perform VNF unlock operation", + "operationId": "unlock" + } + }, + "/operations/LCM:upgrade-backout": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(upgrade-backout)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(upgrade-backout)output-TOP" + } + } + }, + "description": "An operation does a backout after an UpgradeSoftware is completed (either successfully or unsuccessfully).", + "operationId": "upgrade-backout" + } + }, + "/operations/LCM:upgrade-backup": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(upgrade-backup)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(upgrade-backup)output-TOP" + } + } + }, + "description": "An operation to do full backup of the VNF data prior to an upgrade.", + "operationId": "upgrade-backup" + } + }, + "/operations/LCM:upgrade-post-check": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(upgrade-post-check)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(upgrade-post-check)output-TOP" + } + } + }, + "description": "An operation to check the VNF upgrade has been successful completed and all processes are running properly.", + "operationId": "upgrade-post-check" + } + }, + "/operations/LCM:upgrade-pre-check": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(upgrade-pre-check)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(upgrade-pre-check)output-TOP" + } + } + }, + "description": "An operation to check that the VNF has the correct software version needed for a software upgrade.", + "operationId": "upgrade-pre-check" + } + }, + "/operations/LCM:upgrade-software": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(upgrade-software)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(upgrade-software)output-TOP" + } + } + }, + "description": "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status .", + "operationId": "upgrade-software" + } + } + }, + "definitions": { + "(action-status)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(action-status)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(action-status)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(action-status)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(action-status)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(action-status)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(attach-volume)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(attach-volume)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(attach-volume)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(attach-volume)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(attach-volume)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(attach-volume)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(audit)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(audit)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(audit)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(audit)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(audit)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(audit)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(check-lock)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(check-lock)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(check-lock)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(check-lock)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:locked": { + "$ref": "#/definitions/Optional.empty", + "description": "TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(check-lock)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(check-lock)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config)LCM_modulePOST": { + "type": "object" + }, + "(config)action-identifiersPOST": { + "properties": { + "service-instance-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies a specific service the command refers to. When multiple\\n APP-C instances are used and applied to a subset of services,\\n this will become significant . The field is mandatory when the\\n vnf-id is empty" + }, + "vf-module-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the VF module to which this action is to be applied." + }, + "vnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the VNF to which this action is to be applied(vnf-id\\n uniquely identifies the service-instance referred to). Note that\\n some actions are applied to multiple VNFs in the same service.\\n When this is the case, vnf-id may be left out, but service-instance-id\\n must appear. The field is mandatory when service-instance-id is\\n empty" + }, + "vnfc-name": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the VNFC to which this action is to be applied. Some\\n actions apply only to a component within a VNF (e.g. RESTART is\\n sometimes applied to on VM only). In such a case, the name of\\n the VNFC is used to search for the component within the VNF" + }, + "vserver-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + } + }, + "type": "object" + }, + "(config)common-headerPOST": { + "properties": { + "api-ver": { + "$ref": "#/definitions/Optional.empty", + "description": "api-ver is the API version identifier. A given release of APPC\\n should support all previous versions of APPC API (correlate with\\n general requirements)" + }, + "flags": { + "items": { + "$ref": "#/definitions/LCM/common-header(config)flags" + }, + "type": "object" + }, + "originator-id": { + "$ref": "#/definitions/Optional.empty", + "description": "originator-id an identifier of the calling system which can be\\n used addressing purposes, i.e. returning asynchronous response\\n to the proper destination over DMaaP (especially in case of multiple\\n consumers of APP-C APIs)" + }, + "request-id": { + "$ref": "#/definitions/Optional.empty", + "description": "UUID for the request ID. An OSS/BSS identifier for the request\\n that caused the current action. Multiple API calls may be made\\n with the same request-id The request-id shall be recorded throughout\\n the operations on a single request" + }, + "sub-request-id": { + "$ref": "#/definitions/Optional.empty", + "description": "Uniquely identifies a specific LCM action. It is persistent over\\n the life-cycle of a single request" + }, + "timestamp": { + "$ref": "#/definitions/Optional.empty", + "description": "timestamp is in ISO 8601 timestamp format ZULU offset" + } + }, + "required": [ + "api-ver", + "originator-id", + "request-id", + "timestamp" + ], + "type": "object" + }, + "(config)flagsPOST": { + "properties": { + "force": { + "$ref": "#/definitions/Optional.empty", + "description": "TRUE/FALSE - Execute action even if target is in unstable (i.e.\\n locked, transiting, etc.) state" + }, + "mode": { + "$ref": "#/definitions/Optional.empty", + "description": "EXCLUSIVE (accept no queued requests on this VNF while processing)\\n or NORMAL (queue other requests until complete)" + }, + "ttl": { + "$ref": "#/definitions/Optional.empty", + "description": "<0....N> - The timeout value (expressed in seconds) for action\\n execution, between action being received by APPC and action initiation" + } + }, + "type": "object" + }, + "(config)query-resultsPOST": { + "properties": { + "vm-state": { + "$ref": "#/definitions/Optional.empty", + "description": "The state of the VM" + }, + "vm-status": { + "$ref": "#/definitions/Optional.empty", + "description": "the status of the VM" + }, + "vserver-id": { + "$ref": "#/definitions/Optional.empty", + "description": "Identifier of a VM" + } + }, + "required": [ + "vm-state", + "vm-status", + "vserver-id" + ], + "type": "object" + }, + "(config)statusPOST": { + "properties": { + "code": { + "$ref": "#/definitions/Optional.empty", + "description": "Response code" + }, + "message": { + "$ref": "#/definitions/Optional.empty", + "description": "Response message" + } + }, + "required": [ + "code", + "message" + ], + "type": "object" + }, + "(config-backup)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(config-backup)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(config-backup)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-backup)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-backup)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(config-backup)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-backup-delete)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(config-backup-delete)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(config-backup-delete)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-backup-delete)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-backup-delete)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(config-backup-delete)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-export)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(config-export)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(config-export)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-export)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-export)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(config-export)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-modify)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(config-modify)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(config-modify)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-modify)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-modify)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(config-modify)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-restore)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(config-restore)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(config-restore)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-restore)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-restore)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(config-restore)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-scale-out)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(config-scale-out)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(config-scale-out)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-scale-out)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(config-scale-out)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(config-scale-out)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(configure)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(configure)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(configure)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(configure)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(configure)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(configure)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(detach-volume)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(detach-volume)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(detach-volume)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(detach-volume)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(detach-volume)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(detach-volume)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(evacuate)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(evacuate)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(evacuate)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(evacuate)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(evacuate)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(evacuate)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(health-check)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(health-check)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(health-check)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(health-check)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(health-check)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(health-check)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(live-upgrade)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(live-upgrade)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(live-upgrade)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(live-upgrade)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(live-upgrade)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(live-upgrade)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(lock)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(lock)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(lock)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(lock)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(lock)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(lock)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(migrate)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(migrate)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(migrate)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(migrate)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(migrate)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(migrate)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(query)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(query)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(query)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(query)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:query-results": { + "items": { + "$ref": "#/definitions/LCM(config)query-results" + }, + "type": "array" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(query)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(query)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(quiesce-traffic)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(quiesce-traffic)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(quiesce-traffic)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(quiesce-traffic)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(quiesce-traffic)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(quiesce-traffic)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(reboot)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(reboot)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(reboot)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(reboot)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(reboot)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(reboot)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(rebuild)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(rebuild)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(rebuild)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(rebuild)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(rebuild)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(rebuild)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(restart)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(restart)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(restart)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(restart)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(restart)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(restart)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(resume-traffic)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(resume-traffic)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(resume-traffic)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(resume-traffic)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(resume-traffic)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(resume-traffic)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(rollback)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:identity-url": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:snapshot-id": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:identity-url", + "LCM:snapshot-id" + ], + "type": "object" + }, + "(rollback)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(rollback)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(rollback)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(rollback)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(rollback)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(snapshot)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:identity-url": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:identity-url" + ], + "type": "object" + }, + "(snapshot)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(snapshot)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(snapshot)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:snapshot-id": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(snapshot)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(snapshot)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(software-upload)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(software-upload)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(software-upload)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(software-upload)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(software-upload)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(software-upload)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(start)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(start)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(start)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(start)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(start)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(start)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(start-application)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(start-application)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(start-application)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(start-application)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(start-application)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(start-application)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(stop)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(stop)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(stop)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(stop)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(stop)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(stop)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(stop-application)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(stop-application)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(stop-application)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(stop-application)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(stop-application)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(stop-application)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(sync)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(sync)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(sync)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(sync)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(sync)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(sync)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(terminate)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(terminate)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(terminate)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(terminate)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(terminate)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(terminate)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(test)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(test)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(test)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(test)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(test)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(test)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(unlock)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action" + ], + "type": "object" + }, + "(unlock)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(unlock)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(unlock)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(unlock)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(unlock)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-backout)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(upgrade-backout)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(upgrade-backout)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-backout)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-backout)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(upgrade-backout)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-backup)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(upgrade-backup)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(upgrade-backup)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-backup)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-backup)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(upgrade-backup)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-post-check)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(upgrade-post-check)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(upgrade-post-check)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-post-check)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-post-check)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(upgrade-post-check)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-pre-check)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(upgrade-pre-check)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(upgrade-pre-check)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-pre-check)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-pre-check)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(upgrade-pre-check)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-software)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(upgrade-software)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(upgrade-software)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-software)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "(upgrade-software)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(upgrade-software)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "LCM(config)action-identifiers": { + "properties": { + "LCM:service-instance-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies a specific service the command refers to. When multiple\\n APP-C instances are used and applied to a subset of services,\\n this will become significant . The field is mandatory when the\\n vnf-id is empty" + }, + "LCM:vf-module-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the VF module to which this action is to be applied." + }, + "LCM:vnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the VNF to which this action is to be applied(vnf-id\\n uniquely identifies the service-instance referred to). Note that\\n some actions are applied to multiple VNFs in the same service.\\n When this is the case, vnf-id may be left out, but service-instance-id\\n must appear. The field is mandatory when service-instance-id is\\n empty" + }, + "LCM:vnfc-name": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the VNFC to which this action is to be applied. Some\\n actions apply only to a component within a VNF (e.g. RESTART is\\n sometimes applied to on VM only). In such a case, the name of\\n the VNFC is used to search for the component within the VNF" + }, + "LCM:vserver-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + } + }, + "type": "object" + }, + "LCM(config)action-identifiers-TOP": { + "properties": { + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + } + }, + "type": "object" + }, + "LCM(config)common-header": { + "properties": { + "LCM:api-ver": { + "$ref": "#/definitions/Optional.empty", + "description": "api-ver is the API version identifier. A given release of APPC\\n should support all previous versions of APPC API (correlate with\\n general requirements)" + }, + "LCM:flags": { + "description": "Flags are generic flags that apply to any and all commands, all are optional", + "items": { + "$ref": "#/definitions/LCM/common-header(config)flags" + }, + "type": "object" + }, + "LCM:originator-id": { + "$ref": "#/definitions/Optional.empty", + "description": "originator-id an identifier of the calling system which can be\\n used addressing purposes, i.e. returning asynchronous response\\n to the proper destination over DMaaP (especially in case of multiple\\n consumers of APP-C APIs)" + }, + "LCM:request-id": { + "$ref": "#/definitions/Optional.empty", + "description": "UUID for the request ID. An OSS/BSS identifier for the request\\n that caused the current action. Multiple API calls may be made\\n with the same request-id The request-id shall be recorded throughout\\n the operations on a single request" + }, + "LCM:sub-request-id": { + "$ref": "#/definitions/Optional.empty", + "description": "Uniquely identifies a specific LCM action. It is persistent over\\n the life-cycle of a single request" + }, + "LCM:timestamp": { + "$ref": "#/definitions/Optional.empty", + "description": "timestamp is in ISO 8601 timestamp format ZULU offset" + } + }, + "required": [ + "LCM:api-ver", + "LCM:originator-id", + "LCM:request-id", + "LCM:timestamp" + ], + "type": "object" + }, + "LCM(config)common-header-TOP": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + } + }, + "type": "object" + }, + "LCM(config)query-results": { + "properties": { + "LCM:vm-state": { + "$ref": "#/definitions/Optional.empty", + "description": "The state of the VM" + }, + "LCM:vm-status": { + "$ref": "#/definitions/Optional.empty", + "description": "the status of the VM" + }, + "LCM:vserver-id": { + "$ref": "#/definitions/Optional.empty", + "description": "Identifier of a VM" + } + }, + "required": [ + "LCM:vm-state", + "LCM:vm-status", + "LCM:vserver-id" + ], + "type": "object" + }, + "LCM(config)query-results-TOP": { + "properties": { + "LCM:query-results": { + "items": { + "$ref": "#/definitions/LCM(config)query-results" + }, + "type": "array" + } + }, + "type": "object" + }, + "LCM(config)status": { + "properties": { + "LCM:code": { + "$ref": "#/definitions/Optional.empty", + "description": "Response code" + }, + "LCM:message": { + "$ref": "#/definitions/Optional.empty", + "description": "Response message" + } + }, + "required": [ + "LCM:code", + "LCM:message" + ], + "type": "object" + }, + "LCM(config)status-TOP": { + "properties": { + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "type": "object" + }, + "LCM/common-header(config)flags": { + "properties": { + "LCM:force": { + "$ref": "#/definitions/Optional.empty", + "description": "TRUE/FALSE - Execute action even if target is in unstable (i.e.\\n locked, transiting, etc.) state" + }, + "LCM:mode": { + "$ref": "#/definitions/Optional.empty", + "description": "EXCLUSIVE (accept no queued requests on this VNF while processing)\\n or NORMAL (queue other requests until complete)" + }, + "LCM:ttl": { + "$ref": "#/definitions/Optional.empty", + "description": "<0....N> - The timeout value (expressed in seconds) for action\\n execution, between action being received by APPC and action initiation" + } + }, + "type": "object" + }, + "LCM/common-header(config)flags-TOP": { + "properties": { + "LCM:flags": { + "description": "Flags are generic flags that apply to any and all commands, all are optional", + "items": { + "$ref": "#/definitions/LCM/common-header(config)flags" + }, + "type": "object" + } + }, + "type": "object" + }, + "unique_empty_identifier": {} + } +} -- cgit 1.2.3-korg From 40ff9f9d68660a157f9ff477003fc7b359747148 Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Fri, 7 Sep 2018 17:30:02 +0530 Subject: Update network topology to aai issue fix Change-Id: I72d25c8df8726430a087613544a274ca724713cb Issue-ID: SDNC-387 Signed-off-by: shashikanth.vh --- .../dmaapclient/SdncAaiDmaapConsumer.java | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) 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 be2e36c1a..fa9544f3f 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 @@ -132,8 +132,11 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { 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()); + if (action.equalsIgnoreCase("delete")) { + context.put((String) key, "Delete"); + } else { + context.put((String) key, "Update"); + } } } @@ -187,8 +190,8 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { 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."); @@ -196,31 +199,31 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { } 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"); + return; } if (!fieldMap.containsKey(SDNC_ENDPOINT)) { - throw new InvalidMessageException("No SDNC endpoint known for message " + entityType); + return; } - String sdncEndpoint = fieldMap.get(SDNC_ENDPOINT); - + 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); - + String templateName = fieldMap.get(TEMPLATE); + try { String rpcMsgbody = publish(templateName, msg); String odlUrlBase = getProperty("sdnc.odl.url-base"); -- cgit 1.2.3-korg From 4ea2182f617e8e4d80469d96a76128de72be7ee2 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Mon, 17 Sep 2018 16:52:32 -0400 Subject: VF Module ingestion add and parser vers update Changes made: Add vf_customization_uuid and vf_module_label in VF Module ingestion. Update sdc-tosca dependency version to 1.4.3 in pom.xml. Change-Id: I5b03e8ff72a74448901f1d5f6d9ed8b7688a6f15 Issue-ID: CCSDK-540 Signed-off-by: lalena.aria --- ueb-listener/pom.xml | 2 +- .../org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 2fff94e8e..66437e47c 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -18,7 +18,7 @@ 1.3.0 - 1.4.1 + 1.4.3 2.9.4 true /opt/app/ueb-listener 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 64bceb8cd..2ba8de0f1 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 @@ -35,11 +35,11 @@ public class SdncVFModuleModel extends SdncBaseModel { public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group, SdncVFModel vfNodeModel) { super(sdcCsarHelper, group); - //addParameter("vf_customization_uuid", vfNodeModel.getCustomizationUUIDNoQuotes()); + addParameter("vf_customization_uuid", vfNodeModel.getCustomizationUUIDNoQuotes()); // extract properties addParameter("vf_module_type", extractValue(group, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); - //addParameter("vf_module_label", extractValue(group, "vf_module_label")); + addParameter("vf_module_label", extractValue(group, "vf_module_label")); addIntParameter("availability_zone_count", extractValue(group, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)); addParameter("ecomp_generated_vm_assignments", extractBooleanValue(group, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS)); } -- cgit 1.2.3-korg From 481cf0c75af442dc223b803e4de8e797b931581d Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Thu, 20 Sep 2018 17:59:25 +0530 Subject: integration test issues fix for sdwan and sotn On topology discovery, ESR will be updated with pnf relationship resulting in update ESR event causing topology discovery to run in loop. Change-Id: I80d98d5b11f05d395e342479352656364fe071d4 Issue-ID: SDNC-357 Signed-off-by: shashikanth.vh --- .../onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 fa9544f3f..3733fa604 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 @@ -132,10 +132,12 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { context.put(((String)key).replaceAll("-", ""), eventHeader.get((String)key)); } else { String action = (String) eventHeader.get((String) key); - if (action.equalsIgnoreCase("delete")) { + if (action.equalsIgnoreCase("create")) { + context.put((String)key,"Update"); + } else if (action.equalsIgnoreCase("delete")) { context.put((String) key, "Delete"); } else { - context.put((String) key, "Update"); + throw new IOException("Action type not supported " + action); } } } -- cgit 1.2.3-korg From 95071c80308bec97a143831a1f849ebcadd2a604 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 26 Sep 2018 10:37:48 -0400 Subject: Prepare for release build Update for release build : (a) Remove -STAGING tag from release version in version.properties (b) Update to use released version of parent poms (c) Disable single-feature-test (which does not work with released dependencies from ONAP) Change-Id: I77658eeee2f5fcfd0c9eed4047472dff5973a6a2 Issue-ID: CCSDK-597 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 7 ++++++- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 7 ++++++- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 7 ++++++- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 7 ++++++- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- version.properties | 2 +- 29 files changed, 49 insertions(+), 29 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index d26c9485a..734d2cb75 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -17,6 +17,11 @@ ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + + true + + diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 6b6ac64dc..d03a5cc24 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index a8a493591..659230db4 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 37ec67679..31b0b5cf8 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 1cb8af920..3d157265d 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 292a4f363..34fe40b9e 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 1098160b6..10a040854 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 9ed0ac73c..b7d125101 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -17,6 +17,11 @@ ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + true + + + diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index bc673fddb..7bb1d928a 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index a9543ab2a..3c95e4067 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 7f100ec05..a5c1596af 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 26134c3e8..bb815423a 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 6c23fc48f..49d145da5 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 29a832449..82f5fbc33 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 0d7816985..2105991e5 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index ad1a578e4..b8acce508 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -17,6 +17,11 @@ feature ccsdk-sli-northbound :: features :: ${project.artifactId} + + + true + + diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 6372c7ea0..007bac172 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 4e3cdae03..2f52192d3 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/features/pom.xml b/features/pom.xml index 7a5e2e6a8..b02fe9c1e 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 5ea28878b..9399580fb 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -17,6 +17,11 @@ ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + true + + diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 71e729284..82b9fef3f 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 705360200..ad80220d9 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 22d7fafdd..b394c8f45 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index afa844ae6..058d6126c 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/lcm/pom.xml b/lcm/pom.xml index 2bc81749b..b168f778f 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 23efb6e4e..406683885 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/pom.xml b/pom.xml index 8c8f1c924..2b1d55151 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 66437e47c..702a0cb22 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.northbound diff --git a/version.properties b/version.properties index f9fd33500..881489379 100644 --- a/version.properties +++ b/version.properties @@ -9,6 +9,6 @@ feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version}-STAGING +release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 3af0d1e7ed4cb3d232fdc26aef88191ba8cd5615 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 26 Sep 2018 15:13:24 -0400 Subject: Roll to next snapshot Roll to next snapshot release Change-Id: Ied28c6296aa3447926bcc228e867654a460d8455 Issue-ID: CCSDK-597 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 7 ++----- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 7 ++----- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 7 ++----- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 7 ++----- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 4 ++-- 29 files changed, 58 insertions(+), 70 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 734d2cb75..4bf963664 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,21 +6,18 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - - true - diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index d03a5cc24..e00fe9a4d 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 659230db4..92d56e0e5 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 31b0b5cf8..188cb84d8 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 3d157265d..65fec69a8 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 34fe40b9e..44fabdaa7 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 10a040854..d38e69d2d 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index b7d125101..a36b53f14 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,20 +6,17 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - - true - diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 7bb1d928a..d02374ff5 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 3c95e4067..7019ff6f8 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index a5c1596af..3fc432d14 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index bb815423a..7636b0160 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 49d145da5..5a828f026 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 82f5fbc33..061ed9942 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 2105991e5..9c69e12d8 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index b8acce508..7a7f1faa3 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -7,20 +7,17 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} - - true - diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 007bac172..9cc865ffb 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 2f52192d3..814c8afc4 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index b02fe9c1e..d913625f6 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 9399580fb..57d773581 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,21 +6,18 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} - - true - diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 82b9fef3f..25a22892a 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index ad80220d9..99e77356a 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index b394c8f45..04071f991 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 058d6126c..3a196d1e3 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index b168f778f..d87f6b10f 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 406683885..6097cee74 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 2b1d55151..ace219ab2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT 4.0.0 @@ -114,7 +114,7 @@ ONAP - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 702a0cb22..4c166937b 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 881489379..36aa8e3f6 100644 --- a/version.properties +++ b/version.properties @@ -5,10 +5,10 @@ release_name=0 sprint_number=3 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version} +release_version=${base_version}-STAGING snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From d15fd7eeb0237bacfa8db4474bfa761235e32bc0 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 9 Oct 2018 11:26:12 -0400 Subject: Update to latest Tosca parser Use version 1.4.4 of Tosca parser, since version 1.4.3 does not exist. Change-Id: Ibf90c4fa3f36d783847aca9f30d69b96013e8017 Issue-ID: CCSDK-616 Signed-off-by: Timoney, Dan (dt5972) --- ueb-listener/pom.xml | 56 +++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 4c166937b..885dea0c8 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 @@ -18,7 +20,7 @@ 1.3.0 - 1.4.3 + 1.4.4 2.9.4 true /opt/app/ueb-listener @@ -35,12 +37,12 @@ ${sdc.client.version} compile - - org.onap.sdc.sdc-tosca - sdc-tosca - ${sdc.tosca.version} - compile - + + org.onap.sdc.sdc-tosca + sdc-tosca + ${sdc.tosca.version} + compile + org.slf4j slf4j-api @@ -73,25 +75,25 @@ ${junit.version} test - - org.testng - testng - 6.11 - test - - - org.mockito - mockito-core - ${mockito.version} - test - - - ch.vorburger.mariaDB4j - mariaDB4j - 2.2.3 - test - - + + org.testng + testng + 6.11 + test + + + org.mockito + mockito-core + ${mockito.version} + test + + + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.3 + test + + org.onap.ccsdk.sli.core dblib-provider ${sdnctl.dblib.version} -- cgit 1.2.3-korg From b913c3d3bd3eadf4e5a16d006f220272c7426bd9 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 9 Oct 2018 13:03:09 -0400 Subject: Fix UEB client error handling Changed ueb-listener to retry start of client if it returns failure Change-Id: Ieda78615a38925824cb78d63939da00818bf4452 Issue-ID: SDNC-472 Signed-off-by: Timoney, Dan (dt5972) --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 d37518f1b..c025f3b05 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 @@ -27,6 +27,7 @@ import org.onap.sdc.impl.DistributionClientFactory; import org.onap.sdc.utils.DistributionActionResultEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.onap.sdc.utils.DistributionActionResultEnum; public class SdncUebClient { @@ -61,7 +62,12 @@ public class SdncUebClient { try { IDistributionClientResult start = client.start(); LOG.info("Client startup result = {}", start.getDistributionMessageResult()); - keepWaiting = false; + + // Only stop waiting if the result is success + if (start.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { + + keepWaiting = false; + } } catch(Exception e) { LOG.info("Client startup failure", e); } -- cgit 1.2.3-korg From 24794310b1cc8015eb171b8a89a8072c3bcf2434 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Wed, 10 Oct 2018 20:19:50 +0000 Subject: update handling of dmaap errors Update handling of dmaap errors in MessageRouterHttpClient. Instead of calling processMessage just log the error body message because the downstream client can't handle these type of exceptions. Change-Id: I3cee7f81ecbc316226a38908fb4f07ab04c1b64e Issue-ID: CCSDK-618 Signed-off-by: Smokowski, Kevin (ks6305) --- .../sli/northbound/dmaapclient/DmaapListener.java | 6 +- .../dmaapclient/MessageRouterHttpClient.java | 89 ++++++++++++---------- 2 files changed, 55 insertions(+), 40 deletions(-) mode change 100644 => 100755 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java mode change 100644 => 100755 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java 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 old mode 100644 new mode 100755 index 7e257a125..18c00d563 --- 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 @@ -41,7 +41,11 @@ public class DmaapListener { Properties properties = new Properties(); String propFileName = DMAAP_LISTENER_PROPERTIES; String propPath = null; - String propDir = System.getenv(SDNC_CONFIG_DIR); + String propDir = System.getProperty(SDNC_CONFIG_DIR); + if(propDir == null) { + propDir = System.getenv(SDNC_CONFIG_DIR); + LOG.debug(SDNC_CONFIG_DIR + " read from environment variable with value " + propDir); + } List consumers = new LinkedList<>(); if (args.length > 0) { diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java old mode 100644 new mode 100755 index c02ec5df3..2a9e0b145 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/MessageRouterHttpClient.java @@ -64,45 +64,56 @@ public class MessageRouterHttpClient implements SdncDmaapConsumer { } - @Override - public void run() { - if (isReady) { - isRunning = true; - while (isRunning) { - try { - Response response = getMessages.invoke(); - Log.info("GET " + uri + " returned http status " + response.getStatus()); - String entity = response.readEntity(String.class); - if (entity.contains("{")) { - // Get rid of opening [" - entity = entity.substring(2); - // Get rid of closing "] - entity = entity.substring(0, entity.length() - 2); - // This replacement effectively un-escapes the JSON - for (String message : entity.split("\",\"")) { - try { - processMsg(message.replace("\\\"", "\"")); - } catch (InvalidMessageException e) { - Log.error("Message could not be processed", e); - } - } - } else { - Log.info("Entity doesn't appear to contain JSON elements"); - } - } catch (Exception e) { - Log.error("GET " + uri + " failed.", e); - } finally { - Log.info("Pausing " + fetchPause + " milliseconds before fetching from " + uri + " again."); - try { - Thread.sleep(fetchPause); - } catch (InterruptedException e) { - Log.error("Could not sleep thread", e); - Thread.currentThread().interrupt(); - } - } - } - } - } + @Override + public void run() { + if (isReady) { + isRunning = true; + while (isRunning) { + try { + Response response = getMessages.invoke(); + Log.info("GET " + uri + " returned http status " + response.getStatus()); + String entity = response.readEntity(String.class); + if (response.getStatus() < 300) { + if (entity.contains("{")) { + // Get rid of opening [" + entity = entity.substring(2); + // Get rid of closing "] + entity = entity.substring(0, entity.length() - 2); + // This replacement effectively un-escapes the JSON + for (String message : entity.split("\",\"")) { + try { + processMsg(message.replace("\\\"", "\"")); + } catch (InvalidMessageException e) { + Log.error("Message could not be processed", e); + } + } + } else { + if (entity.length() < 1) { + Log.info("GET was successful, but the server returned an empty message body."); + } else { + Log.info( + "GET was successful, but entity is not valid JSON. Message body will be logged, but not processed"); + Log.info(entity); + } + } + } else { + Log.info("GET failed, message body will be logged, but not processed."); + Log.info(entity); + } + } catch (Exception e) { + Log.error("GET " + uri + " failed.", e); + } finally { + Log.info("Pausing " + fetchPause + " milliseconds before fetching from " + uri + " again."); + try { + Thread.sleep(fetchPause); + } catch (InterruptedException e) { + Log.error("Could not sleep thread", e); + Thread.currentThread().interrupt(); + } + } + } + } + } @Override public void init(Properties baseProperties, String consumerPropertiesPath) { -- cgit 1.2.3-korg From ee7f568ad7f2c136ffbdf1bd16afd92875f6a182 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 11 Oct 2018 16:20:15 -0400 Subject: Prepare for RC0 release Update to prepare for RC0 release build: remove -STAGING tag from release version and use released parent poms. Change-Id: I45e31eca955943ca66ec90db826a50d42f1f1d69 Issue-ID: CCSDK-617 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- version.properties | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 4bf963664..46540dbe7 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index e00fe9a4d..13ff659fd 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 92d56e0e5..aabebb4c6 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 188cb84d8..bb177871b 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 65fec69a8..f05f7d00b 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 44fabdaa7..3dd282706 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index d38e69d2d..8b6fa3f1a 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index a36b53f14..8e10406c3 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index d02374ff5..a5f343ebb 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 7019ff6f8..d711837bb 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 3fc432d14..07d183aa6 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 7636b0160..7a9d6a786 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 5a828f026..214a0848d 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 061ed9942..01700d9d1 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 9c69e12d8..92ab049ca 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 7a7f1faa3..6c4a01cbf 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 9cc865ffb..0d5d33417 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 814c8afc4..dde903d6d 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/features/pom.xml b/features/pom.xml index d913625f6..9c5909465 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 57d773581..9228ef9ca 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 25a22892a..b8241d69a 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 99e77356a..46c16b055 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 04071f991..8afffb4bb 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 3a196d1e3..bb465814c 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/lcm/pom.xml b/lcm/pom.xml index d87f6b10f..8108cd34d 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 6097cee74..7b581df77 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/pom.xml b/pom.xml index ace219ab2..e474168de 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 885dea0c8..5f51bb371 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.northbound diff --git a/version.properties b/version.properties index 36aa8e3f6..9f280ea3e 100644 --- a/version.properties +++ b/version.properties @@ -9,6 +9,6 @@ feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version}-STAGING +release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 9004b3654edc1d03a13564e09e741528f4da0a3f Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 23 Oct 2018 08:36:33 -0400 Subject: Roll to initial Dublin snapshot Roll version to initial Dublin snapshot Change-Id: Ic33e690da810cca17d7ff8cd028bb5028558fd17 Issue-ID: CCSDK-617 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 6 +++--- 29 files changed, 59 insertions(+), 59 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 46540dbe7..a83535f58 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 13ff659fd..6ce4e1317 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index aabebb4c6..4f15557ad 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index bb177871b..5e288db62 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index f05f7d00b..85ba01058 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 3dd282706..fe33ea701 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 8b6fa3f1a..2a918df20 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 8e10406c3..260253bc4 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index a5f343ebb..9085dcbba 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index d711837bb..26477be13 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 07d183aa6..f937fab37 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 7a9d6a786..78b605d99 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 214a0848d..3d68052bc 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 01700d9d1..ba88bae41 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 92ab049ca..c63dddea1 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 6c4a01cbf..f9475d6c9 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -7,13 +7,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 0d5d33417..09043ce7c 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index dde903d6d..2c4e7a877 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 9c5909465..bd31c8046 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 9228ef9ca..18b22225c 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index b8241d69a..d50d3e847 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 46c16b055..c995e2fb6 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 8afffb4bb..2dcc19748 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index bb465814c..27dcbdc78 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 8108cd34d..89468a881 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 7b581df77..3d03c36ce 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index e474168de..2a1c958ec 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT 4.0.0 @@ -114,7 +114,7 @@ ONAP - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 5f51bb371..1a97b1811 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -7,12 +7,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 9f280ea3e..7439a509f 100644 --- a/version.properties +++ b/version.properties @@ -4,11 +4,11 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=3 -feature_revision=1 +sprint_number=4 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version} +release_version=${base_version}-STAGING snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 25bb156451b5603f53f3db125c7876a7de571bd8 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 31 Oct 2018 15:50:33 -0400 Subject: Fix error handling Recreate client objects after failure is returned by SDC before retrying. Change-Id: Ib165fc1220a010a0443a7dab4014aaba8c9f29f8 Issue-ID: SDNC-472 Signed-off-by: Timoney, Dan (dt5972) --- .../ccsdk/sli/northbound/uebclient/SdncUebClient.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 c025f3b05..4f2de1cc1 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 @@ -34,13 +34,12 @@ public class SdncUebClient { private static final Logger LOG = LoggerFactory.getLogger(SdncUebConfiguration.class); public static void main(String[] args) { - IDistributionClient client = DistributionClientFactory.createDistributionClient(); SdncUebConfiguration config = new SdncUebConfiguration(); + IDistributionClient client = DistributionClientFactory.createDistributionClient(); SdncUebCallback cb = new SdncUebCallback(client, config); - LOG.info("Scanning for local distribution artifacts before starting client"); cb.deployDownloadedFiles(null, null, null); @@ -67,6 +66,21 @@ public class SdncUebClient { if (start.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { keepWaiting = false; + } else { + LOG.info("SDC returned "+start.getDistributionActionResult().toString()+" - will retry"); + try { + client.stop(); + } catch(Exception e1) { + // Ignore exception on stop + } + client = DistributionClientFactory.createDistributionClient(); + cb = new SdncUebCallback(client, config); + LOG.info("Initializing ASDC distribution client"); + + result = client.init(config, cb); + + LOG.info("Initialized ASDC distribution client - results = {}", result.getDistributionMessageResult()); + } } catch(Exception e) { LOG.info("Client startup failure", e); -- cgit 1.2.3-korg From 29e7063b7f1832d14fd92642914e6917da45c18c Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 2 Nov 2018 10:11:48 -0400 Subject: Explicitly exit on timeout Previously, when timeout occurs trying to connect successfully to SDC, code just dropped out of loop in main() method, expecting to exit. However, if the SDC client left any threads hanging, that might not cause process to exit. Instead, process should explicitly exit via System.exit(). Change-Id: I28316550cbfc2bbddeaadf080c0afa52a1eae350 Issue-ID: SDNC-472 Signed-off-by: Timoney, Dan (dt5972) --- .../onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 4f2de1cc1..2078a798f 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 @@ -54,6 +54,7 @@ public class SdncUebClient { long maxWaitTm = config.getClientStartupTimeout() * 1000L; boolean keepWaiting = true; + boolean listenerStarted = false; while (keepWaiting) { if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { @@ -66,8 +67,9 @@ public class SdncUebClient { if (start.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { keepWaiting = false; + listenerStarted = true; } else { - LOG.info("SDC returned "+start.getDistributionActionResult().toString()+" - will retry"); + LOG.info("SDC returned {} - exitting",start.getDistributionActionResult().toString()); try { client.stop(); } catch(Exception e1) { @@ -99,8 +101,13 @@ public class SdncUebClient { } } - - + + if (!listenerStarted) { + LOG.info("Timed out waiting to connect to SDC"); + System.exit(0); + } + + } -- cgit 1.2.3-korg From b62880bebaafab43294739bb2c867f271d760db1 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 6 Nov 2018 11:09:55 -0500 Subject: Replace logic for subinterface_indicator ingestion Changes made: Replace ingestion logic for VFC_TO_NETWORK_ROLE_MAPPING.subinterface_indicator with alternate logic suggested by ASDC. Change-Id: Ied21e9361091c3fe4c05c6d9a2ee35c6491a7e10 Issue-ID: CCSDK-630 Signed-off-by: lalena.aria --- .../onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java index 5977e2888..db5004309 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java @@ -24,6 +24,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; @@ -113,9 +114,17 @@ public class SdncVFCModel extends SdncBaseModel { SdncBaseModel.addParameter("network_role", networkRole, commonParams); // can not be null SdncBaseModel.addParameter("network_role_tag", nullCheck(propsMap.get("network_role_tag")), commonParams); SdncBaseModel.addParameter("extcp_subnetpool_id", nullCheck(propsMap.get("subnetpoolid")), commonParams); - String subinterfaceIndicator = nullCheck(propsMap.get("subinterface_indicator")); - if (!subinterfaceIndicator.isEmpty()) { - SdncBaseModel.addParameter("subinterface_indicator", subinterfaceIndicator.contains("true") ? "Y" : "N", commonParams); // boolean Y|N + + // Loop thru all CPs using getNodeTemplateChildren and match the network_role on the CP with network_role from + // getCpPropertiesFromVfcAsObject output, then get subinterface_indicator for this CP + List cpNodesList = sdcCsarHelper.getNodeTemplateChildren(vfcNode); + for (NodeTemplate cpNode : cpNodesList){ + String cpNetworkRole = extractValue(cpNode, "network_role"); + + if (cpNetworkRole == networkRole) { + String subinterfaceIndicator = extractBooleanValue (cpNode, "subinterface_indicator"); + addParameter("subinterface_indicator", subinterfaceIndicator, commonParams); + } } // Extract IP Version specific parameters -- cgit 1.2.3-korg From d411beeeb5b407c170a98ad98c18ab85d5281833 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 6 Nov 2018 11:30:49 -0500 Subject: Fix misplaced if Updated main loop of ueb-listener to recreate client on each iteration rather than using client created outside loop. Change-Id: I5c5b9f26e472dfbffefdd49a870a293159f72b10 Issue-ID: SDNC-472 Signed-off-by: Timoney, Dan (dt5972) --- .../sli/northbound/uebclient/SdncUebClient.java | 59 ++++++++++------------ 1 file changed, 26 insertions(+), 33 deletions(-) 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 2078a798f..e5dec14c7 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 @@ -37,66 +37,59 @@ public class SdncUebClient { SdncUebConfiguration config = new SdncUebConfiguration(); - IDistributionClient client = DistributionClientFactory.createDistributionClient(); - SdncUebCallback cb = new SdncUebCallback(client, config); - - LOG.info("Scanning for local distribution artifacts before starting client"); - cb.deployDownloadedFiles(null, null, null); - - LOG.info("Initializing ASDC distribution client"); - - IDistributionClientResult result = client.init(config, cb); - - LOG.info("Initialized ASDC distribution client - results = {}", result.getDistributionMessageResult()); - long startTm = System.currentTimeMillis(); int sleepTm = config.getPollingInterval() * 1000; long maxWaitTm = config.getClientStartupTimeout() * 1000L; boolean keepWaiting = true; boolean listenerStarted = false; + boolean processDownloads = true; while (keepWaiting) { + LOG.info("Initializing ASDC distribution client"); + + IDistributionClient client = DistributionClientFactory.createDistributionClient(); + SdncUebCallback cb = new SdncUebCallback(client, config); + IDistributionClientResult result = client.init(config, cb); + LOG.info("Initialized ASDC distribution client - results = {}", result.getDistributionMessageResult()); + if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { + if (processDownloads) { + LOG.info("Scanning for local distribution artifacts before starting client"); + cb.deployDownloadedFiles(null, null, null); + processDownloads = false; + } LOG.info("Starting client..."); try { IDistributionClientResult start = client.start(); LOG.info("Client startup result = {}", start.getDistributionMessageResult()); - + // Only stop waiting if the result is success if (start.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { - + keepWaiting = false; listenerStarted = true; } else { - LOG.info("SDC returned {} - exitting",start.getDistributionActionResult().toString()); + LOG.info("SDC returned {} - exitting", start.getDistributionActionResult().toString()); try { client.stop(); - } catch(Exception e1) { + } catch (Exception e1) { // Ignore exception on stop } - client = DistributionClientFactory.createDistributionClient(); - cb = new SdncUebCallback(client, config); - LOG.info("Initializing ASDC distribution client"); - - result = client.init(config, cb); - - LOG.info("Initialized ASDC distribution client - results = {}", result.getDistributionMessageResult()); - } - } catch(Exception e) { + } catch (Exception e) { LOG.info("Client startup failure", e); } + } - if (System.currentTimeMillis() - startTm < maxWaitTm) { - keepWaiting = false; - } else { + if (System.currentTimeMillis() - startTm < maxWaitTm) { + keepWaiting = false; + } else { - try { - Thread.sleep(sleepTm); - } catch (InterruptedException e) { - // Ignore - } + try { + Thread.sleep(sleepTm); + } catch (InterruptedException e) { + // Ignore } } -- cgit 1.2.3-korg From be41042f4c01a8ae642862879af019af1cae18a3 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 6 Nov 2018 15:56:35 -0500 Subject: Add logic for ingesting related_network_role data Changes made: Add ingestion for related_network_role data at VL, FV and VFC. Add ingestion for trunk_network_indicator on VL. Fix ATTRIBUTE_VALUE_PAIR insertion for VFC Instance Group properties. Change-Id: Ifd46bad5963a430ed55aacad369ab64b723a11fd Issue-ID: CCSDK-649 Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncNodeModel.java | 49 ++++++++++++++++ .../sli/northbound/uebclient/SdncUebCallback.java | 1 + .../sli/northbound/uebclient/SdncVFCModel.java | 67 ++++++++++++++++++++++ .../sli/northbound/uebclient/SdncVFModel.java | 16 +++++- 4 files changed, 130 insertions(+), 3 deletions(-) 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 d4b3344ca..667f95aae 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 @@ -22,6 +22,9 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; @@ -58,6 +61,8 @@ public class SdncNodeModel extends SdncBaseModel { // extract properties - network_assignments addParameter("is_shared_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISSHAREDNETWORK)); addParameter("is_external_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISEXTERNALNETWORK)); + String trunkNetworkIndicator = extractBooleanValue(nodeTemplate, "network_assignments#is_trunked"); + addParameter("trunk_network_indicator", trunkNetworkIndicator); // extract properties - network_assignments - ipv4_subnet_default_assignment String useIpv4 = extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#use_ipv4"); @@ -122,6 +127,50 @@ public class SdncNodeModel extends SdncBaseModel { throw new IOException (e); } } + + public void insertRelatedNetworkRoleData () throws IOException { + + Object propertyValue = sdcCsarHelper.getNodeTemplatePropertyAsObject(nodeTemplate, "network_assignments#related_networks"); + ArrayList> relatedNetworkList = (ArrayList)propertyValue; + + String networkModelCustomizationUUID = getCustomizationUUID(); + + if (relatedNetworkList != null) { + + try { + cleanUpExistingToscaData("RELATED_NETWORK_ROLE", "network_model_customization_uuid", networkModelCustomizationUUID); + } catch (IOException e) { + LOG.error("Could not clean up Tosca CSAR data in the RELATED_NETWORK_ROLE table"); + throw new IOException (e); + } + + for (Map relatedNetworkValue : relatedNetworkList) { + LOG.debug("Node Template [" + nodeTemplate.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkValue.get("related_network_role")); + + String relatedNetworkRoleValue = relatedNetworkValue.get("related_network_role"); + + try { + // Table cleanup RELATED_NETWORK_ROLE occurs per network + // If related_network_role for this service already exist in RELATED_NETWORK_ROLE, don't attempt insertion + Map relatedNetworkRoleParamsCheck = new HashMap(); + addParameter("related_network_role", relatedNetworkRoleValue, relatedNetworkRoleParamsCheck); + addParameter("network_model_customization_uuid", networkModelCustomizationUUID, relatedNetworkRoleParamsCheck); + if (checkForExistingToscaData("RELATED_NETWORK_ROLE", relatedNetworkRoleParamsCheck) == false) { + relatedNetworkRoleParamsCheck.remove("related_network_role"); + LOG.info("Call insertToscaData for RELATED_NETWORK_ROLE where network_model_customization_uuid = " + networkModelCustomizationUUID); + insertToscaData(buildSql("RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRoleValue + "\"", model_yaml, relatedNetworkRoleParamsCheck), null); + } + } catch (IOException e) { + LOG.debug("Could not insert Tosca CSAR data into the RELATED_NETWORK_ROLE table"); + throw new IOException (e); + } + } + } + else { + LOG.debug("Node Template [" + nodeTemplate.getName() + "], property [" + "related_networks" + "] property value: " + null); + } + + } public String getSql(String model_yaml) { 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 224a51998..3903eb414 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 @@ -710,6 +710,7 @@ public class SdncUebCallback implements INotificationCallback { try { nodeModel.insertNetworkModelData(); + nodeModel.insertRelatedNetworkRoleData(); } catch (IOException e) { deployStatus = DistributionStatusEnum.DEPLOY_ERROR; } diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java index 5977e2888..b23a913ff 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java @@ -24,6 +24,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; @@ -272,6 +273,72 @@ public class SdncVFCModel extends SdncBaseModel { } } + public void insertVFCRelatedNetworkRoleData (String vfCustomizationUUID, NodeTemplate vfcNode) throws IOException { + + // Get the CPs on this VFC - ASDC suggests getNodeTemplateChildren + List cpNodesList = sdcCsarHelper.getNodeTemplateChildren(vfcNode); + + String vfcCustomizationUuid = getCustomizationUUID(); + + try { + cleanUpExistingToscaData("VFC_RELATED_NETWORK_ROLE", "vfc_customization_uuid", vfcCustomizationUuid); + } catch (IOException e) { + LOG.error("Could not clean up Tosca CSAR data in the VFC_RELATED_NETWORK_ROLE table"); + throw new IOException (e); + } + + for (NodeTemplate cpNode : cpNodesList){ + String networkRole = extractValue(cpNode, "network_role"); + Map relatedNetworkRoleParams = new HashMap(); + addParameter("vfc_customization_uuid", vfcCustomizationUuid, relatedNetworkRoleParams); + addParameter("vm_type", vmType, relatedNetworkRoleParams); + addParameter("network_role", networkRole, relatedNetworkRoleParams); + + final Object relatedNetworksPropertyValue = cpNode.getPropertyValue("related_networks"); + + ArrayList> relatedNetworkList = (ArrayList)relatedNetworksPropertyValue; + if (relatedNetworkList != null) { + for (Map relatedNetworkValue : relatedNetworkList) { + LOG.debug("CP [" + cpNode.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkValue.get("related_network_role")); + String relatedNetworkRoleValue = relatedNetworkValue.get("related_network_role"); + + try { + // Table cleanup for VFC_RELATED_NETWORK_ROLE occurs per vfc + // If cp related_network_role, cp network_role and vm_type for this vfc already exist in VFC_RELATED_NETWORK_ROLE, + // don't attempt insertion + Map relatedNetworkRoleParamsCheck = new HashMap(); + addParamsToMap(relatedNetworkRoleParams, relatedNetworkRoleParamsCheck); + addParameter("related_network_role", relatedNetworkRoleValue, relatedNetworkRoleParamsCheck); + if (checkForExistingToscaData("VFC_RELATED_NETWORK_ROLE", relatedNetworkRoleParamsCheck) == false) { + LOG.info("Call insertToscaData for VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = " + vfcCustomizationUuid); + insertToscaData(buildSql("VFC_RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRoleValue + "\"", model_yaml, relatedNetworkRoleParams), null); + } + + // Table cleanup for VNF_RELATED_NETWORK_ROLE occurs per vf (up one level) + // Insert same related_network_role data into VNF_RELATED_NETWORK_ROLE + Map vfRelatedNetworkRoleParamsCheck = new HashMap(); + addParameter("vnf_customization_uuid", vfCustomizationUUID, vfRelatedNetworkRoleParamsCheck); + addParameter("network_role", networkRole, vfRelatedNetworkRoleParamsCheck); + addParameter("related_network_role", relatedNetworkRoleValue, vfRelatedNetworkRoleParamsCheck); + if (checkForExistingToscaData("VNF_RELATED_NETWORK_ROLE", vfRelatedNetworkRoleParamsCheck) == false) { + vfRelatedNetworkRoleParamsCheck.remove("related_network_role"); + LOG.info("Call insertToscaData for VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = " + vfCustomizationUUID); + insertToscaData(buildSql("VNF_RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRoleValue + "\"", model_yaml, vfRelatedNetworkRoleParamsCheck), null); + } + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VFC_RELATED_NETWORK_ROLE table"); + throw new IOException (e); + } + } + } + else { + LOG.debug("CP [" + cpNode.getName() + "], property [" + "related_networks" + "] property value: " + null); + } + } + + } + public String getVmType() { return vmType; } 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 84f8296c9..850a34fa0 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 @@ -79,11 +79,11 @@ public class SdncVFModel extends SdncBaseModel { for (Group group : vfcInstanceGroupListForVf){ String vfcInstanceGroupFunction = extractGetInputValue(group, nodeTemplate, "vfc_instance_group_function"); - addParameter(extractGetInputName (group, "vfc_instance_group_function"), vfcInstanceGroupFunction, attributeValueParams); + addParameter("vfc_instance_group_function", vfcInstanceGroupFunction, attributeValueParams); String networkCollectionFunction = extractGetInputValue(group, nodeTemplate, "network_collection_function"); - addParameter(extractGetInputName (group, "network_collection_function"), networkCollectionFunction, attributeValueParams); + addParameter("network_collection_function", networkCollectionFunction, attributeValueParams); String initSubinterfaceQuantity = extractGetInputValue(group, nodeTemplate, "init_subinterface_quantity"); - addParameter(extractGetInputName (group, "init_subinterface_quantity"), initSubinterfaceQuantity, attributeValueParams); + addParameter("init_subinterface_quantity", initSubinterfaceQuantity, attributeValueParams); } } @@ -185,6 +185,15 @@ public class SdncVFModel extends SdncBaseModel { private void insertVFCData() throws IOException { + /* For each VF, insert VFC_MODEL, VFC_TO_NETWORK_ROLE_MAPPING, VNF_RELATED_NETWORK_ROLE and VFC_RELATED_NETWORK_ROLE data + + try { + cleanUpExistingToscaData("VNF_RELATED_NETWORK_ROLE", "vnf_customization_uuid", getCustomizationUUID()); + } catch (IOException e) { + LOG.error("Could not clean up Tosca CSAR data in the VNF_RELATED_NETWORK_ROLE table"); + throw new IOException (e); + }*/ + // For each VF, insert VFC_MODEL data List vfcNodes = sdcCsarHelper.getVfcListByVf(getCustomizationUUIDNoQuotes()); for (NodeTemplate vfcNode : vfcNodes){ @@ -194,6 +203,7 @@ public class SdncVFModel extends SdncBaseModel { vfcModel.insertVFCModelData(); vfcModel.insertVFCtoNetworkRoleMappingData(vfcNode); + //vfcModel.insertVFCRelatedNetworkRoleData(getCustomizationUUID(), vfcNode); } catch (IOException e) { LOG.error("Could not insert Tosca CSAR VFC data"); throw new IOException (e); -- cgit 1.2.3-korg From b348e62904cfa3687d5cbe062e56cf99c0f7fde2 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 27 Nov 2018 15:55:14 -0500 Subject: Update sdc-tosca version to 1.4.7 Changes made: Update sdc-tosca version to 1.4.7. Replace org.onap.sdc.tosca.parser.impl.SdcTypes with org.onap.sdc.tosca.parser.enums.SdcTypes. Replace getNodeTemplatePropertyAsObject with getNodeTemplatePropertyValueAsObject. Change-Id: I9482cad49e2baae1c1383afabff9377c72441246 Issue-ID: CCSDK-758 Signed-off-by: lalena.aria --- ueb-listener/pom.xml | 2 +- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 2 +- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java | 2 +- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 1a97b1811..d91a5746b 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -20,7 +20,7 @@ 1.3.0 - 1.4.4 + 1.4.7 2.9.4 true /opt/app/ueb-listener 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 b1e065e25..0d5e9d6dd 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 @@ -763,7 +763,7 @@ public class SdncBaseModel { } protected Object extractObjectValue (NodeTemplate nodeTemplate, String name) { - Object value = sdcCsarHelper.getNodeTemplatePropertyAsObject(nodeTemplate, name); + Object value = sdcCsarHelper.getNodeTemplatePropertyValueAsObject(nodeTemplate, name); if (value != null) { return value; } else { 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 667f95aae..4870f29e3 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 @@ -130,7 +130,7 @@ public class SdncNodeModel extends SdncBaseModel { public void insertRelatedNetworkRoleData () throws IOException { - Object propertyValue = sdcCsarHelper.getNodeTemplatePropertyAsObject(nodeTemplate, "network_assignments#related_networks"); + Object propertyValue = sdcCsarHelper.getNodeTemplatePropertyValueAsObject(nodeTemplate, "network_assignments#related_networks"); ArrayList> relatedNetworkList = (ArrayList)propertyValue; String networkModelCustomizationUUID = getCustomizationUUID(); 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 3903eb414..ba644f302 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 @@ -73,9 +73,7 @@ import org.onap.sdc.api.results.IDistributionClientResult; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException; import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory; -import org.onap.sdc.tosca.parser.impl.SdcTypes; import org.onap.sdc.toscaparser.api.NodeTemplate; -import org.onap.sdc.toscaparser.api.Policy; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.sdc.utils.ArtifactTypeEnum; import org.onap.sdc.utils.DistributionActionResultEnum; -- cgit 1.2.3-korg From 07e80503b6823341c48f6eedee585850b2fffe40 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 6 Dec 2018 09:41:59 -0500 Subject: Add missing dependency Needed to add dependency on new sli-provider-base artifact to clear compile error in LCM jUnit test case. Change-Id: Ifc272e47628fd674d860277b80085aee91beb00a Issue-ID: CCSDK-793 Signed-off-by: Timoney, Dan (dt5972) --- lcm/provider/pom.xml | 6 +++- .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 39 +++++++++++----------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 3d03c36ce..f383df7f1 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -58,7 +58,11 @@ org.onap.ccsdk.sli.core sli-provider - + + org.onap.ccsdk.sli.core + sli-provider-base + ${ccsdk.sli.core.version} + org.opendaylight.controller sal-core-api diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 234eb615f..002e05ed4 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -22,28 +22,27 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicLoader; import org.onap.ccsdk.sli.core.sli.SvcLogicParser; import org.onap.ccsdk.sli.core.sli.SvcLogicStore; import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; -import org.onap.ccsdk.sli.core.sli.provider.BlockNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.CallNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.ConfigureNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.DeleteNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.ExecuteNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.ExistsNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.ForNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.GetResourceNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.IsAvailableNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.NotifyNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.RecordNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.ReleaseNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.ReserveNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.ReturnNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.SaveNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.SetNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.SvcLogicNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.BlockNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.CallNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.ConfigureNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.DeleteNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.ExecuteNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.ExistsNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.ForNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.GetResourceNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.IsAvailableNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.NotifyNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.RecordNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.ReleaseNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.ReserveNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.ReturnNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.SaveNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.SetNodeExecutor; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl; -import org.onap.ccsdk.sli.core.sli.provider.SwitchNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.UpdateNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.WhileNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor; +import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -- cgit 1.2.3-korg From 4882f248ed6355c234daa25cd1913afb3897e51d Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Tue, 11 Dec 2018 12:24:05 -0800 Subject: Update INFO.yaml file - Add Gaurav Agrawal as committer - Remove Ryan Goulding - Add missing info sections - Fix indentation to pass verify Change-Id: I777f1f696a2c163a3cd8af06753bf48b99e1fbf8 Issue-ID: CIMAN-134 Signed-off-by: Jessica Wagantall --- INFO.yaml | 67 +++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/INFO.yaml b/INFO.yaml index c9a300684..b352a5be2 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -2,6 +2,7 @@ project: 'ccsdk-sli-northbound' project_creation_date: '2017-06-27' lifecycle_state: 'Incubation' +project_category: '' project_lead: &onap_releng_ptl name: 'Dan Timoney' email: 'dtimoney@att.com' @@ -13,30 +14,58 @@ issue_tracking: type: 'jira' url: 'https://jira.onap.org/projects/CCSDK' key: 'CCDSK' +mailing_list: + type: 'groups.io' + url: 'lists.onap.org' + tag: '<[sub-project_name]>' +realtime_discussion: '' meetings: - type: 'zoom' - agenda: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project' - url: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project#CommonControllerSDKProject-MeetingMinutes' - server: 'n/a' - channel: 'n/a' - repeats: 'weekly' - time: '13:00 UTC' + agenda: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project' + url: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project#CommonControllerSDKProject-MeetingMinutes' + server: 'n/a' + channel: 'n/a' + repeats: 'weekly' + time: '13:00 UTC' committers: - <<: *onap_releng_ptl - name: 'Jack Lucas' - email: 'jflucas@research.att.com' - company: 'ATT' - id: 'jackl' - timezone: 'America/New York' + email: 'jflucas@research.att.com' + company: 'ATT' + id: 'jackl' + timezone: 'America/New York' - name: 'Jun (Nicolas) Hu' - email: 'jh245g@att.com' - company: 'ATT' - id: 'jh245g' - timezone: 'America/New York' - - name: 'Ryan Goulding' - email: 'ryandgoulding@gmail.com' - company: 'Inocybe Technologies' - id: 'rgoulding' - timezone: 'America/New York' + email: 'jh245g@att.com' + company: 'ATT' + id: 'jh245g' + timezone: 'America/New York' + - name: 'Gaurav Agrawal' + email: 'gaurav.agrawal@huawei.com' + company: 'Huawei' + id: 'agrawalgaurav' + timezone: 'Asia/Kolkata' +repositories: + - ccsdk-apps + - ccsdk-cds + - ccsdk-distribution + - ccsdk-features + - ccsdk-parent + - ccsdk-platform-blueprints + - ccsdk-platform-plugins + - ccsdk-sli-adaptors + - ccsdk-sli-core + - ccsdk-sli-northbound + - ccsdk-sli-plugins + - ccsdk-storage-esaas + - ccsdk-utils tsc: approval: 'https://lists.onap.org/pipermail/onap-tsc' + changes: + - type: 'Deletion' + name: 'Ryan Goulding' + link: 'https://lists.onap.org/g/onap-tsc/message/4261' + changes: + - type: 'Addition' + name: 'Gaurav Agrawal' + link: 'https://lists.onap.org/g/onap-tsc/message/4324' + -- cgit 1.2.3-korg From 0db8f9aa9ae019c058f80137dd271c987ad20f8a Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 00:12:46 +0530 Subject: Sonar fix: LcmProvider.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-848 Change-Id: Ida8c5829860e4afba412de967df1ef93ad4423bf Signed-off-by: Arundathi Patil --- .../main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 939836bed..e441bda53 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -5,6 +5,7 @@ package org.onap.ccsdk.sli.northbound; * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,33 +24,24 @@ package org.onap.ccsdk.sli.northbound; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; -import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; -import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.*; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.Status; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.StatusBuilder; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Optional; -import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; import org.onap.ccsdk.sli.northbound.LcmResponseCode.*; @@ -83,8 +75,6 @@ public class LcmProvider implements AutoCloseable, LCMService { private static final Logger LOG = LoggerFactory.getLogger(LcmProvider.class); - private static final String ACTIVE_VERSION = "active"; - private static final String APPLICATION_NAME = "LCM"; private final ExecutorService executor; -- cgit 1.2.3-korg From 56f264776099b0944e790327d3e0ad70acead8a6 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 00:20:42 +0530 Subject: Sonar fix: LcmSliClient.java Fixed sonar issues/code-smells across thisfile Issue-ID: CCSDK-849 Change-Id: Id79d62c6117a0ce7d3551f655b0a56f23c8a0fde Signed-off-by: Arundathi Patil --- .../main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java index 9fcc92c88..54e53c776 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java @@ -5,6 +5,7 @@ package org.onap.ccsdk.sli.northbound; * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +37,8 @@ public class LcmSliClient { private final SvcLogicService svcLogicService; + private String ErrorCode = "error-code"; + public LcmSliClient(final SvcLogicService svcLogicService) { this.svcLogicService = svcLogicService; } @@ -80,12 +83,12 @@ public class LcmSliClient { if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "500"); + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "500"); } } else { - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "200"); + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "200"); } } -- cgit 1.2.3-korg From 0290fe64a150cab9b7ddfad5ae524716411d40a5 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 00:35:54 +0530 Subject: Sonar Fix: SdncAaiDmaapConsumer.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-850 Change-Id: I4f1bb7109bddfed04ffa85df174fecdaaf9a6798 Signed-off-by: Arundathi Patil --- .../ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 3733fa604..5cf369403 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -128,13 +129,13 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { JSONObject eventHeader = jsonObj.getJSONObject(EVENT_HEADER); for(Object key : eventHeader.keySet()) { - if (!key.equals("action")) { + if (!("action").equals(key)) { context.put(((String)key).replaceAll("-", ""), eventHeader.get((String)key)); } else { String action = (String) eventHeader.get((String) key); - if (action.equalsIgnoreCase("create")) { + if (("create").equalsIgnoreCase(action)) { context.put((String)key,"Update"); - } else if (action.equalsIgnoreCase("delete")) { + } else if (("delete").equalsIgnoreCase(action)) { context.put((String) key, "Delete"); } else { throw new IOException("Action type not supported " + action); @@ -202,7 +203,7 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { JsonNode eventTypeNode = eventHeaderNode.get(EVENT_TYPE); String eventType = eventTypeNode.textValue(); - if(AAI_EVENT.equals(eventType) == false) { + if(!AAI_EVENT.equals(eventType)) { LOG.info("Unknown Event Type {}", eventType); return; } -- cgit 1.2.3-korg From 5396e1b390bf7ebeccb5eba01ff563bf39e4fa62 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 00:41:18 +0530 Subject: Sonar fix: SdncDmaapConsumerImpl.java Fixed sonar issues/code-smells acoss this file Issue-ID: CCSDK-851 Change-Id: Iff1156e2cafc198d00daf546699f0ff4ab34ff43 Signed-off-by: Arundathi Patil --- .../onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java index ddd871327..ee8bb4d6e 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumerImpl.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -155,5 +156,5 @@ public abstract class SdncDmaapConsumerImpl implements SdncDmaapConsumer { } } - abstract public void processMsg(String msg) throws InvalidMessageException; + public abstract void processMsg(String msg) throws InvalidMessageException; } -- cgit 1.2.3-korg From 0dad402fd01d72c76235d8a8c1d9b256e9de5042 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 15:07:22 +0530 Subject: Sonar fix: DataChangeProvider.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-852 Change-Id: I73630a11c44105996ed677f7eabb6ea3ffcc501d Signed-off-by: Arundathi Patil --- .../main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 40ebde69a..6b4f1ebca 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +31,6 @@ import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationInput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.DataChangeNotificationInputBuilder; @@ -123,7 +123,7 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { // Call SLI sync method try { - if (dataChangeClient.hasGraph("DataChange", svcOperation , null, "sync")) + if (dataChangeClient.hasGraph(APPLICATION_NAME, svcOperation , null, "sync")) { try { -- cgit 1.2.3-korg From 8c31f39f7e587214273cb496acd0b5243a724551 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 15:18:28 +0530 Subject: Sonar fix: AsdcApiSliClient.java Fixed sonar issues/code-smells across this file. Issue-ID: CCSDK-853 Change-Id: Ib864ab2ac5302aa9387bd19a2dfcc642d3a10f87 Signed-off-by: Arundathi Patil --- .../onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 02dc786ac..880a2fb76 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +35,8 @@ public class AsdcApiSliClient { private final SvcLogicService svcLogicService; + private String ErrorCode = "error-code"; + public AsdcApiSliClient(final SvcLogicService svcLogicService) { this.svcLogicService = svcLogicService; } @@ -78,12 +81,12 @@ public class AsdcApiSliClient { if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "500"); + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "500"); } } else { - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "200"); + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "200"); } } -- cgit 1.2.3-korg From 2420ec6863a87e264d02dc5dd4293b5801b7e31d Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 15:24:11 +0530 Subject: Sonar fix: SdncLcmDmaapConsumer.java Fixed sonar issues/code-smells across this file. Issue-ID: CCSDK-854 Change-Id: I9b25a464b41ce142b6217ff0f7e40beda86eae3a Signed-off-by: Arundathi Patil --- .../onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java index 04f520bd9..f2153789f 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncLcmDmaapConsumer.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,8 +32,6 @@ public class SdncLcmDmaapConsumer extends SdncDmaapConsumerImpl { private static final Logger LOG = LoggerFactory.getLogger(SdncLcmDmaapConsumer.class); - private static final String PARTITION = "cambria.partition"; - private static final String PARTITION_VALUE = "SDNC"; private static final String BODY = "body"; private static final String RPC = "rpc-name"; -- cgit 1.2.3-korg From 9695472daa4664caaeef0ef0d64101caf7d9e0e2 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 15:29:09 +0530 Subject: Sonar fix: SdncARModel.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-855 Change-Id: I5aa4859f2b30fb1efadd6d772cc5d80e00281c42 Signed-off-by: Arundathi Patil --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 adb82c6dd..9cac459d7 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +23,6 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; -import java.util.List; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; @@ -37,7 +37,7 @@ public class SdncARModel extends SdncBaseModel { private static final Logger LOG = LoggerFactory .getLogger(SdncARModel.class); - private String type = null; + private String type = null; private String subcategory = null; public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate,DBResourceManager jdbcDataSource) { -- cgit 1.2.3-korg From ec31fc3ff55b6a2e4fa3b2d04a4339c9d49cf9c9 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 18 Dec 2018 10:10:35 -0500 Subject: Add BOM for sli/northbound Add BOM for sli/northbound for ease of dependency specification. Change-Id: I53d91e9b6b22af2f0cd0049ea2c351143041963d Issue-ID: CCSDK-856 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ pom.xml | 1 + 2 files changed, 95 insertions(+) create mode 100755 artifacts/pom.xml diff --git a/artifacts/pom.xml b/artifacts/pom.xml new file mode 100755 index 000000000..2a8060e9c --- /dev/null +++ b/artifacts/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + org.onap.ccsdk.sli.northbound + sli-northbound-artifacts + 0.4.0-SNAPSHOT + pom + + ccsdk-sli-northbound :: sli-northbound-artifacts + CCSDK northbound components Bill of Materials (BOM) + https://wiki.onap.org + + ONAP + + + + org.onap.ccsdk.parent + parent + 1.2.0-SNAPSHOT + + + + + + org.onap.ccsdk.sli.northbound + ccsdk-asdcApi + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.northbound + ccsdk-dataChange + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.northbound + ccsdk-lcm + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.northbound + asdcApi-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + + + org.onap.ccsdk.sli.northbound + asdcApi-installer + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-provider + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-installer + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-provider + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-installer + ${project.version} + + + + + diff --git a/pom.xml b/pom.xml index 2a1c958ec..af81f479f 100644 --- a/pom.xml +++ b/pom.xml @@ -110,6 +110,7 @@ dmaap-listener ueb-listener features + artifacts ONAP -- cgit 1.2.3-korg From cf26b1adfc48235443c9cc006cea172301cc3cc0 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 20 Dec 2018 17:02:08 +0530 Subject: Sonar Fix: DataChangeProvider.java Fixed sonar issuse/code-smells across this file Issue-ID: CCSDK-852 Change-Id: If7468d54feaf301f15d35dbdf3fe245696aae0bd Signed-off-by: Arundathi Patil --- .../src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6b4f1ebca..f272dbbc1 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 @@ -127,7 +127,7 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { { try { - dataChangeClient.execute("DataChange", svcOperation, null, "sync", serviceDataBuilder, parms); + dataChangeClient.execute(APPLICATION_NAME, svcOperation, null, "sync", serviceDataBuilder, parms); } catch (Exception e) { -- cgit 1.2.3-korg From d50289489133cae368cddd71cd32550e8244a342 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 20 Dec 2018 17:10:51 +0530 Subject: Sonar fix: SdncArtifactMap.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-863 Change-Id: I8c471ab3cdca84427fe88f33a82117200d916b3d Signed-off-by: Arundathi Patil --- .../sli/northbound/uebclient/SdncArtifactMap.java | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 671d47a9f..601569a19 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +42,16 @@ public class SdncArtifactMap { private String rpc; private int pass; + private SdncArtifactType(String tag, String rpc, String pass) { + this.tag = tag; + this.rpc = rpc; + try { + this.pass = Integer.parseInt(pass); + } catch (Exception e) { + LOG.error("Invalid pass value for artifact map entry ({} {} {})", tag, rpc, pass, e); + } + } + public String getTag() { return tag; } @@ -58,26 +69,16 @@ public class SdncArtifactMap { public String getRpcUrl(String base) { return base+rpc; } - - private SdncArtifactType(String tag, String rpc, String pass) { - this.tag = tag; - this.rpc = rpc; - try { - this.pass = Integer.parseInt(pass); - } catch (Exception e) { - LOG.error("Invalid pass value for artifact map entry ({} {} {})", tag, rpc, pass, e); - } - } } private Map mapItems = new HashMap<>(); - private int NumPasses = 1; + private int numPasses = 1; public int getNumPasses() { - return NumPasses; + return numPasses; } public void load(String fileName) { @@ -93,8 +94,8 @@ public class SdncArtifactMap { if (lnFields.length == 3) { SdncArtifactType entry = new SdncArtifactType(lnFields[0], lnFields[1], lnFields[2]); mapItems.put(entry.getTag(), entry); - if (entry.getPass() + 1 > NumPasses ) { - NumPasses = entry.getPass() + 1; + if (entry.getPass() + 1 > numPasses ) { + numPasses = entry.getPass() + 1; } } } -- cgit 1.2.3-korg From 9ac05031bf2778db4100d66bc055381b31c6a4d0 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 20 Dec 2018 21:45:05 +0530 Subject: Sonar Fix: LcmProvider.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-848 Change-Id: I3968ee331f241f409c6d80c56094baaef2a566e2 Signed-off-by: Arundathi Patil --- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 82 +++++++++++----------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index e441bda53..570e89ec3 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -75,6 +75,8 @@ public class LcmProvider implements AutoCloseable, LCMService { private static final Logger LOG = LoggerFactory.getLogger(LcmProvider.class); + private static final String exceptionMessage = "Caught exception"; + private static final String APPLICATION_NAME = "LCM"; private final ExecutorService executor; @@ -138,7 +140,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -160,7 +162,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -182,7 +184,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -203,7 +205,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -224,7 +226,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -245,7 +247,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -266,7 +268,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -287,7 +289,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -308,7 +310,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -329,7 +331,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -350,7 +352,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -371,7 +373,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -392,7 +394,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -413,7 +415,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -434,7 +436,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -455,7 +457,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -476,7 +478,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -497,7 +499,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -518,7 +520,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -539,7 +541,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -560,7 +562,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -581,7 +583,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -602,7 +604,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -623,7 +625,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -644,7 +646,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -665,7 +667,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -686,7 +688,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -707,7 +709,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -728,7 +730,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -749,7 +751,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -770,7 +772,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -791,7 +793,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -812,7 +814,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -833,7 +835,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -854,7 +856,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -875,7 +877,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -896,7 +898,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -917,7 +919,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -938,7 +940,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } @@ -959,7 +961,7 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); } catch (LcmRpcInvocationException e) { - LOG.debug("Caught exception", e); + LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); oBuilder.setStatus(e.getStatus()); } -- cgit 1.2.3-korg From 7643a4addb45ffed94adc3bc9257f3fc9619e56f Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 20 Dec 2018 22:41:19 +0530 Subject: Sonar fix: SdncUebConfiguration.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-866 Change-Id: Icac8e0347d068902217e813a302db69b1bf5cc47 Signed-off-by: Arundathi Patil --- .../northbound/uebclient/SdncUebConfiguration.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 0500954de..0088a14a8 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,10 +59,6 @@ public class SdncUebConfiguration implements IConfiguration{ private SdncArtifactMap artifactMap = SdncArtifactMap.getInstance(); - public String getAsdcApiNamespace() { - return asdcApiNamespace; - } - private String incomingDir = null; private String archiveDir = null; @@ -74,14 +71,6 @@ public class SdncUebConfiguration implements IConfiguration{ private String xsltPathList; - public String getXsltPathList() { - return xsltPathList; - } - - public String getOverrideFile() { - return overrideFile; - } - public SdncUebConfiguration() { String propDir = System.getenv(SDNC_CONFIG_DIR); if (propDir == null) { @@ -103,6 +92,17 @@ public class SdncUebConfiguration implements IConfiguration{ } } + public String getAsdcApiNamespace() { + return asdcApiNamespace; + } + + public String getXsltPathList() { + return xsltPathList; + } + + public String getOverrideFile() { + return overrideFile; + } public void init(String propDir) throws IOException { String propPath; -- cgit 1.2.3-korg From 7575004a8ad0d1f017f9a13dac3c45188f0fa4be Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 20 Dec 2018 22:52:13 +0530 Subject: Sonar fix: SdncVFModuleModel.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-867 Change-Id: I20c5214ce9ab3c2821e58b0c6e2530a0881ccc1d Signed-off-by: Arundathi Patil --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModel.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 2ba8de0f1..914401ff1 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +25,9 @@ package org.onap.ccsdk.sli.northbound.uebclient; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.Group; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class SdncVFModuleModel extends SdncBaseModel { - private static final Logger LOG = LoggerFactory - .getLogger(SdncVFModuleModel.class); - public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group, SdncVFModel vfNodeModel) { super(sdcCsarHelper, group); -- cgit 1.2.3-korg From 05b7bddc79ddaf128a5397bfb3582bbf7f4ae4f1 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 20 Dec 2018 21:54:31 +0530 Subject: Sonar fix: SdncGroupModel.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-865 Change-Id: I29a2badf731506c4abfa908345ccc72c465c8fb0 Signed-off-by: Arundathi Patil --- .../org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java index 95d1fcd20..ea62abe9c 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +36,8 @@ public class SdncGroupModel extends SdncBaseModel { private static final Logger LOG = LoggerFactory .getLogger(SdncVFModuleModel.class); + + private static final String groupType = "group_type"; public SdncGroupModel(ISdcCsarHelper sdcCsarHelper, Group group, NodeTemplate nodeTemplate, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { @@ -47,7 +50,7 @@ public class SdncGroupModel extends SdncBaseModel { UUID = extractValue (metadata, "UUID"); addParameter("group_uuid", UUID); addParameter("group_name", extractValue (metadata, "name")); - addParameter("group_type", group.getType()); + addParameter(groupType, group.getType()); addParameter("version", extractValue (metadata, "version")); // extract properties @@ -55,7 +58,7 @@ public class SdncGroupModel extends SdncBaseModel { addParameter("subinterface_role", extractValue(group, "subinterface_role"), attributeValueParams); // relevant complex group properties are extracted and inserted into ATTRIBUTE_VALUE_PAIR - addParameter(extractGetInputName (group, "group_type"), extractGetInputValue(group, nodeTemplate, "group_type"), attributeValueParams); + addParameter(extractGetInputName (group, groupType), extractGetInputValue(group, nodeTemplate, groupType), attributeValueParams); addParameter(extractGetInputName (group, "group_role"), extractGetInputValue(group, nodeTemplate, "group_role"), attributeValueParams); addParameter(extractGetInputName (group, "group_function"), extractGetInputValue(group, nodeTemplate, "group_function"), attributeValueParams); } -- cgit 1.2.3-korg From feb63251ef347534f45c3cea0d04923e6cbd94ad Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 8 Jan 2019 12:29:46 -0500 Subject: Prepare for release build Prepare for release of early ODL-Oxygen based CCSDK Dublin Change-Id: I7a11b559e32f953bfd5f514a6cd402090005d9eb Issue-ID: CCSDK-870 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 180 ++++++++------- asdcApi/features/ccsdk-asdcApi/pom.xml | 23 +- asdcApi/features/features-asdcApi/pom.xml | 46 ++-- asdcApi/features/pom.xml | 5 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 6 +- asdcApi/pom.xml | 36 +-- asdcApi/provider/pom.xml | 10 +- dataChange/features/ccsdk-dataChange/pom.xml | 23 +- dataChange/features/features-dataChange/pom.xml | 46 ++-- dataChange/features/pom.xml | 5 +- dataChange/installer/pom.xml | 5 +- dataChange/model/pom.xml | 6 +- dataChange/pom.xml | 32 +-- dataChange/provider/pom.xml | 11 +- dmaap-listener/pom.xml | 6 +- features/ccsdk-sli-northbound-all/pom.xml | 116 +++++----- features/features-sli-northbound/pom.xml | 6 +- features/installer/pom.xml | 245 ++++++++++---------- features/pom.xml | 26 +-- lcm/features/ccsdk-lcm/pom.xml | 23 +- lcm/features/features-lcm/pom.xml | 46 ++-- lcm/features/pom.xml | 5 +- lcm/installer/pom.xml | 248 ++++++++++---------- lcm/model/pom.xml | 6 +- lcm/pom.xml | 32 +-- lcm/provider/pom.xml | 11 +- pom.xml | 230 +++++++++---------- ueb-listener/pom.xml | 291 ++++++++++++------------ version.properties | 2 +- 30 files changed, 889 insertions(+), 840 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 2a8060e9c..a89e19310 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -1,94 +1,98 @@ - 4.0.0 + 4.0.0 - org.onap.ccsdk.sli.northbound - sli-northbound-artifacts - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.northbound + sli-northbound-artifacts + 0.4.0-SNAPSHOT + pom - ccsdk-sli-northbound :: sli-northbound-artifacts - CCSDK northbound components Bill of Materials (BOM) - https://wiki.onap.org - - ONAP - - - - org.onap.ccsdk.parent - parent - 1.2.0-SNAPSHOT - - - - - - org.onap.ccsdk.sli.northbound - ccsdk-asdcApi - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.northbound - ccsdk-dataChange - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.northbound - ccsdk-lcm - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.northbound - asdcApi-model - ${project.version} - - - org.onap.ccsdk.sli.northbound - asdcApi-provider - ${project.version} - - - org.onap.ccsdk.sli.northbound - asdcApi-installer - ${project.version} - - - org.onap.ccsdk.sli.northbound - dataChange-model - ${project.version} - - - org.onap.ccsdk.sli.northbound - dataChange-provider - ${project.version} - - - org.onap.ccsdk.sli.northbound - dataChange-installer - ${project.version} - - - org.onap.ccsdk.sli.northbound - lcm-model - ${project.version} - - - org.onap.ccsdk.sli.northbound - lcm-provider - ${project.version} - - - org.onap.ccsdk.sli.northbound - lcm-installer - ${project.version} - - - + ccsdk-sli-northbound :: sli-northbound-artifacts + CCSDK northbound components Bill of Materials (BOM) + https://wiki.onap.org + + ONAP + + + + org.onap.ccsdk.parent + parent + 1.2.0 + + + + ${project.version} + + + + + + org.onap.ccsdk.sli.northbound + ccsdk-asdcApi + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.northbound + ccsdk-dataChange + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.northbound + ccsdk-lcm + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.northbound + asdcApi-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + + + org.onap.ccsdk.sli.northbound + asdcApi-installer + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-provider + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-installer + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-provider + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-installer + ${project.version} + + + diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index a83535f58..e538aab22 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.northbound @@ -18,10 +17,14 @@ ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + ${project.version} + - - - + + + + org.opendaylight.mdsal.model mdsal-model-artifacts ${odl.mdsal.model.version} @@ -35,9 +38,9 @@ pom import - - - + + + diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 6ce4e1317..48bff872d 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -1,29 +1,33 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.0 + + - org.onap.ccsdk.sli.northbound - features-asdcApi - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.northbound + features-asdcApi + 0.4.0-SNAPSHOT + feature - ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - - - ${project.groupId} - ccsdk-asdcApi - ${project.version} - xml - features - + + ${project.version} + - + + + ${project.groupId} + ccsdk-asdcApi + ${project.version} + xml + features + + + diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 4f15557ad..a63f2ee5d 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 5e288db62..f4d1552d4 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 85ba01058..944ca8c9b 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT + 1.2.0 @@ -16,6 +16,10 @@ ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + ${project.version} + + diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index fe33ea701..f37b06974 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -1,27 +1,31 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 - + - org.onap.ccsdk.sli.northbound - asdcApi - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.northbound + asdcApi + 0.4.0-SNAPSHOT + pom ccsdk-sli-northbound :: asdcApi - - model - features - provider - installer - + + ${project.version} + + + + model + features + provider + installer + diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 2a918df20..84ac3313e 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.northbound @@ -17,6 +16,9 @@ ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + ${project.version} + diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 260253bc4..a18d2acf3 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.northbound @@ -18,10 +17,14 @@ ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + ${project.version} + - - - + + + + org.opendaylight.mdsal.model mdsal-model-artifacts ${odl.mdsal.model.version} @@ -35,9 +38,9 @@ pom import - - - + + + diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 9085dcbba..792475095 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -1,29 +1,33 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.0 + + - org.onap.ccsdk.sli.northbound - features-dataChange - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.northbound + features-dataChange + 0.4.0-SNAPSHOT + feature - ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - - - ${project.groupId} - ccsdk-dataChange - ${project.version} - xml - features - + + ${project.version} + - + + + ${project.groupId} + ccsdk-dataChange + ${project.version} + xml + features + + + diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 26477be13..99b8b861f 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index f937fab37..83aaec0b1 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 78b605d99..5d2ce7d1e 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT + 1.2.0 @@ -16,6 +16,10 @@ ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + ${project.version} + + org.opendaylight.mdsal.model diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 3d68052bc..824cd58a2 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -1,26 +1,26 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 - + - org.onap.ccsdk.sli.northbound - dataChange - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.northbound + dataChange + 0.4.0-SNAPSHOT + pom ccsdk-sli-northbound :: dataChange - - model - features - provider - installer - + + model + features + provider + installer + diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index ba88bae41..09b7741d9 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.northbound @@ -17,6 +16,10 @@ ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + ${project.version} + + org.onap.ccsdk.sli.northbound diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index c63dddea1..86c7d54de 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.northbound @@ -28,6 +27,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} + ${project.version} diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index f9475d6c9..181621b92 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -1,66 +1,68 @@ - - 4.0.0 + + 4.0.0 - - org.onap.ccsdk.parent - single-feature-parent - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + single-feature-parent + 1.2.0 + + - org.onap.ccsdk.sli.northbound - ccsdk-sli-northbound-all - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.northbound + ccsdk-sli-northbound-all + 0.4.0-SNAPSHOT + feature - ccsdk-sli-northbound :: features :: ${project.artifactId} + ccsdk-sli-northbound :: features :: ${project.artifactId} - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - + + ${project.version} + - - - ${project.groupId} - ccsdk-asdcApi - ${project.version} - xml - features - - - ${project.groupId} - ccsdk-dataChange - ${project.version} - xml - features - - - ${project.groupId} - ccsdk-lcm - ${project.version} - xml - features - + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + - - + + + ${project.groupId} + ccsdk-asdcApi + ${project.version} + xml + features + + + ${project.groupId} + ccsdk-dataChange + ${project.version} + xml + features + + + ${project.groupId} + ccsdk-lcm + ${project.version} + xml + features + + + + diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 09043ce7c..60f8d735f 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.0-SNAPSHOT + 1.2.0 @@ -16,6 +16,10 @@ ccsdk-sli-northbound :: features :: ${project.artifactId} + + ${project.version} + + ${project.groupId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 2c4e7a877..37e9a269e 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -1,137 +1,136 @@ - - 4.0.0 + + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + + - org.onap.ccsdk.sli.northbound - slinorthbound-features-installer - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.northbound + slinorthbound-features-installer + 0.4.0-SNAPSHOT + pom - ccsdk-sli-northbound :: features :: ${project.artifactId} + ccsdk-sli-northbound :: features :: ${project.artifactId} - - ccsdk-sli-northbound-all - ${application.name} - mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features - false - + + ccsdk-sli-northbound-all + ${application.name} + mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features + false + - + - - org.onap.ccsdk.sli.northbound - ${application.name} - ${project.version} - xml - features - - - * - * - - - + + org.onap.ccsdk.sli.northbound + ${application.name} + ${project.version} + xml + features + + + * + * + + + - + - - - - maven-assembly-plugin - - - maven-repo-zip - - single - - package - - true - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - true - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false + + + + maven-assembly-plugin + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false org.onap.ccsdk.sli.northbound - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + - - + + - - + + diff --git a/features/pom.xml b/features/pom.xml index bd31c8046..2744c5cd3 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -1,22 +1,22 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + + - org.onap.ccsdk.sli.northbound - slinorthbound-feature-aggregator - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.northbound + slinorthbound-feature-aggregator + 0.4.0-SNAPSHOT + pom - ccsdk-sli-northbound :: features + ccsdk-sli-northbound :: features - + ccsdk-sli-northbound-all features-sli-northbound installer diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 18b22225c..6138a3646 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.northbound @@ -18,10 +17,14 @@ ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + ${project.version} + - - - + + + + org.opendaylight.mdsal.model mdsal-model-artifacts ${odl.mdsal.model.version} @@ -35,9 +38,9 @@ pom import - - - + + + diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index d50d3e847..08e4fa8af 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -1,29 +1,33 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.0 + + - org.onap.ccsdk.sli.northbound - features-lcm - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.northbound + features-lcm + 0.4.0-SNAPSHOT + feature - ccsdk-sli-northbound :: lcm :: ${project.artifactId} + ccsdk-sli-northbound :: lcm :: ${project.artifactId} - - - ${project.groupId} - ccsdk-lcm - ${project.version} - xml - features - + + ${project.version} + - + + + ${project.groupId} + ccsdk-lcm + ${project.version} + xml + features + + + diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index c995e2fb6..27fdcefab 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 2dcc19748..e51a95e37 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -1,147 +1,147 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 - + org.onap.ccsdk.sli.northbound - lcm-installer + lcm-installer 0.4.0-SNAPSHOT - pom + pom - ccsdk-sli-northbound :: lcm :: ${project.artifactId} + ccsdk-sli-northbound :: lcm :: ${project.artifactId} - - ccsdk-lcm - ${application.name} + + ccsdk-lcm + ${application.name} mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features - false - + false + - + - - org.onap.ccsdk.sli.northbound - ${application.name} - ${project.version} - xml - features - - - * - * - - - + + org.onap.ccsdk.sli.northbound + ${application.name} + ${project.version} + xml + features + + + * + * + + + org.onap.ccsdk.sli.northbound lcm-model ${project.version} - - org.onap.ccsdk.sli.northbound - lcm-provider - ${project.version} - + + org.onap.ccsdk.sli.northbound + lcm-provider + ${project.version} + - + - - - - maven-assembly-plugin - 2.6 - - - maven-repo-zip - - single - - package - - true - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - true - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false - org.onap.ccsdk.sli.northbound - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.northbound + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + - - + + - - + + diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 27dcbdc78..090ed6490 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT + 1.2.0 @@ -16,6 +16,10 @@ ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + ${project.version} + + diff --git a/lcm/pom.xml b/lcm/pom.xml index 89468a881..54f1ba6b7 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -1,27 +1,27 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 - + - org.onap.ccsdk.sli.northbound - lcm - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.northbound + lcm + 0.4.0-SNAPSHOT + pom ccsdk-sli-northbound :: lcm - - model - features - provider - installer - + + model + features + provider + installer + diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index f383df7f1..188104038 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.northbound @@ -17,6 +16,10 @@ ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + ${project.version} + + diff --git a/pom.xml b/pom.xml index af81f479f..bc96e012c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,121 +1,121 @@ - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - - - 4.0.0 - pom - org.onap.ccsdk.sli.northbound - ccsdk-sli-northbound - - ccsdk-sli-northbound - https://wiki.onap.org - The SDN-C Northbound APIs repo contains code for northbound API adaptors, typically MD-SAL applications - - - - JIRA - https://jira.onap.org/ - - - - - scm:git:ssh://git@${onap.git.host}/sdnc-northbound.git - - scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/sdnc-northbound.git - ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/sdnc-northbound/browse - - - - Jenkins - https://jenkins.onap.org/ - - - - - sdnc-javadoc - dav:https://${onap.nexus.host}:${onap.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} - - - - - blackduck - - - blackduck-scan - - - - - - com.blackducksoftware.integration - hub-maven-plugin - 1.4.0 - false - - ${project.name} - ${project.basedir} - - - - create-bdio-file - package - - createHubOutput - - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.17 - - false - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - https://${onap.nexus.host} - ${onap.nexus.staging.profile-id} - ${onap.nexus.staging.server-id} - - - - - - - asdcApi - dataChange - lcm - dmaap-listener - ueb-listener - features - artifacts - - - ONAP - - 0.4.0-SNAPSHOT + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + + + 4.0.0 + pom + org.onap.ccsdk.sli.northbound + ccsdk-sli-northbound + + ccsdk-sli-northbound + https://wiki.onap.org + The SDN-C Northbound APIs repo contains code for northbound API adaptors, typically MD-SAL applications + + + + JIRA + https://jira.onap.org/ + + + + + scm:git:ssh://git@${onap.git.host}/sdnc-northbound.git + + scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/sdnc-northbound.git + ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/sdnc-northbound/browse + + + + Jenkins + https://jenkins.onap.org/ + + + + + sdnc-javadoc + dav:https://${onap.nexus.host}:${onap.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} + + + + + blackduck + + + blackduck-scan + + + + + + com.blackducksoftware.integration + hub-maven-plugin + 1.4.0 + false + + ${project.name} + ${project.basedir} + + + + create-bdio-file + package + + createHubOutput + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.17 + + false + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + https://${onap.nexus.host} + ${onap.nexus.staging.profile-id} + ${onap.nexus.staging.server-id} + + + + + + + asdcApi + dataChange + lcm + dmaap-listener + ueb-listener + features + artifacts + + + ONAP + + 0.4.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index d91a5746b..43832db85 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -1,159 +1,158 @@ - - 4.0.0 + + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + - org.onap.ccsdk.sli.northbound - ueb-listener - 0.4.0-SNAPSHOT - jar + org.onap.ccsdk.sli.northbound + ueb-listener + 0.4.0-SNAPSHOT + jar - ccsdk-sli-northbound :: ueb-listener - UEB Listener + ccsdk-sli-northbound :: ueb-listener + UEB Listener - - 1.3.0 - 1.4.7 - 2.9.4 - true - /opt/app/ueb-listener - yyyyMMdd'T'HHmmss'Z' - ${maven.build.timestamp} - ${project.version}-${build.number} - + + 1.3.0 + 1.4.7 + 2.9.4 + true + /opt/app/ueb-listener + yyyyMMdd'T'HHmmss'Z' + ${maven.build.timestamp} + ${project.version}-${build.number} + ${project.version} + - + - - org.onap.sdc.sdc-distribution-client - sdc-distribution-client - ${sdc.client.version} - compile - - - org.onap.sdc.sdc-tosca - sdc-tosca - ${sdc.tosca.version} - compile - - - org.slf4j - slf4j-api - 1.7.21 - - - org.slf4j - slf4j-log4j12 - 1.6.1 - compile - - - log4j - log4j - 1.2.17 - - - com.fasterxml.jackson.core - jackson-core - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.core - jackson-databind - ${fasterxml.jackson.version} - - - junit - junit - ${junit.version} - test - - - org.testng - testng - 6.11 - test - - - org.mockito - mockito-core - ${mockito.version} - test - - - ch.vorburger.mariaDB4j - mariaDB4j - 2.2.3 - test - - - org.onap.ccsdk.sli.core - dblib-provider - ${sdnctl.dblib.version} - - + + org.onap.sdc.sdc-distribution-client + sdc-distribution-client + ${sdc.client.version} + compile + + + org.onap.sdc.sdc-tosca + sdc-tosca + ${sdc.tosca.version} + compile + + + org.slf4j + slf4j-api + 1.7.21 + + + org.slf4j + slf4j-log4j12 + 1.6.1 + compile + + + log4j + log4j + 1.2.17 + + + com.fasterxml.jackson.core + jackson-core + ${fasterxml.jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${fasterxml.jackson.version} + + + junit + junit + ${junit.version} + test + + + org.testng + testng + 6.11 + test + + + org.mockito + mockito-core + ${mockito.version} + test + + + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.3 + test + + + org.onap.ccsdk.sli.core + dblib-provider + ${sdnctl.dblib.version} + + - - + + - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - true - - 1.7 - 1.7 - - + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + true + + 1.7 + 1.7 + + - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - true - org.onap.ccsdk.sli.northbound.uebclient.SdncUebClient - - - - + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + true + org.onap.ccsdk.sli.northbound.uebclient.SdncUebClient + + + + - - maven-assembly-plugin - 2.6 - - - create-zip - - single - - package - - true - ${project.artifactId}.${project.version} - true - - src/assembly/assemble_zip.xml - - false - - - - + + maven-assembly-plugin + 2.6 + + + create-zip + + single + + package + + true + ${project.artifactId}.${project.version} + true + + src/assembly/assemble_zip.xml + + false + + + + - - + + diff --git a/version.properties b/version.properties index 7439a509f..e1b84eea2 100644 --- a/version.properties +++ b/version.properties @@ -9,6 +9,6 @@ feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version}-STAGING +release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From cbe2411c3460693a9d1843698c4a4b0d73f65a14 Mon Sep 17 00:00:00 2001 From: Driptaroop Das Date: Thu, 10 Jan 2019 13:50:04 +0530 Subject: merged lcm.yang from app-c Merged differences from lcm.yang from appc to ccsdk. Issue-ID: CCSDK-925 Change-Id: I6b179f5a184408673231b57f8fc5d331bc11f0e7 Signed-off-by: Driptaroop Das --- lcm/model/src/main/yang/lcm.yang | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index a03fff607..c9ec3ca81 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -561,6 +561,10 @@ module LCM { output { uses common-header; uses status; + leaf payload { + type payload; + mandatory true; + } } } @@ -607,6 +611,10 @@ module LCM { output { uses common-header; uses status; + leaf payload { + type payload; + mandatory true; + } } } @@ -811,7 +819,7 @@ module LCM { uses action-identifiers; leaf payload { type payload; - mandatory false; + mandatory true; } } output { @@ -985,6 +993,11 @@ module LCM { output { uses common-header; uses status; + leaf payload { + type payload; + mandatory true; + } + } } -- cgit 1.2.3-korg From 90adbb654c878bfc9e1ba61c75feb3cba8280733 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 20 Dec 2018 14:29:35 -0500 Subject: Code changes to sli/northbound for ODL Fluorine Code changes needed to support port to ODL Fluorine. Change-Id: If898ed120a3d03773db815f797f1eee633ca77e3 Issue-ID: CCSDK-870 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 +- asdcApi/features/ccsdk-asdcApi/pom.xml | 26 +------ asdcApi/features/features-asdcApi/pom.xml | 4 +- asdcApi/features/pom.xml | 4 +- asdcApi/installer/pom.xml | 4 +- asdcApi/model/pom.xml | 8 +-- asdcApi/model/src/main/yang/ASDC-API.yang | 2 +- asdcApi/pom.xml | 4 +- asdcApi/provider/pom.xml | 20 ++++-- .../sli/northbound/asdcapi/AsdcApiProvider.java | 10 +-- dataChange/features/ccsdk-dataChange/pom.xml | 25 +------ dataChange/features/features-dataChange/pom.xml | 4 +- dataChange/features/pom.xml | 4 +- dataChange/installer/pom.xml | 4 +- dataChange/model/pom.xml | 8 +-- dataChange/pom.xml | 4 +- dataChange/provider/pom.xml | 20 ++++-- .../ccsdk/sli/northbound/DataChangeProvider.java | 4 +- .../sdnc/northbound/dataChange/TestDataChange.java | 2 +- dmaap-listener/pom.xml | 4 +- features/ccsdk-sli-northbound-all/pom.xml | 25 +------ features/features-sli-northbound/pom.xml | 4 +- features/installer/pom.xml | 4 +- features/pom.xml | 4 +- lcm/features/ccsdk-lcm/pom.xml | 27 +------- lcm/features/features-lcm/pom.xml | 4 +- lcm/features/pom.xml | 4 +- lcm/installer/pom.xml | 4 +- lcm/model/pom.xml | 8 +-- lcm/pom.xml | 4 +- lcm/provider/pom.xml | 37 +++++----- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 81 +++++++++++----------- pom.xml | 6 +- ueb-listener/pom.xml | 4 +- version.properties | 2 +- 35 files changed, 159 insertions(+), 224 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index a89e19310..d15621f98 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.0 + 1.2.1-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index e538aab22..d492848f0 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,43 +5,21 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - ${project.version} - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - - org.onap.ccsdk.sli.core diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 48bff872d..312c7b71a 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index a63f2ee5d..260878a2c 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index f4d1552d4..f17b7a1f7 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 944ca8c9b..61384fd9b 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} @@ -24,11 +24,11 @@ org.opendaylight.mdsal.model - ietf-inet-types + ietf-inet-types-2013-07-15 org.opendaylight.mdsal.model - ietf-yang-types + ietf-yang-types-20130715 diff --git a/asdcApi/model/src/main/yang/ASDC-API.yang b/asdcApi/model/src/main/yang/ASDC-API.yang index 00ef4522a..12cfb9a56 100755 --- a/asdcApi/model/src/main/yang/ASDC-API.yang +++ b/asdcApi/model/src/main/yang/ASDC-API.yang @@ -13,7 +13,7 @@ module ASDC-API { import ietf-inet-types { prefix inet; - revision-date "2010-09-24"; + revision-date "2013-07-15"; } organization diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index f37b06974..c724d452a 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 84ac3313e..9d41cdca8 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} @@ -20,16 +20,24 @@ ${project.version} + + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + + + org.onap.ccsdk.sli.northbound asdcApi-model ${project.version} - - org.opendaylight.controller - sal-binding-config - org.opendaylight.controller 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 27280d2d3..1a79f8c41 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 @@ -25,7 +25,6 @@ import java.util.Properties; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; @@ -59,6 +58,7 @@ import org.slf4j.LoggerFactory; import com.google.common.base.Optional; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; /** * Defines a base implementation for your provider. This class extends from a helper class @@ -203,7 +203,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { InstanceIdentifier.InstanceIdentifierBuilder aIdBuilder = InstanceIdentifier . builder(Artifacts.class) - .child(Artifact.class, artifact.getKey()); + .child(Artifact.class, artifact.key()); InstanceIdentifier path = aIdBuilder.build(); @@ -238,7 +238,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier . builder(VfLicenseModelVersions.class) - .child(VfLicenseModelVersion.class, version.getKey()); + .child(VfLicenseModelVersion.class, version.key()); InstanceIdentifier path = versionIdBuilder.build(); @@ -264,7 +264,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { VfLicenseModelVersion version = vBuilder.build(); InstanceIdentifier.InstanceIdentifierBuilder versionIdBuilder = InstanceIdentifier . builder(VfLicenseModelVersions.class) - .child(VfLicenseModelVersion.class, version.getKey()); + .child(VfLicenseModelVersion.class, version.key()); InstanceIdentifier path = versionIdBuilder.build(); @@ -282,7 +282,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { } @Override -public Future> vfLicenseModelUpdate(VfLicenseModelUpdateInput input) { +public ListenableFuture> vfLicenseModelUpdate(VfLicenseModelUpdateInput input) { final String svcOperation = "vf-license-model-update"; Properties parms = new Properties(); diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index a18d2acf3..16383e8c0 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,42 +5,21 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - ${project.version} - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 792475095..66264cd23 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 99b8b861f..02e257f89 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 83aaec0b1..d2d9b1547 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 5d2ce7d1e..aa987302e 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} @@ -23,11 +23,11 @@ org.opendaylight.mdsal.model - ietf-inet-types + ietf-inet-types-2013-07-15 org.opendaylight.mdsal.model - ietf-yang-types + ietf-yang-types-20130715 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 824cd58a2..b6418f4c2 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 09b7741d9..dd08e3eae 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} @@ -19,6 +19,18 @@ ${project.version} + + + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + + @@ -26,10 +38,6 @@ dataChange-model ${project.version} - - org.opendaylight.controller - sal-binding-config - org.opendaylight.controller 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 f272dbbc1..3301ca8e0 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 @@ -25,7 +25,6 @@ package org.onap.ccsdk.sli.northbound; import java.util.Properties; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; import org.opendaylight.controller.md.sal.binding.api.DataBroker; @@ -43,6 +42,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; /** * Defines a base implementation for your provider. This class extends from a helper class @@ -98,7 +98,7 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { } @Override - public Future> dataChangeNotification( + public ListenableFuture> dataChangeNotification( DataChangeNotificationInput input) { final String svcOperation = "data-change-notification"; diff --git a/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java b/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java index 7855375a3..f9c39b703 100644 --- a/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java +++ b/dataChange/provider/src/test/java/org/onap/sdnc/northbound/dataChange/TestDataChange.java @@ -19,7 +19,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.sdnc.northbound; +package org.onap.sdnc.northbound.dataChange; import org.junit.Before; import org.junit.Test; diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 86c7d54de..07c80d06f 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 181621b92..f4d233827 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,41 +5,20 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} - ${project.version} - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - ${project.groupId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 60f8d735f..5d4433514 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 37e9a269e..644ca1c76 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 2744c5cd3..f96883608 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 6138a3646..67fadb15d 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,42 +5,21 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} - ${project.version} - - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - + diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 08e4fa8af..571b8e0a5 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 27fdcefab..afde4e171 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index e51a95e37..10e7bdd30 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 090ed6490..38416fe25 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} @@ -24,11 +24,11 @@ org.opendaylight.mdsal.model - ietf-inet-types + ietf-inet-types-2013-07-15 org.opendaylight.mdsal.model - ietf-yang-types + ietf-yang-types-20130715 diff --git a/lcm/pom.xml b/lcm/pom.xml index 54f1ba6b7..4e9f1033c 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 188104038..a6dd8637b 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} @@ -20,16 +20,17 @@ ${project.version} + - - - org.opendaylight.controller - mdsal-artifacts - 1.6.1 - pom - import - - + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + @@ -38,16 +39,15 @@ lcm-model ${project.version} - - org.opendaylight.controller - sal-binding-config - org.opendaylight.controller sal-binding-api - + + org.opendaylight.controller + sal-binding-broker-impl + org.opendaylight.controller sal-common-util @@ -95,6 +95,11 @@ 10.12.1.1 test + + org.osgi + org.osgi.core + test + diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 570e89ec3..d1f3ba53f 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -43,6 +43,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; import org.onap.ccsdk.sli.northbound.LcmResponseCode.*; @@ -131,7 +132,7 @@ public class LcmProvider implements AutoCloseable, LCMService { @Override - public Future> checkLock(CheckLockInput input) { + public ListenableFuture> checkLock(CheckLockInput input) { CheckLockInputBuilder iBuilder = new CheckLockInputBuilder(input); CheckLockOutputBuilder oBuilder = new CheckLockOutputBuilder(); @@ -153,7 +154,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> reboot(RebootInput input) { + public ListenableFuture> reboot(RebootInput input) { RebootInputBuilder iBuilder = new RebootInputBuilder(input); RebootOutputBuilder oBuilder = new RebootOutputBuilder(); @@ -174,7 +175,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> upgradeBackup(UpgradeBackupInput input) { + public ListenableFuture> upgradeBackup(UpgradeBackupInput input) { UpgradeBackupInputBuilder iBuilder = new UpgradeBackupInputBuilder(input); UpgradeBackupOutputBuilder oBuilder = new UpgradeBackupOutputBuilder(); @@ -196,7 +197,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> rollback(RollbackInput input) { + public ListenableFuture> rollback(RollbackInput input) { RollbackInputBuilder iBuilder = new RollbackInputBuilder(input); RollbackOutputBuilder oBuilder = new RollbackOutputBuilder(); @@ -217,7 +218,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> sync(SyncInput input) { + public ListenableFuture> sync(SyncInput input) { SyncInputBuilder iBuilder = new SyncInputBuilder(input); SyncOutputBuilder oBuilder = new SyncOutputBuilder(); @@ -238,7 +239,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> query(QueryInput input) { + public ListenableFuture> query(QueryInput input) { QueryInputBuilder iBuilder = new QueryInputBuilder(input); QueryOutputBuilder oBuilder = new QueryOutputBuilder(); @@ -259,7 +260,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> configExport(ConfigExportInput input) { + public ListenableFuture> configExport(ConfigExportInput input) { ConfigExportInputBuilder iBuilder = new ConfigExportInputBuilder(input); ConfigExportOutputBuilder oBuilder = new ConfigExportOutputBuilder(); @@ -280,7 +281,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> stopApplication(StopApplicationInput input) { + public ListenableFuture> stopApplication(StopApplicationInput input) { StopApplicationInputBuilder iBuilder = new StopApplicationInputBuilder(input); StopApplicationOutputBuilder oBuilder = new StopApplicationOutputBuilder(); @@ -301,7 +302,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> softwareUpload(SoftwareUploadInput input) { + public ListenableFuture> softwareUpload(SoftwareUploadInput input) { SoftwareUploadInputBuilder iBuilder = new SoftwareUploadInputBuilder(input); SoftwareUploadOutputBuilder oBuilder = new SoftwareUploadOutputBuilder(); @@ -322,7 +323,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> resumeTraffic(ResumeTrafficInput input) { + public ListenableFuture> resumeTraffic(ResumeTrafficInput input) { ResumeTrafficInputBuilder iBuilder = new ResumeTrafficInputBuilder(input); ResumeTrafficOutputBuilder oBuilder = new ResumeTrafficOutputBuilder(); @@ -343,7 +344,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> distributeTraffic(DistributeTrafficInput input) { + public ListenableFuture> distributeTraffic(DistributeTrafficInput input) { DistributeTrafficInputBuilder iBuilder = new DistributeTrafficInputBuilder(input); DistributeTrafficOutputBuilder oBuilder = new DistributeTrafficOutputBuilder(); @@ -364,7 +365,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> configure(ConfigureInput input) { + public ListenableFuture> configure(ConfigureInput input) { ConfigureInputBuilder iBuilder = new ConfigureInputBuilder(input); ConfigureOutputBuilder oBuilder = new ConfigureOutputBuilder(); @@ -385,7 +386,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> actionStatus(ActionStatusInput input) { + public ListenableFuture> actionStatus(ActionStatusInput input) { ActionStatusInputBuilder iBuilder = new ActionStatusInputBuilder(input); ActionStatusOutputBuilder oBuilder = new ActionStatusOutputBuilder(); @@ -406,7 +407,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> upgradePreCheck(UpgradePreCheckInput input) { + public ListenableFuture> upgradePreCheck(UpgradePreCheckInput input) { UpgradePreCheckInputBuilder iBuilder = new UpgradePreCheckInputBuilder(input); UpgradePreCheckOutputBuilder oBuilder = new UpgradePreCheckOutputBuilder(); @@ -427,7 +428,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> liveUpgrade(LiveUpgradeInput input) { + public ListenableFuture> liveUpgrade(LiveUpgradeInput input) { LiveUpgradeInputBuilder iBuilder = new LiveUpgradeInputBuilder(input); LiveUpgradeOutputBuilder oBuilder = new LiveUpgradeOutputBuilder(); @@ -448,7 +449,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> configModify(ConfigModifyInput input) { + public ListenableFuture> configModify(ConfigModifyInput input) { ConfigModifyInputBuilder iBuilder = new ConfigModifyInputBuilder(input); ConfigModifyOutputBuilder oBuilder = new ConfigModifyOutputBuilder(); @@ -469,7 +470,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> restart(RestartInput input) { + public ListenableFuture> restart(RestartInput input) { RestartInputBuilder iBuilder = new RestartInputBuilder(input); RestartOutputBuilder oBuilder = new RestartOutputBuilder(); @@ -490,7 +491,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> healthCheck(HealthCheckInput input) { + public ListenableFuture> healthCheck(HealthCheckInput input) { HealthCheckInputBuilder iBuilder = new HealthCheckInputBuilder(input); HealthCheckOutputBuilder oBuilder = new HealthCheckOutputBuilder(); @@ -511,7 +512,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> lock(LockInput input) { + public ListenableFuture> lock(LockInput input) { LockInputBuilder iBuilder = new LockInputBuilder(input); LockOutputBuilder oBuilder = new LockOutputBuilder(); @@ -532,7 +533,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> terminate(TerminateInput input) { + public ListenableFuture> terminate(TerminateInput input) { TerminateInputBuilder iBuilder = new TerminateInputBuilder(input); TerminateOutputBuilder oBuilder = new TerminateOutputBuilder(); @@ -553,7 +554,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> attachVolume(AttachVolumeInput input) { + public ListenableFuture> attachVolume(AttachVolumeInput input) { AttachVolumeInputBuilder iBuilder = new AttachVolumeInputBuilder(input); AttachVolumeOutputBuilder oBuilder = new AttachVolumeOutputBuilder(); @@ -574,7 +575,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> migrate(MigrateInput input) { + public ListenableFuture> migrate(MigrateInput input) { MigrateInputBuilder iBuilder = new MigrateInputBuilder(input); MigrateOutputBuilder oBuilder = new MigrateOutputBuilder(); @@ -595,7 +596,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> quiesceTraffic(QuiesceTrafficInput input) { + public ListenableFuture> quiesceTraffic(QuiesceTrafficInput input) { QuiesceTrafficInputBuilder iBuilder = new QuiesceTrafficInputBuilder(input); QuiesceTrafficOutputBuilder oBuilder = new QuiesceTrafficOutputBuilder(); @@ -616,7 +617,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> configRestore(ConfigRestoreInput input) { + public ListenableFuture> configRestore(ConfigRestoreInput input) { ConfigRestoreInputBuilder iBuilder = new ConfigRestoreInputBuilder(input); ConfigRestoreOutputBuilder oBuilder = new ConfigRestoreOutputBuilder(); @@ -637,7 +638,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> upgradeBackout(UpgradeBackoutInput input) { + public ListenableFuture> upgradeBackout(UpgradeBackoutInput input) { UpgradeBackoutInputBuilder iBuilder = new UpgradeBackoutInputBuilder(input); UpgradeBackoutOutputBuilder oBuilder = new UpgradeBackoutOutputBuilder(); @@ -658,7 +659,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> evacuate(EvacuateInput input) { + public ListenableFuture> evacuate(EvacuateInput input) { EvacuateInputBuilder iBuilder = new EvacuateInputBuilder(input); EvacuateOutputBuilder oBuilder = new EvacuateOutputBuilder(); @@ -679,7 +680,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> unlock(UnlockInput input) { + public ListenableFuture> unlock(UnlockInput input) { UnlockInputBuilder iBuilder = new UnlockInputBuilder(input); UnlockOutputBuilder oBuilder = new UnlockOutputBuilder(); @@ -700,7 +701,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> configBackupDelete(ConfigBackupDeleteInput input) { + public ListenableFuture> configBackupDelete(ConfigBackupDeleteInput input) { ConfigBackupDeleteInputBuilder iBuilder = new ConfigBackupDeleteInputBuilder(input); ConfigBackupDeleteOutputBuilder oBuilder = new ConfigBackupDeleteOutputBuilder(); @@ -721,7 +722,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> upgradeSoftware(UpgradeSoftwareInput input) { + public ListenableFuture> upgradeSoftware(UpgradeSoftwareInput input) { UpgradeSoftwareInputBuilder iBuilder = new UpgradeSoftwareInputBuilder(input); UpgradeSoftwareOutputBuilder oBuilder = new UpgradeSoftwareOutputBuilder(); @@ -742,7 +743,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> stop(StopInput input) { + public ListenableFuture> stop(StopInput input) { StopInputBuilder iBuilder = new StopInputBuilder(input); StopOutputBuilder oBuilder = new StopOutputBuilder(); @@ -763,7 +764,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> detachVolume(DetachVolumeInput input) { + public ListenableFuture> detachVolume(DetachVolumeInput input) { DetachVolumeInputBuilder iBuilder = new DetachVolumeInputBuilder(input); DetachVolumeOutputBuilder oBuilder = new DetachVolumeOutputBuilder(); @@ -784,7 +785,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> configScaleOut(ConfigScaleOutInput input) { + public ListenableFuture> configScaleOut(ConfigScaleOutInput input) { ConfigScaleOutInputBuilder iBuilder = new ConfigScaleOutInputBuilder(input); ConfigScaleOutOutputBuilder oBuilder = new ConfigScaleOutOutputBuilder(); @@ -805,7 +806,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> upgradePostCheck(UpgradePostCheckInput input) { + public ListenableFuture> upgradePostCheck(UpgradePostCheckInput input) { UpgradePostCheckInputBuilder iBuilder = new UpgradePostCheckInputBuilder(input); UpgradePostCheckOutputBuilder oBuilder = new UpgradePostCheckOutputBuilder(); @@ -826,7 +827,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> test(TestInput input) { + public ListenableFuture> test(TestInput input) { TestInputBuilder iBuilder = new TestInputBuilder(input); TestOutputBuilder oBuilder = new TestOutputBuilder(); @@ -847,7 +848,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> startApplication(StartApplicationInput input) { + public ListenableFuture> startApplication(StartApplicationInput input) { StartApplicationInputBuilder iBuilder = new StartApplicationInputBuilder(input); StartApplicationOutputBuilder oBuilder = new StartApplicationOutputBuilder(); @@ -868,7 +869,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> configBackup(ConfigBackupInput input) { + public ListenableFuture> configBackup(ConfigBackupInput input) { ConfigBackupInputBuilder iBuilder = new ConfigBackupInputBuilder(input); ConfigBackupOutputBuilder oBuilder = new ConfigBackupOutputBuilder(); @@ -889,7 +890,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> rebuild(RebuildInput input) { + public ListenableFuture> rebuild(RebuildInput input) { RebuildInputBuilder iBuilder = new RebuildInputBuilder(input); RebuildOutputBuilder oBuilder = new RebuildOutputBuilder(); @@ -910,7 +911,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> audit(AuditInput input) { + public ListenableFuture> audit(AuditInput input) { AuditInputBuilder iBuilder = new AuditInputBuilder(input); AuditOutputBuilder oBuilder = new AuditOutputBuilder(); @@ -931,7 +932,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> start(StartInput input) { + public ListenableFuture> start(StartInput input) { StartInputBuilder iBuilder = new StartInputBuilder(input); StartOutputBuilder oBuilder = new StartOutputBuilder(); @@ -952,7 +953,7 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public Future> snapshot(SnapshotInput input) { + public ListenableFuture> snapshot(SnapshotInput input) { SnapshotInputBuilder iBuilder = new SnapshotInputBuilder(input); SnapshotOutputBuilder oBuilder = new SnapshotOutputBuilder(); diff --git a/pom.xml b/pom.xml index bc96e012c..e170498ad 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT 4.0.0 @@ -84,7 +84,6 @@ org.apache.maven.plugins maven-surefire-plugin - 2.17 false @@ -92,7 +91,6 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 true https://${onap.nexus.host} @@ -115,7 +113,7 @@ ONAP - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 43832db85..87a9dfe97 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index e1b84eea2..2a56aedac 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=4 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 50bd4a0f591d9d00335b008a9e66f1906d40bc20 Mon Sep 17 00:00:00 2001 From: "Haddox, Anthony" Date: Wed, 16 Jan 2019 08:08:35 -0800 Subject: [CCSDK-953]Create Daexim Offsite Backup Inital commit of ODL feature Issue-ID: CCSDK-953 Change-Id: I7eb64fc9f414083db424700f2c901ba0a66cb0c4 Signed-off-by: Haddox, Anthony --- daexim-offsite-backup/.gitignore | 38 ++ daexim-offsite-backup/README.md | 82 ++++ .../features/ccsdk-daexim-offsite-backup/pom.xml | 46 +++ .../src/main/feature/feature.xml | 7 + .../features-daexim-offsite-backup/pom.xml | 28 ++ daexim-offsite-backup/features/pom.xml | 23 ++ daexim-offsite-backup/installer/pom.xml | 137 +++++++ .../src/assembly/assemble_installer_zip.xml | 56 +++ .../src/assembly/assemble_mvnrepo_zip.xml | 47 +++ .../src/main/resources/scripts/install-feature.sh | 39 ++ daexim-offsite-backup/model/.gitignore | 1 + daexim-offsite-backup/model/pom.xml | 27 ++ .../model/scripts/python/yang2props.py | 57 +++ .../model/src/main/yang/daexim-offsite-backup.yang | 46 +++ daexim-offsite-backup/pom.xml | 48 +++ daexim-offsite-backup/provider/.gitignore | 3 + daexim-offsite-backup/provider/pom.xml | 91 +++++ .../DaeximOffsiteBackupProvider.java | 419 +++++++++++++++++++++ .../DaeximOffsiteBackupUtil.java | 78 ++++ .../resources/daexim-offsite-backup.properties | 6 + .../opendaylight/blueprint/DaeximOffsiteBackup.xml | 20 + .../DaeximOffsiteBackupProviderTest.java | 223 +++++++++++ .../DaeximOffsiteBackupUtilTest.java | 40 ++ .../resources/daexim-offsite-backup.properties | 4 + .../provider/src/test/resources/fileToZip1 | 1 + .../provider/src/test/resources/fileToZip2 | 1 + pom.xml | 1 + 27 files changed, 1569 insertions(+) create mode 100755 daexim-offsite-backup/.gitignore create mode 100755 daexim-offsite-backup/README.md create mode 100644 daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml create mode 100644 daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml create mode 100644 daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml create mode 100755 daexim-offsite-backup/features/pom.xml create mode 100755 daexim-offsite-backup/installer/pom.xml create mode 100755 daexim-offsite-backup/installer/src/assembly/assemble_installer_zip.xml create mode 100755 daexim-offsite-backup/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 daexim-offsite-backup/installer/src/main/resources/scripts/install-feature.sh create mode 100755 daexim-offsite-backup/model/.gitignore create mode 100755 daexim-offsite-backup/model/pom.xml create mode 100755 daexim-offsite-backup/model/scripts/python/yang2props.py create mode 100755 daexim-offsite-backup/model/src/main/yang/daexim-offsite-backup.yang create mode 100755 daexim-offsite-backup/pom.xml create mode 100755 daexim-offsite-backup/provider/.gitignore create mode 100755 daexim-offsite-backup/provider/pom.xml create mode 100755 daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java create mode 100755 daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java create mode 100755 daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties create mode 100755 daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml create mode 100644 daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java create mode 100644 daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtilTest.java create mode 100755 daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties create mode 100644 daexim-offsite-backup/provider/src/test/resources/fileToZip1 create mode 100644 daexim-offsite-backup/provider/src/test/resources/fileToZip2 diff --git a/daexim-offsite-backup/.gitignore b/daexim-offsite-backup/.gitignore new file mode 100755 index 000000000..a01e90efe --- /dev/null +++ b/daexim-offsite-backup/.gitignore @@ -0,0 +1,38 @@ +tandard .git ignore entries##### + +## IDE Specific Files ## +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +maven-eclipse.xml +workspace + +## Compilation Files ## +*.class +**/target +target +target-ide +MANIFEST.MF + +## Misc Ignores (OS specific etc) ## +bin/ +dist +*~ +*.ipr +*.iml +*.iws +classes +out/ +.DS_STORE +.metadata + +## Folders which contain auto generated source code ## +yang-gen-config +yang-gen-sal + +#####Archetype specific .git ignore entries####### +generate +Archetype_Next_Steps.README diff --git a/daexim-offsite-backup/README.md b/daexim-offsite-backup/README.md new file mode 100755 index 000000000..26d8a7ede --- /dev/null +++ b/daexim-offsite-backup/README.md @@ -0,0 +1,82 @@ +Introduction +====================== +You have generated an MD-SAL module. + +* You should be able to successfully run ```mvn clean install``` on this project. + +Next Steps +====================== +* run a ```mvn clean install``` if you haven't already. This will generate some code from the yang models. +* Modify the model yang file under the model project. +* Follow the comments in the generated provider class to wire your new provider into the generated +code. +* Modify the generated provider model to respond to and handle the yang model. Depending on what +you added to your model you may need to inherit additional interfaces or make other changes to +the provider model. + +Generated Bundles +====================== +* model + - Provides the yang model for your application. This is your primary northbound interface. +* provider + - Provides a template implementation for a provider to respond to your yang model. +* features + - Defines a karaf feature. If you add dependencies on third-party bundles then you will need to + modify the features.xml to list out the dependencies. +* installer + - Bundles all of the jars and third party dependencies (minus ODL dependencies) into a single + .zip file. + +Usage +====================== +## Purpose +The purpose of this ODL feature is to support local and geo-redundancy by providing a way to +back up and retrieve MD-SAL data exports to and from a Sonatype Nexus server. In order to function, +this module requires the controller to have an installation of the ```data-export-import``` module and a valid export of MD-SAL data. + +## Backup +MD-SAL Backup can be achieved using the ```daexim-offsite-backup:backup-data``` RPC either through the +RESTConf portal or through a tool such as cURL or Postman. While no input is required for this RPC, +the RPC does require the operational, models, and config .JSONs to be present in the daexim directory of the controller. +```sh +export USER=user +export PASSWORD=password +export ODL_HOST=https://yourhost.com:8181 +curl -X POST -u$USER:$PASSWORD ${ODL_HOST}/restconf/operations/daexim-offsite-backup:backup-data +``` +Through this process a timestamped archive is created in the form of ```POD_NAME-yyyyMMdd_HH-odl_backup.zip``` +where ```POD_NAME``` is the name of the ODL, specified through the properties file or through an environment variable. + +## Retrieval +MD-SAL Retrieval can be achieved by using the ```daexim-offsite-backup:retrieve-data``` RPC either through the +RESTConf portal or through a tool such as cURL or Postman. This RPC requires timestamp information and may +be supplied with an optional podName. + +```sh +export USER=user +export PASSWORD=password +export ODL_HOST=https://yourhost.com:8181 +export TARGET_ODL=targetOdlPodName +export TIMESTAMP=yyyyMMdd_HH +export DATA= ' + { + "input": { + "pod-name": "'"$TARGET_ODL"'", + "timestamp": "'"$TIMESTAMP"'" + } + }' +curl -X POST -u$USER:$PASSWORD --data $DATA ${ODL_HOST}/restconf/operations/daexim-offsite-backup:retrieve-data +``` + +Through this process an archive with the specified timestamp (and optional pod name) is downloaded from +the Nexus server and extracted into the controller's daexim directory. After this it is up to the user +to trigger an MD-SAL import. + +## Properties File +Before each RPC execution this module pulls information from a user supplied properties file. The module expects to find: +- daeximDirectory +- credentials +- nexusUrl +- podName + +If the module cannot find the properties file it will default to generic values and attempt to move forward. diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml new file mode 100644 index 000000000..13c062565 --- /dev/null +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-daexim-offsite-backup + 0.4.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + provided + + + ${project.groupId} + daexim-offsite-backup-model + ${project.version} + + + ${project.groupId} + daexim-offsite-backup-provider + ${project.version} + + + diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml new file mode 100644 index 000000000..3dcb9002c --- /dev/null +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml @@ -0,0 +1,7 @@ + + + mvn:org.onap.ccsdk.sli.core/ccsdk-sli/LATEST/xml/features + + ccsdk-sli + + diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml new file mode 100644 index 000000000..d7f823cf2 --- /dev/null +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + features-daexim-offsite-backup + 0.4.1-SNAPSHOT + feature + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-daexim-offsite-backup + ${project.version} + xml + features + + + diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml new file mode 100755 index 000000000..8c4eaf5cb --- /dev/null +++ b/daexim-offsite-backup/features/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-features + 0.4.1-SNAPSHOT + pom + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + + + ccsdk-daexim-offsite-backup + features-daexim-offsite-backup + + diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml new file mode 100755 index 000000000..2cf83d76b --- /dev/null +++ b/daexim-offsite-backup/installer/pom.xml @@ -0,0 +1,137 @@ + + + 4.0.0 + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + + + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-installer + 0.4.1-SNAPSHOT + pom + + ccsdk-daexim-offsite-backup + ${application.name} + mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features + false + + + + org.onap.ccsdk.sli.northbound + ${application.name} + ${project.version} + xml + features + + + * + * + + + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-provider + ${project.version} + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-model + ${project.version} + + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.northbound + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + diff --git a/daexim-offsite-backup/installer/src/assembly/assemble_installer_zip.xml b/daexim-offsite-backup/installer/src/assembly/assemble_installer_zip.xml new file mode 100755 index 000000000..41d23e88a --- /dev/null +++ b/daexim-offsite-backup/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,56 @@ + + + + + + installer_zip + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + diff --git a/daexim-offsite-backup/installer/src/assembly/assemble_mvnrepo_zip.xml b/daexim-offsite-backup/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100755 index 000000000..275060986 --- /dev/null +++ b/daexim-offsite-backup/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,47 @@ + + + + + + repo + + zip + + + + false + + + + target/assembly/ + . + + + + + + diff --git a/daexim-offsite-backup/installer/src/main/resources/scripts/install-feature.sh b/daexim-offsite-backup/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 000000000..1d7be149e --- /dev/null +++ b/daexim-offsite-backup/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2018 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========================================================= +### + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} +INSTALLERDIR=$(dirname $0) + +REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}-repo.zip + +if [ -f ${REPOZIP} ] +then + unzip -d ${ODL_HOME} ${REPOZIP} +else + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 +fi + +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/daexim-offsite-backup/model/.gitignore b/daexim-offsite-backup/model/.gitignore new file mode 100755 index 000000000..eacf31a67 --- /dev/null +++ b/daexim-offsite-backup/model/.gitignore @@ -0,0 +1 @@ +/target-ide/ diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml new file mode 100755 index 000000000..a38f085f4 --- /dev/null +++ b/daexim-offsite-backup/model/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + org.onap.ccsdk.parent + binding-parent + 1.2.1-SNAPSHOT + + + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-model + 0.4.1-SNAPSHOT + bundle + + + + org.opendaylight.mdsal.model + ietf-inet-types-2013-07-15 + + + org.opendaylight.mdsal.model + ietf-yang-types-20130715 + + + diff --git a/daexim-offsite-backup/model/scripts/python/yang2props.py b/daexim-offsite-backup/model/scripts/python/yang2props.py new file mode 100755 index 000000000..559d31b8b --- /dev/null +++ b/daexim-offsite-backup/model/scripts/python/yang2props.py @@ -0,0 +1,57 @@ +#!/usr/bin/python + +import re +import sys + + +# Convert word from foo-bar to FooBar +# words begining with a digit will be converted to _digit +def to_enum(s): + if s[0].isdigit(): + s = "_" + s + else: + s = s[0].upper() + s[1:] + return re.sub(r'(?!^)-([a-zA-Z])', lambda m: m.group(1).upper(), s) + +leaf = "" +val = "" +li = [] + +if len(sys.argv) < 3: + print 'yang2props.py ' + sys.exit(2) + +with open(sys.argv[1], "r") as ins: + for line in ins: + # if we see a leaf save the name for later + if "leaf " in line: + match = re.search(r'leaf (\S+)', line) + if match: + leaf = match.group(1) + + # if we see enum convert the value to enum format and see if it changed + # if the value is different write a property entry + if "enum " in line: + match = re.search(r'enum "(\S+)";', line) + if match: + val = match.group(1) + enum = to_enum(val) + + # see if converting to enum changed the string + if val != enum: + property = "yang."+leaf+"."+enum+"="+val + if property not in li: + li.append( property) + + +# Open output file +fo = open(sys.argv[2], "wb") +fo.write("# yang conversion properties \n") +fo.write("# used to convert Enum back to the original yang value \n") +fo.write("\n".join(li)) +fo.write("\n") + +# Close opend file +fo.close() + + diff --git a/daexim-offsite-backup/model/src/main/yang/daexim-offsite-backup.yang b/daexim-offsite-backup/model/src/main/yang/daexim-offsite-backup.yang new file mode 100755 index 000000000..363136caf --- /dev/null +++ b/daexim-offsite-backup/model/src/main/yang/daexim-offsite-backup.yang @@ -0,0 +1,46 @@ +module daexim-offsite-backup{ + namespace "org:onap:ccsdk:sli:northbound:daeximoffsitebackup"; + prefix daexim-offsite-backup; + + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix yang; + } + description + "This ODL feature is designed for transferring MD-SAL data + to an offsite location in the ECOMP-C containerized environments."; + revision "2018-09-26" { + description + "Release 19.02 draft"; + } + + rpc backup-data { + output { + leaf status { type string; } + leaf message { type string; } + } + } + + rpc retrieve-data { + input { + leaf pod-name { + type string; + description + "Name of the desired MD-SAL backup's pod. If not supplied will + default to the name of this pod."; + } + leaf timestamp { + type string; + description + "Timestamp of the desired backup. Format: yyyyMMdd_HH"; + mandatory true; + } + } + output { + leaf status { type string; } + leaf message { type string; } + } + } +}////closes the module \ No newline at end of file diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml new file mode 100755 index 000000000..2542043a5 --- /dev/null +++ b/daexim-offsite-backup/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup + 0.4.1-SNAPSHOT + pom + + ccsdk-sli-northbound :: daexim-offsite-backup + ODL feature used for transferring MD-SAL data to an offsite location. + + + model + provider + features + installer + + + + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-features + features + xml + ${project.version} + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-model + ${project.version} + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-provider + ${project.version} + + + + diff --git a/daexim-offsite-backup/provider/.gitignore b/daexim-offsite-backup/provider/.gitignore new file mode 100755 index 000000000..527bb69aa --- /dev/null +++ b/daexim-offsite-backup/provider/.gitignore @@ -0,0 +1,3 @@ +/target-ide/ +fileToZip1 +fileToZip2 \ No newline at end of file diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml new file mode 100755 index 000000000..1dc855855 --- /dev/null +++ b/daexim-offsite-backup/provider/pom.xml @@ -0,0 +1,91 @@ + + + 4.0.0 + + org.onap.ccsdk.parent + binding-parent + 1.2.1-SNAPSHOT + + + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-provider + 0.4.1-SNAPSHOT + bundle + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.controller.config.yang.config.daexim-offsite-backup_provider + * + + + + + + + + + org.onap.ccsdk.sli.northbound + daexim-offsite-backup-model + ${project.version} + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-common-util + + + sal-test-model + org.opendaylight.controller + test + + + org.opendaylight.controller + sal-binding-broker-impl + test + + + org.opendaylight.controller + sal-binding-broker-impl + tests + test-jar + test + + + org.apache.commons + commons-lang3 + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + + + junit + junit + 4.11 + test + + + org.mockito + mockito-core + 1.10.19 + test + + + diff --git a/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java b/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java new file mode 100755 index 000000000..cc16bf70d --- /dev/null +++ b/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java @@ -0,0 +1,419 @@ +/* + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2018 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.daeximoffsitebackup; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Arrays; +import java.util.Base64; +import java.util.Collection; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; +import javax.annotation.Nonnull; + +import com.google.common.util.concurrent.CheckedFuture; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; + +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener; +import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.BackupDataInput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.BackupDataOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.BackupDataOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.DaeximOffsiteBackupService; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataInput; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsiteBackupService, DataTreeChangeListener { + private static final Logger LOG = LoggerFactory.getLogger(DaeximOffsiteBackupProvider.class); + + private static String DAEXIM_DIR; + private static String CREDENTIALS; + private static String NEXUS_URL; + private static String POD_NAME; + private static String PROPERTIES_FILE = System.getenv("SDNC_CONFIG_DIR") + "/daexim-offsite-backup.properties"; + + private static final String OPERATIONAL_JSON = "odl_backup_operational.json"; + private static final String MODELS_JSON = "odl_backup_models.json"; + private static final String CONFIG_JSON = "odl_backup_config.json"; + private static final String BACKUP_ARCHIVE = "odl_backup.zip"; + private static final String appName = "daexim-offsite-backup"; + + private final ExecutorService executor; + private Properties properties; + private DataBroker dataBroker; + private RpcProviderRegistry rpcRegistry; + private BindingAwareBroker.RpcRegistration rpcRegistration; + + public DaeximOffsiteBackupProvider(DataBroker dataBroker, + RpcProviderRegistry rpcProviderRegistry) { + LOG.info("Creating provider for " + appName); + this.executor = Executors.newFixedThreadPool(1); + this.dataBroker = dataBroker; + this.rpcRegistry = rpcProviderRegistry; + initialize(); + } + + public void initialize() { + LOG.info("Initializing provider for " + appName); + // Create the top level containers + createContainers(); + try { + DaeximOffsiteBackupUtil.loadProperties(); + } catch (Exception e) { + LOG.error("Caught Exception while trying to load properties file", e); + } + rpcRegistration = rpcRegistry.addRpcImplementation(DaeximOffsiteBackupService.class, this); + LOG.info("Initialization complete for " + appName); + } + + private void loadProperties() { + LOG.info("Loading properties from " + PROPERTIES_FILE); + if(properties == null) + properties = new Properties(); + File propertiesFile = new File(PROPERTIES_FILE); + if(!propertiesFile.exists()) { + LOG.warn("Properties file (" + PROPERTIES_FILE + ") not found. Using default properties."); + properties.put("daeximDirectory", "/opt/opendaylight/current/daexim/"); + properties.put("credentials", "admin:enc:YWRtaW4xMjM="); + properties.put("nexusUrl", "http://localhost:8081/nexus/content/repositories/"); + properties.put("podName", "UNKNOWN_ODL"); + return; + } + FileInputStream fileInputStream; + try { + fileInputStream = new FileInputStream(propertiesFile); + properties.load(fileInputStream); + fileInputStream.close(); + LOG.info(properties.size() + " properties loaded."); + LOG.info("daeximDirectory: " + properties.getProperty("daeximDirectory")); + LOG.info("nexusUrl: " + properties.getProperty("nexusUrl")); + LOG.info("podName: " + properties.getProperty("podName")); + } catch(IOException e) { + LOG.error("Error loading properties.", e); + } + } + + private void applyProperties() { + LOG.info("Applying properties..."); + if(POD_NAME == null || POD_NAME.isEmpty()) { + LOG.warn("MY_POD_NAME environment variable not set. Using value from properties."); + POD_NAME = properties.getProperty("podName"); + } + DAEXIM_DIR = properties.getProperty("daeximDirectory"); + NEXUS_URL = properties.getProperty("nexusUrl"); + + if(!properties.getProperty("credentials").contains(":")) { //Entire thing is encoded + CREDENTIALS = new String(Base64.getDecoder().decode(properties.getProperty("credentials"))); + } + else { + String[] credentials = properties.getProperty("credentials").split(":", 2); + if(credentials[1].startsWith("enc:")) { // Password is encoded + credentials[1] = new String(Base64.getDecoder().decode(credentials[1].split(":")[1])); + } + CREDENTIALS = credentials[0] + ":" + credentials[1]; + } + LOG.info("Properties applied."); + } + + private void createContainers() { + final WriteTransaction t = dataBroker.newReadWriteTransaction(); + try { + CheckedFuture checkedFuture = t.submit(); + checkedFuture.get(); + LOG.info("Create Containers succeeded!: "); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Create Containers Failed: " + e); + LOG.error("context", e); + } + } + + protected void initializeChild() { + + } + + @Override + public void close() throws Exception { + LOG.info("Closing provider for " + appName); + executor.shutdown(); + rpcRegistration.close(); + LOG.info("Successfully closed provider for " + appName); + } + + @Override + public void onDataTreeChanged(@Nonnull Collection changes) { + + } + + @Override + public ListenableFuture> backupData(BackupDataInput input) { + final String SVC_OPERATION = "backup-data"; + LOG.info(appName + ":" + SVC_OPERATION + " called."); + + String statusCode; + String message = "Data sent to offsite location."; + + loadProperties(); + applyProperties(); + + LOG.info("Pod Name: " + POD_NAME); + Instant timestamp = Instant.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HH").withZone(ZoneId.of("GMT")); + String timestampedArchive = DAEXIM_DIR + POD_NAME + '-' + formatter.format(timestamp) + "-" + BACKUP_ARCHIVE; + try { + LOG.info("Creating archive..."); + List daeximFiles = Arrays.asList(DAEXIM_DIR + OPERATIONAL_JSON,DAEXIM_DIR + MODELS_JSON, DAEXIM_DIR + CONFIG_JSON); + createArchive(daeximFiles, timestampedArchive); + LOG.info("Archive created."); + } catch(IOException e) { + LOG.error("Error creating archive " + timestampedArchive); + LOG.error(e.getMessage()); + statusCode = "500"; + message = "Archive creation failed."; + return buildBackupDataFuture(statusCode, message); + } + + try{ + LOG.info("Sending archive to Nexus server: " + NEXUS_URL); + statusCode = Integer.toString(putArchive(timestampedArchive)); + LOG.info("Archive sent to Nexus."); + } catch(IOException e) { + LOG.error("Nexus creation failed.", e); + statusCode = "500"; + message = "Nexus creation failed."; + } + + File archive = new File(timestampedArchive); + if(archive.exists()) { + archive.delete(); // Save some space on the ODL, keep them from piling up + } + + LOG.info("Sending Response statusCode=" + statusCode+ " message=" + message + " | " + SVC_OPERATION); + return buildBackupDataFuture(statusCode, message); + } + + @Override + public ListenableFuture> retrieveData(RetrieveDataInput input) { + final String SVC_OPERATION = "retrieve-data"; + LOG.info(appName + ":" + SVC_OPERATION + " called."); + + String statusCode = "200"; + String message = "Data retrieved from offsite location."; + + loadProperties(); + applyProperties(); + + LOG.info("Pod Name: " + POD_NAME); + String archiveIdentifier = POD_NAME + '-' + input.getTimestamp(); + String timestampedArchive = DAEXIM_DIR + archiveIdentifier + "-" + BACKUP_ARCHIVE; + LOG.info("Trying to retrieve " + timestampedArchive); + try { + statusCode = Integer.toString(getArchive(archiveIdentifier)); + } catch(IOException e) { + LOG.error("Could not retrieve archive.", e); + statusCode = "500"; + message = "Could not retrieve archive."; + return retrieveDataOutputRpcResult(statusCode, message); + } + LOG.info("Retrieved archive."); + + LOG.info("Extracting archive..."); + try { + extractArchive(DAEXIM_DIR + "-" + BACKUP_ARCHIVE); + } catch(IOException e) { + LOG.error("Could not extract archive.", e); + statusCode = "500"; + message = "Could not extract archive."; + return retrieveDataOutputRpcResult(statusCode, message); + } + LOG.info("Archive extracted."); + + return retrieveDataOutputRpcResult(statusCode, message); + } + + private boolean exportExists(List daeximFiles) { + File file; + for(String f : daeximFiles) { + file = new File(f); + if(!file.exists()) { + return false; + } + } + return true; + } + + private void createArchive(List daeximFiles, String timestampedArchive) throws IOException { + if(!exportExists(daeximFiles)) { + LOG.error("Daexim exports do not exist."); + throw new IOException(); + } + LOG.info("Creating " + timestampedArchive); + FileOutputStream fileOutputStream = new FileOutputStream(timestampedArchive); + ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream); + File targetZipFile; + FileInputStream fileInputStream; + ZipEntry zipEntry; + byte[] bytes; + int length; + for(String source : daeximFiles) { + LOG.info("Adding " + source + " to archive..."); + targetZipFile = new File(source); + fileInputStream = new FileInputStream(targetZipFile); + zipEntry = new ZipEntry(targetZipFile.getName()); + zipOutputStream.putNextEntry(zipEntry); + bytes = new byte[1024]; + + while((length = fileInputStream.read(bytes)) >= 0) { + zipOutputStream.write(bytes, 0, length); + } + fileInputStream.close(); + } + + zipOutputStream.close(); + fileOutputStream.close(); + } + + private void extractArchive(String timestampedArchive) throws IOException { + byte[] bytes = new byte[1024]; + ZipInputStream zis = new ZipInputStream(new FileInputStream(timestampedArchive)); + ZipEntry zipEntry = zis.getNextEntry(); + while(zipEntry != null){ + String fileName = zipEntry.getName(); + File newFile = new File(DAEXIM_DIR + fileName); + FileOutputStream fos = new FileOutputStream(newFile); + int len; + while ((len = zis.read(bytes)) > 0) { + fos.write(bytes, 0, len); + } + fos.close(); + LOG.info(zipEntry.getName() + " extracted."); + zipEntry = zis.getNextEntry(); + } + zis.closeEntry(); + zis.close(); + LOG.info(timestampedArchive + " extracted successfully."); + } + + private int putArchive(String timestampedArchive) throws IOException { + File archive = new File(timestampedArchive); + HttpURLConnection connection = getNexusConnection(archive.getName()); + connection.setRequestProperty("Content-Length", Long.toString(archive.length())); + connection.setRequestMethod("PUT"); + connection.setDoOutput(true); + + FileInputStream fileInputStream = new FileInputStream(archive); + OutputStream outputStream = connection.getOutputStream(); + + byte[] bytes = new byte[1024]; + int length; + while((length = fileInputStream.read(bytes)) >= 0) { + outputStream.write(bytes, 0, length); + } + + outputStream.flush(); + outputStream.close(); + fileInputStream.close(); + connection.disconnect(); + + LOG.info("Status: " + connection.getResponseCode()); + LOG.info("Message: " + connection.getResponseMessage()); + return connection.getResponseCode(); + } + + private HttpURLConnection getNexusConnection(String archive) throws IOException { + URL url = new URL(NEXUS_URL + archive); + String auth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(CREDENTIALS.getBytes()); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.addRequestProperty("Authorization", auth); + connection.setRequestProperty("Connection", "keep-alive"); + connection.setRequestProperty("Proxy-Connection", "keep-alive"); + return connection; + } + + private int getArchive(String archiveIdentifier) throws IOException { + File archive = new File(DAEXIM_DIR + "backup.zip"); + if(archive.exists()) { + LOG.info("Recently retrieved archive found. Removing old archive..."); + archive.delete(); + LOG.info("Archive removed."); + } + HttpURLConnection connection = getNexusConnection( archiveIdentifier + "-" + BACKUP_ARCHIVE); + connection.setRequestMethod("GET"); + connection.setDoInput(true); + + InputStream connectionInputStream = connection.getInputStream(); + FileOutputStream fileOutputStream = new FileOutputStream(archive); + + byte[] bytes = new byte[1024]; + int length; + while((length = connectionInputStream.read(bytes)) >= 0) { // while connection has bytes + fileOutputStream.write(bytes, 0, length); // write to archive + } + connection.disconnect(); + + LOG.info("Status: " + connection.getResponseCode()); + LOG.info("Message: " + connection.getResponseMessage()); + LOG.info(archive.getName() + " successfully created."); + return connection.getResponseCode(); + } + + private ListenableFuture> buildBackupDataFuture(String statusCode, String message) { + BackupDataOutputBuilder outputBuilder = new BackupDataOutputBuilder(); + outputBuilder.setStatus(statusCode); + outputBuilder.setMessage(message); + RpcResult rpcResult = RpcResultBuilder. status(true).withResult(outputBuilder.build()).build(); + return Futures.immediateFuture(rpcResult); + } + + private ListenableFuture> retrieveDataOutputRpcResult(String status, String message) { + RetrieveDataOutputBuilder outputBuilder = new RetrieveDataOutputBuilder(); + outputBuilder.setStatus(status); + outputBuilder.setMessage(message); + RpcResult rpcResult = RpcResultBuilder. status(true).withResult(outputBuilder.build()).build(); + return Futures.immediateFuture(rpcResult); + } +} diff --git a/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java b/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java new file mode 100755 index 000000000..7adb2fa1b --- /dev/null +++ b/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2018 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.daeximoffsitebackup; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.BackupDataOutputBuilder; + +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataOutputBuilder; + +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DaeximOffsiteBackupUtil extends MdsalHelper { + private static final Logger LOG = LoggerFactory.getLogger(DaeximOffsiteBackupUtil.class); + private static String PROPERTIES_FILE; + + public static void loadProperties() { + File file = new File(PROPERTIES_FILE); + Properties properties = new Properties(); + InputStream input = null; + if(file.isFile() && file.canRead()) { + try { + input = new FileInputStream(file); + properties.load(input); + LOG.info("Loaded properties from " + PROPERTIES_FILE); + setProperties(properties); + } catch (Exception e) { + LOG.error("Failed to load properties " + PROPERTIES_FILE + "\n", e); + } finally { + if(input != null) { + try { + input.close(); + } catch (IOException e) { + LOG.error("Failed to close properties file " + PROPERTIES_FILE + "\n", e); + } + } + } + } + } + + static { + // Trick class loader into loading builders. Some of + // these will be needed later by Reflection classes, but need + // to explicitly "new" them here to get class loader to load them. + + BackupDataOutputBuilder b1 = new BackupDataOutputBuilder(); + + RetrieveDataOutputBuilder b2 = new RetrieveDataOutputBuilder(); + RetrieveDataInputBuilder b3 = new RetrieveDataInputBuilder(); + } +} diff --git a/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties b/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties new file mode 100755 index 000000000..bdfa8155a --- /dev/null +++ b/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties @@ -0,0 +1,6 @@ +# Example properties file + +daeximDirectory=/opt/opendaylight/current/daexim/ +credentials=admin:enc:YWRtaW4xMjM= +nexusUrl=http://localhost:8081/nexus/content/repositories/ +podName=UNKNOWN_ODL \ No newline at end of file diff --git a/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml b/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml new file mode 100755 index 000000000..8e2101ad3 --- /dev/null +++ b/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + diff --git a/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java b/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java new file mode 100644 index 000000000..65d0dcaf2 --- /dev/null +++ b/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java @@ -0,0 +1,223 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2018 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.daeximoffsitebackup; + +import org.eclipse.jdt.annotation.Nullable; +import org.junit.Before; +import org.junit.Test; + +import org.opendaylight.controller.md.sal.binding.api.*; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; + +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.DaeximOffsiteBackupService; + +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataInput; + +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.DataContainer; + +import com.google.common.util.concurrent.CheckedFuture; + +import java.io.File; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.ExecutionException; + +import static org.mockito.Mockito.*; +import static org.junit.Assert.*; + +public class DaeximOffsiteBackupProviderTest { + public DataBroker dataBroker; + public ReadWriteTransaction writeTransaction; + public CheckedFuture checkedFuture; + public RpcProviderRegistry rpcRegistry; + public DaeximOffsiteBackupProvider provider; + public Properties resProps; + + @Before + public void setup() { + resProps = new Properties(); + resProps.put("error-code", "200"); + resProps.put("error-message", "Success"); + dataBroker = mock(DataBroker.class); + writeTransaction = mock(ReadWriteTransaction.class); + checkedFuture = mock(CheckedFuture.class); + rpcRegistry = mock(RpcProviderRegistry.class); + when(rpcRegistry.addRoutedRpcImplementation(any(), any(DaeximOffsiteBackupService.class))).thenReturn(null); + try { + when(checkedFuture.get()).thenReturn(null); + } + catch(InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + when(writeTransaction.submit()).thenReturn(checkedFuture); + when(dataBroker.newReadWriteTransaction()).thenReturn(writeTransaction); + + provider = new DaeximOffsiteBackupProvider(dataBroker, rpcRegistry); + } + + @Test + public void initializeTest() { + provider.initialize(); + } + + @Test + public void closeTest() { + try { + provider.close(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + @Test + public void onDataTreeChangedTest() { + provider.onDataTreeChanged(null); + // onDataTreeChanged is an empty stub + } + + @Test + public void backupDataTest() { + try { + assertNotNull(provider.backupData(null)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.backupData(null)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.backupData(null)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.backupData(null)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.backupData(null)); + } + catch(Exception e) { + fail(); + } + } + + @Test + public void retrieveDataTest() { + RetrieveDataInput input = new RetrieveDataInput() { + @Override + public > @Nullable E augmentation(Class augmentationType) { + return null; + } + + @Override + public String getPodName() { + return "Some Pod"; + } + + @Override + public String getTimestamp() { + return "Some Timestamp"; + } + + @Override + public Class getImplementedInterface() { + return null; + } + }; + try { + assertNotNull(provider.retrieveData(input)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.retrieveData(input)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.retrieveData(input)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.retrieveData(input)); + } + catch(Exception e) { + fail(); + } + try { + assertNotNull(provider.retrieveData(input)); + } + catch(Exception e) { + fail(); + } + } + + @Test + public void archiveOperationsTest() { + List files = Arrays.asList("src/test/resources/fileToZip1", "src/test/resources/fileToZip2"); + String archive = "src/test/resources/zippedArchive.zip"; + try { + Method method = provider.getClass().getDeclaredMethod("createArchive", List.class, String.class); + method.setAccessible(true); + method.invoke(provider, files, archive); + + } + catch(NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + fail(); + } + + try { + Field field = provider.getClass().getDeclaredField("DAEXIM_DIR"); + field.setAccessible(true); + field.set(provider, ""); + Method method = provider.getClass().getDeclaredMethod("extractArchive", String.class); + method.setAccessible(true); + method.invoke(provider, archive); + } + catch(NoSuchMethodException | IllegalAccessException | InvocationTargetException | NoSuchFieldException e) { + fail(); + } + finally { + File zip = new File(archive); + zip.delete(); + } + } +} diff --git a/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtilTest.java b/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtilTest.java new file mode 100644 index 000000000..16ce68198 --- /dev/null +++ b/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtilTest.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2018 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.daeximoffsitebackup; + +import org.junit.Test; + +import java.lang.reflect.Field; + +public class DaeximOffsiteBackupUtilTest { + @Test + public void loadProperties() { + try { + Field field = DaeximOffsiteBackupUtil.class.getDeclaredField("PROPERTIES_FILE"); + field.setAccessible(true); + field.set(new DaeximOffsiteBackupUtil(), "src/test/resources/daexim-offsite-backup.properties"); + DaeximOffsiteBackupUtil.loadProperties(); + } catch(Exception e) { + // Files don't exist on build server + } + } +} diff --git a/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties b/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties new file mode 100755 index 000000000..49dd133bc --- /dev/null +++ b/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties @@ -0,0 +1,4 @@ +daeximDirectory=/opt/opendaylight/current/daexim/ +credentials=admin:admin123 +nexusUrl=http://localhost:8081/nexus/content/repositories/ +podName=UNKNOWN_ODL \ No newline at end of file diff --git a/daexim-offsite-backup/provider/src/test/resources/fileToZip1 b/daexim-offsite-backup/provider/src/test/resources/fileToZip1 new file mode 100644 index 000000000..c7ef4260e --- /dev/null +++ b/daexim-offsite-backup/provider/src/test/resources/fileToZip1 @@ -0,0 +1 @@ +Lorem ipsum. \ No newline at end of file diff --git a/daexim-offsite-backup/provider/src/test/resources/fileToZip2 b/daexim-offsite-backup/provider/src/test/resources/fileToZip2 new file mode 100644 index 000000000..c7ef4260e --- /dev/null +++ b/daexim-offsite-backup/provider/src/test/resources/fileToZip2 @@ -0,0 +1 @@ +Lorem ipsum. \ No newline at end of file diff --git a/pom.xml b/pom.xml index e170498ad..031d405e1 100644 --- a/pom.xml +++ b/pom.xml @@ -107,6 +107,7 @@ lcm dmaap-listener ueb-listener + daexim-offsite-backup features artifacts -- cgit 1.2.3-korg From 81fd4cee0d7ca6a014eb33d5ffba63f731249141 Mon Sep 17 00:00:00 2001 From: "Haddox, Anthony" Date: Fri, 25 Jan 2019 08:57:39 -0800 Subject: [CCSDK-1008]Generalize offsite backup Revised the provider to use file names designated in the properties file. This is for those who use vendor provided distributions of OpenDaylight Change-Id: Ib120452fa989fff371a832416a34d95745fead1b Issue-ID: CCSDK-1008 Signed-off-by: Haddox, Anthony --- daexim-offsite-backup/README.md | 5 +++++ .../DaeximOffsiteBackupProvider.java | 16 ++++++++++++--- .../resources/daexim-offsite-backup.properties | 24 +++++++++++++++++++++- .../resources/daexim-offsite-backup.properties | 24 +++++++++++++++++++++- 4 files changed, 64 insertions(+), 5 deletions(-) diff --git a/daexim-offsite-backup/README.md b/daexim-offsite-backup/README.md index 26d8a7ede..e3f13aee9 100755 --- a/daexim-offsite-backup/README.md +++ b/daexim-offsite-backup/README.md @@ -78,5 +78,10 @@ Before each RPC execution this module pulls information from a user supplied pro - credentials - nexusUrl - podName +- file.operational +- file.models +- file.config + +> Refer to the example properties file If the module cannot find the properties file it will default to generic values and attempt to move forward. diff --git a/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java b/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java index cc16bf70d..09c8f92f4 100755 --- a/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java +++ b/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java @@ -75,11 +75,11 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite private static String CREDENTIALS; private static String NEXUS_URL; private static String POD_NAME; + private static String OPERATIONAL_JSON; + private static String MODELS_JSON; + private static String CONFIG_JSON; private static String PROPERTIES_FILE = System.getenv("SDNC_CONFIG_DIR") + "/daexim-offsite-backup.properties"; - private static final String OPERATIONAL_JSON = "odl_backup_operational.json"; - private static final String MODELS_JSON = "odl_backup_models.json"; - private static final String CONFIG_JSON = "odl_backup_config.json"; private static final String BACKUP_ARCHIVE = "odl_backup.zip"; private static final String appName = "daexim-offsite-backup"; @@ -122,6 +122,9 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite properties.put("credentials", "admin:enc:YWRtaW4xMjM="); properties.put("nexusUrl", "http://localhost:8081/nexus/content/repositories/"); properties.put("podName", "UNKNOWN_ODL"); + properties.put("file.operational", "odl_backup_operational.json"); + properties.put("file.models", "odl_backup_models.json"); + properties.put("file.config", "odl_backup_config.json"); return; } FileInputStream fileInputStream; @@ -133,6 +136,9 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite LOG.info("daeximDirectory: " + properties.getProperty("daeximDirectory")); LOG.info("nexusUrl: " + properties.getProperty("nexusUrl")); LOG.info("podName: " + properties.getProperty("podName")); + LOG.info("file.operational: " + properties.getProperty("file.operational")); + LOG.info("file.models: " + properties.getProperty("file.models")); + LOG.info("file.config: " + properties.getProperty("file.config")); } catch(IOException e) { LOG.error("Error loading properties.", e); } @@ -147,6 +153,10 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite DAEXIM_DIR = properties.getProperty("daeximDirectory"); NEXUS_URL = properties.getProperty("nexusUrl"); + OPERATIONAL_JSON = properties.getProperty("file.operational"); + MODELS_JSON = properties.getProperty("file.models"); + CONFIG_JSON = properties.getProperty("file.config"); + if(!properties.getProperty("credentials").contains(":")) { //Entire thing is encoded CREDENTIALS = new String(Base64.getDecoder().decode(properties.getProperty("credentials"))); } diff --git a/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties b/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties index bdfa8155a..51efc1f1e 100755 --- a/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties +++ b/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties @@ -1,6 +1,28 @@ +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2019 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========================================================= + # Example properties file daeximDirectory=/opt/opendaylight/current/daexim/ credentials=admin:enc:YWRtaW4xMjM= nexusUrl=http://localhost:8081/nexus/content/repositories/ -podName=UNKNOWN_ODL \ No newline at end of file +podName=UNKNOWN_ODL +file.operational=odl_backup_operational.json +file.models=odl_backup_models.json +file.config=odl_backup_config.json \ No newline at end of file diff --git a/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties b/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties index 49dd133bc..b69027906 100755 --- a/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties +++ b/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties @@ -1,4 +1,26 @@ +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2019 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========================================================= + daeximDirectory=/opt/opendaylight/current/daexim/ credentials=admin:admin123 nexusUrl=http://localhost:8081/nexus/content/repositories/ -podName=UNKNOWN_ODL \ No newline at end of file +podName=UNKNOWN_ODL +file.operational=odl_backup_operational.json +file.models=odl_backup_models.json +file.config=odl_backup_config.json \ No newline at end of file -- cgit 1.2.3-korg From 0f7da02eb356f85aeb9790061feb841729158e0f Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 21 Feb 2019 08:38:14 -0500 Subject: Turn on debugging in jUnit test Turn on debug level tracing in LCM jUnit testing to test branches only executed when trace level >= DEBUG. Change-Id: I2aae7f058461404d6582dc36c72a4f7834692e94 Issue-ID: CCSDK-1096 Signed-off-by: Timoney, Dan (dt5972) --- .../src/test/resources/simplelogger.properties | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lcm/provider/src/test/resources/simplelogger.properties diff --git a/lcm/provider/src/test/resources/simplelogger.properties b/lcm/provider/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..001dfd427 --- /dev/null +++ b/lcm/provider/src/test/resources/simplelogger.properties @@ -0,0 +1,22 @@ +### +# ============LICENSE_START======================================================= +# ONAP : CCSDK +# ================================================================================ +# 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========================================================= +### + +org.slf4j.simpleLogger.defaultLogLevel=debug -- cgit 1.2.3-korg From d6375ac33711eadd11f08017072e0552f819cac2 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 26 Feb 2019 19:51:20 +0000 Subject: Use getEntity to populate network_role Changes made: Update sdc-tosca version to 1.5.0. Replace getCpListByVf with equivalent getEntity call in SdncVFModel.java. Replace policy.getMetaData with getMetaDataObj to work around parser issue. Change-Id: I1d972f75cc5ca1c8dc0e5d58880a3bb306608ca2 Issue-ID: CCSDK-1089 Signed-off-by: Ubuntu --- ueb-listener/pom.xml | 2 +- .../sli/northbound/uebclient/SdncBaseModel.java | 36 ++++++++----- .../sli/northbound/uebclient/SdncVFModel.java | 61 ++++++++++++++++------ 3 files changed, 69 insertions(+), 30 deletions(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 87a9dfe97..df20a01cf 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -18,7 +18,7 @@ 1.3.0 - 1.4.7 + 1.5.0 2.9.4 true /opt/app/ueb-listener 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 0d5e9d6dd..37b100ca4 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 @@ -278,9 +278,9 @@ public class SdncBaseModel { for (Policy policy : policyList) { // extract policy metadata - String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); - String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); - String policyCustomizationUuid = policy.getMetaData().getOrDefault("customizationUUID", "").toString(); + String policyUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("UUID", "").toString(); + String policyInvariantUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("invariantUUID", "").toString(); + String policyCustomizationUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("customizationUUID", "").toString(); // cleanup existing RESOURCE_POLICY data Map cleanupParams = new HashMap(); @@ -293,9 +293,9 @@ public class SdncBaseModel { addParameter("policy_uuid", policyUuid, policyParams); addParameter("policy_customization_uuid", policyCustomizationUuid, policyParams); addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - addParameter("policy_name", policy.getMetaData().getOrDefault(PARAM_NAME_KEY, "").toString(), policyParams); - addParameter(PARAM_VERSION_KEY, policy.getMetaData().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); - addParameter("policy_type", policy.getMetaData().getOrDefault(PARAM_TYPE_KEY, "").toString(), policyParams); + addParameter("policy_name", policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_NAME_KEY, "").toString(), policyParams); + addParameter(PARAM_VERSION_KEY, policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); + addParameter("policy_type", policy.getType(), policyParams); // extract properties addParameter("property_type", extractValue(policy, PARAM_TYPE_KEY), policyParams); @@ -350,8 +350,8 @@ public class SdncBaseModel { for (Policy policy : policyList) { // extract policy metadata - String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); - String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); + String policyUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("UUID", "").toString(); + String policyInvariantUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("invariantUUID", "").toString(); // cleanup existing RESOURCE_POLICY data Map cleanupParams = new HashMap(); @@ -363,8 +363,8 @@ public class SdncBaseModel { Map policyParams = new HashMap(); addParameter("policy_uuid", policyUuid, policyParams); addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - addParameter("policy_name", policy.getMetaData().getOrDefault("name", "").toString(), policyParams); - addParameter("version", policy.getMetaData().getOrDefault("version", "").toString(), policyParams); + addParameter("policy_name", policy.getMetaDataObj().getAllProperties().getOrDefault("name", "").toString(), policyParams); + addParameter("version", policy.getMetaDataObj().getAllProperties().getOrDefault("version", "").toString(), policyParams); addParameter("policy_type", policy.getType(), policyParams); // extract properties @@ -386,6 +386,10 @@ public class SdncBaseModel { // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING List policyTargetNameList = policy.getTargets(); + if (policyTargetNameList == null) { + continue; + } + for (String targetName : policyTargetNameList) { NodeTemplate targetNode = sdcCsarHelper.getNodeTemplateByName(targetName); @@ -423,8 +427,8 @@ public class SdncBaseModel { for (Policy policy : policyList) { // extract policy metadata - String policyUuid = policy.getMetaData().getOrDefault("UUID", "").toString(); - String policyInvariantUuid = policy.getMetaData().getOrDefault("invariantUUID", "").toString(); + String policyUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("UUID", "").toString(); + String policyInvariantUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("invariantUUID", "").toString(); // cleanup existing RESOURCE_POLICY data Map cleanupParams = new HashMap(); @@ -436,9 +440,9 @@ public class SdncBaseModel { Map policyParams = new HashMap(); addParameter("policy_uuid", policyUuid, policyParams); addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - String policyName = policy.getMetaData().getOrDefault(PARAM_NAME_KEY, "").toString(); + String policyName = policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_NAME_KEY, "").toString(); addParameter("policy_name", policyName, policyParams); - addParameter(PARAM_VERSION_KEY, policy.getMetaData().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); + addParameter(PARAM_VERSION_KEY, policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); addParameter("policy_type", policy.getType(), policyParams); // extract properties @@ -460,6 +464,10 @@ public class SdncBaseModel { // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING List targetNodeList = sdcCsarHelper.getPolicyTargetsFromOrigin(nodeTemplate, policyName); + if (targetNodeList == null) { + continue; + } + for (NodeTemplate targetNode : targetNodeList) { //NodeTemplate targetNode = sdcCsarHelper.getNodeTemplateByName(targetName); if (targetNode == null) { 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 850a34fa0..a42f03d8e 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 @@ -27,10 +27,14 @@ import java.util.List; import java.util.Map; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.tosca.parser.api.IEntityDetails; +import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; +import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; import org.onap.sdc.toscaparser.api.Group; import org.onap.sdc.toscaparser.api.NodeTemplate; -import org.onap.sdc.toscaparser.api.Policy; +import org.onap.sdc.toscaparser.api.Property; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; @@ -162,21 +166,48 @@ public class SdncVFModel extends SdncBaseModel { private void insertVFtoNetworkRoleMappingData () throws IOException { - // For each VF, insert VF_TO_NETWORK_ROLE_MAPPING data - List cpNodes = sdcCsarHelper.getCpListByVf(getCustomizationUUIDNoQuotes()); - for (NodeTemplate cpNode : cpNodes){ - - // Insert into VF_TO_NETWORK_ROLE_MAPPING vf_customization_uuid and network_role - String cpNetworkRole = sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, "network_role"); + // Cleanup existing VF_TO_NETWORK_ROLE_MAPPING for this VF + try { + cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", getCustomizationUUID()); + } catch (IOException e) { + LOG.error("Could not cleanup Tosca CSAR data into the VF_TO_NETWORK_ROLE_MAPPING table"); + throw new IOException (e); + } + + // For this VF, insert VF_TO_NETWORK_ROLE_MAPPING data + EntityQuery entityQueryCP = EntityQuery.newBuilder(SdcTypes.CP).build(); + TopologyTemplateQuery topologyTemplateQueryVF = TopologyTemplateQuery.newBuilder(SdcTypes.VF).customizationUUID(getCustomizationUUIDNoQuotes()).build(); + List cpEntities = sdcCsarHelper.getEntity(entityQueryCP, topologyTemplateQueryVF, true); + + for (IEntityDetails entity: cpEntities ) { + + Map properties = entity.getProperties(); + if (properties.containsKey("network_role")) { - try { - cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING where vf_customization_uuid = " + getCustomizationUUID()); - insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + - getCustomizationUUID() + ", \"" + cpNetworkRole + "\")", null); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the VF_TO_NETWORK_ROLE_MAPPING table"); - throw new IOException (e); + Property networkRoleProperty = properties.get("network_role"); + if (networkRoleProperty != null && networkRoleProperty.getValue() != null) { + String cpNetworkRole = networkRoleProperty.getValue().toString(); + LOG.debug("insertVFtoNetworkRoleMappingData: " + "VF: " + getCustomizationUUID() + ", networkRole = " + cpNetworkRole); + + // Only insert unique network_role values for this VF + boolean networkRoleExists = false; + Map networkRoleyKeys = new HashMap(); + networkRoleyKeys.put("vf_customization_uuid", getCustomizationUUID()); + networkRoleyKeys.put("network_role", "\"" + cpNetworkRole + "\""); + networkRoleExists = checkForExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", networkRoleyKeys); + + if (networkRoleExists == false) { + try { + //cleanUpExistingToscaData("VF_TO_NETWORK_ROLE_MAPPING", "vf_customization_uuid", getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_TO_NETWORK_ROLE_MAPPING where vf_customization_uuid = " + getCustomizationUUID()); + insertToscaData("insert into VF_TO_NETWORK_ROLE_MAPPING (vf_customization_uuid, network_role) values (" + + getCustomizationUUID() + ", \"" + cpNetworkRole + "\")", null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_TO_NETWORK_ROLE_MAPPING table"); + throw new IOException (e); + } + } + } } } // CP loop -- cgit 1.2.3-korg From d91b57fd11c55a93ff0f55bb35aa4071eb7c0b61 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Mon, 4 Mar 2019 20:04:27 -0500 Subject: Improve ueb-listener test coverage Add missing initialization code in test case to trigger testing of pre-staged artifacts. Change-Id: I707ad708e461867b1dea79e11df13460262b6818 Issue-ID: CCSDK-1124 Signed-off-by: Timoney, Dan (dt5972) --- .../org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java | 1 + 1 file changed, 1 insertion(+) diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index d0a94d4bd..5b4637ea7 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -275,6 +275,7 @@ public class TestSdncUebCallback { when(iData.getServiceName()).thenReturn("testServiceName"); //when(iData.getServiceArtifacts()).thenReturn(artifactInfoList); + cb.deployDownloadedFiles(null, null, null); cb.activateCallback(iData); } -- cgit 1.2.3-korg From e8941385a6b0353236884fb183ef9e198b6560f5 Mon Sep 17 00:00:00 2001 From: "Aria, Lalena (la505a)" Date: Wed, 13 Mar 2019 18:18:14 +0000 Subject: Use getEnitity API for ingestion of TOSCA PNF Changes made: Update SdncUebCallback.processToscaCsar to ingest PNF entities. Add methods in SdncBaseModel.java to support processing of IEntityDetails. Add SdncPNFModel.java to populate VF_MODEL with PNF data. Add SdncPNFModelTest.java junit coverage. Change-Id: I9a82a94e8198d629395a60779f74178e4f8f065e Issue-ID: SDNC-675 Signed-off-by: Aria, Lalena (la505a) --- .../sli/northbound/uebclient/SdncBaseModel.java | 59 +++++++++ .../sli/northbound/uebclient/SdncPNFModel.java | 142 +++++++++++++++++++++ .../sli/northbound/uebclient/SdncUebCallback.java | 26 ++++ .../sli/northbound/uebclient/SdncPNFModelTest.java | 102 +++++++++++++++ 4 files changed, 329 insertions(+) create mode 100644 ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModel.java create mode 100644 ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java 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 37b100ca4..4824d9f2d 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 @@ -31,6 +31,7 @@ import java.util.Map; import javax.sql.rowset.CachedRowSet; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.CapabilityAssignment; @@ -70,6 +71,7 @@ public class SdncBaseModel { protected static DBResourceManager jdbcDataSource = null; protected static SdncUebConfiguration config = null; protected NodeTemplate nodeTemplate = null; + protected IEntityDetails entityDetails = null; public SdncBaseModel(DBResourceManager jdbcDataSource) { this.jdbcDataSource = jdbcDataSource; @@ -89,6 +91,14 @@ public class SdncBaseModel { this.jdbcDataSource = jdbcDataSource; this.config = config; } + + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails entityDetails, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { + this (sdcCsarHelper, entityDetails); + this.sdcCsarHelper = sdcCsarHelper; + this.entityDetails = entityDetails; + this.jdbcDataSource = jdbcDataSource; + this.config = config; + } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { @@ -128,6 +138,23 @@ public class SdncBaseModel { } + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails entityDetails) { + + params = new HashMap(); + attributeValueParams = new HashMap(); + this.sdcCsarHelper = sdcCsarHelper; + this.entityDetails = entityDetails; + + // extract common nodeTemplate metadata + Metadata metadata = entityDetails.getMetadata(); + customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + invariantUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); + addParameter(PARAM_INVARIANT_UUID_KEY, invariantUUID); + UUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID); + addParameter(PARAM_UUID_KEY, UUID); + addParameter(PARAM_VERSION_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); + } + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { this (sdcCsarHelper, group); this.sdcCsarHelper = sdcCsarHelper; @@ -662,6 +689,22 @@ public class SdncBaseModel { } } + protected String extractValue (IEntityDetails entityDetails, String name) { + String value = null; + if (entityDetails.getProperties().containsKey(name)) { + Property property = entityDetails.getProperties().get(name); + if (property != null && property.getValue() != null) { + value = property.getValue().toString(); + } + } + + if (value != null) { + return value; + } else { + return ""; + } + } + protected String extractGetInputValue (Group group, NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (group, name)); @@ -761,6 +804,22 @@ public class SdncBaseModel { } } + protected String extractBooleanValue (IEntityDetails entityDetails, String name) { + String value = null; + if (entityDetails.getProperties().containsKey(name)) { + Property property = entityDetails.getProperties().get(name); + if (property != null && property.getValue() != null) { + value = property.getValue().toString(); + } + } + + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + public static String extractBooleanValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); if (value != null && !value.isEmpty()) { diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModel.java new file mode 100644 index 000000000..296b13819 --- /dev/null +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModel.java @@ -0,0 +1,142 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 - 2018 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.uebclient; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.tosca.parser.api.IEntityDetails; +import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncPNFModel extends SdncBaseModel { + + private static final Logger LOG = LoggerFactory + .getLogger(SdncVFModel.class); + + private String vendor = null; + private String vendorModelDescription = null; + private String nfNamingCode = null; + private String serviceUUID = null; + private String serviceInvariantUUID = null; + + public SdncPNFModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails entityDetails, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { + + super(sdcCsarHelper, entityDetails, jdbcDataSource, config); + + // extract metadata + Metadata metadata = entityDetails.getMetadata(); + addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); + vendor = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR); + addParameter("vendor", vendor); + vendorModelDescription = extractValue (metadata, "description"); + addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); + + // extract properties + addParameter("ecomp_generated_naming", extractBooleanValue(entityDetails, "nf_naming#ecomp_generated_naming")); + addParameter("naming_policy", extractValue(entityDetails, "nf_naming#naming_policy")); + addParameter("nf_type", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); + addParameter("nf_role", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFROLE)); + nfNamingCode = extractValue(entityDetails, "nf_naming_code"); + addParameter("nf_code", nfNamingCode); + addParameter("nf_function", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); + addIntParameter("avail_zone_max_count", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); + addParameter("sdnc_model_name", extractValue(entityDetails, "sdnc_model_name")); + addParameter("sdnc_model_version", extractValue(entityDetails, "sdnc_model_version")); + addParameter("sdnc_artifact_name", extractValue(entityDetails, "sdnc_artifact_name")); + + } + + public void insertData() throws IOException { + + insertPNFModelData(); + } + + private void insertPNFModelData () throws IOException { + + try { + cleanUpExistingToscaData("VF_MODEL", "customization_uuid", getCustomizationUUID()) ; + cleanUpExistingToscaData("SERVICE_MODEL_TO_VF_MODEL_MAPPING", "service_uuid", serviceUUID, "vf_customization_uuid", getCustomizationUUID()); + + // insert into VF_MODEL/ATTRIBUTE_VALUE_PAIR and SERVICE_MODEL_TO_VF_MODEL_MAPPING + LOG.info("Call insertToscaData for VF_MODEL where customization_uuid = " + getCustomizationUUID()); + insertToscaData(buildSql("VF_MODEL", model_yaml), null); + //insertRelevantAttributeData(); + + Map mappingParams = new HashMap(); + addParameter("service_invariant_uuid", serviceInvariantUUID, mappingParams); + addParameter("vf_uuid", getUUID(), mappingParams); + addParameter("vf_customization_uuid", getCustomizationUUIDNoQuotes(), mappingParams); + insertToscaData(buildSql("SERVICE_MODEL_TO_VF_MODEL_MAPPING", "service_uuid", serviceUUID, model_yaml, mappingParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_MODEL table"); + throw new IOException (e); + } + + } + + public String getVendor() { + return vendor; + } + + public void setVendor(String vendor) { + this.vendor = vendor; + } + + public String getVendorModelDescription() { + return vendorModelDescription; + } + + public void setVendorModelDescription(String vendorModelDescription) { + this.vendorModelDescription = vendorModelDescription; + } + + public String getNfNamingCode() { + return nfNamingCode; + } + + public void setNfNamingCode(String nfNamingCode) { + this.nfNamingCode = nfNamingCode; + } + + public String getServiceUUID() { + return serviceUUID; + } + public void setServiceUUID(String serviceUUID) { + this.serviceUUID = serviceUUID; + } + + public String getServiceInvariantUUID() { + return serviceInvariantUUID; + } + + public void setServiceInvariantUUID(String serviceInvariantUUID) { + this.serviceInvariantUUID = serviceInvariantUUID; + } + +} 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 ba644f302..4d9dbda96 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 @@ -70,7 +70,11 @@ import org.onap.sdc.api.notification.INotificationData; import org.onap.sdc.api.notification.IResourceInstance; import org.onap.sdc.api.results.IDistributionClientDownloadResult; import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; +import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; +import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException; import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory; import org.onap.sdc.toscaparser.api.NodeTemplate; @@ -751,6 +755,28 @@ public class SdncUebCallback implements INotificationCallback { } // VF loop + + // Ingest Network (PNF) Data - Dublin/1906 + EntityQuery entityQuery = EntityQuery.newBuilder(SdcTypes.PNF).build(); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(); + + List pnfs = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, false); + if (!pnfs.isEmpty()) { + + for (IEntityDetails pnf : pnfs) { + + try { + SdncPNFModel pnfModel = new SdncPNFModel(sdcCsarHelper, pnf, jdbcDataSource, config); + pnfModel.setServiceUUID(serviceModel.getServiceUUID()); + pnfModel.setServiceInvariantUUID(serviceModel.getServiceInvariantUUID()); + pnfModel.insertData(); + + } catch (IOException e) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + } + } // PNF loop + } + DistributionStatusEnum complexToscaDeployStatus = customProcessComplexTosca(sdcCsarHelper, config, jdbcDataSource, serviceModel, data, svcName, resourceName, artifact, archiveDir); if (complexToscaDeployStatus == DistributionStatusEnum.DEPLOY_ERROR) { diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java new file mode 100644 index 000000000..d4c06b049 --- /dev/null +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java @@ -0,0 +1,102 @@ +package org.onap.ccsdk.sli.northbound.uebclient; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; +import org.onap.sdc.tosca.parser.api.IEntityDetails; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.toscaparser.api.Property; + +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; + + public class SdncPNFModelTest { + + SdncPNFModel testSdncPNFModel = null; + + @Before + public void setUp() throws Exception { + ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + IEntityDetails mockEntityDetails = mock(IEntityDetails.class); + Metadata mockMetadata = mock(Metadata.class); + Property mockProperty = mock(Property.class); + Map mockProperties = new HashMap(); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); + + when(mockEntityDetails.getMetadata()).thenReturn(mockMetadata); + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + mockProperty.setValue("test-nf-naming-code"); + when(mockProperties.get("nf_naming_code")).thenReturn(mockProperty); + + try { + testSdncPNFModel = new SdncPNFModel(mockCsarHelper,mockEntityDetails,mockDBResourceManager,mockSdncUebConfiguration); + testSdncPNFModel.setServiceUUID("bbbb-cccc-dddd-eeee"); + testSdncPNFModel.setServiceInvariantUUID("cccc-dddd-eeee-ffff"); + testSdncPNFModel.setVendor("Cisco"); + testSdncPNFModel.setVendorModelDescription("Cisco Equipment Model"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + assertNotNull(testSdncPNFModel); + } + + @Test + public void testSetGetVendor() { + String newVendorModel = "new-vendor-model"; + testSdncPNFModel.setVendor(newVendorModel); + String result = testSdncPNFModel.getVendor(); + assertEquals(result, newVendorModel); + } + + @Test + public void testSetGetVendorModelDescription() { + String newVendorModelDescription = "new-vendor-model-description"; + testSdncPNFModel.setVendorModelDescription(newVendorModelDescription); + String result = testSdncPNFModel.getVendorModelDescription(); + assertEquals(result, newVendorModelDescription); + } + + @Test + public void testSetGetNfNamingCode() { + String newNfNamingCode = "new-nf-naming-code"; + testSdncPNFModel.setNfNamingCode(newNfNamingCode); + String result = testSdncPNFModel.getNfNamingCode(); + assertEquals(result, newNfNamingCode); + } + + @Test + public void testSetGetServiceUUID() { + String newServiceUuid = "cccc-dddd-eeee-ffff"; + testSdncPNFModel.setServiceUUID(newServiceUuid); + String result = testSdncPNFModel.getServiceUUID(); + assertEquals(newServiceUuid, result); + } + + @Test + public void testSetGetServiceInvariantUUID() { + String newServiceInvariantUuid = "dddd-eeee-ffff-eeee"; + testSdncPNFModel.setServiceInvariantUUID(newServiceInvariantUuid); + String result = testSdncPNFModel.getServiceInvariantUUID(); + assertEquals(result, newServiceInvariantUuid); + } + + @Test + public void testInsertData() { + try { + testSdncPNFModel.insertData(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + } -- cgit 1.2.3-korg From fc013e3622d743a3f559cb2ce20311c83e7e8112 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 14 Mar 2019 11:33:05 -0400 Subject: Prepare for release 0.4.1 Prepare to create release version 0.4.1 by using released version of parent pom Change-Id: I9a3c60350913ed816b6db411df0009f4b755e072 Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 7 +++---- .../features/features-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/pom.xml | 5 ++--- daexim-offsite-backup/installer/pom.xml | 2 +- daexim-offsite-backup/model/pom.xml | 2 +- daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 36 files changed, 39 insertions(+), 41 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index d15621f98..244dba19a 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index d492848f0..0691fc211 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 312c7b71a..292cac23d 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 260878a2c..2c81542bc 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index f17b7a1f7..860563f8c 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 61384fd9b..3952fea74 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index c724d452a..3e8f12877 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 9d41cdca8..6df4ba2f2 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 13c062565..d5fa7b420 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT - + 1.2.1 + org.onap.ccsdk.sli.northbound diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index d7f823cf2..07b4a039b 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 8c4eaf5cb..318ebad38 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.northbound diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 2cf83d76b..23ac81f5e 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index a38f085f4..0805a60c8 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 2542043a5..4c73bdae3 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 1dc855855..087f014f1 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 16383e8c0..ad1c29e5b 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 66264cd23..be8fabdc7 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 02e257f89..55f0c1428 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index d2d9b1547..0828da596 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index aa987302e..26b6b9cd0 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index b6418f4c2..cfeee532b 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index dd08e3eae..62d134ccc 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 07c80d06f..87f97bc21 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index f4d233827..471cadeb0 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 5d4433514..6b76770e7 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 644ca1c76..731b7a93c 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/features/pom.xml b/features/pom.xml index f96883608..957e07826 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 67fadb15d..fa2f73a94 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 571b8e0a5..7f216cb0c 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index afde4e171..0c5404744 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 10e7bdd30..df5214f65 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 38416fe25..a8f8a0c98 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/lcm/pom.xml b/lcm/pom.xml index 4e9f1033c..42b9002b9 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index a6dd8637b..49d8c7d51 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/pom.xml b/pom.xml index 031d405e1..f705e2c25 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index df20a01cf..39ba7efff 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From 212f2fe2dfa6c31dd64b5c7defe66ed458cfd4c3 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Mon, 18 Mar 2019 13:19:55 -0400 Subject: Remove staging plugin from top level pom.xml Remove staging plugin from pom.xml. It should be part of a build profile in the odlparent pom. Change-Id: Ib948ff6dbf8c07bce690a33903fe1c10844dbb87 Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pom.xml b/pom.xml index f705e2c25..1b7d85d8d 100644 --- a/pom.xml +++ b/pom.xml @@ -88,16 +88,6 @@ false - - org.sonatype.plugins - nexus-staging-maven-plugin - true - - https://${onap.nexus.host} - ${onap.nexus.staging.profile-id} - ${onap.nexus.staging.server-id} - - -- cgit 1.2.3-korg From 602185d0b632359adae3b3eabd8bf8c3234651ad Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Tue, 19 Mar 2019 08:40:53 +0000 Subject: Update LCM:rollback action for PNF S/W upgrade Change mandatory input fields in rollback action to optional and add optional output payload field. Change-Id: Icc1b479c7fcfaeeb315dadd5762e9443d5dfba1c Issue-ID: SDNC-669 Signed-off-by: Enbo Wang --- lcm/model/src/main/yang/lcm.yang | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index c9ec3ca81..cbb772fb0 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -682,16 +682,20 @@ module LCM { } leaf identity-url { type string; - mandatory true; + mandatory false; } leaf snapshot-id { type string; - mandatory true; + mandatory false; } } output { uses common-header; uses status; + leaf payload { + type payload; + mandatory false; + } } } -- cgit 1.2.3-korg From e530f30b4d7c3609cd026047ffaa6b3a77d0aec6 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 19 Mar 2019 17:11:28 -0400 Subject: Compile against Fluorine SR2 Updated to compile against Fluorine SR2 Change-Id: I7a104f16bfd17d30d925a6cd70dedbd6aa0f0b4c Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 37 files changed, 73 insertions(+), 73 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 244dba19a..ff7bc3f7b 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 0691fc211..d7ad2b799 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 292cac23d..a3c92f6e1 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 2c81542bc..95e71af76 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 860563f8c..d078f5aa9 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 3952fea74..384c03130 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 3e8f12877..aade65265 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 6df4ba2f2..97c39dc65 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index d5fa7b420..820054eff 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index 07b4a039b..a8eec8ece 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-daexim-offsite-backup - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 318ebad38..78187ef04 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 23ac81f5e..6d2d4c9a6 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 0805a60c8..5490df9f1 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 4c73bdae3..135ab35b9 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 087f014f1..ed8eb4fac 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index ad1c29e5b..dae1a3510 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index be8fabdc7..79affc6f6 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 55f0c1428..454eaa914 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 0828da596..1bf4fe3ca 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 26b6b9cd0..195ff6bf3 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index cfeee532b..211f9d997 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 62d134ccc..a4b892518 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 87f97bc21..cfdf0fa7f 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 471cadeb0..13d12b467 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 6b76770e7..7e55dbf0d 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 731b7a93c..90df894f5 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 957e07826..d3aac65b5 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index fa2f73a94..086996eea 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 7f216cb0c..700b1f82c 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 0c5404744..0b04daff8 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index df5214f65..fd36b7a33 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index a8f8a0c98..b8e5c1879 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 42b9002b9..1e5f0c6a2 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 49d8c7d51..addb1d5c4 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 1b7d85d8d..34f36f486 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT 4.0.0 @@ -104,7 +104,7 @@ ONAP - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 39ba7efff..1894f8f30 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 2a56aedac..e40820109 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=4 -feature_revision=1 +feature_revision=2 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 9638aae95f0121d0f697a27508f105439e8bdf96 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Mon, 25 Mar 2019 14:23:11 -0400 Subject: Fix jackson version Use managed version of jackson in ueb-listener instead of our own Change-Id: I1e5608ca4a5da698b48bf1f00bb8be5fca0c4d2f Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- ueb-listener/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 1894f8f30..1867a261d 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -19,7 +19,9 @@ 1.3.0 1.5.0 + true /opt/app/ueb-listener yyyyMMdd'T'HHmmss'Z' @@ -61,12 +63,10 @@ com.fasterxml.jackson.core jackson-core - ${fasterxml.jackson.version} com.fasterxml.jackson.core jackson-databind - ${fasterxml.jackson.version} junit -- 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(-) 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 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 cd856c935cd050be3c3d3a657830853fd57f9147 Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Sun, 14 Apr 2019 23:46:33 +0800 Subject: Add missing payload in output of callDG in LcmProvider Change-Id: Ibafc968b747ad93934e6fa2ad2607ad921a9225e Issue-ID: CCSDK-1224 Signed-off-by: Enbo Wang --- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index d1f3ba53f..0074dfc65 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -59,10 +59,18 @@ public class LcmProvider implements AutoCloseable, LCMService { private class CommonLcmFields { private StatusBuilder statusBuilder; private CommonHeaderBuilder commonHeaderBuilder; + private Payload payload; public CommonLcmFields(StatusBuilder statusBuilder, CommonHeaderBuilder commonHeaderBuilder) { this.statusBuilder = statusBuilder; this.commonHeaderBuilder = commonHeaderBuilder; + this.payload = null; + } + + public CommonLcmFields(StatusBuilder statusBuilder, CommonHeaderBuilder commonHeaderBuilder, Payload payload) { + this.statusBuilder = statusBuilder; + this.commonHeaderBuilder = commonHeaderBuilder; + this.payload = payload; } public StatusBuilder getStatusBuilder() { @@ -72,6 +80,10 @@ public class LcmProvider implements AutoCloseable, LCMService { public CommonHeaderBuilder getCommonHeaderBuilder() { return commonHeaderBuilder; } + + public Payload getPayload() { + return payload; + } } private static final Logger LOG = LoggerFactory.getLogger(LcmProvider.class); @@ -205,6 +217,9 @@ public class LcmProvider implements AutoCloseable, LCMService { CommonLcmFields retval = callDG("rollback", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } } catch (LcmRpcInvocationException e) { LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); @@ -415,6 +430,9 @@ public class LcmProvider implements AutoCloseable, LCMService { CommonLcmFields retval = callDG("upgrade-pre-check", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } } catch (LcmRpcInvocationException e) { LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); @@ -814,6 +832,9 @@ public class LcmProvider implements AutoCloseable, LCMService { CommonLcmFields retval = callDG("upgrade-post-check", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } } catch (LcmRpcInvocationException e) { LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); @@ -1036,6 +1057,12 @@ public class LcmProvider implements AutoCloseable, LCMService { MdsalHelper.toBuilder(respProps, sBuilder); MdsalHelper.toBuilder(respProps, hBuilder); + Payload payload = null; + String payloadValue = respProps.getProperty("payload"); + if (payloadValue != null) { + payload = new Payload(payloadValue); + } + String statusCode = sBuilder.getCode().toString(); if (!"400".equals(statusCode)) { @@ -1044,7 +1071,7 @@ public class LcmProvider implements AutoCloseable, LCMService { LOG.info("Returned SUCCESS for "+rpcName+" "); } - return new CommonLcmFields(sBuilder,hBuilder); + return new CommonLcmFields(sBuilder, hBuilder, payload); } -- 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 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 ed46a3907146c1abea813338a888e3318c7b1524 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 24 Apr 2019 13:07:12 -0400 Subject: Update to use released 1.2.2 parent Update to use released 1.2.2 version of parent poms. Change-Id: Ib0aba55743d4f799a2380a36cfbd5fcb9b729172 Issue-ID: CCSDK-1222 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/pom.xml | 2 +- daexim-offsite-backup/installer/pom.xml | 2 +- daexim-offsite-backup/model/pom.xml | 2 +- daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index ff7bc3f7b..c52e716d8 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index d7ad2b799..515f8825f 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index a3c92f6e1..f55f8d748 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 95e71af76..8d87a57a3 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index d078f5aa9..2be88ee4d 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 384c03130..687a16064 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index aade65265..c77638918 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 97c39dc65..9f38c5b8c 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 820054eff..62a5b6427 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index a8eec8ece..98ad2a4a7 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 78187ef04..b98634e3b 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.northbound diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 6d2d4c9a6..5fba2e8ad 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 5490df9f1..9bbc32d10 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 135ab35b9..1d60d7599 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index ed8eb4fac..ae5a65ff0 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index dae1a3510..cb345476b 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 79affc6f6..bdc04f249 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 454eaa914..054e1384c 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 1bf4fe3ca..8d4f3f322 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 195ff6bf3..fb0500dc5 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 211f9d997..353b6976d 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index a4b892518..04f54bb57 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index cfdf0fa7f..a90504457 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 13d12b467..440209637 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 7e55dbf0d..99269b0bd 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 90df894f5..edf3038a5 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/features/pom.xml b/features/pom.xml index d3aac65b5..a7058eef3 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 086996eea..2f4c5819a 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 700b1f82c..7369792c1 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 0b04daff8..222258e44 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index fd36b7a33..643e8d333 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index b8e5c1879..267b1043c 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/lcm/pom.xml b/lcm/pom.xml index 1e5f0c6a2..72debbb3b 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index addb1d5c4..dbd914b34 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/pom.xml b/pom.xml index 34f36f486..167c5dcbe 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 1867a261d..3d713246d 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From e5d3dc87cebc8461e1fe4deb919487f25bef59fb Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 30 Apr 2019 11:43:00 -0400 Subject: Roll master to El Alto Roll master version to El Alto versions Change-Id: Ib9fa2945f1d5b58c3f2c0c3c8be5716a6eb8390e Issue-ID: CCSDK-1222 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 4 ++-- 37 files changed, 74 insertions(+), 74 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index c52e716d8..dfa35f405 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.2 + 1.3.0-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 515f8825f..d3ba70ce3 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index f55f8d748..65191b77c 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 8d87a57a3..dee99361d 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 2be88ee4d..15e5bd4fe 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 687a16064..dfc5ce7e3 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index c77638918..c4055964a 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 9f38c5b8c..6ba7a5c95 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 62a5b6427..1716eba8d 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index 98ad2a4a7..65bbf7d55 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-daexim-offsite-backup - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index b98634e3b..0f2827cb3 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 5fba2e8ad..8d856529b 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 9bbc32d10..f6bb8c9aa 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 1d60d7599..a2f864b64 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index ae5a65ff0..d5563ba0e 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index cb345476b..a6f57f91d 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index bdc04f249..882831e49 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 054e1384c..940617e94 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 8d4f3f322..0f3ea6364 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index fb0500dc5..c20f07337 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 353b6976d..75caf3ebe 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 04f54bb57..0ebbcbd90 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index a90504457..6c43c9c18 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 440209637..94623a981 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 99269b0bd..aa07657f8 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index edf3038a5..250d3f8ce 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index a7058eef3..7d4eca129 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 2f4c5819a..1bb6a37eb 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 7369792c1..2499b9923 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 222258e44..02eda542f 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 643e8d333..db3cf5fa2 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 267b1043c..77c8b959c 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 72debbb3b..1098fd6f0 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index dbd914b34..e236d0ff8 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 167c5dcbe..e8e5c4950 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT 4.0.0 @@ -104,7 +104,7 @@ ONAP - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 3d713246d..b7ec6ff2f 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index e40820109..3e36988ca 100644 --- a/version.properties +++ b/version.properties @@ -4,8 +4,8 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=4 -feature_revision=2 +sprint_number=5 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 39b9cb6e48052a5fe474e056fa867e5b9bd59ca9 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 16 May 2019 15:08:30 -0400 Subject: Update to Tosca parser version 1.5.1 Tosca parser version 1.5.1 needed for policy deployment Change-Id: I67de4357267b6e46615906c29f34d728a5279299 Issue-ID: CCSDK-1338 Signed-off-by: Timoney, Dan (dt5972) --- ueb-listener/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index b7ec6ff2f..550cbfdd9 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -18,7 +18,7 @@ 1.3.0 - 1.5.0 + 1.5.1 -- cgit 1.2.3-korg From 3a86df02c0c53b9c4c1138084a18bb724d22c4ef Mon Sep 17 00:00:00 2001 From: "Agarwal, Ruchira (ra1926)" Date: Mon, 20 May 2019 22:02:34 +0000 Subject: Use getEntity to populate VF Module tables Changes made: Update SdncVFModel.insertVFModuleData to use getEntity. Update SdncVFModule to use IEntityDetails instead of Group. Issue-ID: CCSDK-1347 Change-Id: I319d4b56b7d1e9bfb6a2d7601a24cd5c192477d7 Signed-off-by: Aria, Lalena (la505a) --- .../sli/northbound/uebclient/SdncBaseModel.java | 1 + .../sli/northbound/uebclient/SdncGroupModel.java | 2 +- .../sli/northbound/uebclient/SdncVFModel.java | 137 +++++++++++++++++---- .../northbound/uebclient/SdncVFModuleModel.java | 16 ++- .../uebclient/SdncVFModuleModelTest.java | 7 +- 5 files changed, 127 insertions(+), 36 deletions(-) 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 4824d9f2d..a5de97fc2 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 @@ -58,6 +58,7 @@ public class SdncBaseModel { protected String name = null; protected String PARAM_INVARIANT_UUID_KEY = "invariant_uuid"; + protected String PARAM_CUSTOMIZATION_UUID_KEY = "customization_uuid"; protected String PARAM_UUID_KEY = "uuid"; protected String PARAM_VERSION_KEY = "version"; protected String PARAM_NAME_KEY = "name"; diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java index ea62abe9c..dedaa9a2a 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java @@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory; public class SdncGroupModel extends SdncBaseModel { private static final Logger LOG = LoggerFactory - .getLogger(SdncVFModuleModel.class); + .getLogger(SdncGroupModel.class); private static final String groupType = "group_type"; 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 a42f03d8e..12eccf213 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 @@ -22,6 +22,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -94,7 +95,7 @@ public class SdncVFModel extends SdncBaseModel { public void insertData() throws IOException { insertVFModelData(); - insertVFModuleData(nodeTemplate, jdbcDataSource); + insertVFModuleData(); insertVFtoNetworkRoleMappingData(); insertVFCData(); insertVFCInstanceGroupData(); @@ -125,12 +126,29 @@ public class SdncVFModel extends SdncBaseModel { } - private void insertVFModuleData (NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) throws IOException { + private void insertVFModuleData () throws IOException { - List vfModules = sdcCsarHelper.getVfModulesByVf(getCustomizationUUIDNoQuotes()); - for (Group group : vfModules){ - SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, group, this); - + // Step 1: Get all the VF Module groups (entities) in this Service + EntityQuery entityQuery = EntityQuery.newBuilder("org.openecomp.groups.VfModule").build(); + String vfCustomizationUuid = getCustomizationUUIDNoQuotes(); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE) + .build(); + List vfModules = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, false); + if (vfModules == null) { + return; + } + + // Insert each VF Module group (entity) into VF_MODULE_MODEL if its name is prefixed with the VF name + for (IEntityDetails vfModule : vfModules){ + + // If this vfModule name is prefixed with the VF name of the VF bing processed, insert this VF Module in VF_MODULE_MODEL + String normailizedVfName = nodeTemplate.getName().toLowerCase().replace(" ", ""); + if (!vfModule.getName().startsWith(normailizedVfName)) { + continue; + } + + SdncVFModuleModel vfModuleModel = new SdncVFModuleModel(sdcCsarHelper, vfModule, this); + try { cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); @@ -140,28 +158,95 @@ public class SdncVFModel extends SdncBaseModel { LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_MODEL table "); throw new IOException (e); } - - // For each VF Module, get the VFC list, insert VF_MODULE_TO_VFC_MAPPING data - // List groupMembers = sdcCsarHelper.getMembersOfGroup(group); - old version - // For each vfcNode (group member) in the groupMembers list, extract vm_type and vm_count. - // Insert vf_module.customizationUUID, vfcNode.customizationUUID and vm_type and vm_count into VF_MODULE_TO_VFC_MAPPING - List groupMembers = sdcCsarHelper.getMembersOfVfModule(nodeTemplate, group); - for (NodeTemplate vfcNode : groupMembers){ - SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode, jdbcDataSource); - - try { - LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); - insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + - vfModuleModel.getCustomizationUUID() + ", " + vfcModel.getCustomizationUUID() + ", \"" + vfcModel.getVmType() + "\", \"" + vfcModel.getVmCount() + "\")", null); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); - throw new IOException (e); - } - + + // Step 2: Get the non-catalog VF Module in order to get the group members + String vfModuleUuid = vfModuleModel.getUUID().replace("\"", ""); + EntityQuery entityQuery2 = EntityQuery.newBuilder("org.openecomp.groups.VfModule") + .uUID(vfModuleUuid) + .build(); + TopologyTemplateQuery topologyTemplateQuery2 = TopologyTemplateQuery.newBuilder(SdcTypes.VF) + .customizationUUID(vfCustomizationUuid) // customization UUID of the VF if exists + .build(); + List vfModulesNonCatalog = sdcCsarHelper.getEntity(entityQuery2, topologyTemplateQuery2, false); + if (vfModulesNonCatalog == null || vfModulesNonCatalog.isEmpty()) { + LOG.info("insertVFModuleDataGetEntity2: Could not find the non-catelog VF Module for: " + vfModuleModel.getCustomizationUUID() + ". Unable to insert members into VF_MODULE_TO_VFC_MAPPING"); + continue; + } + + List vfModuleMembers = vfModulesNonCatalog.get(0).getMemberNodes(); + + // Find all members for each VF Module that are of type CVFC and insert it and any nested CFVCs into VF_MODULE_TO_VFC_MAPPING + for (IEntityDetails vfModuleMember: vfModuleMembers) { + if (vfModuleMember.getMetadata().getValue("type").equals(SdcTypes.CVFC.getValue())) { + + // Insert this CVFC data into VF_MODULE_TO_VFC_MAPPING + String cvfcCustomizationUuid = extractValue(vfModuleMember.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String vfcVmType = extractValue (vfModuleMember, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); // extracted as vm_type_tag + String vfcVmCount = ""; + if (vfModuleMember.getProperties().containsKey("service_template_filter")) { + Property property = vfModuleMember.getProperties().get("service_template_filter"); + if (property != null && property.getLeafPropertyValue("count") != null) { + vfcVmCount = property.getLeafPropertyValue("count").get(0); + } + } + if (vfcVmCount.isEmpty()) { + vfcVmCount = "0"; // vm_count can not be null + } + + try { + LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); + insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + + vfModuleModel.getCustomizationUUID() + ", \"" + cvfcCustomizationUuid + "\", \"" + vfcVmType + "\", \"" + vfcVmCount + "\")", null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); + throw new IOException (e); + } + + // Step 3: Get any nested CVFCs under this CVFC + EntityQuery entityQuery3 = EntityQuery.newBuilder(SdcTypes.CVFC) + .build(); + TopologyTemplateQuery topologyTemplateQuery3 = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC) + .customizationUUID(cvfcCustomizationUuid) // customization UUID of the CVFC if exists + .build(); + List nestedCvfcs = sdcCsarHelper.getEntity(entityQuery3, topologyTemplateQuery3, true); // true allows for nested search + if (nestedCvfcs == null || nestedCvfcs.isEmpty()) { + LOG.info("insertVFModuleDataGetEntity2: Could not find the nested CVFCs for: " + cvfcCustomizationUuid); + continue; + } + + for (IEntityDetails nestedCvfc: nestedCvfcs) { + + // Insert this CVFC data into VF_MODULE_TO_VFC_MAPPING + String nestedCvfcCustomizationUuid = extractValue(nestedCvfc.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String nestedVfcVmType = extractValue (nestedCvfc, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); // extracted as vm_type_tag + String nestedVfcVmCount = ""; + if (nestedCvfc.getProperties().containsKey("service_template_filter")) { + Property property = nestedCvfc.getProperties().get("service_template_filter"); + if (property != null && property.getLeafPropertyValue("count") != null) { + nestedVfcVmCount = property.getLeafPropertyValue("count").get(0); + } + } + if (nestedVfcVmCount.isEmpty()) { + nestedVfcVmCount = "0"; // vm_count can not be null + } + + try { + LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); + insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + + vfModuleModel.getCustomizationUUID() + ", \"" + nestedCvfcCustomizationUuid + "\", \"" + nestedVfcVmType + "\", \"" + nestedVfcVmCount + "\")", null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); + throw new IOException (e); + } + + } + + } + } - + } - + } private void insertVFtoNetworkRoleMappingData () throws IOException { 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 914401ff1..f9a03b3f3 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 @@ -22,22 +22,26 @@ package org.onap.ccsdk.sli.northbound.uebclient; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.Group; public class SdncVFModuleModel extends SdncBaseModel { - public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, Group group, SdncVFModel vfNodeModel) { + public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails vfModule, SdncVFModel vfNodeModel) { - super(sdcCsarHelper, group); + super(sdcCsarHelper, vfModule); + // override base implementation for setting customizationUUID because customizationUUID is called differently for Groups + customizationUUID = extractValue (vfModule.getMetadata(), "vfModuleModelCustomizationUUID"); + UUID = extractValue (vfModule.getMetadata(), "vfModuleModelUUID"); addParameter("vf_customization_uuid", vfNodeModel.getCustomizationUUIDNoQuotes()); // extract properties - addParameter("vf_module_type", extractValue(group, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); - addParameter("vf_module_label", extractValue(group, "vf_module_label")); - addIntParameter("availability_zone_count", extractValue(group, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)); - addParameter("ecomp_generated_vm_assignments", extractBooleanValue(group, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS)); + addParameter("vf_module_type", extractValue(vfModule, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); + addParameter("vf_module_label", extractValue(vfModule, "vf_module_label")); + addIntParameter("availability_zone_count", extractValue(vfModule, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)); + addParameter("ecomp_generated_vm_assignments", extractBooleanValue(vfModule, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS)); } } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java index 1fd10104c..846b79b49 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java @@ -3,7 +3,8 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; -import org.junit.Test; +import org.junit.Test; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.Group; import org.onap.ccsdk.sli.northbound.uebclient.SdncVFModel; @@ -12,10 +13,10 @@ public class SdncVFModuleModelTest { @Test public void testSdncVFModuleModelConstructor() { - Group mockGroup = mock(Group.class); + IEntityDetails mockEntity = mock(IEntityDetails.class); ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); SdncVFModel mockSdncVFModel = mock(SdncVFModel.class); - SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockGroup, mockSdncVFModel); + SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockEntity, mockSdncVFModel); assertNotNull(testSdncVFModel); } -- cgit 1.2.3-korg From 6d6ccec6604ea2cd672bb1c453d6d1f96e9c0518 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Sun, 26 May 2019 10:37:21 -0500 Subject: Fix bug with DMAAP listener for SDNR OOFPCIPOC Replaced 2 dmaap consumers with one consumer for DMAAP topic SDNR-CL. Also updated corresponding JUNIT file. Issue-ID: CCSDK-1364 Signed-off-by: SandeepLinux Change-Id: I840a38d04423954102865a68b0e216c745ed161b --- .../ANRChangesFromPolicyToSDNRDmaapConsumer.java | 343 -------------- .../dmaapclient/OofPciPocDmaapConsumers.java | 504 +++++++++++++++++++++ .../PciChangesFromPolicyToSDNRDmaapConsumer.java | 314 ------------- ...estANRChangesFromPolicyToSDNRDmaapConsumer.java | 142 ------ .../dmaapclient/TestOofPciPocDmaapConsumers.java | 314 +++++++++++++ ...estPciChangesFromPolicyToSDNRDmaapConsumer.java | 181 -------- 6 files changed, 818 insertions(+), 980 deletions(-) delete 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/OofPciPocDmaapConsumers.java delete mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java delete 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/TestOofPciPocDmaapConsumers.java delete mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestPciChangesFromPolicyToSDNRDmaapConsumer.java 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 deleted file mode 100644 index 5bc2c6011..000000000 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/ANRChangesFromPolicyToSDNRDmaapConsumer.java +++ /dev/null @@ -1,343 +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========================================================= - */ - -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/OofPciPocDmaapConsumers.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/OofPciPocDmaapConsumers.java new file mode 100644 index 000000000..2e6ae742b --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/OofPciPocDmaapConsumers.java @@ -0,0 +1,504 @@ +/*- + * ============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 OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { + + private static final Logger LOG = LoggerFactory.getLogger(OofPciPocDmaapConsumers.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 UTF_8 = "UTF-8"; + + 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 CONFIGURATIONS = "Configurations"; + private static final String MODIFY_CONFIG = "ModifyConfig"; + private static final String DATA = "data"; + private static final String FAP_SERVICE = "FAPService"; + + private static final String PAYLOAD = "Payload"; + private static final String PCI_CHANGES_MAP_FILE_NAME = "pci-changes-from-policy-to-sdnr"; + 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 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"; + private static final String ANR_CHANGES_MAP_FILE_NAME = "anr-changes-from-policy-to-sdnr"; + + private String rootDir; + + protected VelocityEngine velocityEngine; + + public OofPciPocDmaapConsumers() { + 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 + */ + OofPciPocDmaapConsumers(Properties props) { + velocityEngine = new VelocityEngine(); + velocityEngine.init(props); + } + + protected String publish(String templatePath, String jsonString, JsonNode configurationsOrDataNode, boolean invokePciChangesPublish, boolean invokeAnrChangesPublish) throws IOException, InvalidMessageException + { + if (invokePciChangesPublish){ + return publishPciChangesFromPolicyToSDNR(templatePath, configurationsOrDataNode); + } else if (invokeAnrChangesPublish){ + return publishANRChangesFromPolicyToSDNR(templatePath, configurationsOrDataNode); + } 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"); + } + + } + + 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 dmaapMessageRootNode; + try { + dmaapMessageRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + + JsonNode rpcnameNode = dmaapMessageRootNode.get(RPC_NAME); + if(rpcnameNode == null) { + LOG.info("Unable to identify the respective consumer to invoke. Please verify the dmaap message.."); + return; + } + + String rpcname = rpcnameNode.textValue(); + + if(!MODIFY_CONFIG.toLowerCase().equals(rpcname) && !MODIFY_CONFIG_ANR.toLowerCase().equals(rpcname)) { + LOG.info("Unknown rpc name {}", rpcname); + return; + } + + if(MODIFY_CONFIG.toLowerCase().equals(rpcname)) { + invokePCIChangesConsumer(dmaapMessageRootNode, oMapper, msg); + return; + } + + if(MODIFY_CONFIG_ANR.toLowerCase().equals(rpcname)) { + invokeANRChangesConsumer(dmaapMessageRootNode, oMapper, msg); + return; + } + + } + + private void invokeANRChangesConsumer(JsonNode dmaapMessageRootNode, ObjectMapper oMapper, + String msg) throws InvalidMessageException { + JsonNode body = dmaapMessageRootNode.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 + ANR_CHANGES_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 { + buildAndInvokeANRChangesRPC(sdncEndpoint, templateName,msg, dataNode); + } + } + }else { + throw new InvalidMessageException("Configurations is not of Type Array. Could not read configuration changes"); + } + } + + private void invokePCIChangesConsumer(JsonNode dmaapMessageRootNode, ObjectMapper oMapper, + String msg) throws InvalidMessageException { + JsonNode body = dmaapMessageRootNode.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 + PCI_CHANGES_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); + + buildAndInvokePCIChangesRPC(sdncEndpoint, templateName, msg, configurationsJsonNode); + } + + private void buildAndInvokePCIChangesRPC(String sdncEndpoint, String templateName, String msg, JsonNode configurationsOrDataNode) { + try { + String rpcMsgbody = publish(templateName, msg, configurationsOrDataNode, true, false); + 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 void buildAndInvokeANRChangesRPC(String sdncEndpoint, String templateName, String msg, JsonNode configurationsOrDataNode) { + try { + String rpcMsgbody = publish(templateName, msg, configurationsOrDataNode, false, true); + 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/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java deleted file mode 100644 index 8c44377f9..000000000 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/PciChangesFromPolicyToSDNRDmaapConsumer.java +++ /dev/null @@ -1,314 +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========================================================= - */ - -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/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestANRChangesFromPolicyToSDNRDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestANRChangesFromPolicyToSDNRDmaapConsumer.java deleted file mode 100644 index 66b63a17d..000000000 --- a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestANRChangesFromPolicyToSDNRDmaapConsumer.java +++ /dev/null @@ -1,142 +0,0 @@ -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/TestOofPciPocDmaapConsumers.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestOofPciPocDmaapConsumers.java new file mode 100644 index 000000000..cd2ea6eb0 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestOofPciPocDmaapConsumers.java @@ -0,0 +1,314 @@ +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 TestOofPciPocDmaapConsumers { + + 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" + + "}"; + + 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 { + } + + /* ---------- PCI Changes DMAAP messages test cases ------------------- */ + + @Test + public void testPCIChangesDmaapRPCMessageBodyResponse() 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 OofPciPocDmaapConsumers(props).publish("src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt", pciChangesFromPolicyToSDNRInput,configurationsJsonNode, true, false); + + 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 testPCIChangesDmaapProcessMsgNullMessage() throws Exception { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + consumer.processMsg(null); + } + + @Test(expected = InvalidMessageException.class) + public void testPCIChangesDmaapProcessMsgInvalidMessage() throws Exception { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + consumer.processMsg("test"); + } + + @Test + public void testPCIChangesDmaapProcessMsgMissingActionHeader() throws Exception { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + 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 testPCIChangesDmaapProcessMsgInvalidPayloadConfigurations() 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 { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + 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()); + } + } + + /* ---------- PCI Changes DMAAP messages test cases ------------------- */ + + /* ---------- ANR Changes DMAAP messages test cases ------------------- */ + + @Test + public void testANRChangesDmaapRPCMessageBodyResponse() 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 OofPciPocDmaapConsumers(props).publish("src/main/resources/anr-pci-changes-from-policy-to-sdnr.vt", anrChangesFromPolicyToSDNRInput,dataNode, false, true); + + 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 testANRChangesDmaapProcessMsgNullMessage() throws Exception { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + consumer.processMsg(null); + } + + @Test(expected = InvalidMessageException.class) + public void testANRChangesDmaapProcessMsgInvalidMessage() throws Exception { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + consumer.processMsg("test"); + } + + @Test + public void testANRChangesDmaapProcessMsgMissingActionHeader() throws Exception { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + 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 testANRChangesDmaapProcessMsgInvalidPayloadConfigurations() 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 { + OofPciPocDmaapConsumers consumer = new OofPciPocDmaapConsumers(); + consumer.processMsg(msg); + + } catch (final InvalidMessageException e) { + final String errorMsg = "Cannot parse payload value"; + assertEquals(errorMsg, e.getMessage()); + } + } + + /* ---------- ANR Changes DMAAP messages test cases ------------------- */ +} 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 deleted file mode 100644 index a42bc48f6..000000000 --- a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestPciChangesFromPolicyToSDNRDmaapConsumer.java +++ /dev/null @@ -1,181 +0,0 @@ -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 e8fcf7c536a77381542dabc239a3e127c319e4a8 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 9 May 2019 10:26:49 -0400 Subject: Update to use standalone pom Update standalone containers dmaap-listener and ueb-listener to use standalone parent poms. This version contains some vulnerability fixes that are not possible to address in containers that install their own third-party library versions. Change-Id: I75a295b331190d87a38002924ccbdd985ca8f494 Issue-ID: CCSDK-1320 Signed-off-by: Timoney, Dan (dt5972) --- dmaap-listener/pom.xml | 36 +++++++++++++----------------------- ueb-listener/pom.xml | 44 +++++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 48 deletions(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 6c43c9c18..500121378 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent - odlparent-lite + standalone-parent 1.3.0-SNAPSHOT @@ -17,21 +17,27 @@ DMAAP Listener - 1.2.0-SNAPSHOT - 2.9.4 - 2.0 true /opt/app/dmaap-listener - 1.1.5 yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} + + 0.5.0-SNAPSHOT ${project.version} + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + javax.ws.rs @@ -46,61 +52,45 @@ org.onap.dmaap.messagerouter.dmaapclient dmaapClient - ${dmaap.listener.version} org.slf4j slf4j-api - 1.7.21 - - - org.slf4j - slf4j-log4j12 - 1.6.1 - compile - log4j - log4j - 1.2.17 + org.apache.logging.log4j + log4j-slf4j-impl com.fasterxml.jackson.core jackson-core - ${fasterxml.jackson.version} com.fasterxml.jackson.core jackson-databind - ${fasterxml.jackson.version} com.fasterxml.jackson.core jackson-annotations - ${fasterxml.jackson.version} org.apache.velocity velocity-engine-core - ${velocity.version} junit junit - ${junit.version} test ch.vorburger.mariaDB4j mariaDB4j - 2.2.3 test org.onap.ccsdk.sli.core dblib-provider - ${sdnctl.dblib.version} diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 550cbfdd9..f219f5238 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent - odlparent-lite + standalone-parent 1.3.0-SNAPSHOT @@ -17,48 +17,47 @@ UEB Listener - 1.3.0 - 1.5.1 - true /opt/app/ueb-listener yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} + 0.5.0-SNAPSHOT ${project.version} + + + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + + + org.onap.sdc.sdc-distribution-client sdc-distribution-client - ${sdc.client.version} compile org.onap.sdc.sdc-tosca sdc-tosca - ${sdc.tosca.version} compile org.slf4j slf4j-api - 1.7.21 - org.slf4j - slf4j-log4j12 - 1.6.1 - compile - - - log4j - log4j - 1.2.17 + org.apache.logging.log4j + log4j-slf4j-impl com.fasterxml.jackson.core @@ -71,31 +70,26 @@ junit junit - ${junit.version} test org.testng testng - 6.11 test org.mockito mockito-core - ${mockito.version} test ch.vorburger.mariaDB4j mariaDB4j - 2.2.3 test org.onap.ccsdk.sli.core dblib-provider - ${sdnctl.dblib.version} @@ -111,8 +105,8 @@ 2.5.1 true - 1.7 - 1.7 + 1.8 + 1.8 -- 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(-) 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 69a61e338d5e528870085f6d365ae41bfd2cd9a4 Mon Sep 17 00:00:00 2001 From: "Aria, Lalena (la505a)" Date: Fri, 14 Jun 2019 14:58:13 +0000 Subject: Use getEntity to populate VFC and AR tables Changes made: Update SdncARModel to use IEntityDetails instead of NodeTemplate. Update SdncVFCModel to use IEntityDetails instead of Group. Small fixes in SdncVFModuleModel. Corresponding junit changes for getEntity migration. Issue-ID: CCSDK-1367 Change-Id: Ifaf57e9fb22ef87be80bad39948f07bb0a78a6bc Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncARModel.java | 43 ++- .../sli/northbound/uebclient/SdncBaseModel.java | 75 ++++ .../sli/northbound/uebclient/SdncUebCallback.java | 30 +- .../sli/northbound/uebclient/SdncVFCModel.java | 414 ++++++++++----------- .../sli/northbound/uebclient/SdncVFModel.java | 69 ++-- .../northbound/uebclient/SdncVFModuleModel.java | 8 +- .../sli/northbound/uebclient/SdncARModelTest.java | 12 +- .../sli/northbound/uebclient/SdncVFCModelTest.java | 20 +- 8 files changed, 401 insertions(+), 270 deletions(-) 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 9cac459d7..f1e514da4 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 @@ -23,10 +23,14 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; +import java.util.List; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; +import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; +import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; -import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; @@ -40,21 +44,21 @@ public class SdncARModel extends SdncBaseModel { private String type = null; private String subcategory = null; - public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate,DBResourceManager jdbcDataSource) { + public SdncARModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails arEntity, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { - super(sdcCsarHelper, nodeTemplate, jdbcDataSource); + super(sdcCsarHelper, arEntity, jdbcDataSource, config); // extract metadata - Metadata metadata = nodeTemplate.getMetaData(); + Metadata metadata = arEntity.getMetadata(); type = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE); subcategory = extractValue (metadata, "subcategory"); addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); // extract properties - addParameter("role", extractValue (nodeTemplate, "nf_role")); - addParameter("type", extractValue (nodeTemplate, "nf_type")); - addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, "nf_naming#ecomp_generated_naming")); - addParameter("naming_policy", extractValue (nodeTemplate, "nf_naming#naming_policy")); + addParameter("role", extractValue (arEntity, "nf_role")); + addParameter("type", extractValue (arEntity, "nf_type")); + addParameter("ecomp_generated_naming", extractBooleanValue (arEntity, "nf_naming", "ecomp_generated_naming")); + addParameter("naming_policy", extractValue (arEntity, "nf_naming", "naming_policy")); } public void insertAllottedResourceModelData () throws IOException { @@ -67,6 +71,29 @@ public class SdncARModel extends SdncBaseModel { throw new IOException (e); } } + + public void insertAllottedResourceVfcModelData () throws IOException { + + // Insert the child VFCs (not CVFC) into VFC_MODEL + String vfCustomizationUuid = getCustomizationUUID().replace("\"", ""); + EntityQuery vfcEntityQuery = EntityQuery.newBuilder(SdcTypes.VFC).build(); + TopologyTemplateQuery vfcTopologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF) + .customizationUUID(vfCustomizationUuid) + .build(); + List nestedVfcs = sdcCsarHelper.getEntity(vfcEntityQuery, vfcTopologyTemplateQuery, true); // true allows for nested search + if (nestedVfcs == null || nestedVfcs.isEmpty()) { + LOG.info("Could not find the nested VFCs for: " + vfCustomizationUuid); + } + + for (IEntityDetails nestedVfc: nestedVfcs) { + try { + SdncVFCModel arVfcModel = new SdncVFCModel (sdcCsarHelper, nestedVfc, jdbcDataSource, config); + arVfcModel.insertVFCModelData(); + } catch (IOException e) { + LOG.info("Could not find the nested VFCs for: " + vfCustomizationUuid); + } + } + } public String getSubcategory() { return subcategory; 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 a5de97fc2..245911250 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 @@ -706,6 +706,65 @@ public class SdncBaseModel { } } + protected String extractValue (IEntityDetails entityDetails, String path, String name) { + String value = null; + + if (entityDetails.getProperties().containsKey(path)) { + Property property = entityDetails.getProperties().get(path); + if (property != null && property.getLeafPropertyValue(name) != null) { + value = property.getLeafPropertyValue(name).get(0); + } + } + + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractValue (Property property, String name) { + String value = null; + + if (!property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanValue (Property property, String name) { + String value = null; + + if (!property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + + if (value != null) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + protected String extractIntegerValue (Property property, String name) { + String value = null; + + if (!property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + + if (value != null && !value.isEmpty() && !value.contains("null")) { + return value; + } else { + return ""; + } + } + protected String extractGetInputValue (Group group, NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (group, name)); @@ -821,6 +880,22 @@ public class SdncBaseModel { } } + protected String extractBooleanValue (IEntityDetails entityDetails, String path, String name) { + String value = null; + if (entityDetails.getProperties().containsKey(path)) { + Property property = entityDetails.getProperties().get(path); + if (property != null && property.getLeafPropertyValue(name) != null) { + value = property.getLeafPropertyValue(name).get(0); + } + } + + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + public static String extractBooleanValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); if (value != null && !value.isEmpty()) { 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 4d9dbda96..95672ea5f 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 @@ -718,16 +718,26 @@ public class SdncUebCallback implements INotificationCallback { } } - // Ingest Allotted Resource Data - 1707 - List arNodeTemplatesList = sdcCsarHelper.getAllottedResources(); - - for (NodeTemplate nodeTemplate : arNodeTemplatesList) { - - try { - SdncARModel nodeModel = new SdncARModel (sdcCsarHelper, nodeTemplate, jdbcDataSource); - nodeModel.insertAllottedResourceModelData (); - } catch (IOException e) { - deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + // Ingest Allotted Resource Data - 1707 / migrate to getEntity - 1908 + // Use getEntity to get all VFs in the service filter by metadata Category = Allotted Resource + EntityQuery vfEntityQuery = EntityQuery.newBuilder(SdcTypes.VF).build(); + TopologyTemplateQuery vfTopologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(); + List vfEntities = sdcCsarHelper.getEntity(vfEntityQuery, vfTopologyTemplateQuery, true); + if (vfEntities != null) { + for (IEntityDetails vfEntity : vfEntities){ + + // If this VF has metadata Category: Allotted Resource, insert it into ALLOTTED_RESOURCE_MODEL table + String vfCategory = SdncBaseModel.extractValue(sdcCsarHelper, vfEntity.getMetadata(), "category"); + if (vfCategory.contains("Allotted Resource")) { + + try { + SdncARModel arModel = new SdncARModel (sdcCsarHelper, vfEntity, jdbcDataSource, config); + arModel.insertAllottedResourceModelData (); + arModel.insertAllottedResourceVfcModelData(); + } catch (IOException e) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + } + } } } 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 94392262e..bd71c0240 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 @@ -27,9 +27,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; +import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; +import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; -import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.Property; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,28 +46,28 @@ public class SdncVFCModel extends SdncBaseModel { private String vmType = null; private String vmCount = null; - public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) { + public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails entityDetails, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { - super(sdcCsarHelper, nodeTemplate, jdbcDataSource); + super(sdcCsarHelper, entityDetails, jdbcDataSource, config); // extract properties - addParameter("ecomp_generated_naming", extractBooleanValue (nodeTemplate, "nfc_naming#ecomp_generated_naming")); - addParameter("naming_policy", extractValue (nodeTemplate, "nfc_naming#naming_policy")); - vmCount = extractValue (nodeTemplate, "service_template_filter#count"); // need path to vm_count, extracted as service_template_filter#count + addParameter("ecomp_generated_naming", extractBooleanValue (entityDetails, "nfc_naming", "ecomp_generated_naming")); + addParameter("naming_policy", extractValue (entityDetails, "nfc_naming", "naming_policy")); + vmCount = extractValue (entityDetails, "service_template_filter", "count"); // need path to vm_count, extracted as service_template_filter#count if (vmCount.isEmpty()) { vmCount = "0"; // vm_count can not be null } - vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); + vmType = extractValue (entityDetails, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); addParameter("vm_type", vmType); // populate vm_type with vm_type_tag value addParameter("vm_type_tag", vmType); - addParameter("nfc_naming_code", extractValue (nodeTemplate, "nfc_naming_code")); - addParameter("nfc_function", extractValue (nodeTemplate, "nfc_function")); - addParameter("high_availability", extractValue (nodeTemplate, "high_availablity")); - addParameter("vm_image_name", extractValue (nodeTemplate, "vm_image_name")); - addParameter("vm_flavor_name", extractValue (nodeTemplate, "vm_flavor_name")); - addParameter("nfc_naming", extractValue (nodeTemplate, "nfc_naming")); - addParameter("min_instances", extractValue (nodeTemplate, "min_instances")); - addParameter("max_instances", extractValue (nodeTemplate, "max_instances")); + addParameter("nfc_naming_code", extractValue (entityDetails, "nfc_naming_code")); + addParameter("nfc_function", extractValue (entityDetails, "nfc_function")); + addParameter("high_availability", extractValue (entityDetails, "high_availablity")); + addParameter("vm_image_name", extractValue (entityDetails, "vm_image_name")); + addParameter("vm_flavor_name", extractValue (entityDetails, "vm_flavor_name")); + addParameter("nfc_naming", extractValue (entityDetails, "nfc_naming")); + addParameter("min_instances", extractValue (entityDetails, "min_instances")); + addParameter("max_instances", extractValue (entityDetails, "max_instances")); } public void insertVFCModelData () throws IOException { @@ -78,16 +82,20 @@ public class SdncVFCModel extends SdncBaseModel { } - public void insertVFCtoNetworkRoleMappingData (NodeTemplate vfcNode) throws IOException { - + public void insertVFCtoNetworkRoleMappingData (IEntityDetails cvfcEntity) throws IOException { + + // Get the CPs on this VFC - using getEntity // For each VFC node, get CP properties to insert into VFC_TO_NETWORK_ROLE_MAPPING // VFC_TO_NETWORK_ROLE_MAPPING: vfc_customization_uuid, network_role, network_role_tag, vm_type, ipv4_count, ipv6_count, // ipv4_use_dhcp, ipv6_use_dhcp, ipv4_ip_version, ipv6_ip_version, extcp_subnetpool_id - Map> cpPropertiesMap = sdcCsarHelper.getCpPropertiesFromVfcAsObject(vfcNode); - // DEBUG only - if (cpPropertiesMap != null && !cpPropertiesMap.toString().contentEquals("{}")) { - LOG.info("getCpPropertiesFromVfcAsObject for vfc_customization_uuid " + this.getCustomizationUUID() + ": " + cpPropertiesMap.toString()); + String vfcCustomizationUuid = getCustomizationUUID().replace("\"", ""); + EntityQuery entityQueryCP = EntityQuery.newBuilder(SdcTypes.CP).build(); + TopologyTemplateQuery topologyTemplateQueryVFC = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID(vfcCustomizationUuid).build(); + List cpEntities = sdcCsarHelper.getEntity(entityQueryCP, topologyTemplateQueryVFC, true); + if (cpEntities == null || cpEntities.isEmpty()) { + LOG.info("insertVFCtoNetworkRoleMappingData: Could not find the nested CVFCs for: " + vfcCustomizationUuid); + return; } // Clean up all VFC_TO_NETWORK_ROLE_MAPPING data for this VFC node @@ -96,165 +104,147 @@ public class SdncVFCModel extends SdncBaseModel { } catch (IOException e) { LOG.error("Could not clean up data in VFC_TO_NETWORK_ROLE_MAPPING table ", e); } - - // There will be a cpPropertiesMap entry for each CP which will contain a map of properties to be inserted into VFC_TO_NETWORK_ROLE_MAPPING + // There can be multiple insertions per CP: // Insert once for each unique IP Version / Subnet Role combination per CP (network_role) - // If there are IPV4 and IPV6 ip_requirements elements that have the same subnet_role (within a CP) combine those parameters for one insert - for (String nodeMapKey : cpPropertiesMap.keySet()) { // there will be one entry in this map per CP (network_role) - LOG.debug("node key = " + nodeMapKey); - Map propsMap = cpPropertiesMap.get(nodeMapKey); - Map commonParams = new HashMap(); // non-IP Version specific parameters + for (IEntityDetails cpEntity : cpEntities) { + // Extract common parameters + Map commonParams = new HashMap(); // non-IP Version specific parameters // Get vm_type from VFC node - SdncBaseModel.addParameter("vm_type", getVmType(), commonParams); + addParameter("vm_type", getVmType(), commonParams); - // Extract non-IP Version specific parameters - String networkRole = nullCheck(propsMap.get("network_role")).isEmpty() ? "default-network-role" : nullCheck(propsMap.get("network_role")); - SdncBaseModel.addParameter("network_role", networkRole, commonParams); // can not be null - SdncBaseModel.addParameter("network_role_tag", nullCheck(propsMap.get("network_role_tag")), commonParams); - SdncBaseModel.addParameter("extcp_subnetpool_id", nullCheck(propsMap.get("subnetpoolid")), commonParams); - - // Loop thru all CPs using getNodeTemplateChildren and match the network_role on the CP with network_role from - // getCpPropertiesFromVfcAsObject output, then get subinterface_indicator for this CP - List cpNodesList = sdcCsarHelper.getNodeTemplateChildren(vfcNode); - for (NodeTemplate cpNode : cpNodesList){ - String cpNetworkRole = extractValue(cpNode, "network_role"); - - if (cpNetworkRole == networkRole) { - String subinterfaceIndicator = extractBooleanValue (cpNode, "subinterface_indicator"); - addParameter("subinterface_indicator", subinterfaceIndicator, commonParams); - } - } - - // Extract IP Version specific parameters - String ipRequirementsString = nullCheck(propsMap.get("ip_requirements")); - //ArrayList> ipPropsList = (ArrayList>) propsMap.get("ip_requirements"); - ArrayList> ipPropsList = new ArrayList>(); - - if (!ipRequirementsString.equals("{}")) { - ipPropsList = (ArrayList>) propsMap.get("ip_requirements"); - } + // Extract non-IP Version specific parameters - outside the ip_requirements block + String networkRole = extractValue(cpEntity, "network_role").isEmpty() ? "default-network-role" : extractValue(cpEntity, "network_role"); // set default-network-role? + addParameter("network_role", networkRole, commonParams); // can not be null + addParameter("network_role_tag", nullCheck(extractValue(cpEntity, "network_role_tag")), commonParams); + addParameter("extcp_subnetpool_id", nullCheck(extractValue(cpEntity, "subnetpoolid")), commonParams); + String subinterfaceIndicator = extractBooleanValue (cpEntity, "subinterface_indicator"); + addParameter("subinterface_indicator", subinterfaceIndicator, commonParams); // Build lists of all IPV4 and IPV6 ip_requirements elements ArrayList> ipv4PropParamsList = new ArrayList>(); ArrayList> ipv6PropParamsList = new ArrayList>(); - - if (ipPropsList != null) { - for (Map ipPropMap : ipPropsList) { - //LOG.info("ip_requirements prop map = " + nullCheck(ipPropMap)); - - String ipVersion = nullCheck(ipPropMap.get("ip_version")); - if (ipVersion == null) { - LOG.error("SdncVFCModel: ipVersion not included in ip_requirements element"); - continue; - } - - String subnetRole = nullCheck(ipPropMap.get("subnet_role")); - - if (ipVersion.contains("4")) { + + // Extract IP Version specific parameters + if (cpEntity.getProperties().containsKey("ip_requirements")) { + + ArrayList> ipPropsList = new ArrayList>(); + ipPropsList = (ArrayList>) cpEntity.getProperties().get("ip_requirements").getValue(); + + if (ipPropsList != null) { + for (Map ipPropMap : ipPropsList) { + //LOG.info("ip_requirements prop map = " + nullCheck(ipPropMap)); + + String ipVersion = nullCheck(ipPropMap.get("ip_version")); + if (ipVersion == null) { + LOG.error("SdncVFCModel: ipVersion not included in ip_requirements element"); + continue; + } - // If we have already encountered this subnetRole for IPV4, skip this ip_requirements element - if (!ipPropParamsMapContainsSubnetRole (ipv4PropParamsList, subnetRole)) { + String subnetRole = nullCheck(ipPropMap.get("subnet_role")); - Map ipv4PropParams = new HashMap(); - SdncBaseModel.addParameter("ipv4_ip_version", ipVersion, ipv4PropParams); - SdncBaseModel.addParameter("ipv4_use_dhcp", nullCheck(ipPropMap.get("dhcp_enabled")).contains("true") ? "Y" : "N", ipv4PropParams); - Map ipCountRequired = (Map)ipPropMap.get("ip_count_required"); - if (ipCountRequired != null && ipCountRequired.get("count") != null) { - SdncBaseModel.addParameter("ipv4_count", nullCheck(ipCountRequired.get("count")), ipv4PropParams); - } - Map floatingIpCountRequired = (Map)ipPropMap.get("floating_ip_count_required"); - if (floatingIpCountRequired != null && floatingIpCountRequired.get("count") != null) { - SdncBaseModel.addParameter("ipv4_floating_count", nullCheck(floatingIpCountRequired.get("count")), ipv4PropParams); - } - SdncBaseModel.addParameter("ipv4_address_plan_name", nullCheck(ipPropMap.get("ip_address_plan_name")), ipv4PropParams); - SdncBaseModel.addParameter("ipv4_vrf_name", nullCheck(ipPropMap.get("vrf_name")), ipv4PropParams); - SdncBaseModel.addParameter("subnet_role", nullCheck(ipPropMap.get("subnet_role")), ipv4PropParams); - - ipv4PropParamsList.add(ipv4PropParams); + if (ipVersion.contains("4")) { + + // If we have already encountered this subnetRole for IPV4, skip this ip_requirements element + if (!ipPropParamsMapContainsSubnetRole (ipv4PropParamsList, subnetRole)) { - } else { - LOG.error("SdncVFCModel: Additional V4 ip-requirements element encountered for this subnet_role: ", subnetRole); - } + Map ipv4PropParams = new HashMap(); + SdncBaseModel.addParameter("ipv4_ip_version", ipVersion, ipv4PropParams); + SdncBaseModel.addParameter("ipv4_use_dhcp", nullCheck(ipPropMap.get("dhcp_enabled")).contains("true") ? "Y" : "N", ipv4PropParams); + Map ipCountRequired = (Map)ipPropMap.get("ip_count_required"); + if (ipCountRequired != null && ipCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv4_count", nullCheck(ipCountRequired.get("count")), ipv4PropParams); + } + Map floatingIpCountRequired = (Map)ipPropMap.get("floating_ip_count_required"); + if (floatingIpCountRequired != null && floatingIpCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv4_floating_count", nullCheck(floatingIpCountRequired.get("count")), ipv4PropParams); + } + SdncBaseModel.addParameter("ipv4_address_plan_name", nullCheck(ipPropMap.get("ip_address_plan_name")), ipv4PropParams); + SdncBaseModel.addParameter("ipv4_vrf_name", nullCheck(ipPropMap.get("vrf_name")), ipv4PropParams); + SdncBaseModel.addParameter("subnet_role", nullCheck(ipPropMap.get("subnet_role")), ipv4PropParams); + + ipv4PropParamsList.add(ipv4PropParams); + + } else { + LOG.error("SdncVFCModel: Additional V4 ip-requirements element encountered for this subnet_role: ", subnetRole); + } - } else if (ipVersion.contains("6")) { + } else if (ipVersion.contains("6")) { - // If we have already encountered this subnetRole for IPV6, skip this ip_requirements element - if (!ipPropParamsMapContainsSubnetRole (ipv6PropParamsList, subnetRole)) { - - Map ipv6PropParams = new HashMap(); - SdncBaseModel.addParameter("ipv6_ip_version", ipVersion, ipv6PropParams); - SdncBaseModel.addParameter("ipv6_use_dhcp", nullCheck(ipPropMap.get("dhcp_enabled")).contains("true") ? "Y" : "N", ipv6PropParams); - Map ipCountRequired = (Map)ipPropMap.get("ip_count_required"); - if (ipCountRequired != null && ipCountRequired.get("count") != null) { - SdncBaseModel.addParameter("ipv6_count", nullCheck(ipCountRequired.get("count")), ipv6PropParams); - } - Map floatingIpCountRequired = (Map)ipPropMap.get("floating_ip_count_required"); - if (floatingIpCountRequired != null && floatingIpCountRequired.get("count") != null) { - SdncBaseModel.addParameter("ipv6_floating_count", nullCheck(floatingIpCountRequired.get("count")), ipv6PropParams); - } - SdncBaseModel.addParameter("ipv6_address_plan_name", nullCheck(ipPropMap.get("ip_address_plan_name")), ipv6PropParams); - SdncBaseModel.addParameter("ipv6_vrf_name", nullCheck(ipPropMap.get("vrf_name")), ipv6PropParams); - SdncBaseModel.addParameter("subnet_role", nullCheck(ipPropMap.get("subnet_role")), ipv6PropParams); + // If we have already encountered this subnetRole for IPV6, skip this ip_requirements element + if (!ipPropParamsMapContainsSubnetRole (ipv6PropParamsList, subnetRole)) { - ipv6PropParamsList.add(ipv6PropParams); - - } else { - LOG.error("SdncVFCModel: Additional V6 ip-requirements element encountered for this subnetRole: ", subnetRole); - } - - } else { - LOG.error("SdncVFCModel: invalid IP version encountered: ", ipVersion); - } - - } // for each ip-requirements element - - } // ipPropsList null check - - // After all Common and IP Version specific parameters are extracted, insert IPV4 and IPV6 data separately - // Insert IPV4 data - for (Map ipv4PropParams: ipv4PropParamsList) { - - Map mappingParams = new HashMap(); // final list for single insertion - addParamsToMap(commonParams, mappingParams); - addParamsToMap(ipv4PropParams, mappingParams); + Map ipv6PropParams = new HashMap(); + SdncBaseModel.addParameter("ipv6_ip_version", ipVersion, ipv6PropParams); + SdncBaseModel.addParameter("ipv6_use_dhcp", nullCheck(ipPropMap.get("dhcp_enabled")).contains("true") ? "Y" : "N", ipv6PropParams); + Map ipCountRequired = (Map)ipPropMap.get("ip_count_required"); + if (ipCountRequired != null && ipCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv6_count", nullCheck(ipCountRequired.get("count")), ipv6PropParams); + } + Map floatingIpCountRequired = (Map)ipPropMap.get("floating_ip_count_required"); + if (floatingIpCountRequired != null && floatingIpCountRequired.get("count") != null) { + SdncBaseModel.addParameter("ipv6_floating_count", nullCheck(floatingIpCountRequired.get("count")), ipv6PropParams); + } + SdncBaseModel.addParameter("ipv6_address_plan_name", nullCheck(ipPropMap.get("ip_address_plan_name")), ipv6PropParams); + SdncBaseModel.addParameter("ipv6_vrf_name", nullCheck(ipPropMap.get("vrf_name")), ipv6PropParams); + SdncBaseModel.addParameter("subnet_role", nullCheck(ipPropMap.get("subnet_role")), ipv6PropParams); - // Insert ipv4PropParams into VFC_TO_NETWORK_ROLE_MAPPING - try { - LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING where vfc_customization_uuid = " + getCustomizationUUID()); - addRequiredParameters(mappingParams); - insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", getCustomizationUUID(), "", mappingParams), null); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the VFC_TO_NETWORK_ROLE_MAPPING table"); - throw new IOException (e); - } - - } + ipv6PropParamsList.add(ipv6PropParams); + + } else { + LOG.error("SdncVFCModel: Additional V6 ip-requirements element encountered for this subnetRole: ", subnetRole); + } + + } else { + LOG.error("SdncVFCModel: invalid IP version encountered: ", ipVersion); + } + + } // for each ip-requirements element + + } // ipPropsList null check - // Insert IPV6 data - for (Map ipv6PropParams: ipv6PropParamsList) { - - Map mappingParams = new HashMap(); // final list for single insertion - addParamsToMap(commonParams, mappingParams); - addParamsToMap(ipv6PropParams, mappingParams); - - // Insert ipv6PropParams into VFC_TO_NETWORK_ROLE_MAPPING - try { - LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING where vfc_customization_uuid = " + getCustomizationUUID()); - addRequiredParameters(mappingParams); - insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", getCustomizationUUID(), "", mappingParams), null); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the VFC_TO_NETWORK_ROLE_MAPPING table"); - throw new IOException (e); - } + // After all Common and IP Version specific parameters are extracted, insert IPV4 and IPV6 data separately + // Insert IPV4 data + for (Map ipv4PropParams: ipv4PropParamsList) { + + Map mappingParams = new HashMap(); // final list for single insertion + addParamsToMap(commonParams, mappingParams); + addParamsToMap(ipv4PropParams, mappingParams); + + // Insert ipv4PropParams into VFC_TO_NETWORK_ROLE_MAPPING + try { + LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING where vfc_customization_uuid = " + getCustomizationUUID()); + addRequiredParameters(mappingParams); + insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", getCustomizationUUID(), "", mappingParams), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VFC_TO_NETWORK_ROLE_MAPPING table"); + throw new IOException (e); + } + + } - } - - } // Outer map loop - one per ExtCP - + // Insert IPV6 data + for (Map ipv6PropParams: ipv6PropParamsList) { + + Map mappingParams = new HashMap(); // final list for single insertion + addParamsToMap(commonParams, mappingParams); + addParamsToMap(ipv6PropParams, mappingParams); + + // Insert ipv6PropParams into VFC_TO_NETWORK_ROLE_MAPPING + try { + LOG.info("Call insertToscaData for VFC_TO_NETWORK_ROLE_MAPPING where vfc_customization_uuid = " + getCustomizationUUID()); + addRequiredParameters(mappingParams); + insertToscaData(SdncBaseModel.getSql("VFC_TO_NETWORK_ROLE_MAPPING", "vfc_customization_uuid", getCustomizationUUID(), "", mappingParams), null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VFC_TO_NETWORK_ROLE_MAPPING table"); + throw new IOException (e); + } + } + } + } } - + protected boolean ipPropParamsMapContainsSubnetRole (ArrayList> ipPropParamsList, String subnetRole) { boolean subnetRoleFound = false; @@ -281,70 +271,74 @@ public class SdncVFCModel extends SdncBaseModel { } } - public void insertVFCRelatedNetworkRoleData (String vfCustomizationUUID, NodeTemplate vfcNode) throws IOException { + public void insertVFCRelatedNetworkRoleData (String vfCustomizationUUID, IEntityDetails cvfcEntity) throws IOException { - // Get the CPs on this VFC - ASDC suggests getNodeTemplateChildren - List cpNodesList = sdcCsarHelper.getNodeTemplateChildren(vfcNode); + // Get the CPs on this VFC - using getEntity - String vfcCustomizationUuid = getCustomizationUUID(); + String vfcCustomizationUuid = getCustomizationUUID().replace("\"", ""); + // Get the CPs on this VFC - ASDC suggests getNodeTemplateChildren + //List cpNodesList = sdcCsarHelper.getNodeTemplateChildren(vfcNode); + EntityQuery entityQueryCP = EntityQuery.newBuilder(SdcTypes.CP).build(); + TopologyTemplateQuery topologyTemplateQueryVFC = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID(vfcCustomizationUuid).build(); + List cpEntities = sdcCsarHelper.getEntity(entityQueryCP, topologyTemplateQueryVFC, true); + if (cpEntities == null || cpEntities.isEmpty()) { + LOG.info("insertVFCRelatedNetworkRoleData: Could not find the nested CVFCs for: " + vfcCustomizationUuid); + return; + } try { - cleanUpExistingToscaData("VFC_RELATED_NETWORK_ROLE", "vfc_customization_uuid", vfcCustomizationUuid); + cleanUpExistingToscaData("VFC_RELATED_NETWORK_ROLE", "vfc_customization_uuid", getCustomizationUUID()); } catch (IOException e) { LOG.error("Could not clean up Tosca CSAR data in the VFC_RELATED_NETWORK_ROLE table"); throw new IOException (e); } - for (NodeTemplate cpNode : cpNodesList){ - String networkRole = extractValue(cpNode, "network_role"); + for (IEntityDetails cpEntity : cpEntities){ + String networkRole = extractValue(cpEntity, "network_role"); Map relatedNetworkRoleParams = new HashMap(); - addParameter("vfc_customization_uuid", vfcCustomizationUuid, relatedNetworkRoleParams); + addParameter("vfc_customization_uuid", getCustomizationUUID(), relatedNetworkRoleParams); addParameter("vm_type", vmType, relatedNetworkRoleParams); addParameter("network_role", networkRole, relatedNetworkRoleParams); - - final Object relatedNetworksPropertyValue = cpNode.getPropertyValue("related_networks"); - - ArrayList> relatedNetworkList = (ArrayList)relatedNetworksPropertyValue; - if (relatedNetworkList != null) { - for (Map relatedNetworkValue : relatedNetworkList) { - LOG.debug("CP [" + cpNode.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkValue.get("related_network_role")); - String relatedNetworkRoleValue = relatedNetworkValue.get("related_network_role"); - - try { - // Table cleanup for VFC_RELATED_NETWORK_ROLE occurs per vfc - // If cp related_network_role, cp network_role and vm_type for this vfc already exist in VFC_RELATED_NETWORK_ROLE, - // don't attempt insertion - Map relatedNetworkRoleParamsCheck = new HashMap(); - addParamsToMap(relatedNetworkRoleParams, relatedNetworkRoleParamsCheck); - addParameter("related_network_role", relatedNetworkRoleValue, relatedNetworkRoleParamsCheck); - if (checkForExistingToscaData("VFC_RELATED_NETWORK_ROLE", relatedNetworkRoleParamsCheck) == false) { - LOG.info("Call insertToscaData for VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = " + vfcCustomizationUuid); - insertToscaData(buildSql("VFC_RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRoleValue + "\"", model_yaml, relatedNetworkRoleParams), null); - } + + if (cpEntity.getProperties().containsKey("related_networks")) { + + Property relatedNetworksProperty = cpEntity.getProperties().get("related_networks"); + List relatedNetworkRoles = relatedNetworksProperty.getLeafPropertyValue("related_network_role"); + + for (String relatedNetworkRole : relatedNetworkRoles) { + LOG.debug("CP [" + cpEntity.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkRole); + + try { + // Table cleanup for VFC_RELATED_NETWORK_ROLE occurs per vfc + // If cp related_network_role, cp network_role and vm_type for this vfc already exist in VFC_RELATED_NETWORK_ROLE, + // don't attempt insertion + Map relatedNetworkRoleParamsCheck = new HashMap(); + addParamsToMap(relatedNetworkRoleParams, relatedNetworkRoleParamsCheck); + addParameter("related_network_role", relatedNetworkRole, relatedNetworkRoleParamsCheck); + if (checkForExistingToscaData("VFC_RELATED_NETWORK_ROLE", relatedNetworkRoleParamsCheck) == false) { + LOG.info("Call insertToscaData for VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = " + getCustomizationUUID()); + insertToscaData(buildSql("VFC_RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRole + "\"", model_yaml, relatedNetworkRoleParams), null); + } - // Table cleanup for VNF_RELATED_NETWORK_ROLE occurs per vf (up one level) - // Insert same related_network_role data into VNF_RELATED_NETWORK_ROLE - Map vfRelatedNetworkRoleParamsCheck = new HashMap(); - addParameter("vnf_customization_uuid", vfCustomizationUUID, vfRelatedNetworkRoleParamsCheck); - addParameter("network_role", networkRole, vfRelatedNetworkRoleParamsCheck); - addParameter("related_network_role", relatedNetworkRoleValue, vfRelatedNetworkRoleParamsCheck); - if (checkForExistingToscaData("VNF_RELATED_NETWORK_ROLE", vfRelatedNetworkRoleParamsCheck) == false) { - vfRelatedNetworkRoleParamsCheck.remove("related_network_role"); - LOG.info("Call insertToscaData for VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = " + vfCustomizationUUID); - insertToscaData(buildSql("VNF_RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRoleValue + "\"", model_yaml, vfRelatedNetworkRoleParamsCheck), null); - } + // Table cleanup for VNF_RELATED_NETWORK_ROLE occurs per vf (up one level) + // Insert same related_network_role data into VNF_RELATED_NETWORK_ROLE + Map vfRelatedNetworkRoleParamsCheck = new HashMap(); + addParameter("vnf_customization_uuid", vfCustomizationUUID, vfRelatedNetworkRoleParamsCheck); + addParameter("network_role", networkRole, vfRelatedNetworkRoleParamsCheck); + addParameter("related_network_role", relatedNetworkRole, vfRelatedNetworkRoleParamsCheck); + if (checkForExistingToscaData("VNF_RELATED_NETWORK_ROLE", vfRelatedNetworkRoleParamsCheck) == false) { + vfRelatedNetworkRoleParamsCheck.remove("related_network_role"); + LOG.info("Call insertToscaData for VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = " + vfCustomizationUUID); + insertToscaData(buildSql("VNF_RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRole + "\"", model_yaml, vfRelatedNetworkRoleParamsCheck), null); + } - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the VFC_RELATED_NETWORK_ROLE table"); - throw new IOException (e); - } - } - } - else { - LOG.debug("CP [" + cpNode.getName() + "], property [" + "related_networks" + "] property value: " + null); - } + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VFC_RELATED_NETWORK_ROLE table"); + throw new IOException (e); + } + } + } } - } public String getVmType() { 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 12eccf213..d6a09317a 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 @@ -22,7 +22,6 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -141,8 +140,8 @@ public class SdncVFModel extends SdncBaseModel { // Insert each VF Module group (entity) into VF_MODULE_MODEL if its name is prefixed with the VF name for (IEntityDetails vfModule : vfModules){ - // If this vfModule name is prefixed with the VF name of the VF bing processed, insert this VF Module in VF_MODULE_MODEL - String normailizedVfName = nodeTemplate.getName().toLowerCase().replace(" ", ""); + // If this vfModule name is prefixed with the VF name of the VF being processed, insert this VF Module in VF_MODULE_MODEL + String normailizedVfName = nodeTemplate.getName().toLowerCase().replace(" ", "").replace("-", ""); // need full set of normalization rules from ASDC if (!vfModule.getName().startsWith(normailizedVfName)) { continue; } @@ -169,7 +168,7 @@ public class SdncVFModel extends SdncBaseModel { .build(); List vfModulesNonCatalog = sdcCsarHelper.getEntity(entityQuery2, topologyTemplateQuery2, false); if (vfModulesNonCatalog == null || vfModulesNonCatalog.isEmpty()) { - LOG.info("insertVFModuleDataGetEntity2: Could not find the non-catelog VF Module for: " + vfModuleModel.getCustomizationUUID() + ". Unable to insert members into VF_MODULE_TO_VFC_MAPPING"); + LOG.info("insertVFModuleData: Could not find the non-catelog VF Module for: " + vfModuleModel.getCustomizationUUID() + ". Unable to insert members into VF_MODULE_TO_VFC_MAPPING"); continue; } @@ -184,10 +183,7 @@ public class SdncVFModel extends SdncBaseModel { String vfcVmType = extractValue (vfModuleMember, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); // extracted as vm_type_tag String vfcVmCount = ""; if (vfModuleMember.getProperties().containsKey("service_template_filter")) { - Property property = vfModuleMember.getProperties().get("service_template_filter"); - if (property != null && property.getLeafPropertyValue("count") != null) { - vfcVmCount = property.getLeafPropertyValue("count").get(0); - } + vfcVmCount = extractIntegerValue (vfModuleMember.getProperties().get("service_template_filter"), "count"); } if (vfcVmCount.isEmpty()) { vfcVmCount = "0"; // vm_count can not be null @@ -210,7 +206,7 @@ public class SdncVFModel extends SdncBaseModel { .build(); List nestedCvfcs = sdcCsarHelper.getEntity(entityQuery3, topologyTemplateQuery3, true); // true allows for nested search if (nestedCvfcs == null || nestedCvfcs.isEmpty()) { - LOG.info("insertVFModuleDataGetEntity2: Could not find the nested CVFCs for: " + cvfcCustomizationUuid); + LOG.info("insertVFModuleData: Could not find the nested CVFCs for: " + cvfcCustomizationUuid); continue; } @@ -221,10 +217,7 @@ public class SdncVFModel extends SdncBaseModel { String nestedVfcVmType = extractValue (nestedCvfc, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); // extracted as vm_type_tag String nestedVfcVmCount = ""; if (nestedCvfc.getProperties().containsKey("service_template_filter")) { - Property property = nestedCvfc.getProperties().get("service_template_filter"); - if (property != null && property.getLeafPropertyValue("count") != null) { - nestedVfcVmCount = property.getLeafPropertyValue("count").get(0); - } + nestedVfcVmCount = extractIntegerValue (nestedCvfc.getProperties().get("service_template_filter"), "count"); } if (nestedVfcVmCount.isEmpty()) { nestedVfcVmCount = "0"; // vm_count can not be null @@ -237,16 +230,11 @@ public class SdncVFModel extends SdncBaseModel { } catch (IOException e) { LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); throw new IOException (e); - } - - } - - } - - } - - } - + } + } + } + } // For each VF Module member + } // For each VF Module } private void insertVFtoNetworkRoleMappingData () throws IOException { @@ -259,11 +247,16 @@ public class SdncVFModel extends SdncBaseModel { throw new IOException (e); } - // For this VF, insert VF_TO_NETWORK_ROLE_MAPPING data + // For this VF, insert VF_TO_NETWORK_ROLE_MAPPING data. network_role is a property on the CPs for this VF. + // Use getEntity to extract all the CPs on this VF EntityQuery entityQueryCP = EntityQuery.newBuilder(SdcTypes.CP).build(); TopologyTemplateQuery topologyTemplateQueryVF = TopologyTemplateQuery.newBuilder(SdcTypes.VF).customizationUUID(getCustomizationUUIDNoQuotes()).build(); List cpEntities = sdcCsarHelper.getEntity(entityQueryCP, topologyTemplateQueryVF, true); - + if (cpEntities == null || cpEntities.isEmpty()) { + LOG.info("insertVFtoNetworkRoleMappingData: Could not find CPs for VF: " + getCustomizationUUIDNoQuotes()); + return; + } + for (IEntityDetails entity: cpEntities ) { Map properties = entity.getProperties(); @@ -310,21 +303,35 @@ public class SdncVFModel extends SdncBaseModel { throw new IOException (e); }*/ - // For each VF, insert VFC_MODEL data - List vfcNodes = sdcCsarHelper.getVfcListByVf(getCustomizationUUIDNoQuotes()); - for (NodeTemplate vfcNode : vfcNodes){ + // Get any CVFCs under this VF (top-level and nested) + String vfCustomizationUid = customizationUUID; + EntityQuery entityQuery = EntityQuery.newBuilder(SdcTypes.CVFC) + .build(); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF) + .customizationUUID(vfCustomizationUid) // customization UUID of the VF if exists + .build(); + List cvfcEntities = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, true); // true allows for nested search + if (cvfcEntities == null || cvfcEntities.isEmpty()) { + LOG.info("insertVFCDataEntity: Could not find the CVFCs for: " + vfCustomizationUid); + } + + for (IEntityDetails cvfcEntity: cvfcEntities) { + // Insert this CVFC data into VFC_MODEL try { - SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, vfcNode, jdbcDataSource); + + SdncVFCModel vfcModel = new SdncVFCModel(sdcCsarHelper, cvfcEntity, jdbcDataSource, config); vfcModel.insertVFCModelData(); - vfcModel.insertVFCtoNetworkRoleMappingData(vfcNode); - //vfcModel.insertVFCRelatedNetworkRoleData(getCustomizationUUID(), vfcNode); + vfcModel.insertVFCtoNetworkRoleMappingData(cvfcEntity); + //vfcModel.insertVFCRelatedNetworkRoleData(getCustomizationUUID(), cvfcEntity); + } catch (IOException e) { LOG.error("Could not insert Tosca CSAR VFC data"); throw new IOException (e); } } + } public void insertVFCInstanceGroupData () throws IOException { 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 f9a03b3f3..ef815d027 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 @@ -25,17 +25,21 @@ package org.onap.ccsdk.sli.northbound.uebclient; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; -import org.onap.sdc.toscaparser.api.Group; public class SdncVFModuleModel extends SdncBaseModel { public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails vfModule, SdncVFModel vfNodeModel) { super(sdcCsarHelper, vfModule); - // override base implementation for setting customizationUUID because customizationUUID is called differently for Groups + // override base implementation for setting metadata because properties are called differently for Groups customizationUUID = extractValue (vfModule.getMetadata(), "vfModuleModelCustomizationUUID"); + invariantUUID = extractValue (vfModule.getMetadata(), "vfModuleModelInvariantUUID"); UUID = extractValue (vfModule.getMetadata(), "vfModuleModelUUID"); + version = extractValue (vfModule.getMetadata(), "vfModuleModelVersion"); addParameter("vf_customization_uuid", vfNodeModel.getCustomizationUUIDNoQuotes()); + addParameter("invariant_uuid", invariantUUID); + addParameter("uuid", UUID); + addParameter("version", version); // extract properties addParameter("vf_module_type", extractValue(vfModule, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE)); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java index ea6499cd3..734dee229 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java @@ -7,9 +7,10 @@ import java.io.IOException; import org.junit.Before; import org.junit.Test; - import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; - import org.onap.sdc.toscaparser.api.NodeTemplate; - import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.onap.sdc.tosca.parser.api.IEntityDetails; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncARModelTest { @@ -19,8 +20,11 @@ import org.junit.Test; public void setUp() throws Exception { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); + IEntityDetails mockEntityDetails = mock(IEntityDetails.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); - testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate,mockDBResourceManager); + SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); + + testSdncARModel = new SdncARModel(mockCsarHelper,mockEntityDetails,mockDBResourceManager,mockSdncUebConfiguration); assertNotNull(testSdncARModel); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java index 469312359..768eed86c 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java @@ -10,7 +10,8 @@ import java.util.HashMap; import java.util.ArrayList; import org.junit.Before; -import org.junit.Test; +import org.junit.Test; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.elements.Metadata; @@ -20,16 +21,20 @@ public class SdncVFCModelTest { SdncVFCModel testSdncVFCModel; NodeTemplate mockVFCNodeTemplate = null; + IEntityDetails mockEntityDetails = null; @Before public void setup() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate mockNodeTemplate = mock(NodeTemplate.class); + mockEntityDetails = mock(IEntityDetails.class); mockVFCNodeTemplate = mock(NodeTemplate.class); Metadata mockMetadata = mock(Metadata.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); when(mockNodeTemplate.getMetaData()).thenReturn(mockMetadata); + when(mockEntityDetails.getMetadata()).thenReturn(mockMetadata); when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); when(mockCsarHelper.getNodeTemplatePropertyLeafValue(mockNodeTemplate, "nfc_naming_code")).thenReturn("test-nfc-naming-code"); @@ -50,9 +55,14 @@ public class SdncVFCModelTest { cpPropertiesMap.put("cp-node-1", propertiesMap); when(mockCsarHelper.getCpPropertiesFromVfcAsObject(mockVFCNodeTemplate)).thenReturn(cpPropertiesMap); - testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate, mockDBResourceManager); - testSdncVFCModel.setVmType("Test-type"); - testSdncVFCModel.setVmCount("5"); + try { + testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockEntityDetails, mockDBResourceManager, mockSdncUebConfiguration); + testSdncVFCModel.setVmType("Test-type"); + testSdncVFCModel.setVmCount("5"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } @@ -83,7 +93,7 @@ public class SdncVFCModelTest { @Test public void testInsertVFCtoNetworkRoleMappingData() { try { - testSdncVFCModel.insertVFCtoNetworkRoleMappingData(mockVFCNodeTemplate); + testSdncVFCModel.insertVFCtoNetworkRoleMappingData(mockEntityDetails); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); -- cgit 1.2.3-korg From 2d77e48e87057c595162dec4ed1e85f8db765006 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 21 Jun 2019 16:58:47 -0400 Subject: Remove versions from project poms Remove versions from project poms and instead drive version from dependencyManagement to ensure consistency. Change-Id: Ie560bcbbd37d434eb56ccfcf8a5f0bf79a9e7d9e Issue-ID: CCSDK-1416 Signed-off-by: Timoney, Dan (dt5972) --- daexim-offsite-backup/provider/pom.xml | 2 -- dataChange/provider/pom.xml | 1 - lcm/provider/pom.xml | 1 - 3 files changed, 4 deletions(-) diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index d5563ba0e..301092999 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -78,13 +78,11 @@ junit junit - 4.11 test org.mockito mockito-core - 1.10.19 test diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 0ebbcbd90..4f1c6e3bb 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -79,7 +79,6 @@ org.testng testng - 6.11 test diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index e236d0ff8..111346949 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -92,7 +92,6 @@ org.apache.derby derby - 10.12.1.1 test -- cgit 1.2.3-korg From 1ce6dbdae9d7a354ceb82e56b8d88b33753c6a5d Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Fri, 28 Jun 2019 20:31:32 +0000 Subject: Logic change for insertion in to VF_MODULE_TO_VFC_MAPPING Changes made: Update SdncVFModel.insertVFModuleData to insert only CVFCs that contain VFC. Add check for empty and string null in SdncBaseModel extractValue methods. Issue-ID: CCSDK-1442 Change-Id: I058154e2e64e7123a13be5542021e7ca0187afe0 Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncBaseModel.java | 24 ++--- .../sli/northbound/uebclient/SdncVFModel.java | 105 +++++++++++++-------- 2 files changed, 80 insertions(+), 49 deletions(-) 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 245911250..0c05b3dc8 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 @@ -691,7 +691,7 @@ public class SdncBaseModel { } protected String extractValue (IEntityDetails entityDetails, String name) { - String value = null; + String value = ""; if (entityDetails.getProperties().containsKey(name)) { Property property = entityDetails.getProperties().get(name); if (property != null && property.getValue() != null) { @@ -699,7 +699,7 @@ public class SdncBaseModel { } } - if (value != null) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value; } else { return ""; @@ -707,7 +707,7 @@ public class SdncBaseModel { } protected String extractValue (IEntityDetails entityDetails, String path, String name) { - String value = null; + String value = ""; if (entityDetails.getProperties().containsKey(path)) { Property property = entityDetails.getProperties().get(path); @@ -716,7 +716,7 @@ public class SdncBaseModel { } } - if (value != null) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value; } else { return ""; @@ -724,13 +724,13 @@ public class SdncBaseModel { } protected String extractValue (Property property, String name) { - String value = null; + String value = ""; if (!property.getLeafPropertyValue(name).isEmpty()) { value = property.getLeafPropertyValue(name).get(0); } - if (value != null) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value; } else { return ""; @@ -738,13 +738,13 @@ public class SdncBaseModel { } protected String extractBooleanValue (Property property, String name) { - String value = null; + String value = ""; if (!property.getLeafPropertyValue(name).isEmpty()) { value = property.getLeafPropertyValue(name).get(0); } - if (value != null) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value.contains("true") ? "Y" : "N"; } else { return ""; @@ -752,13 +752,13 @@ public class SdncBaseModel { } protected String extractIntegerValue (Property property, String name) { - String value = null; + String value = ""; if (!property.getLeafPropertyValue(name).isEmpty()) { value = property.getLeafPropertyValue(name).get(0); } - if (value != null && !value.isEmpty() && !value.contains("null")) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value; } else { return ""; @@ -873,7 +873,7 @@ public class SdncBaseModel { } } - if (value != null && !value.isEmpty()) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value.contains("true") ? "Y" : "N"; } else { return ""; @@ -889,7 +889,7 @@ public class SdncBaseModel { } } - if (value != null && !value.isEmpty()) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value.contains("true") ? "Y" : "N"; } else { return ""; 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 d6a09317a..ac59eafa3 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 @@ -127,11 +127,18 @@ public class SdncVFModel extends SdncBaseModel { private void insertVFModuleData () throws IOException { + // Pre-Step: Get all CVFC with VFC inside use this list to filter before insert into VF_MODULE_TO_VFC_MAPPING + // Get all VFC in all CFVC in entire model (getEntity VFC, CVFC, true) and then check resulting entity has parent that matches member + // if parent of VFC has customizationUUID that matches customizationUUID of group member, then insert into VF_MODULE_TO_VFC_MAPPING + // then get count property + EntityQuery vfcEntityQuery = EntityQuery.newBuilder(SdcTypes.VFC).build(); + TopologyTemplateQuery cvfcTopologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).build(); + List allVfcsInsideAllCvfcs = sdcCsarHelper.getEntity(vfcEntityQuery, cvfcTopologyTemplateQuery, true); + // Step 1: Get all the VF Module groups (entities) in this Service EntityQuery entityQuery = EntityQuery.newBuilder("org.openecomp.groups.VfModule").build(); String vfCustomizationUuid = getCustomizationUUIDNoQuotes(); - TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE) - .build(); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(); List vfModules = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, false); if (vfModules == null) { return; @@ -172,23 +179,27 @@ public class SdncVFModel extends SdncBaseModel { continue; } - List vfModuleMembers = vfModulesNonCatalog.get(0).getMemberNodes(); - + List vfModuleMembers = vfModulesNonCatalog.get(0).getMemberNodes(); // does getMemberNodes give nested CFVCs? + // Find all members for each VF Module that are of type CVFC and insert it and any nested CFVCs into VF_MODULE_TO_VFC_MAPPING for (IEntityDetails vfModuleMember: vfModuleMembers) { - if (vfModuleMember.getMetadata().getValue("type").equals(SdcTypes.CVFC.getValue())) { - - // Insert this CVFC data into VF_MODULE_TO_VFC_MAPPING + if (vfModuleMember.getMetadata().getValue("type").equals(SdcTypes.CVFC.getValue())) { + String cvfcCustomizationUuid = extractValue(vfModuleMember.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - String vfcVmType = extractValue (vfModuleMember, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); // extracted as vm_type_tag - String vfcVmCount = ""; + + // Additional check to see if this CVFC has a VFC in it? We only are to map CVFCs with VFC in it. + if (cvfcContainsVfc(allVfcsInsideAllCvfcs, vfModuleMember) == true) { + + // Insert this CVFC data into VF_MODULE_TO_VFC_MAPPING + String vfcVmType = extractValue (vfModuleMember, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); // extracted as vm_type_tag + String vfcVmCount = ""; if (vfModuleMember.getProperties().containsKey("service_template_filter")) { vfcVmCount = extractIntegerValue (vfModuleMember.getProperties().get("service_template_filter"), "count"); } if (vfcVmCount.isEmpty()) { vfcVmCount = "0"; // vm_count can not be null } - + try { LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + @@ -196,47 +207,67 @@ public class SdncVFModel extends SdncBaseModel { } catch (IOException e) { LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); throw new IOException (e); - } + } + } // Step 3: Get any nested CVFCs under this CVFC - EntityQuery entityQuery3 = EntityQuery.newBuilder(SdcTypes.CVFC) - .build(); - TopologyTemplateQuery topologyTemplateQuery3 = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC) - .customizationUUID(cvfcCustomizationUuid) // customization UUID of the CVFC if exists - .build(); - List nestedCvfcs = sdcCsarHelper.getEntity(entityQuery3, topologyTemplateQuery3, true); // true allows for nested search - if (nestedCvfcs == null || nestedCvfcs.isEmpty()) { - LOG.info("insertVFModuleData: Could not find the nested CVFCs for: " + cvfcCustomizationUuid); - continue; - } + EntityQuery entityQuery3 = EntityQuery.newBuilder(SdcTypes.CVFC).build(); + TopologyTemplateQuery topologyTemplateQuery3 = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC) + .customizationUUID(cvfcCustomizationUuid) // customization UUID of the CVFC if exists + .build(); + List nestedCvfcs = sdcCsarHelper.getEntity(entityQuery3, topologyTemplateQuery3, true); // true allows for nested search + if (nestedCvfcs == null || nestedCvfcs.isEmpty()) { + LOG.info("insertVFModuleData: Could not find the nested CVFCs for: " + cvfcCustomizationUuid); + continue; + } - for (IEntityDetails nestedCvfc: nestedCvfcs) { + for (IEntityDetails nestedCvfc: nestedCvfcs) { + + // Additional check to see if this CVFC has a VFC in it? We only are to map CVFCs with VFC in it. + if (cvfcContainsVfc(allVfcsInsideAllCvfcs, nestedCvfc) == false) { + continue; // continue to next CVFC + } // Insert this CVFC data into VF_MODULE_TO_VFC_MAPPING - String nestedCvfcCustomizationUuid = extractValue(nestedCvfc.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String nestedCvfcCustomizationUuid = extractValue(nestedCvfc.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); String nestedVfcVmType = extractValue (nestedCvfc, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG); // extracted as vm_type_tag String nestedVfcVmCount = ""; - if (nestedCvfc.getProperties().containsKey("service_template_filter")) { - nestedVfcVmCount = extractIntegerValue (nestedCvfc.getProperties().get("service_template_filter"), "count"); - } - if (nestedVfcVmCount.isEmpty()) { - nestedVfcVmCount = "0"; // vm_count can not be null - } + if (nestedCvfc.getProperties().containsKey("service_template_filter")) { + nestedVfcVmCount = extractIntegerValue (nestedCvfc.getProperties().get("service_template_filter"), "count"); + } + if (nestedVfcVmCount.isEmpty()) { + nestedVfcVmCount = "0"; // vm_count can not be null + } - try { - LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); - insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + - vfModuleModel.getCustomizationUUID() + ", \"" + nestedCvfcCustomizationUuid + "\", \"" + nestedVfcVmType + "\", \"" + nestedVfcVmCount + "\")", null); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); - throw new IOException (e); - } + try { + LOG.info("Call insertToscaData for VF_MODULE_TO_VFC_MAPPING where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); + insertToscaData("insert into VF_MODULE_TO_VFC_MAPPING (vf_module_customization_uuid, vfc_customization_uuid, vm_type, vm_count) values (" + + vfModuleModel.getCustomizationUUID() + ", \"" + nestedCvfcCustomizationUuid + "\", \"" + nestedVfcVmType + "\", \"" + nestedVfcVmCount + "\")", null); + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_TO_VFC_MAPPING table"); + throw new IOException (e); } + } } } // For each VF Module member } // For each VF Module } + private boolean cvfcContainsVfc (List allVfcsInsideAllCvfcs, IEntityDetails cvfcEntity) { + boolean containsVfc = false; + + for (IEntityDetails vfcEntity: allVfcsInsideAllCvfcs) { + IEntityDetails vfcParentEntity = vfcEntity.getParent(); + String parentCustomizationUuid = extractValue (vfcParentEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String cvfcEntityCustomizationUuid = extractValue (cvfcEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + if (parentCustomizationUuid == cvfcEntityCustomizationUuid) { + return true; + } + } + + return containsVfc; + } + private void insertVFtoNetworkRoleMappingData () throws IOException { // Cleanup existing VF_TO_NETWORK_ROLE_MAPPING for this VF -- cgit 1.2.3-korg From c84f0cf17122c65faad639c37028fd99e6594939 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 9 Jul 2019 15:34:57 +0000 Subject: Use getEntity to populate Policy-Related tables Changes made: Update SdncBaseModel policy data methods to use getEntity. Update SdncVFModel to call updated SdncBaseModel policy data methods. Minor changes in SdncServiceModel.java. Corresponding junit changes for getEntity migration. Issue-ID: CCSDK-1456 Change-Id: Idf000bb48896ca4c57d6d1659730e2aea7f49ec4 Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncBaseModel.java | 317 +++++++-------------- .../sli/northbound/uebclient/SdncServiceModel.java | 5 +- .../sli/northbound/uebclient/SdncUebCallback.java | 2 +- .../sli/northbound/uebclient/SdncVFModel.java | 16 +- .../northbound/uebclient/SdncServiceModelTest.java | 4 +- 5 files changed, 126 insertions(+), 218 deletions(-) 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 0c05b3dc8..27814c358 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 @@ -33,6 +33,9 @@ import javax.sql.rowset.CachedRowSet; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; +import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; +import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.CapabilityAssignment; import org.onap.sdc.toscaparser.api.CapabilityAssignments; @@ -101,10 +104,11 @@ public class SdncBaseModel { this.config = config; } - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { + public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata, DBResourceManager jdbcDataSource) { params = new HashMap(); this.sdcCsarHelper = sdcCsarHelper; + this.jdbcDataSource = jdbcDataSource; // extract service metadata invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); @@ -294,240 +298,139 @@ public class SdncBaseModel { } } - protected void insertPolicyData (NodeTemplate nodeTemplate, NodeTemplate targetNode, String policyType) throws IOException { + protected void insertEntityPolicyData (String nodeTemplateCustomizationUuid, String nodeTemplateUuid, SdcTypes queryType, String targetCustomizationUuid, String targetUuid, String targetType, String policyType) throws IOException { + + EntityQuery policyEntityQuery = EntityQuery.newBuilder(policyType).build(); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(queryType).customizationUUID(nodeTemplateCustomizationUuid).build(); + List policyEntities = sdcCsarHelper.getEntity(policyEntityQuery, topologyTemplateQuery, false); + if (policyEntities == null || policyEntities.isEmpty()) { + LOG.info("insertPolicyData: Could not find policy data for: " + nodeTemplateCustomizationUuid); + return; + } - // Get External policies of the node - List policyList = sdcCsarHelper.getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(nodeTemplate, policyType); - //List policyList2 = sdcCsarHelper.getPoliciesOfTopologyTemplateByToscaPolicyType(policyType); // returns nothing - //List policyList3 = sdcCsarHelper.getPoliciesOfTargetByToscaPolicyType(nodeTemplate, policyType); // returns nothing - String resourceUuid = getUUID(); - for (Policy policy : policyList) { + for (IEntityDetails policyEntity : policyEntities) { // extract policy metadata - String policyUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("UUID", "").toString(); - String policyInvariantUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("invariantUUID", "").toString(); - String policyCustomizationUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("customizationUUID", "").toString(); - - // cleanup existing RESOURCE_POLICY data - Map cleanupParams = new HashMap(); - addParameter("resource_uuid", resourceUuid, cleanupParams); - addParameter("policy_uuid", policyUuid, cleanupParams); - addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); - - // insert into RESOURCE_POLICY - Map policyParams = new HashMap(); - addParameter("policy_uuid", policyUuid, policyParams); - addParameter("policy_customization_uuid", policyCustomizationUuid, policyParams); - addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - addParameter("policy_name", policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_NAME_KEY, "").toString(), policyParams); - addParameter(PARAM_VERSION_KEY, policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); - addParameter("policy_type", policy.getType(), policyParams); - - // extract properties - addParameter("property_type", extractValue(policy, PARAM_TYPE_KEY), policyParams); - addParameter("property_source", extractValue(policy, "source"), policyParams); - addParameter("property_name", extractValue(policy, PARAM_NAME_KEY), policyParams); - - // Insert into RESOURCE_POLICY and RESOURCE_POLICY_TO_TARGET_NODE_MAPPING - // RESOURCE_POLICY: resource_uuid (CR node UUID), uuid, customization_uuid, invariant_uuid, name, version, policy_type, - // property_type, property_source, property_name - - try { - - // insert into RESOURCE_POLICY - cleanupExistingToscaData("RESOURCE_POLICY", cleanupParams); - LOG.info("Call insertToscaData for RESOURCE_POLICY where resource_uuid = " + resourceUuid + " and policy_uuid = " + policyUuid); - insertToscaData(buildSql("RESOURCE_POLICY", "resource_uuid", resourceUuid, model_yaml, policyParams), null); - - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY table"); - throw new IOException (e); - } - - // insert RESOURCE_POLICY_TO_TARGET_NODE_MAPPING: policy_uuid, parent_uuid (CR node UUID), target_node_uuid, target_type, table_name - try { - Map mappingCleanupParams = new HashMap(); - addParameter("policy_uuid", policyUuid, mappingCleanupParams); - addParameter("parent_uuid", nodeTemplate.getMetaData().getValue("UUID"), mappingCleanupParams); - addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingCleanupParams); - cleanupExistingToscaData("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", mappingCleanupParams); - - Map mappingParams = new HashMap(); - addParameter("parent_uuid", nodeTemplate.getMetaData().getValue("UUID"), mappingParams); - addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); - addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); - addParameter("policy_customization_uuid", policyCustomizationUuid, mappingParams); - addParameter("target_type", targetNode.getMetaData().getValue(PARAM_TYPE_KEY), mappingParams); - LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid); - insertToscaData(buildSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", model_yaml, mappingParams), null); + String policyUuid = extractValue(policyEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID); + String policyCustomizationUuid = extractValue(policyEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY_TO_TARGET_NODE_MAPPING"); - throw new IOException (e); - } + insertResourcePolicyData(policyEntity, resourceUuid); + insertResourcePolicyToTargetNodeMappingData(policyUuid, nodeTemplateUuid, targetUuid, targetCustomizationUuid, policyCustomizationUuid, targetType); } } - public static void insertPolicyData (ISdcCsarHelper sdcCsarHelper, DBResourceManager jdbcDataSource, String resourceUuid, String parentUuid, String policyType) throws IOException { + public void insertEntityPolicyData (String resourceCustomizationUuid, String resourceUuid, String parentUuid, String policyType, SdcTypes queryType) throws IOException { - // Get External policies of the node - List policyList = sdcCsarHelper.getPoliciesOfTopologyTemplateByToscaPolicyType(policyType); + EntityQuery policyEntityQuery = EntityQuery.newBuilder(policyType).build(); + TopologyTemplateQuery topologyTemplateQuery; + if (queryType == SdcTypes.VF) { + topologyTemplateQuery = TopologyTemplateQuery.newBuilder(queryType).customizationUUID(resourceCustomizationUuid).build(); + } else { + topologyTemplateQuery = TopologyTemplateQuery.newBuilder(queryType).build(); + } - for (Policy policy : policyList) { + List policyEntities = sdcCsarHelper.getEntity(policyEntityQuery, topologyTemplateQuery, false); + if (policyEntities == null || policyEntities.isEmpty()) { + LOG.info("insertPolicyData: Could not find policy data for Service/VF: " + resourceUuid); + return; + } + + for (IEntityDetails policyEntity : policyEntities) { // extract policy metadata - String policyUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("UUID", "").toString(); - String policyInvariantUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("invariantUUID", "").toString(); - - // cleanup existing RESOURCE_POLICY data - Map cleanupParams = new HashMap(); - addParameter("resource_uuid", resourceUuid, cleanupParams); - addParameter("policy_uuid", policyUuid, cleanupParams); - addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); - - // insert into RESOURCE_POLICY - Map policyParams = new HashMap(); - addParameter("policy_uuid", policyUuid, policyParams); - addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - addParameter("policy_name", policy.getMetaDataObj().getAllProperties().getOrDefault("name", "").toString(), policyParams); - addParameter("version", policy.getMetaDataObj().getAllProperties().getOrDefault("version", "").toString(), policyParams); - addParameter("policy_type", policy.getType(), policyParams); - - // extract properties - addParameter("property_type", extractValueStatic(policy, "type"), policyParams); - addParameter("property_source", extractValueStatic(policy, "source"), policyParams); - addParameter("property_name", extractValueStatic(policy, "name"), policyParams); - - try { - - // insert into RESOURCE_POLICY - SdncBaseModel.cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY", cleanupParams); - LOG.info("Call insertToscaData for RESOURCE_POLICY where resource_uuid = " + resourceUuid); - insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY", "resource_uuid", resourceUuid, "", policyParams), null); + String policyUuid = extractValue(policyEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID); + String policyCustomizationUuid = extractValue(policyEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY table"); - throw new IOException (e); - } - - // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING - List policyTargetNameList = policy.getTargets(); - if (policyTargetNameList == null) { + insertResourcePolicyData(policyEntity, resourceUuid); + List targetEntities = policyEntity.getTargetEntities(); + if (targetEntities == null || targetEntities.isEmpty()) { + LOG.info("insertPolicyData: Could not find targetEntites for policy: " + policyUuid); continue; - } - - for (String targetName : policyTargetNameList) { - NodeTemplate targetNode = sdcCsarHelper.getNodeTemplateByName(targetName); - - // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING - try { - Map mappingCleanupParams = new HashMap(); - addParameter("policy_uuid", policyUuid, mappingCleanupParams); - addParameter("parent_uuid", parentUuid, mappingCleanupParams); - addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingCleanupParams); - SdncBaseModel.cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", mappingCleanupParams); - - Map mappingParams = new HashMap(); - addParameter("parent_uuid", parentUuid, mappingParams); - addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); - addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); - addParameter("target_type", targetNode.getMetaData().getValue("type"), mappingParams); // type of the target node - LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid + " and target_node_uuid = " + targetNode.getMetaData().getValue("UUID")); - SdncBaseModel.insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", "", mappingParams), null); - - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY_TO_TARGET_NODE_MAPPING"); - throw new IOException (e); - } + } + for (IEntityDetails targetEntity : targetEntities) { + + String targetUuid = extractValue(targetEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID); + String targetCustomizationUuid = extractValue(targetEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String targetType = extractValue(targetEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_TYPE); + insertResourcePolicyToTargetNodeMappingData(policyUuid, parentUuid, targetUuid, targetCustomizationUuid, policyCustomizationUuid, targetType); } } } - protected void insertPolicyData (NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource, String parentUuid, String policyType) throws IOException { + protected void insertResourcePolicyData (IEntityDetails policyEntity, String resourceUuid) throws IOException { - // Get External policies of the node - List policyList = sdcCsarHelper.getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(nodeTemplate, policyType); - String resourceUuid = "\"" + extractValue (nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID) + "\""; + // extract policy metadata + String policyUuid = extractValue(policyEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID); + String policyInvariantUuid = extractValue(policyEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); + String policyCustomizationUuid = extractValue(policyEntity.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - for (Policy policy : policyList) { - - // extract policy metadata - String policyUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("UUID", "").toString(); - String policyInvariantUuid = policy.getMetaDataObj().getAllProperties().getOrDefault("invariantUUID", "").toString(); - - // cleanup existing RESOURCE_POLICY data - Map cleanupParams = new HashMap(); - addParameter("resource_uuid", resourceUuid, cleanupParams); - addParameter("policy_uuid", policyUuid, cleanupParams); - addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + // cleanup existing RESOURCE_POLICY data + Map cleanupParams = new HashMap(); + addParameter("resource_uuid", resourceUuid, cleanupParams); + addParameter("policy_uuid", policyUuid, cleanupParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, cleanupParams); + + // insert into RESOURCE_POLICY + Map policyParams = new HashMap(); + addParameter("policy_uuid", policyUuid, policyParams); + addParameter("policy_customization_uuid", policyCustomizationUuid, policyParams); + addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); + addParameter("policy_name", extractValue(policyEntity.getMetadata(), PARAM_NAME_KEY), policyParams); + addParameter(PARAM_VERSION_KEY, extractValue(policyEntity.getMetadata(), PARAM_VERSION_KEY), policyParams); + addParameter("policy_type", policyEntity.getToscaType(), policyParams); + + // extract properties + addParameter("property_type", extractValue(policyEntity, PARAM_TYPE_KEY), policyParams); + addParameter("property_source", extractValue(policyEntity, "source"), policyParams); + addParameter("property_name", extractValue(policyEntity, PARAM_NAME_KEY), policyParams); + + // Insert into RESOURCE_POLICY and RESOURCE_POLICY_TO_TARGET_NODE_MAPPING + // RESOURCE_POLICY: resource_uuid (CR node UUID), uuid, customization_uuid, invariant_uuid, name, version, policy_type, + // property_type, property_source, property_name + + try { // insert into RESOURCE_POLICY - Map policyParams = new HashMap(); - addParameter("policy_uuid", policyUuid, policyParams); - addParameter("policy_invariant_uuid", policyInvariantUuid, policyParams); - String policyName = policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_NAME_KEY, "").toString(); - addParameter("policy_name", policyName, policyParams); - addParameter(PARAM_VERSION_KEY, policy.getMetaDataObj().getAllProperties().getOrDefault(PARAM_VERSION_KEY, "").toString(), policyParams); - addParameter("policy_type", policy.getType(), policyParams); - - // extract properties - addParameter("property_type", extractValue(policy, PARAM_TYPE_KEY), policyParams); - addParameter("property_source", extractValue(policy, "source"), policyParams); - addParameter("property_name", extractValue(policy, PARAM_NAME_KEY), policyParams); - - try { - - // insert into RESOURCE_POLICY - cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY", cleanupParams); - LOG.info("Call insertToscaData for RESOURCE_POLICY where resource_uuid = " + resourceUuid); - insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY", "resource_uuid", resourceUuid, "", policyParams), null); + cleanupExistingToscaData("RESOURCE_POLICY", cleanupParams); + LOG.info("Call insertToscaData for RESOURCE_POLICY where resource_uuid = " + resourceUuid + " and policy_uuid = " + "\"" + policyUuid + "\"" ); + insertToscaData(buildSql("RESOURCE_POLICY", "resource_uuid", resourceUuid, model_yaml, policyParams), null); - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY table"); - throw new IOException (e); - } - - // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING - List targetNodeList = sdcCsarHelper.getPolicyTargetsFromOrigin(nodeTemplate, policyName); - if (targetNodeList == null) { - continue; - } - - for (NodeTemplate targetNode : targetNodeList) { - //NodeTemplate targetNode = sdcCsarHelper.getNodeTemplateByName(targetName); - if (targetNode == null) { - LOG.error("Target node for policy " + policyName + " is NULL. Can't insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING"); - continue; - } - - // insert into RESOURCE_POLICY_TO_TARGET_NODE_MAPPING - try { - Map mappingCleanupParams = new HashMap(); - addParameter("policy_uuid", policyUuid, mappingCleanupParams); - addParameter("parent_uuid", parentUuid, mappingCleanupParams); - addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingCleanupParams); - SdncBaseModel.cleanupExistingToscaData(jdbcDataSource, "RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", mappingCleanupParams); - - Map mappingParams = new HashMap(); - addParameter("parent_uuid", parentUuid, mappingParams); - addParameter("target_node_uuid", targetNode.getMetaData().getValue("UUID"), mappingParams); - addParameter("target_node_customization_uuid", targetNode.getMetaData().getValue("customizationUUID"), mappingParams); - addParameter("target_type", targetNode.getMetaData().getValue(PARAM_TYPE_KEY), mappingParams); // type of the target node - LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + policyUuid + " and target_node_uuid = " + targetNode.getMetaData().getValue("UUID")); - SdncBaseModel.insertToscaData(jdbcDataSource, getSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", "", mappingParams), null); - - } catch (IOException e) { - LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY_TO_TARGET_NODE_MAPPING table"); - throw new IOException (e); - } - - } + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY table"); + throw new IOException (e); } + } + protected void insertResourcePolicyToTargetNodeMappingData(String policyUuid, String parentUuid, String targetUuid, String targetCustomizationUuid, String policyCustomizationUuid, String targetType) throws IOException { + + // insert RESOURCE_POLICY_TO_TARGET_NODE_MAPPING: policy_uuid, parent_uuid (CR node UUID), target_node_uuid, target_type, table_name + try { + Map mappingCleanupParams = new HashMap(); + addParameter("policy_uuid", policyUuid, mappingCleanupParams); + addParameter("parent_uuid", parentUuid, mappingCleanupParams); + addParameter("target_node_uuid", targetUuid, mappingCleanupParams); + cleanupExistingToscaData("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", mappingCleanupParams); + + Map mappingParams = new HashMap(); + addParameter("parent_uuid", parentUuid, mappingParams); + addParameter("target_node_uuid", targetUuid, mappingParams); + addParameter("target_node_customization_uuid", targetCustomizationUuid, mappingParams); + addParameter("policy_customization_uuid", policyCustomizationUuid, mappingParams); + addParameter("target_type", targetType, mappingParams); + LOG.info("Call insertToscaData for RESOURCE_POLICY_TO_TARGET_NODE_MAPPING where policy_uuid = " + "\"" + policyUuid + "\" and parent_uuid = " + "\"" + parentUuid + "\" and target_node_uuid = " + "\"" + targetUuid + "\""); + insertToscaData(buildSql("RESOURCE_POLICY_TO_TARGET_NODE_MAPPING", "policy_uuid", "\"" + policyUuid + "\"", model_yaml, mappingParams), null); + + } catch (IOException e) { + LOG.error("Could not insert Tosca CSAR data into the RESOURCE_POLICY_TO_TARGET_NODE_MAPPING"); + throw new IOException (e); + } + } + + protected void insertNodeCapabilitiesData (CapabilityAssignments capabilities) throws IOException { // Process the capabilities on the node template 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 4bed2fe76..52e38624a 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 @@ -21,6 +21,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.elements.Metadata; @@ -35,9 +36,9 @@ public class SdncServiceModel extends SdncBaseModel { private String serviceInstanceNamePrefix = null; private String filename = null; - public SdncServiceModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) { + public SdncServiceModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata, DBResourceManager jdbcDataSource) { - super(sdcCsarHelper, metadata); + super(sdcCsarHelper, metadata, jdbcDataSource); UUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_UUID); 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 95672ea5f..d39622621 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 @@ -689,7 +689,7 @@ public class SdncUebCallback implements INotificationCallback { // Ingest Service Data - 1707 Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata(); - SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata); + SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata, jdbcDataSource); serviceModel.setFilename(spoolFile.toString().substring(spoolFile.toString().lastIndexOf("/")+1)); // will be csar file name serviceModel.setServiceInstanceNamePrefix(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).substring(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).lastIndexOf(".")+1)); 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 ac59eafa3..750cb72a3 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 @@ -385,7 +385,9 @@ public class SdncVFModel extends SdncBaseModel { List targetNodeList = group.getMemberNodes(); for (NodeTemplate targetNode : targetNodeList) { - String targetNodeUuid = targetNode.getMetaData().getValue("UUID"); + String targetNodeUuid = extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID); + String targetNodeCustomizationUuid = extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String targetNodeType = extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_TYPE); // insert RESOURCE_GROUP_TO_TARGET_NODE_MAPPING try { @@ -398,10 +400,9 @@ public class SdncVFModel extends SdncBaseModel { Map mappingParams = new HashMap(); addParameter("parent_uuid", getUUID(), mappingParams); addParameter("target_node_uuid", targetNodeUuid, mappingParams); - String targetType = extractValue(targetNode.getMetaData(), "type"); - addParameter("target_type", targetType, mappingParams); + addParameter("target_type", targetNodeType, mappingParams); String tableName = ""; - switch (targetType) { + switch (targetNodeType) { case "CVFC": tableName = "VFC_MODEL"; break; @@ -417,8 +418,9 @@ public class SdncVFModel extends SdncBaseModel { throw new IOException (e); } - // For each target node, get External policies - insertPolicyData(nodeTemplate, targetNode, "org.openecomp.policies.External"); + // For each target node, get External policies + SdcTypes queryType = SdcTypes.valueOf(extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_TYPE)); + insertEntityPolicyData(getCustomizationUUIDNoQuotes(), getUUID().replace("\"", ""), queryType, targetNodeCustomizationUuid, targetNodeUuid, targetNodeType, "org.openecomp.policies.External"); // AFTER getEntity } } } @@ -426,7 +428,7 @@ public class SdncVFModel extends SdncBaseModel { private void insertVFPolicyData() throws IOException { // For each VF node, ingest External Policy data - insertPolicyData (nodeTemplate, jdbcDataSource, serviceUUID, "org.openecomp.policies.External"); + insertEntityPolicyData (getCustomizationUUIDNoQuotes(), getUUID(), serviceUUID.replace("\"", ""), "org.openecomp.policies.External", SdcTypes.VF); } public String getVendor() { diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java index 95f5a75ec..af17e2291 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java @@ -7,6 +7,7 @@ import java.io.IOException; import org.junit.Before; import org.junit.Test; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.elements.Metadata; @@ -17,13 +18,14 @@ import org.onap.sdc.toscaparser.api.elements.Metadata; @Before public void setUp() throws Exception { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); Metadata mockMetadata = mock(Metadata.class); when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "UUID")).thenReturn("aaaa-bbbb-cccc-dddd"); when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "invariantUUID")).thenReturn("bbbb-cccc-dddd-eeee"); when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "namingPolicy")).thenReturn("test-naming-policy"); - testSdncServiceModel = new SdncServiceModel(mockCsarHelper,mockMetadata); + testSdncServiceModel = new SdncServiceModel(mockCsarHelper,mockMetadata,mockDBResourceManager); assertNotNull(testSdncServiceModel); } -- cgit 1.2.3-korg From 9110d07f3c8e373fb1d8fef2884304aed8556a6c Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 12 Jul 2019 08:33:25 -0400 Subject: Add Brinda as committer Added Brinda as committer to INFO.yaml Change-Id: Ib6b19318eb9837306ea7f27589b44b8d2e2be327 Issue-ID: CCSDK-1480 Signed-off-by: Timoney, Dan (dt5972) --- INFO.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/INFO.yaml b/INFO.yaml index b352a5be2..6545b24ad 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -22,7 +22,7 @@ realtime_discussion: '' meetings: - type: 'zoom' agenda: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project' - url: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project#CommonControllerSDKProject-MeetingMinutes' + url: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project' server: 'n/a' channel: 'n/a' repeats: 'weekly' @@ -44,6 +44,11 @@ committers: company: 'Huawei' id: 'agrawalgaurav' timezone: 'Asia/Kolkata' + - name: 'Brinda Santh Muthuramalingam' + email: 'brindasanth@in.ibm.com' + company: 'IBM' + id: 'brindasanthm' + timezone: 'America/New York' repositories: - ccsdk-apps - ccsdk-cds @@ -64,8 +69,9 @@ tsc: - type: 'Deletion' name: 'Ryan Goulding' link: 'https://lists.onap.org/g/onap-tsc/message/4261' - changes: - type: 'Addition' name: 'Gaurav Agrawal' link: 'https://lists.onap.org/g/onap-tsc/message/4324' - + - type: 'Addition' + name: 'Brinda Santh Muthuramalingam' + link: 'https://lists.onap.org/g/onap-tsc/message/5208' -- cgit 1.2.3-korg From 18551cc0bf09a0c0443e3f96cb01c1b4743e7a40 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 17 Jul 2019 11:00:02 -0400 Subject: Update parent version to 1.3.1 Update parent poms to version 1.3.1-SNAPSHOT Change-Id: Ia53c92b56e16cdef8a82927513e4ce6cf24862e0 Issue-ID: CCSDK-1496 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/pom.xml | 2 +- daexim-offsite-backup/installer/pom.xml | 2 +- daexim-offsite-backup/model/pom.xml | 2 +- daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index dfa35f405..95adfa3fb 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index d3ba70ce3..76814c0e5 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 65191b77c..6a0af748b 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index dee99361d..2b37fa363 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 15e5bd4fe..ff870be56 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index dfc5ce7e3..70ba14589 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index c4055964a..e170341df 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 6ba7a5c95..9295b3ecc 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 1716eba8d..9ed8d2812 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index 65bbf7d55..92858ef9e 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 0f2827cb3..9be977c55 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 8d856529b..ba9644dc8 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index f6bb8c9aa..8aa844482 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index a2f864b64..685577229 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 301092999..cf71caa8a 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index a6f57f91d..3b071b912 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 882831e49..e5a9f04c7 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 940617e94..cf4f3881a 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 0f3ea6364..88f0f59fc 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index c20f07337..e801ba33a 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 75caf3ebe..96cfba7db 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 4f1c6e3bb..ee04ce501 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 500121378..fc9df6e34 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 94623a981..97aa31080 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index aa07657f8..b5eb43eae 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 250d3f8ce..969121d59 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/features/pom.xml b/features/pom.xml index 7d4eca129..b2a528d99 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 1bb6a37eb..9b21ca015 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 2499b9923..067fc351a 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 02eda542f..9090200a3 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index db3cf5fa2..264582bb8 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 77c8b959c..0d07359eb 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/lcm/pom.xml b/lcm/pom.xml index 1098fd6f0..0bf9bed10 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 111346949..df4701964 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index e8e5c4950..c03cfdf43 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index f219f5238..97d88a4cd 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From 9f93347d67850bc68072216a3dc8448c83c0d214 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Mon, 22 Jul 2019 14:08:24 +0000 Subject: Use getEntity to populate Group-Related tables Changes made: Convert SdncGroupModel to entity. Convert SdncVFModel.insertVFCInstanceGroupData to entity. Corresponding SdncBaseModel changes for getEntity migration. Corresponding junit changes for getEntity migration. Issue-ID: CCSDK-1501 Change-Id: I8a8938dc1b1e7bf37212799277aef60ffff5edb1 Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncBaseModel.java | 86 +++++++++++++++++++--- .../sli/northbound/uebclient/SdncGroupModel.java | 18 +++-- .../sli/northbound/uebclient/SdncVFModel.java | 26 ++++--- .../northbound/uebclient/SdncGroupModelTest.java | 3 +- 4 files changed, 108 insertions(+), 25 deletions(-) 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 27814c358..84918ab10 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 @@ -250,12 +250,18 @@ public class SdncBaseModel { protected void insertGroupData (NodeTemplate nodeTemplate, NodeTemplate targetNode, String groupType) throws IOException { - // Get the NetworkCollection groups of the node - Map groupParams = new HashMap(); - List groupList = sdcCsarHelper.getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate, groupType); - //List groupList2 = sdcCsarHelper.getGroupsOfTopologyTemplateByToscaGroupType(groupType); // returns nothing + // Get the Groups on a node - Convert to use getEntity in 19.08 + EntityQuery entityQuery = EntityQuery.newBuilder(groupType).build(); + String customizationUuid = getCustomizationUUIDNoQuotes(); + SdcTypes nodeTemplateSdcType = SdcTypes.valueOf(extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_TYPE)); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(nodeTemplateSdcType) + .customizationUUID(customizationUuid).build(); + List groupList = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, false); + if (groupList == null) { + return; + } - for (Group group : groupList) { + for (IEntityDetails group : groupList){ // Insert into RESOURCE_GROUP/ATTRIBUTE_VALUE_PAIR and RESOURCE_GROUP_TO_TARGET_NODE_MAPPING // RESOURCE_GROUP (group metadata): resource_uuid (CR node UUID), uuid, customization_uuid, invariant_uuid, name, version @@ -269,13 +275,13 @@ public class SdncBaseModel { try { Map mappingCleanupParams = new HashMap(); addParameter("group_uuid", groupModel.getUUID(), mappingCleanupParams); - addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), "UUID"), mappingCleanupParams); - addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), "UUID"), mappingCleanupParams); + addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingCleanupParams); + addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingCleanupParams); cleanupExistingToscaData("RESOURCE_GROUP_TO_TARGET_NODE_MAPPING", mappingCleanupParams); Map mappingParams = new HashMap(); - addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), "UUID"), mappingParams); - addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), "UUID"), mappingParams); + addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingParams); + addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingParams); String targetType = extractValue(targetNode.getMetaData(), PARAM_TYPE_KEY); addParameter("target_type", targetType, mappingParams); String tableName = ""; @@ -495,6 +501,68 @@ public class SdncBaseModel { } } + protected void insertNodeCapabilitiesEntityData (Map capabilities) throws IOException { + + // Process the capabilities + for (Map.Entry entry : capabilities.entrySet()) { + CapabilityAssignment capability = entry.getValue(); + + // Insert into NODE_CAPABILITY: + // capability_id (generated) + // capability_provider_uuid - UUID of this node + // capability_provider_customization_uuid - customization UUID of this node + // capability_name - capability.getName() + // capability_type - ? + + // Check capability name against relevant capabilities + boolean capabilityIsRelevant = false; + /*List relevantCapabilities = config.getRelevantCapabilityNames(); + for (String relevantCapabilityName : relevantCapabilities ) { + + if (capability.getName().toLowerCase().contains(relevantCapabilityName.toLowerCase())) { + capabilityIsRelevant = true; + } + }*/ + + if (capabilityIsRelevant == false){ + continue; + } + + String capabilityProviderUuid = getUUID(); + + Map cleanupParams = new HashMap(); + addParameter("capability_provider_uuid", capabilityProviderUuid, cleanupParams); // node customization UUID + addParameter("capability_provider_customization_uuid", getCustomizationUUIDNoQuotes(), cleanupParams); // node customization UUID + addParameter("capability_name", capability.getName(), cleanupParams); + + Map nodeCapabilityParams = new HashMap(); + addParameter("capability_provider_customization_uuid", getCustomizationUUIDNoQuotes(), nodeCapabilityParams); // node customization UUID + addParameter("capability_name", capability.getName(), nodeCapabilityParams); + addParameter("capability_type", extractValue(capability, PARAM_TYPE_KEY), nodeCapabilityParams); + + // Insert NODE_CAPABILITY data for each capability + String capabilityId = ""; + try { + + cleanupExistingToscaData("NODE_CAPABILITY", cleanupParams); // will also delete NODE_CAPABILITY_PROPERTY with same capability_id + LOG.info("Call insertToscaData for NODE_CAPABILITY where capability_provider_uuid = " + capabilityProviderUuid + " and capability_name = " + capability.getName()); + insertToscaData(buildSql("NODE_CAPABILITY", "capability_provider_uuid", capabilityProviderUuid, model_yaml, nodeCapabilityParams), null); + + // Get capabilityId for capability just inserted + CachedRowSet rowData = getToscaData("NODE_CAPABILITY", nodeCapabilityParams); + rowData.first(); + int capabilityIdint = rowData.getInt("capability_id"); + capabilityId = capabilityId.valueOf(capabilityIdint); + + } catch (IOException | SQLException e) { + LOG.error("Could not insert Tosca CSAR data into the NODE_CAPABILITY table"); + throw new IOException (e); + } + + insertNodeCapabilityPropertyData (capability, capabilityId); + } + } + protected void insertNodeCapabilityPropertyData(CapabilityAssignment capability, String capabilityId) throws IOException { // Insert property name / value into NODE_CAPABILITY_PROPERTY diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java index dedaa9a2a..268590feb 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java @@ -25,6 +25,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.Group; import org.onap.sdc.toscaparser.api.NodeTemplate; @@ -39,28 +40,33 @@ public class SdncGroupModel extends SdncBaseModel { private static final String groupType = "group_type"; - public SdncGroupModel(ISdcCsarHelper sdcCsarHelper, Group group, NodeTemplate nodeTemplate, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { + public SdncGroupModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails group, NodeTemplate nodeTemplate, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { super(sdcCsarHelper, group); // Metadata for Resource group is not extracted in base class due to inconsistency in TOSCA model Group object Metadata metadata = group.getMetadata(); + params.remove("invariant_uuid"); // remove invariant_uuid which is added by base class, it does not apply for groups invariantUUID = extractValue (metadata, "invariantUUID"); addParameter("group_invariant_uuid", invariantUUID); + params.remove("uuid"); // remove uuid which is added by base class, it does not apply for groups UUID = extractValue (metadata, "UUID"); addParameter("group_uuid", UUID); addParameter("group_name", extractValue (metadata, "name")); - addParameter(groupType, group.getType()); + addParameter(groupType, group.getToscaType()); addParameter("version", extractValue (metadata, "version")); // extract properties addParameter("vfc_parent_port_role", extractValue(group, "vfc_parent_port_role"), attributeValueParams); addParameter("subinterface_role", extractValue(group, "subinterface_role"), attributeValueParams); - // relevant complex group properties are extracted and inserted into ATTRIBUTE_VALUE_PAIR - addParameter(extractGetInputName (group, groupType), extractGetInputValue(group, nodeTemplate, groupType), attributeValueParams); - addParameter(extractGetInputName (group, "group_role"), extractGetInputValue(group, nodeTemplate, "group_role"), attributeValueParams); - addParameter(extractGetInputName (group, "group_function"), extractGetInputValue(group, nodeTemplate, "group_function"), attributeValueParams); + // relevant complex group properties are extracted and inserted into ATTRIBUTE_VALUE_PAIR + String extractedGroupType = extractValue (group, groupType); + String extractedGroupRole = extractValue (group, "group_role"); + String extractedGroupFunction = extractValue (group, "group_function"); + addParameter(groupType, extractedGroupType, attributeValueParams); + addParameter("group_role", extractedGroupRole, attributeValueParams); + addParameter("group_function", extractedGroupFunction, attributeValueParams); } public void insertGroupData(NodeTemplate resourceNodeTemplate) throws IOException { 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 750cb72a3..2b2d078f7 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 @@ -370,24 +370,32 @@ public class SdncVFModel extends SdncBaseModel { // Insert Group data in RESOURCE_GROUP // Store group capabilities and capability properties in NODE_CAPABILITY and NODE_CAPABILITY_PROPERTY table - // For each VF, insert CFVC data - 1806 - List vfcInstanceGroupListForVf = sdcCsarHelper.getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate, "org.openecomp.groups.VfcInstanceGroup"); - for (Group group : vfcInstanceGroupListForVf){ + // For each VF, insert VFC Instance Group data (convert to use getEntity in 19.08) + EntityQuery entityQuery = EntityQuery.newBuilder("org.openecomp.groups.VfcInstanceGroup").build(); + String vfCustomizationUuid = getCustomizationUUIDNoQuotes(); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF) + .customizationUUID(vfCustomizationUuid).build(); + List vfcInstanceGroupListForVf = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, false); + if (vfcInstanceGroupListForVf == null) { + return; + } + + for (IEntityDetails group : vfcInstanceGroupListForVf){ SdncGroupModel groupModel = new SdncGroupModel (sdcCsarHelper, group, nodeTemplate, config, jdbcDataSource); groupModel.insertGroupData(nodeTemplate); // For each group, populate NODE_CAPABILITY/NODE_CAPABILITY_PROPERTY - insertNodeCapabilitiesData(group.getCapabilities()); + insertNodeCapabilitiesEntityData(group.getCapabilities()); // Store relationship between VfcInstanceGroup and node-type=VFC in RESOURCE_GROUP_TO_TARGET_NODE_MAPPING table // target is each VFC in targets section of group - List targetNodeList = group.getMemberNodes(); - for (NodeTemplate targetNode : targetNodeList) { + List targetNodeList = group.getMemberNodes(); + for (IEntityDetails targetNode : targetNodeList) { - String targetNodeUuid = extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID); - String targetNodeCustomizationUuid = extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - String targetNodeType = extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_TYPE); + String targetNodeUuid = extractValue(targetNode.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID); + String targetNodeCustomizationUuid = extractValue(targetNode.getMetadata(), SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String targetNodeType = extractValue(targetNode.getMetadata(), SdcPropertyNames.PROPERTY_NAME_TYPE); // insert RESOURCE_GROUP_TO_TARGET_NODE_MAPPING try { diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java index 0c6030b44..8bf3c9145 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java @@ -6,6 +6,7 @@ import static org.mockito.Mockito.*; import java.io.IOException; import org.junit.Test; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.Group; @@ -17,7 +18,7 @@ import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public void testSdncGroupModelConstructor() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); - Group group = mock(Group.class); + IEntityDetails group = mock(IEntityDetails.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); SdncGroupModel testSdncGroupModel = null; -- cgit 1.2.3-korg From 47a2c99bdeeefd34172d2b4a2cb7170b1c81bd67 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Thu, 1 Aug 2019 09:13:34 -0500 Subject: OOFPCIPPOC DMAAP listener bug fix DMAAP listener code change to refer to the correct YANG RPC leaf node Issue-ID: CCSDK-1565 Signed-off-by: SandeepLinux Change-Id: Id8afb807bf281125e522f86079a877184271ca51 --- .../dmaapclient/OofPciPocDmaapConsumers.java | 108 ++++++++++----------- 1 file changed, 54 insertions(+), 54 deletions(-) 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 7037d8848..9d78e8acf 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 @@ -57,17 +57,17 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { private static final String MODIFY_CONFIG = "ModifyConfig"; private static final String DATA = "data"; private static final String FAP_SERVICE = "FAPService"; - + private static final String PAYLOAD = "Payload"; private static final String PCI_CHANGES_MAP_FILE_NAME = "pci-changes-from-policy-to-sdnr"; 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 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"; @@ -137,31 +137,31 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { 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") @@ -174,21 +174,21 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { .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").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); - + 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(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT+"lte-cell-number-of-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(); @@ -196,29 +196,29 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { writer.flush(); return writer.toString(); - + }else { throw new InvalidMessageException("nbrListInUse is not of Type Array. Could not read neighbor list elements"); } - + } - + 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) @@ -231,14 +231,14 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { .put(STRING_VALUE, dataNode.get(DATA).get(FAP_SERVICE).get(X0005b9Lte).get("pnfName").toString().replace(ESCAPE_SEQUENCE_QUOTES, EMPTY))); 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(); @@ -246,11 +246,11 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { writer.flush(); return writer.toString(); - + }else { throw new InvalidMessageException("Configurations is not of Type Array. Could not read configuration changes"); } - + } @Override @@ -267,31 +267,31 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { } catch (Exception e) { throw new InvalidMessageException("Cannot parse json object", e); } - + JsonNode rpcnameNode = dmaapMessageRootNode.get(RPC_NAME); if(rpcnameNode == null) { LOG.info("Unable to identify the respective consumer to invoke. Please verify the dmaap message.."); return; } - + String rpcname = rpcnameNode.textValue(); - + if(!MODIFY_CONFIG.toLowerCase().equals(rpcname) && !MODIFY_CONFIG_ANR.toLowerCase().equals(rpcname)) { LOG.info("Unknown rpc name {}", rpcname); return; } - + if(MODIFY_CONFIG.toLowerCase().equals(rpcname)) { invokePCIChangesConsumer(dmaapMessageRootNode, oMapper, msg); return; } - + if(MODIFY_CONFIG_ANR.toLowerCase().equals(rpcname)) { invokeANRChangesConsumer(dmaapMessageRootNode, oMapper, msg); return; } - + } private void invokeANRChangesConsumer(JsonNode dmaapMessageRootNode, ObjectMapper oMapper, @@ -301,24 +301,24 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { 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."); @@ -326,12 +326,12 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { } String payloadText = payload.asText(); - + if(!payloadText.contains(CONFIGURATIONS)) { LOG.info("Missing configurations node."); return; } - + JsonNode configurationsJsonNode; try { configurationsJsonNode = oMapper.readTree(payloadText); @@ -354,9 +354,9 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { 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) { @@ -377,24 +377,24 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { 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."); @@ -402,12 +402,12 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { } String configurations = payload.asText(); - + if(!configurations.contains(CONFIGURATIONS)) { LOG.info("Missing configurations node."); return; } - + JsonNode configurationsJsonNode; try { configurationsJsonNode = oMapper.readTree(configurations); @@ -430,7 +430,7 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { throw new InvalidMessageException("No SDNC template known for message "); } String templateName = fieldMap.get(TEMPLATE); - + buildAndInvokePCIChangesRPC(sdncEndpoint, templateName, msg, configurationsJsonNode); } @@ -452,7 +452,7 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { LOG.error("Unable to process message", e); } } - + private void buildAndInvokeANRChangesRPC(String sdncEndpoint, String templateName, String msg, JsonNode configurationsOrDataNode) { try { String rpcMsgbody = publish(templateName, msg, configurationsOrDataNode, false, true); -- cgit 1.2.3-korg From 5f9d3faad6a139578cb1c9b1c76f7bb5282cbe79 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 2 Aug 2019 16:03:20 -0400 Subject: Release sli/northbound 0.5.0 Release sli/northbound version 0.5.0 Change-Id: I54243f8d05b3cfa9896f5b4b4745ca952086c5e3 Issue-ID: CCSDK-1563 Signed-off-by: Timoney, Dan (dt5972) --- releases/0.5.0.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/0.5.0.yaml diff --git a/releases/0.5.0.yaml b/releases/0.5.0.yaml new file mode 100644 index 000000000..89e429e5d --- /dev/null +++ b/releases/0.5.0.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '0.5.0' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/161/' -- cgit 1.2.3-korg From e48d419ff3348af068aa2e72e283b0fed0cb5108 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 6 Aug 2019 11:02:42 -0400 Subject: Roll version to recreate artifacts Roll version to 0.5.1 to recreate El Alto early drop artifacts Change-Id: I0b516ccc051ca5a08414c653b7631716fafa987e Issue-ID: CCSDK-1563 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- .../features/features-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 6 +++--- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 6 +++--- version.properties | 2 +- 37 files changed, 75 insertions(+), 75 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 95adfa3fb..1ca2f7276 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.1-SNAPSHOT + 1.3.2 diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 76814c0e5..5cb47d9c5 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 6a0af748b..4c0762b59 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound features-asdcApi - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 2b37fa363..37929d871 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound asdcApi-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index ff870be56..70b8ad896 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound asdcApi-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 70ba14589..5c11f7fe1 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound asdcApi-model - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index e170341df..7909602c2 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound asdcApi - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 9295b3ecc..fff19f630 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound asdcApi-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 9ed8d2812..6e5e39854 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index 92858ef9e..fa5fce035 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound features-daexim-offsite-backup - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 9be977c55..904aa5a06 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index ba9644dc8..3b48a5356 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 8aa844482..b842ee670 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 685577229..a2c624e8e 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index cf71caa8a..e91fc6b11 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 3b071b912..7aca371c2 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index e5a9f04c7..a55235507 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound features-dataChange - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index cf4f3881a..b9652a11b 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound dataChange-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 88f0f59fc..c778296f2 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound dataChange-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index e801ba33a..5aa0825b1 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound dataChange-model - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 96cfba7db..a8def686e 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound dataChange - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index ee04ce501..db1f3aff3 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound dataChange-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index fc9df6e34..a6c6cdfe8 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound dmaap-listener - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener @@ -24,7 +24,7 @@ ${maven.build.timestamp} ${project.version}-${build.number} - 0.5.0-SNAPSHOT + ${project.version} ${project.version} diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 97aa31080..0835eff1d 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index b5eb43eae..e2cb8cf00 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound features-sli-northbound - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 969121d59..fa17f17c2 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index b2a528d99..d20d77be4 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 9b21ca015..1bc3a1e77 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 067fc351a..54315d1cf 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound features-lcm - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 9090200a3..f177a06a8 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound lcm-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 264582bb8..3625134c8 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound lcm-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 0d07359eb..f79e5718b 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound lcm-model - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 0bf9bed10..b9d1a770a 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound lcm - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index df4701964..7734d929c 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound lcm-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index c03cfdf43..120548d9b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 4.0.0 @@ -104,7 +104,7 @@ ONAP - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 97d88a4cd..e31603106 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.northbound ueb-listener - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener @@ -22,7 +22,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - 0.5.0-SNAPSHOT + ${project.version} ${project.version} diff --git a/version.properties b/version.properties index 3e36988ca..71ba554ca 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=5 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From c0c9d433434dde14d68c5a8b5816b5371677dc24 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 7 Aug 2019 16:10:49 -0400 Subject: Release CCSDK version 0.5.1 Release version 0.5.1 of CCSDK artifacts Change-Id: I237973c3af1a22c4ed512f2f1b45d6c3fd4449ad Issue-ID: CCSDK-1563 Signed-off-by: Timoney, Dan (dt5972) --- releases/0.5.1.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/0.5.1.yaml diff --git a/releases/0.5.1.yaml b/releases/0.5.1.yaml new file mode 100644 index 000000000..0f10908d4 --- /dev/null +++ b/releases/0.5.1.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '0.5.1' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/167/' -- cgit 1.2.3-korg From 3f336cecddbc7adf45489e0d4a0b1b19deeee1ef Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Wed, 7 Aug 2019 19:59:04 +0000 Subject: Use getEntity to populate Complex Resource-Related tables Changes made: Clean up in SdncBaseModel for unused methods. Fixes in SdncGroupModel. Convert SdncNodeModel to entity. Corrected logging in SdncVFCModel. Corresponding Group-related and logging fixes in SdncVFModel. Corresponding SdncBaseModel changes for getEntity migration. Corresponding junit changes for getEntity migration. Issue-ID: CCSDK-1578 Change-Id: Ic7f7ec38325aeddcad2d86c8f8425ec825512714 Signed-off-by: lalena.aria --- artifacts/pom.xml | 4 +- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 +- asdcApi/features/features-asdcApi/pom.xml | 4 +- asdcApi/features/pom.xml | 4 +- asdcApi/installer/pom.xml | 4 +- asdcApi/model/pom.xml | 4 +- asdcApi/pom.xml | 4 +- asdcApi/provider/pom.xml | 4 +- .../features/ccsdk-daexim-offsite-backup/pom.xml | 4 +- .../features-daexim-offsite-backup/pom.xml | 4 +- daexim-offsite-backup/features/pom.xml | 4 +- daexim-offsite-backup/installer/pom.xml | 4 +- daexim-offsite-backup/model/pom.xml | 4 +- daexim-offsite-backup/pom.xml | 4 +- daexim-offsite-backup/provider/pom.xml | 4 +- dataChange/features/ccsdk-dataChange/pom.xml | 4 +- dataChange/features/features-dataChange/pom.xml | 4 +- dataChange/features/pom.xml | 4 +- dataChange/installer/pom.xml | 4 +- dataChange/model/pom.xml | 4 +- dataChange/pom.xml | 4 +- dataChange/provider/pom.xml | 4 +- dmaap-listener/pom.xml | 4 +- features/ccsdk-sli-northbound-all/pom.xml | 4 +- features/features-sli-northbound/pom.xml | 4 +- features/installer/pom.xml | 4 +- features/pom.xml | 4 +- lcm/features/ccsdk-lcm/pom.xml | 4 +- lcm/features/features-lcm/pom.xml | 4 +- lcm/features/pom.xml | 4 +- lcm/installer/pom.xml | 4 +- lcm/model/pom.xml | 4 +- lcm/pom.xml | 4 +- lcm/provider/pom.xml | 4 +- pom.xml | 4 +- ueb-listener/pom.xml | 4 +- .../sli/northbound/uebclient/SdncBaseModel.java | 281 ++++++--------------- .../sli/northbound/uebclient/SdncGroupModel.java | 24 +- .../sli/northbound/uebclient/SdncNodeModel.java | 126 ++++----- .../sli/northbound/uebclient/SdncUebCallback.java | 24 +- .../sli/northbound/uebclient/SdncVFCModel.java | 4 +- .../sli/northbound/uebclient/SdncVFModel.java | 25 +- .../northbound/uebclient/SdncGroupModelTest.java | 6 +- .../northbound/uebclient/SdncNodeModelTest.java | 18 +- .../northbound/uebclient/TestSdncUebCallback.java | 152 +++++++++++ .../src/test/resources/ueb-listener.properties | 3 +- version.properties | 2 +- 47 files changed, 428 insertions(+), 381 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 1ca2f7276..42eeb71f6 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.2 + 1.3.3-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 5cb47d9c5..be3dee2b5 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 4c0762b59..2917abd74 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 37929d871..6f6ac13f6 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 70b8ad896..33af1bd52 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 5c11f7fe1..a5bb371c6 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 7909602c2..d00afcb41 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index fff19f630..34f65285f 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 6e5e39854..d54eb208a 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index fa5fce035..632cad587 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-daexim-offsite-backup - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 904aa5a06..d23a039c1 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 3b48a5356..d58467bb0 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index b842ee670..e0702fee5 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index a2c624e8e..34e4e1953 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index e91fc6b11..49bd6e7ec 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 7aca371c2..635cbe5f7 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index a55235507..5a50ef10a 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index b9652a11b..d4fab812c 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index c778296f2..d3e7cb2b4 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 5aa0825b1..57a8a8774 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index a8def686e..1419661b2 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index db1f3aff3..204e9158a 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index a6c6cdfe8..d07f8111d 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 0835eff1d..c5c1b914c 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index e2cb8cf00..fce265bbe 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index fa17f17c2..46bdfdf3f 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index d20d77be4..486ff093c 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 1bc3a1e77..cd80fb34d 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 54315d1cf..cb7126187 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index f177a06a8..b59d2b92c 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 3625134c8..3966c9d2f 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index f79e5718b..6f41820c3 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index b9d1a770a..455beb899 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 7734d929c..def00a9b3 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 120548d9b..76ad8082c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT 4.0.0 @@ -104,7 +104,7 @@ ONAP - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index e31603106..63b849ec6 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener 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 84918ab10..d3fef173f 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 @@ -77,10 +77,6 @@ public class SdncBaseModel { protected NodeTemplate nodeTemplate = null; protected IEntityDetails entityDetails = null; - public SdncBaseModel(DBResourceManager jdbcDataSource) { - this.jdbcDataSource = jdbcDataSource; - } - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) { this (sdcCsarHelper, nodeTemplate); this.sdcCsarHelper = sdcCsarHelper; @@ -159,28 +155,7 @@ public class SdncBaseModel { addParameter(PARAM_UUID_KEY, UUID); addParameter(PARAM_VERSION_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); } - - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { - this (sdcCsarHelper, group); - this.sdcCsarHelper = sdcCsarHelper; - this.config = config; - this.jdbcDataSource = jdbcDataSource; - } - - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) { - - params = new HashMap(); - this.sdcCsarHelper = sdcCsarHelper; - attributeValueParams = new HashMap(); - // extract group metadata - Metadata metadata = group.getMetadata(); - //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null - customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID"); - addParameter(PARAM_INVARIANT_UUID_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); - addParameter(PARAM_UUID_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); - addParameter(PARAM_VERSION_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); - } /* This is the generic approach Shoujit attempted for 18.06 but can't be implemented without parser API to * get properties with substring match on the name @@ -238,7 +213,7 @@ public class SdncBaseModel { addParameter("resource_type", metadataType, attributeParams); addParameter("resource_customization_uuid", getCustomizationUUID(), attributeParams); - LOG.info("Call insertToscaData for ATTRIBUTE_VALUE_PAIR where resource_uuid = " + getUUID() + " and attriubute_name = " + paramName); + LOG.info("Call insertToscaData for ATTRIBUTE_VALUE_PAIR where resource_uuid = " + getUUID() + " and attribute_name = \"" + paramName + "\""); try { insertToscaData(buildSql("ATTRIBUTE_VALUE_PAIR", "resource_uuid", getUUID(), model_yaml, attributeParams), null); } catch (IOException e) { @@ -248,13 +223,13 @@ public class SdncBaseModel { } } - protected void insertGroupData (NodeTemplate nodeTemplate, NodeTemplate targetNode, String groupType) throws IOException { + protected void insertEntityGroupData (IEntityDetails entityDetails, IEntityDetails targetNode, String groupType) throws IOException { // Get the Groups on a node - Convert to use getEntity in 19.08 EntityQuery entityQuery = EntityQuery.newBuilder(groupType).build(); String customizationUuid = getCustomizationUUIDNoQuotes(); - SdcTypes nodeTemplateSdcType = SdcTypes.valueOf(extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_TYPE)); - TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(nodeTemplateSdcType) + SdcTypes entitySdcType = SdcTypes.valueOf(extractValue(entityDetails.getMetadata(), SdcPropertyNames.PROPERTY_NAME_TYPE)); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(entitySdcType) .customizationUUID(customizationUuid).build(); List groupList = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, false); if (groupList == null) { @@ -268,21 +243,22 @@ public class SdncBaseModel { // ATTRIBUTE_VALUE_PAIR (group properties): group_type, group_role, group_function // RESOURCE_GROUP_TO_TARGET_NODE_MAPPING: group_uuid, parent_uuid (CR node UUID), target_node_uuid, target_type, table_name - SdncGroupModel groupModel = new SdncGroupModel (sdcCsarHelper, group, nodeTemplate, config, jdbcDataSource); - groupModel.insertGroupData(nodeTemplate); + SdncGroupModel groupModel = new SdncGroupModel (sdcCsarHelper, group, entityDetails, config, jdbcDataSource); + String resourceUuid = getUUID(); + groupModel.insertGroupData(resourceUuid); // insert RESOURCE_GROUP_TO_TARGET_NODE_MAPPING try { Map mappingCleanupParams = new HashMap(); addParameter("group_uuid", groupModel.getUUID(), mappingCleanupParams); - addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingCleanupParams); - addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingCleanupParams); + addParameter("parent_uuid", extractValue(entityDetails.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingCleanupParams); + addParameter("target_node_uuid", extractValue(targetNode.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingCleanupParams); cleanupExistingToscaData("RESOURCE_GROUP_TO_TARGET_NODE_MAPPING", mappingCleanupParams); Map mappingParams = new HashMap(); - addParameter("parent_uuid", extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingParams); - addParameter("target_node_uuid", extractValue(targetNode.getMetaData(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingParams); - String targetType = extractValue(targetNode.getMetaData(), PARAM_TYPE_KEY); + addParameter("parent_uuid", extractValue(entityDetails.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingParams); + addParameter("target_node_uuid", extractValue(targetNode.getMetadata(), SdcPropertyNames.PROPERTY_NAME_UUID), mappingParams); + String targetType = extractValue(targetNode.getMetadata(), PARAM_TYPE_KEY); addParameter("target_type", targetType, mappingParams); String tableName = ""; switch (targetType) { @@ -310,7 +286,7 @@ public class SdncBaseModel { TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(queryType).customizationUUID(nodeTemplateCustomizationUuid).build(); List policyEntities = sdcCsarHelper.getEntity(policyEntityQuery, topologyTemplateQuery, false); if (policyEntities == null || policyEntities.isEmpty()) { - LOG.info("insertPolicyData: Could not find policy data for: " + nodeTemplateCustomizationUuid); + LOG.debug("insertPolicyData: Could not find policy data for: " + nodeTemplateCustomizationUuid); return; } @@ -339,7 +315,7 @@ public class SdncBaseModel { List policyEntities = sdcCsarHelper.getEntity(policyEntityQuery, topologyTemplateQuery, false); if (policyEntities == null || policyEntities.isEmpty()) { - LOG.info("insertPolicyData: Could not find policy data for Service/VF: " + resourceUuid); + LOG.debug("insertPolicyData: Could not find policy data for Service/VF: " + resourceUuid); return; } @@ -352,7 +328,7 @@ public class SdncBaseModel { insertResourcePolicyData(policyEntity, resourceUuid); List targetEntities = policyEntity.getTargetEntities(); if (targetEntities == null || targetEntities.isEmpty()) { - LOG.info("insertPolicyData: Could not find targetEntites for policy: " + policyUuid); + LOG.debug("insertPolicyData: Could not find targetEntites for policy: " + policyUuid); continue; } @@ -483,7 +459,7 @@ public class SdncBaseModel { try { cleanupExistingToscaData("NODE_CAPABILITY", cleanupParams); // will also delete NODE_CAPABILITY_PROPERTY with same capability_id - LOG.info("Call insertToscaData for NODE_CAPABILITY where capability_provider_uuid = " + capabilityProviderUuid + " and capability_name = " + capability.getName()); + LOG.info("Call insertToscaData for NODE_CAPABILITY where capability_provider_uuid = " + capabilityProviderUuid + " and capability_name = \"" + capability.getName() + "\""); insertToscaData(buildSql("NODE_CAPABILITY", "capability_provider_uuid", capabilityProviderUuid, model_yaml, nodeCapabilityParams), null); // Get capabilityId for capability just inserted @@ -545,7 +521,7 @@ public class SdncBaseModel { try { cleanupExistingToscaData("NODE_CAPABILITY", cleanupParams); // will also delete NODE_CAPABILITY_PROPERTY with same capability_id - LOG.info("Call insertToscaData for NODE_CAPABILITY where capability_provider_uuid = " + capabilityProviderUuid + " and capability_name = " + capability.getName()); + LOG.info("Call insertToscaData for NODE_CAPABILITY where capability_provider_uuid = " + capabilityProviderUuid + " and capability_name = \"" + capability.getName()+ "\""); insertToscaData(buildSql("NODE_CAPABILITY", "capability_provider_uuid", capabilityProviderUuid, model_yaml, nodeCapabilityParams), null); // Get capabilityId for capability just inserted @@ -578,7 +554,7 @@ public class SdncBaseModel { try { // Data from NODE_CAPABILITY_PROPERTY is cleaned up via cascade delete on NODE_CAPABILITY - LOG.info("Call insertToscaData for NODE_CAPABILITY_PROPERTY where capability_id = " + capabilityId + " and property_name = " + property.getName() + ", property_value: " + property.getValue().toString()); + LOG.info("Call insertToscaData for NODE_CAPABILITY_PROPERTY where capability_id = \"" + capabilityId + "\" and capability_property_name = \"" + property.getName() + "\" and capability_property_type = \"" + property.getValue().toString() + "\""); insertToscaData(buildSql("NODE_CAPABILITY_PROPERTY", "capability_id", capabilityId, model_yaml, nodeCapabilityPropertyParams), null); } catch (IOException e) { LOG.error("Could not insert Tosca CSAR data into the NODE_CAPABILITY_PROPERTY table"); @@ -605,12 +581,6 @@ public class SdncBaseModel { } } - public static void addIntParameter (String name, String value, Map params) { - if (value != null && !value.isEmpty()) { - params.put(name, value); - } - } - public static void addParameter (String name, String value, Map params) { if (value != null && !value.isEmpty()) { // remove any quotes within the string @@ -682,7 +652,7 @@ public class SdncBaseModel { if (entityDetails.getProperties().containsKey(path)) { Property property = entityDetails.getProperties().get(path); - if (property != null && property.getLeafPropertyValue(name) != null) { + if (property != null && !property.getLeafPropertyValue(name).isEmpty()) { value = property.getLeafPropertyValue(name).get(0); } } @@ -693,34 +663,49 @@ public class SdncBaseModel { return ""; } } - - protected String extractValue (Property property, String name) { + + protected String extractValue (IEntityDetails entityDetails, String path1, String path2, String name) { String value = ""; - if (!property.getLeafPropertyValue(name).isEmpty()) { - value = property.getLeafPropertyValue(name).get(0); - } - + value = extractNestedValue (entityDetails, path1, path2, name); + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value; } else { return ""; } } - - protected String extractBooleanValue (Property property, String name) { + + protected String extractBooleanValue (IEntityDetails entityDetails, String path1, String path2, String name) { String value = ""; - if (!property.getLeafPropertyValue(name).isEmpty()) { - value = property.getLeafPropertyValue(name).get(0); - } + value = extractNestedValue (entityDetails, path1, path2, name); - if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { + if (value != null && !value.isEmpty()) { return value.contains("true") ? "Y" : "N"; } else { return ""; } } + + protected String extractNestedValue (IEntityDetails entityDetails, String path1, String path2, String name) { + String value = ""; + + if (entityDetails.getProperties().containsKey(path1)) { + Property path1Property = entityDetails.getProperties().get(path1); + if (path1Property != null) { + Map path1PropertyValue = (Map) path1Property.getValue(); + if (path1PropertyValue.containsKey(path2)) { + Map path2PropertyValue = (Map) path1PropertyValue.get(path2); + if (path2PropertyValue != null && path2PropertyValue.containsKey(name)) { + value = path2PropertyValue.get(name).toString(); + } + } + } + } + + return value; + } protected String extractIntegerValue (Property property, String name) { String value = ""; @@ -735,35 +720,48 @@ public class SdncBaseModel { return ""; } } + + protected String extractGetInputValue (IEntityDetails group, IEntityDetails entityDetails, String name) { - protected String extractGetInputValue (Group group, NodeTemplate nodeTemplate, String name) { - - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (group, name)); - if (value != null) { - return value; + // Extract the property on entityDetails after getting the property name from the group + String getInputName = extractGetInputName (group, name); + String entityPropertyValue = ""; + + if (entityDetails.getProperties().containsKey(getInputName)) { + Property entityProperty = entityDetails.getProperties().get(getInputName); + entityPropertyValue = entityProperty.getValue().toString(); + } + + if (!entityPropertyValue.isEmpty()) { + return entityPropertyValue; } else { return ""; } } - protected String extractGetInputName (Group group, String name) { + protected String extractGetInputName (IEntityDetails group, String name) { String getInputName = name; - String groupProperty = sdcCsarHelper.getGroupPropertyLeafValue(group, name); - if (groupProperty != null) { - int getInputIndex = groupProperty.indexOf("{get_input="); + String groupPropertyValue = ""; + if (group.getProperties().containsKey(name)) { + Property groupProperty = group.getProperties().get(name); + groupPropertyValue = groupProperty.getValue().toString(); + } + if (!groupPropertyValue.isEmpty()) { + int getInputIndex = groupPropertyValue.indexOf("{get_input="); if (getInputIndex > -1) { - getInputName = groupProperty.substring(getInputIndex+11, groupProperty.length()-1); + getInputName = groupPropertyValue.substring(getInputIndex+11, groupPropertyValue.length()-1); } } return getInputName; } - - protected String extractGetInputValue (Policy policy, NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (policy, name)); + // Remove this after migrate SdncVFModel to getEntity + protected String extractGetInputValue (Group group, NodeTemplate nodeTemplate, String name) { + + String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (group, name)); if (value != null) { return value; } else { @@ -771,13 +769,12 @@ public class SdncBaseModel { } } - protected String extractGetInputName (Policy policy, String name) { + // Remove this after migrate SdncVFModel to getEntity + protected String extractGetInputName (Group group, String name) { String getInputName = name; - //String groupProperty = sdcCsarHelper.getPolicyPropertyLeafValue(policy, name); - Map propMap = policy.getPolicyProperties(); - String groupProperty = nullCheck(propMap.get(name)); - if (!groupProperty.isEmpty()) { + String groupProperty = sdcCsarHelper.getGroupPropertyLeafValue(group, name); + if (groupProperty != null) { int getInputIndex = groupProperty.indexOf("{get_input="); if (getInputIndex > -1) { getInputName = groupProperty.substring(getInputIndex+11, groupProperty.length()-1); @@ -787,36 +784,7 @@ public class SdncBaseModel { return getInputName; } - - protected String extractValue (Policy policy, String name) { - - Map propMap = policy.getPolicyProperties(); - if (propMap == null) { - return ""; - } else { - return nullCheck(propMap.get(name)); - } - } - - protected static String extractValueStatic (Policy policy, String name) { - - Map propMap = policy.getPolicyProperties(); - if (propMap == null) { - return ""; - } else { - return nullCheckStatic(propMap.get(name)); - } - } - - public static String extractValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); - if (value != null) { - return value; - } else { - return ""; - } - } - + protected String extractValue (CapabilityAssignment capability, String name) { String value = sdcCsarHelper.getCapabilityPropertyLeafValue(capability, name); if (value != null) { @@ -855,8 +823,10 @@ public class SdncBaseModel { String value = null; if (entityDetails.getProperties().containsKey(path)) { Property property = entityDetails.getProperties().get(path); - if (property != null && property.getLeafPropertyValue(name) != null) { - value = property.getLeafPropertyValue(name).get(0); + if (property != null) { + if (property != null && !property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } } } @@ -867,15 +837,6 @@ public class SdncBaseModel { } } - public static String extractBooleanValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - protected Object extractObjectValue (NodeTemplate nodeTemplate, String name) { Object value = sdcCsarHelper.getNodeTemplatePropertyValueAsObject(nodeTemplate, name); if (value != null) { @@ -885,60 +846,6 @@ public class SdncBaseModel { } } - protected String extractValue (Group group, String name) { - String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); - if (value != null) { - return value; - } else { - return ""; - } - } - - protected String extractBooleanValue (Group group, String name) { - String value = sdcCsarHelper.getGroupPropertyLeafValue(group, name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - - protected String extractInputDefaultValue (String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null) { - return value; - } else { - return ""; - } - } - - protected String extractBooleanInputDefaultValue (String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - - public static String extractInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null) { - return value; - } else { - return ""; - } - } - - public static String extractBooleanInputDefaultValue (ISdcCsarHelper sdcCsarHelper, String name) { - String value = sdcCsarHelper.getServiceInputLeafValueOfDefault(name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } - public static String extractSubstitutionMappingTypeName (ISdcCsarHelper sdcCsarHelper) { String value = sdcCsarHelper.getServiceSubstitutionMappingsTypeName(); if (value != null) { @@ -1058,21 +965,6 @@ public class SdncBaseModel { throw new IOException (e); } - } - - protected static void insertToscaData(DBResourceManager jdbcDataSource, String toscaDataString, ArrayList arguments) throws IOException - { - LOG.debug("insertToscaData: " + toscaDataString); - - try { - - jdbcDataSource.writeData(toscaDataString, arguments, null); - - } catch (SQLException e) { - LOG.error("Could not insert Tosca data into the database"); - throw new IOException (e); - } - } protected void cleanUpExistingToscaData(String tableName, String keyName, String keyValue) throws IOException @@ -1188,7 +1080,7 @@ public class SdncBaseModel { rowCount ++; } if (rowCount != 0) { - LOG.info("checkForExistingToscaData in " + tableName + ": Data FOUND"); + LOG.debug("checkForExistingToscaData in " + tableName + ": Data FOUND"); dataExists = true; } @@ -1233,6 +1125,7 @@ public class SdncBaseModel { return data; } + protected void addParamsToMap (Map fromMap, Map toMap) { for (String key : fromMap.keySet()) { if (!toMap.containsKey(key)) { @@ -1249,12 +1142,4 @@ public class SdncBaseModel { return stringValue; } - protected static String nullCheckStatic (Object extractedObject) { - String stringValue = ""; - if (extractedObject != null) { - return extractedObject.toString(); - } - return stringValue; - } - } diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java index 268590feb..622936652 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModel.java @@ -27,8 +27,6 @@ import java.io.IOException; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.Group; -import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,7 +38,7 @@ public class SdncGroupModel extends SdncBaseModel { private static final String groupType = "group_type"; - public SdncGroupModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails group, NodeTemplate nodeTemplate, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { + public SdncGroupModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails group, IEntityDetails entityDetails, SdncUebConfiguration config, DBResourceManager jdbcDataSource) throws IOException { super(sdcCsarHelper, group); @@ -60,24 +58,20 @@ public class SdncGroupModel extends SdncBaseModel { addParameter("vfc_parent_port_role", extractValue(group, "vfc_parent_port_role"), attributeValueParams); addParameter("subinterface_role", extractValue(group, "subinterface_role"), attributeValueParams); - // relevant complex group properties are extracted and inserted into ATTRIBUTE_VALUE_PAIR - String extractedGroupType = extractValue (group, groupType); - String extractedGroupRole = extractValue (group, "group_role"); - String extractedGroupFunction = extractValue (group, "group_function"); - addParameter(groupType, extractedGroupType, attributeValueParams); - addParameter("group_role", extractedGroupRole, attributeValueParams); - addParameter("group_function", extractedGroupFunction, attributeValueParams); + // relevant complex group properties are extracted and inserted into ATTRIBUTE_VALUE_PAIR + addParameter(extractGetInputName (group, groupType), extractGetInputValue(group, entityDetails, groupType), attributeValueParams); + addParameter(extractGetInputName (group, "group_role"), extractGetInputValue(group, entityDetails, "group_role"), attributeValueParams); + addParameter(extractGetInputName (group, "group_function"), extractGetInputValue(group, entityDetails, "group_function"), attributeValueParams); } - public void insertGroupData(NodeTemplate resourceNodeTemplate) throws IOException { + public void insertGroupData(String resourceUuid) throws IOException { try { // insert into RESOURCE_GROUP/ATTRIBUTE_VALUE_PAIR - String resourceNodeUuid = "\"" + extractValue (resourceNodeTemplate.getMetaData(), "UUID") + "\""; - cleanUpExistingToscaData("RESOURCE_GROUP", "resource_uuid", resourceNodeUuid, "group_uuid", getUUID()) ; - LOG.info("Call insertToscaData for RESOURCE_GROUP where group_uuid = " + getUUID() + " and resource_uuid = " + resourceNodeUuid); - insertToscaData(buildSql("RESOURCE_GROUP", "resource_uuid", resourceNodeUuid, model_yaml, params), null); + cleanUpExistingToscaData("RESOURCE_GROUP", "resource_uuid", resourceUuid, "group_uuid", getUUID()) ; + LOG.info("Call insertToscaData for RESOURCE_GROUP where group_uuid = " + getUUID() + " and resource_uuid = " + resourceUuid); + insertToscaData(buildSql("RESOURCE_GROUP", "resource_uuid", resourceUuid, model_yaml, params), null); insertRelevantAttributeData("group"); } catch (IOException e) { 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 4870f29e3..cf81b3cae 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 @@ -24,11 +24,13 @@ package org.onap.ccsdk.sli.northbound.uebclient; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; -import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.Property; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,59 +45,53 @@ public class SdncNodeModel extends SdncBaseModel { private String [] bindingUuids = null; // Using ASDC TOSCA Parser 17.07 - public SdncNodeModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) { + public SdncNodeModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails nodeEntity, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { - super(sdcCsarHelper, nodeTemplate, jdbcDataSource); + super(sdcCsarHelper, nodeEntity, jdbcDataSource, config); - // extract inpuecompGeneratedNamingts - String ecompGeneratedNaming = extractBooleanInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_ECOMPGENERATEDNAMING); - addParameter("ecomp_generated_naming",ecompGeneratedNaming); - addParameter("naming_policy", extractInputDefaultValue(SdcPropertyNames.PROPERTY_NAME_SERVICENAMING_DEFAULT_NAMINGPOLICY)); - // extract properties - addParameter("network_type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)); - addParameter("network_role", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)); - addParameter("network_scope", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)); - addParameter("network_technology", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)); + addParameter("ecomp_generated_naming", extractBooleanValue (nodeEntity, "exVL_naming", "ecomp_generated_naming")); // should be extractBooleanValue? + addParameter("naming_policy", extractValue (nodeEntity, "exVL_naming", "naming_policy")); + + addParameter("network_type", extractValue (nodeEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)); + addParameter("network_role", extractValue (nodeEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)); + addParameter("network_scope", extractValue (nodeEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)); + addParameter("network_technology", extractValue (nodeEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)); // extract properties - network_assignments - addParameter("is_shared_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISSHAREDNETWORK)); - addParameter("is_external_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_ISEXTERNALNETWORK)); - String trunkNetworkIndicator = extractBooleanValue(nodeTemplate, "network_assignments#is_trunked"); + addParameter("is_shared_network", extractBooleanValue (nodeEntity, "network_assignments", "is_shared_network")); + addParameter("is_external_network", extractBooleanValue (nodeEntity, "network_assignments", "is_external_network")); + String trunkNetworkIndicator = extractBooleanValue(nodeEntity, "network_assignments", "is_trunked"); addParameter("trunk_network_indicator", trunkNetworkIndicator); // extract properties - network_assignments - ipv4_subnet_default_assignment - String useIpv4 = extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#use_ipv4"); + String useIpv4 = extractBooleanValue(nodeEntity, "network_assignments", "use_ipv4"); addParameter("use_ipv4", useIpv4); - addParameter("ipv4_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#dhcp_enabled")); - if (useIpv4.contains("Y")) { - addParameter("ipv4_ip_version", "ipv4"); - } - addParameter("ipv4_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#cidr_mask")); - addParameter("eipam_v4_address_plan", extractValue(nodeTemplate, "network_assignments#ipv4_subnet_default_assignment#ip_network_address_plan")); + addParameter("ipv4_dhcp_enabled", extractBooleanValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "dhcp_enabled")); + addParameter("ipv4_ip_version", extractValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "ip_version")); + addParameter("ipv4_cidr_mask", extractValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "cidr_mask")); + addParameter("eipam_v4_address_plan", extractValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "ip_network_address_plan")); // extract properties - network_assignments - ipv6_subnet_default_assignment - String useIpv6 = extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#use_ipv6"); + String useIpv6 = extractBooleanValue(nodeEntity, "network_assignments", "use_ipv6"); addParameter("use_ipv6", useIpv6); - addParameter("ipv6_dhcp_enabled", extractBooleanValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#dhcp_enabled")); - if (useIpv6.contains("Y")) { - addParameter("ipv6_ip_version", "ipv6"); - } - addParameter("ipv6_cidr_mask", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#cidr_mask")); - addParameter("eipam_v6_address_plan", extractValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignment#ip_network_address_plan")); + addParameter("ipv6_dhcp_enabled", extractBooleanValue(nodeEntity, "network_assignments", "ipv6_subnet_default_assignment", "dhcp_enabled")); + addParameter("ipv6_ip_version", extractValue(nodeEntity, "network_assignments", "ipv6_subnet_default_assignment", "ip_version")); + addParameter("ipv6_cidr_mask", extractValue(nodeEntity, "network_assignments", "ipv6_subnet_default_assignment", "cidr_mask")); + addParameter("eipam_v6_address_plan", extractValue(nodeEntity, "network_assignments", "ipv6_subnet_default_assignment", "ip_network_address_plan")); // extract properties - provider_network - addParameter("is_provider_network", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK)); - addParameter("physical_network_name", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_PHYSICALNETWORKNAME)); + addParameter("is_provider_network", extractBooleanValue (nodeEntity, "provider_network", "is_provider_network")); + addParameter("physical_network_name", extractValue(nodeEntity, "provider_network", "physical_network_name")); // extract properties - network_flows - addParameter("is_bound_to_vpn", extractBooleanValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_ISBOUNDTOVPN)); + addParameter("is_bound_to_vpn", extractBooleanValue (nodeEntity, "network_flows", "is_bound_to_vpn")); // extract properties - network_flows - vpn_bindings - String vpnBindingString = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKFLOWS_VPNBINDING); + String vpnBindingString = extractValue (nodeEntity, "network_flows", "vpn_binding"); bindingUuids = vpnBindingString.split(","); -} + } public String getServiceUUID() { return serviceUUID; @@ -113,13 +109,24 @@ public class SdncNodeModel extends SdncBaseModel { params.put("ecomp_generated_naming", "\"" + ecompGeneratedNaming + "\""); } } + public void setComplexResourceUUID(String complexResourceUuid) { + if (complexResourceUuid != null && !complexResourceUuid.isEmpty()) { + params.put("complex_resource_uuid", complexResourceUuid); + } + } + + public void setComplexResourceCustomizationUUID(String complexResourceCustomizationUuid) { + if (complexResourceCustomizationUuid != null && !complexResourceCustomizationUuid.isEmpty()) { + params.put("complex_resource_customization_uuid", complexResourceCustomizationUuid); + } + } public void insertNetworkModelData () throws IOException { try { // Clean up NETWORK_MODEL data for this customization_uuid and service_uuid? cleanUpExistingToscaData("NETWORK_MODEL", "customization_uuid", getCustomizationUUID()); cleanUpExistingToscaData("VPN_BINDINGS", "network_customization_uuid", getCustomizationUUID()); - LOG.info("Call insertToscaData for NETWORK_MODEL customizationUUID = " + getCustomizationUUID()); + LOG.info("Call insertToscaData for NETWORK_MODEL where customization_uuid = " + getCustomizationUUID()); insertToscaData(getSql(model_yaml), null); insertToscaData(getVpnBindingsSql(), null); } catch (IOException e) { @@ -127,48 +134,47 @@ public class SdncNodeModel extends SdncBaseModel { throw new IOException (e); } } - + public void insertRelatedNetworkRoleData () throws IOException { - Object propertyValue = sdcCsarHelper.getNodeTemplatePropertyValueAsObject(nodeTemplate, "network_assignments#related_networks"); - ArrayList> relatedNetworkList = (ArrayList)propertyValue; - - String networkModelCustomizationUUID = getCustomizationUUID(); + if (entityDetails.getProperties().containsKey("related_networks")) { + + Property relatedNetworksProperty = entityDetails.getProperties().get("related_networks"); + List relatedNetworkRoles = relatedNetworksProperty.getLeafPropertyValue("related_network_role"); + + String networkModelCustomizationUUID = getCustomizationUUID(); - if (relatedNetworkList != null) { - - try { - cleanUpExistingToscaData("RELATED_NETWORK_ROLE", "network_model_customization_uuid", networkModelCustomizationUUID); - } catch (IOException e) { - LOG.error("Could not clean up Tosca CSAR data in the RELATED_NETWORK_ROLE table"); - throw new IOException (e); - } - - for (Map relatedNetworkValue : relatedNetworkList) { - LOG.debug("Node Template [" + nodeTemplate.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkValue.get("related_network_role")); + try { + cleanUpExistingToscaData("RELATED_NETWORK_ROLE", "network_model_customization_uuid", networkModelCustomizationUUID); + } catch (IOException e) { + LOG.error("Could not clean up Tosca CSAR data in the RELATED_NETWORK_ROLE table"); + throw new IOException (e); + } + + for (String relatedNetworkRole : relatedNetworkRoles) { + + LOG.debug("Node Template [" + entityDetails.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkRole); - String relatedNetworkRoleValue = relatedNetworkValue.get("related_network_role"); - try { // Table cleanup RELATED_NETWORK_ROLE occurs per network // If related_network_role for this service already exist in RELATED_NETWORK_ROLE, don't attempt insertion Map relatedNetworkRoleParamsCheck = new HashMap(); - addParameter("related_network_role", relatedNetworkRoleValue, relatedNetworkRoleParamsCheck); + addParameter("related_network_role", relatedNetworkRole, relatedNetworkRoleParamsCheck); addParameter("network_model_customization_uuid", networkModelCustomizationUUID, relatedNetworkRoleParamsCheck); if (checkForExistingToscaData("RELATED_NETWORK_ROLE", relatedNetworkRoleParamsCheck) == false) { relatedNetworkRoleParamsCheck.remove("related_network_role"); LOG.info("Call insertToscaData for RELATED_NETWORK_ROLE where network_model_customization_uuid = " + networkModelCustomizationUUID); - insertToscaData(buildSql("RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRoleValue + "\"", model_yaml, relatedNetworkRoleParamsCheck), null); + insertToscaData(buildSql("RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRole + "\"", model_yaml, relatedNetworkRoleParamsCheck), null); } } catch (IOException e) { LOG.debug("Could not insert Tosca CSAR data into the RELATED_NETWORK_ROLE table"); throw new IOException (e); } - } - } - else { - LOG.debug("Node Template [" + nodeTemplate.getName() + "], property [" + "related_networks" + "] property value: " + null); - } + } + } + else { + LOG.debug("Node Template [" + entityDetails.getName() + "], property [" + "related_networks" + "] property value: " + null); + } } 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 d39622621..d7418824b 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 @@ -703,18 +703,22 @@ public class SdncUebCallback implements INotificationCallback { } - // Ingest Network (VL) Data - 1707 - List vlNodeTemplatesList = sdcCsarHelper.getServiceVlList(); + // Ingest Network (VL) Data - 1707 / migrate to getEntity - 1908 + EntityQuery vlEntityQuery = EntityQuery.newBuilder(SdcTypes.VL).build(); + TopologyTemplateQuery vlTopologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(); + List vlEntities = sdcCsarHelper.getEntity(vlEntityQuery, vlTopologyTemplateQuery, false); // false to not recurse + if (vlEntities != null && !vlEntities.isEmpty()) { + for (IEntityDetails vlEntity : vlEntities){ - for (NodeTemplate nodeTemplate : vlNodeTemplatesList) { - SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, nodeTemplate, jdbcDataSource); - nodeModel.setServiceUUID(serviceModel.getServiceUUID()); + try { + SdncNodeModel nodeModel = new SdncNodeModel (sdcCsarHelper, vlEntity, jdbcDataSource, config); + nodeModel.setServiceUUID(serviceModel.getServiceUUID()); - try { - nodeModel.insertNetworkModelData(); - nodeModel.insertRelatedNetworkRoleData(); - } catch (IOException e) { - deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + nodeModel.insertNetworkModelData(); + nodeModel.insertRelatedNetworkRoleData(); + } catch (IOException e) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + } } } 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 bd71c0240..fc288aaa9 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 @@ -94,7 +94,7 @@ public class SdncVFCModel extends SdncBaseModel { TopologyTemplateQuery topologyTemplateQueryVFC = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID(vfcCustomizationUuid).build(); List cpEntities = sdcCsarHelper.getEntity(entityQueryCP, topologyTemplateQueryVFC, true); if (cpEntities == null || cpEntities.isEmpty()) { - LOG.info("insertVFCtoNetworkRoleMappingData: Could not find the nested CVFCs for: " + vfcCustomizationUuid); + LOG.debug("insertVFCtoNetworkRoleMappingData: Could not find the nested CVFCs for: " + vfcCustomizationUuid); return; } @@ -282,7 +282,7 @@ public class SdncVFCModel extends SdncBaseModel { TopologyTemplateQuery topologyTemplateQueryVFC = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID(vfcCustomizationUuid).build(); List cpEntities = sdcCsarHelper.getEntity(entityQueryCP, topologyTemplateQueryVFC, true); if (cpEntities == null || cpEntities.isEmpty()) { - LOG.info("insertVFCRelatedNetworkRoleData: Could not find the nested CVFCs for: " + vfcCustomizationUuid); + LOG.debug("insertVFCRelatedNetworkRoleData: Could not find the nested CVFCs for: " + vfcCustomizationUuid); return; } 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 2b2d078f7..dd93f45db 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 @@ -54,7 +54,14 @@ public class SdncVFModel extends SdncBaseModel { public SdncVFModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { super(sdcCsarHelper, nodeTemplate, jdbcDataSource, config); - + + // Since SdncVFModel is not yet converted for getEntity, find the entity for this nodeTemplate + EntityQuery vfEntityQuery = EntityQuery.newBuilder(SdcTypes.VF).customizationUUID(getCustomizationUUIDNoQuotes()).build(); + TopologyTemplateQuery vfTopologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(); + List vfEntities = sdcCsarHelper.getEntity(vfEntityQuery, vfTopologyTemplateQuery, true); + if (vfEntities != null && !vfEntities.isEmpty()) { + entityDetails = vfEntities.get(0); + } // extract metadata Metadata metadata = nodeTemplate.getMetaData(); addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); @@ -158,7 +165,7 @@ public class SdncVFModel extends SdncBaseModel { try { cleanUpExistingToscaData("VF_MODULE_MODEL", "customization_uuid", vfModuleModel.getCustomizationUUID()); cleanUpExistingToscaData("VF_MODULE_TO_VFC_MAPPING", "vf_module_customization_uuid", vfModuleModel.getCustomizationUUID()); - LOG.info("Call insertToscaData for VF_MODULE_MODEL where vf_module_customization_uuid = " + vfModuleModel.getCustomizationUUID()); + LOG.info("Call insertToscaData for VF_MODULE_MODEL where customization_uuid = " + vfModuleModel.getCustomizationUUID()); insertToscaData(vfModuleModel.buildSql("VF_MODULE_MODEL", model_yaml), null); } catch (IOException e) { LOG.error("Could not insert Tosca CSAR data into the VF_MODULE_MODEL table "); @@ -175,7 +182,7 @@ public class SdncVFModel extends SdncBaseModel { .build(); List vfModulesNonCatalog = sdcCsarHelper.getEntity(entityQuery2, topologyTemplateQuery2, false); if (vfModulesNonCatalog == null || vfModulesNonCatalog.isEmpty()) { - LOG.info("insertVFModuleData: Could not find the non-catelog VF Module for: " + vfModuleModel.getCustomizationUUID() + ". Unable to insert members into VF_MODULE_TO_VFC_MAPPING"); + LOG.debug("insertVFModuleData: Could not find the non-catelog VF Module for: " + vfModuleModel.getCustomizationUUID() + ". Unable to insert members into VF_MODULE_TO_VFC_MAPPING"); continue; } @@ -217,7 +224,7 @@ public class SdncVFModel extends SdncBaseModel { .build(); List nestedCvfcs = sdcCsarHelper.getEntity(entityQuery3, topologyTemplateQuery3, true); // true allows for nested search if (nestedCvfcs == null || nestedCvfcs.isEmpty()) { - LOG.info("insertVFModuleData: Could not find the nested CVFCs for: " + cvfcCustomizationUuid); + LOG.debug("insertVFModuleData: Could not find the nested CVFCs for: " + cvfcCustomizationUuid); continue; } @@ -284,7 +291,7 @@ public class SdncVFModel extends SdncBaseModel { TopologyTemplateQuery topologyTemplateQueryVF = TopologyTemplateQuery.newBuilder(SdcTypes.VF).customizationUUID(getCustomizationUUIDNoQuotes()).build(); List cpEntities = sdcCsarHelper.getEntity(entityQueryCP, topologyTemplateQueryVF, true); if (cpEntities == null || cpEntities.isEmpty()) { - LOG.info("insertVFtoNetworkRoleMappingData: Could not find CPs for VF: " + getCustomizationUUIDNoQuotes()); + LOG.debug("insertVFtoNetworkRoleMappingData: Could not find CPs for VF: " + getCustomizationUUIDNoQuotes()); return; } @@ -343,7 +350,7 @@ public class SdncVFModel extends SdncBaseModel { .build(); List cvfcEntities = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, true); // true allows for nested search if (cvfcEntities == null || cvfcEntities.isEmpty()) { - LOG.info("insertVFCDataEntity: Could not find the CVFCs for: " + vfCustomizationUid); + LOG.debug("insertVFCDataEntity: Could not find the CVFCs for: " + vfCustomizationUid); } for (IEntityDetails cvfcEntity: cvfcEntities) { @@ -382,8 +389,8 @@ public class SdncVFModel extends SdncBaseModel { for (IEntityDetails group : vfcInstanceGroupListForVf){ - SdncGroupModel groupModel = new SdncGroupModel (sdcCsarHelper, group, nodeTemplate, config, jdbcDataSource); - groupModel.insertGroupData(nodeTemplate); + SdncGroupModel groupModel = new SdncGroupModel (sdcCsarHelper, group, entityDetails, config, jdbcDataSource); + groupModel.insertGroupData(getUUID()); // For each group, populate NODE_CAPABILITY/NODE_CAPABILITY_PROPERTY insertNodeCapabilitiesEntityData(group.getCapabilities()); @@ -419,7 +426,7 @@ public class SdncVFModel extends SdncBaseModel { break; } addParameter("table_name", tableName, mappingParams); - LOG.info("Call insertToscaData for RESOURCE_GROUP_TO_TARGET_NODE_MAPPING where group_uuid = " + groupModel.getUUID() + " and target_node_uuid = " + targetNodeUuid); + LOG.info("Call insertToscaData for RESOURCE_GROUP_TO_TARGET_NODE_MAPPING where group_uuid = " + groupModel.getUUID() + " and target_node_uuid = \"" + targetNodeUuid + "\""); insertToscaData(buildSql("RESOURCE_GROUP_TO_TARGET_NODE_MAPPING", "group_uuid", groupModel.getUUID(), model_yaml, mappingParams), null); } catch (IOException e) { LOG.error("Could not insert Tosca CSAR data into the RESOURCE_GROUP_TO_TARGET_NODE_MAPPING"); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java index 8bf3c9145..3b2cd96a1 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java @@ -8,8 +8,6 @@ import java.io.IOException; import org.junit.Test; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.NodeTemplate; -import org.onap.sdc.toscaparser.api.Group; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncGroupModelTest { @@ -17,13 +15,13 @@ import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @Test public void testSdncGroupModelConstructor() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); - NodeTemplate nodeTemplate = mock(NodeTemplate.class); IEntityDetails group = mock(IEntityDetails.class); + IEntityDetails entityDetails = mock(IEntityDetails.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); SdncGroupModel testSdncGroupModel = null; try { - testSdncGroupModel = new SdncGroupModel(mockCsarHelper,group,nodeTemplate,mockSdncUebConfiguration,mockDBResourceManager); + testSdncGroupModel = new SdncGroupModel(mockCsarHelper,group,entityDetails,mockSdncUebConfiguration,mockDBResourceManager); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java index a77c5adbf..9f859e793 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java @@ -7,9 +7,9 @@ import static org.mockito.Mockito.*; import java.io.IOException; import org.junit.Before; -import org.junit.Test; -import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.junit.Test; +import org.onap.sdc.tosca.parser.api.IEntityDetails; +import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @@ -18,17 +18,17 @@ public class SdncNodeModelTest { SdncNodeModel sdncNodeModel; @Before - public void setUp() throws Exception { + public void setUp() throws Exception { + SdncUebConfiguration config = mock(SdncUebConfiguration.class); ISdcCsarHelper isdcCsarHelper = mock(ISdcCsarHelper.class); - NodeTemplate nodeTemplate = mock(NodeTemplate.class); + IEntityDetails entityDetails = mock(IEntityDetails.class); Metadata mockMetadata = mock(Metadata.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); - when(nodeTemplate.getMetaData()).thenReturn(mockMetadata); + when(entityDetails.getMetadata()).thenReturn(mockMetadata); when(isdcCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); - when(isdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "network_type")).thenReturn("test-network-type"); - sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate, mockDBResourceManager); + sdncNodeModel = new SdncNodeModel(isdcCsarHelper, entityDetails, mockDBResourceManager, config); sdncNodeModel.setServiceUUID("0e8d757f-1c80-40af-85de-31d64f1f5af8"); sdncNodeModel.setEcompGeneratedNaming("hello-world"); } @@ -48,7 +48,7 @@ public class SdncNodeModelTest { @Test public void testGetSqlString() { String result = sdncNodeModel.getSql("TEST-HELLO"); - String test = "INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, ecomp_generated_naming, network_type) values (0e8d757f-1c80-40af-85de-31d64f1f5af8, \"aaaa-bbbb-cccc-dddd\", \"TEST-HELLO\", \"hello-world\", \"test-network-type\");"; + String test = "INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, ecomp_generated_naming) values (0e8d757f-1c80-40af-85de-31d64f1f5af8, \"aaaa-bbbb-cccc-dddd\", \"TEST-HELLO\", \"hello-world\");"; assertEquals(test, result); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index 5b4637ea7..2c44ba732 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -46,6 +46,23 @@ public class TestSdncUebCallback { " `naming_policy` varchar(255) DEFAULT NULL,\n" + " PRIMARY KEY (`service_uuid`)\n" + ") "; + + private static final String CRTBL_SERVICE_MODEL_TO_VF_MODEL_MAPPING = "CREATE TABLE `SERVICE_MODEL_TO_VF_MODEL_MAPPING` (\n" + + " `service_uuid` varchar(255) NOT NULL,\n" + + " `vf_uuid` varchar(255) DEFAULT NULL,\n" + + " `vf_customization_uuid` varchar(255) DEFAULT NULL,\n" + + " `service_invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`service_uuid`)\n" + + ") "; + + private static final String CRTBL_ATTRIBUTE_VALUE_PAIR = "CREATE TABLE `ATTRIBUTE_VALUE_PAIR` (\n" + + " `resource_uuid` varchar(255) NOT NULL,\n" + + " `attribute_name` varchar(255) NOT NULL,\n" + + " `resource_type` varchar(255) NOT NULL,\n" + + " `attribute_value` varchar(255) DEFAULT NULL,\n" + + " `resource_customization_uuid` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`resource_uuid`,`attribute_name`,`resource_type`)\n" + + ") "; private static final String CRTBL_NETWORK_MODEL = "CREATE TABLE `NETWORK_MODEL` (\n" + " `customization_uuid` varchar(255) NOT NULL,\n" + @@ -118,6 +135,39 @@ public class TestSdncUebCallback { " PRIMARY KEY (`customization_uuid`)\n" + ") "; + private static final String CRTBL_VFC_RELATED_NETWORK_ROLE = "CREATE TABLE `VFC_RELATED_NETWORK_ROLE` (\n" + + " `vfc_customization_uuid` varchar(255) NOT NULL,\n" + + " `vm_type` varchar(255) NOT NULL,\n" + + " `network_role` varchar(255) NOT NULL,\n" + + " `related_network_role` varchar(255) NOT NULL,\n" + + " PRIMARY KEY (`vfc_customization_uuid`,`vm_type`,`network_role`,`related_network_role`)\n" + + ") "; + + private static final String CRTBL_VFC_TO_NETWORK_ROLE_MAPPING = "CREATE TABLE `VFC_TO_NETWORK_ROLE_MAPPING` (\n" + + " `seq` int(11) NOT NULL AUTO_INCREMENT,\n" + + " `vfc_customization_uuid` varchar(255) NOT NULL,\n" + + " `network_role` varchar(255) NOT NULL,\n" + + " `vm_type` varchar(255) DEFAULT NULL,\n" + + " `network_role_tag` varchar(255) DEFAULT NULL,\n" + + " `ipv4_count` int(11) NOT NULL,\n" + + " `ipv6_count` int(11) NOT NULL,\n" + + " `ipv4_use_dhcp` char(1) DEFAULT NULL,\n" + + " `ipv6_use_dhcp` char(1) DEFAULT NULL,\n" + + " `ipv4_ip_version` char(1) DEFAULT NULL,\n" + + " `ipv6_ip_version` char(1) DEFAULT NULL,\n" + + " `extcp_subnetpool_id` varchar(512) DEFAULT NULL,\n" + + " `ipv4_floating_count` int(11) DEFAULT NULL,\n" + + " `ipv6_floating_count` int(11) DEFAULT NULL,\n" + + " `ipv4_address_plan_name` varchar(512) DEFAULT NULL,\n" + + " `ipv6_address_plan_name` varchar(512) DEFAULT NULL,\n" + + " `ipv4_vrf_name` varchar(512) DEFAULT NULL,\n" + + " `ipv6_vrf_name` varchar(512) DEFAULT NULL,\n" + + " `subnet_role` varchar(255) DEFAULT NULL,\n" + + " `subinterface_indicator` char(1) DEFAULT NULL,\n" + + " PRIMARY KEY (`seq`),\n" + + " KEY `IX1_VFC_TO_NETWORK_ROLE_MAPPING` (`vfc_customization_uuid`)\n" + + ") "; + private static final String CRTBL_VF_MODEL = "CREATE TABLE `VF_MODEL` (\n" + " `customization_uuid` varchar(255) NOT NULL,\n" + " `model_yaml` longblob,\n" + @@ -137,6 +187,21 @@ public class TestSdncUebCallback { " PRIMARY KEY (`customization_uuid`)\n" + ")"; + private static final String CRTBL_VNF_RELATED_NETWORK_ROLE = "CREATE TABLE `VNF_RELATED_NETWORK_ROLE` (\n" + + " `vnf_customization_uuid` varchar(255) NOT NULL,\n" + + " `network_role` varchar(255) NOT NULL,\n" + + " `related_network_role` varchar(255) NOT NULL,\n" + + " PRIMARY KEY (`vnf_customization_uuid`,`network_role`,`related_network_role`)\n" + + ")"; + + private static final String CRTBL_VF_TO_NETWORK_ROLE_MAPPING = "CREATE TABLE `VF_TO_NETWORK_ROLE_MAPPING` (\n" + + " `seq` int(11) NOT NULL AUTO_INCREMENT,\n" + + " `vf_customization_uuid` varchar(255) NOT NULL,\n" + + " `network_role` varchar(255) NOT NULL,\n" + + " PRIMARY KEY (`seq`),\n" + + " KEY `IX1_VF_TO_NETWORK_ROLE_MAPPING` (`vf_customization_uuid`)\n" + + ")"; + private static final String CRTBL_VF_MODULE_MODEL = "CREATE TABLE `VF_MODULE_MODEL` (\n" + " `customization_uuid` varchar(255) NOT NULL,\n" + " `model_yaml` longblob,\n" + @@ -146,8 +211,82 @@ public class TestSdncUebCallback { " `vf_module_type` varchar(255) DEFAULT NULL,\n" + " `availability_zone_count` int(11) DEFAULT NULL,\n" + " `ecomp_generated_vm_assignments` char(1) DEFAULT NULL,\n" + + " `vf_customization_uuid` char(255) DEFAULT NULL,\n" + + " `vf_module_label` char(255) DEFAULT NULL,\n" + " PRIMARY KEY (`customization_uuid`)\n" + ")"; + + private static final String CRTBL_VF_MODULE_TO_VFC_MAPPING = "CREATE TABLE `VF_MODULE_TO_VFC_MAPPING` (\n" + + " `seq` int(11) NOT NULL AUTO_INCREMENT,\n" + + " `vf_module_customization_uuid` varchar(255) NOT NULL,\n" + + " `vfc_customization_uuid` varchar(255) NOT NULL,\n" + + " `vm_type` varchar(255) NOT NULL,\n" + + " `vm_count` int(11) NOT NULL,\n" + + " PRIMARY KEY (`seq`),\n" + + " KEY `IX1_VF_MODULE_TO_VFC_MAPPING` (`vf_module_customization_uuid`)\n" + + ")"; + + private static final String CRTBL_RESOURCE_GROUP = "CREATE TABLE `RESOURCE_GROUP` (\n" + + " `resource_uuid` varchar(255) NOT NULL,\n" + + " `group_uuid` varchar(255) NOT NULL,\n" + + " `group_customization_uuid` varchar(255) DEFAULT NULL,\n" + + " `group_invariant_uuid` varchar(255) DEFAULT NULL,\n" + + " `group_name` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " `group_type` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`resource_uuid`,`group_uuid`)\n" + + ")"; + + private static final String CRTBL_RESOURCE_GROUP_TO_TARGET_NODE_MAPPING = "CREATE TABLE `RESOURCE_GROUP_TO_TARGET_NODE_MAPPING` (\n" + + " `group_uuid` varchar(255) NOT NULL,\n" + + " `parent_uuid` varchar(255) NOT NULL,\n" + + " `target_node_uuid` varchar(255) NOT NULL,\n" + + " `target_type` varchar(255) DEFAULT NULL,\n" + + " `table_name` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`group_uuid`,`parent_uuid`,`target_node_uuid`)\n" + + ")"; + + private static final String CRTBL_RESOURCE_POLICY = "CREATE TABLE `RESOURCE_POLICY` (\n" + + " `resource_uuid` varchar(255) NOT NULL,\n" + + " `policy_uuid` varchar(255) NOT NULL,\n" + + " `policy_invariant_uuid` varchar(255) NOT NULL,\n" + + " `policy_name` varchar(255) DEFAULT NULL,\n" + + " `version` varchar(255) DEFAULT NULL,\n" + + " `policy_type` varchar(255) DEFAULT NULL,\n" + + " `property_type` varchar(255) DEFAULT NULL,\n" + + " `property_source` varchar(255) DEFAULT NULL,\n" + + " `property_name` varchar(255) DEFAULT NULL,\n" + + " `policy_customization_uuid` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`resource_uuid`,`policy_uuid`)\n" + + ")"; + + private static final String CRTBL_RESOURCE_POLICY_TO_TARGET_NODE_MAPPING = "CREATE TABLE `RESOURCE_POLICY_TO_TARGET_NODE_MAPPING` (\n" + + " `policy_uuid` varchar(255) NOT NULL,\n" + + " `parent_uuid` varchar(255) NOT NULL,\n" + + " `target_node_uuid` varchar(255) NOT NULL,\n" + + " `target_type` varchar(255) DEFAULT NULL,\n" + + " `target_node_customization_uuid` varchar(255) DEFAULT NULL,\n" + + " `policy_customization_uuid` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`policy_uuid`,`parent_uuid`,`target_node_uuid`)\n" + + ")"; + + private static final String CRTBL_NODE_CAPABILITY = "CREATE TABLE `NODE_CAPABILITY` (\n" + + " `capability_id` int(11) NOT NULL AUTO_INCREMENT,\n" + + " `capability_provider_uuid` varchar(255) NOT NULL,\n" + + " `capability_provider_customization_uuid` varchar(255) NOT NULL,\n" + + " `capability_name` varchar(255) DEFAULT NULL,\n" + + " `capability_type` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`capability_id`)\n" + + ")"; + + private static final String CRTBL_NODE_CAPABILITY_PROPERTY = "CREATE TABLE `NODE_CAPABILITY_PROPERTY` (\n" + + " `capability_id` int(11) NOT NULL AUTO_INCREMENT,\n" + + " `capability_property_name` varchar(255) NOT NULL,\n" + + " `capability_property_type` varchar(255) DEFAULT NULL,\n" + + " PRIMARY KEY (`capability_id`,`capability_property_name`),\n" + + " CONSTRAINT `NODE_CAPABILITY_PROPERTY_TO_NODE_CAPABILITY` FOREIGN KEY (`capability_id`) REFERENCES `NODE_CAPABILITY` (`capability_id`) ON DELETE CASCADE\n" + + ")"; + private static final Logger LOG = LoggerFactory .getLogger(TestSdncUebCallback.class); @@ -195,11 +334,24 @@ public class TestSdncUebCallback { // Create TOSCA tables dblibSvc.writeData(CRTBL_SERVICE_MODEL, null, null); + dblibSvc.writeData(CRTBL_SERVICE_MODEL_TO_VF_MODEL_MAPPING, null, null); + dblibSvc.writeData(CRTBL_ATTRIBUTE_VALUE_PAIR, null, null); dblibSvc.writeData(CRTBL_NETWORK_MODEL, null, null); dblibSvc.writeData(CRTBL_VFC_MODEL, null, null); + dblibSvc.writeData(CRTBL_VFC_RELATED_NETWORK_ROLE, null, null); + dblibSvc.writeData(CRTBL_VFC_TO_NETWORK_ROLE_MAPPING, null, null); dblibSvc.writeData(CRTBL_VF_MODEL, null, null); + dblibSvc.writeData(CRTBL_VNF_RELATED_NETWORK_ROLE, null, null); + dblibSvc.writeData(CRTBL_VF_TO_NETWORK_ROLE_MAPPING, null, null); dblibSvc.writeData(CRTBL_VF_MODULE_MODEL, null, null); + dblibSvc.writeData(CRTBL_VF_MODULE_TO_VFC_MAPPING, null, null); dblibSvc.writeData(CRTBL_ALLOTTED_RESOURCE_MODEL, null, null); + dblibSvc.writeData(CRTBL_RESOURCE_GROUP, null, null); + dblibSvc.writeData(CRTBL_RESOURCE_GROUP_TO_TARGET_NODE_MAPPING, null, null); + dblibSvc.writeData(CRTBL_RESOURCE_POLICY, null, null); + dblibSvc.writeData(CRTBL_RESOURCE_POLICY_TO_TARGET_NODE_MAPPING, null, null); + dblibSvc.writeData(CRTBL_NODE_CAPABILITY, null, null); + dblibSvc.writeData(CRTBL_NODE_CAPABILITY_PROPERTY, null, null); processLevelArtifactList = new ArrayList<>(); serviceLevelArtifactList = new ArrayList<>(); diff --git a/ueb-listener/src/test/resources/ueb-listener.properties b/ueb-listener/src/test/resources/ueb-listener.properties index 35c380595..c017cbd7b 100755 --- a/ueb-listener/src/test/resources/ueb-listener.properties +++ b/ueb-listener/src/test/resources/ueb-listener.properties @@ -14,8 +14,9 @@ org.onap.ccsdk.sli.northbound.uebclient.polling-interval=30 org.onap.ccsdk.sli.northbound.uebclient.polling-timeout=15 org.onap.ccsdk.sli.northbound.uebclient.client-startup-timeout=60 org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION +org.onap.ccsdk.sli.northbound.uebclient.relevant-capability-names=RoutingConfiguration,routing_configuration,VLANAssignment,vlan_assignment org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth=false org.onap.ccsdk.sli.northbound.uebclient.keystore-path= org.onap.ccsdk.sli.northbound.uebclient.keystore-password= org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list= -org.onap.ccsdk.sli.northbound.uebclient.artifact-map=src/test/resources/artifact.map \ No newline at end of file +org.onap.ccsdk.sli.northbound.uebclient.artifact-map=src/test/resources/artifact.map diff --git a/version.properties b/version.properties index 71ba554ca..74fd99918 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=5 -feature_revision=1 +feature_revision=2 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 1f685ea0295dc23233fa91cdc32ba412535d3f50 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 14 Aug 2019 14:53:22 -0400 Subject: Release version 0.5.2 Release version 0.5.2 (last Fluorine SR2 version of CCSDK) Change-Id: I8fc069ad8a0fc5aa50b48aa60fbcb3ab95e55f4d Issue-ID: CCSDK-1401 Signed-off-by: Timoney, Dan (dt5972) --- releases/0.5.2.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/0.5.2.yaml diff --git a/releases/0.5.2.yaml b/releases/0.5.2.yaml new file mode 100644 index 000000000..e464af013 --- /dev/null +++ b/releases/0.5.2.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '0.5.2' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/175/' -- cgit 1.2.3-korg From 5e2c493f9856c2d8cc966ca9a89506f57f00930f Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 9 Jul 2019 13:36:38 -0400 Subject: Code changes for Neon Updated code via ccsdk/parent/tools/fluorine2neon.sh script. Change-Id: Ie19b69db481318afa9224d4673f27e74bfc65a81 Issue-ID: CCSDK-1389 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 +-- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 +-- asdcApi/features/features-asdcApi/pom.xml | 4 +-- asdcApi/features/pom.xml | 4 +-- asdcApi/installer/pom.xml | 4 +-- asdcApi/model/pom.xml | 14 ++++----- asdcApi/pom.xml | 4 +-- asdcApi/provider/pom.xml | 4 +-- .../OSGI-INF/blueprint/asdc-blueprint.xml | 32 ++++++++++++++++++++ .../features/ccsdk-daexim-offsite-backup/pom.xml | 4 +-- .../features-daexim-offsite-backup/pom.xml | 4 +-- daexim-offsite-backup/features/pom.xml | 4 +-- daexim-offsite-backup/installer/pom.xml | 4 +-- daexim-offsite-backup/model/pom.xml | 14 ++++----- daexim-offsite-backup/pom.xml | 4 +-- daexim-offsite-backup/provider/pom.xml | 4 +-- .../OSGI-INF/blueprint/DaeximOffsiteBackup.xml | 20 +++++++++++++ dataChange/features/ccsdk-dataChange/pom.xml | 4 +-- dataChange/features/features-dataChange/pom.xml | 4 +-- dataChange/features/pom.xml | 4 +-- dataChange/installer/pom.xml | 4 +-- dataChange/model/pom.xml | 14 ++++----- dataChange/pom.xml | 4 +-- dataChange/provider/pom.xml | 4 +-- .../OSGI-INF/blueprint/datachange-blueprint.xml | 32 ++++++++++++++++++++ dmaap-listener/pom.xml | 6 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 +-- features/features-sli-northbound/pom.xml | 4 +-- features/installer/pom.xml | 4 +-- features/pom.xml | 4 +-- lcm/features/ccsdk-lcm/pom.xml | 4 +-- lcm/features/features-lcm/pom.xml | 4 +-- lcm/features/pom.xml | 4 +-- lcm/installer/pom.xml | 4 +-- lcm/model/pom.xml | 14 ++++----- lcm/pom.xml | 4 +-- lcm/provider/pom.xml | 4 +-- .../resources/OSGI-INF/blueprint/lcm-blueprint.xml | 34 ++++++++++++++++++++++ pom.xml | 4 +-- ueb-listener/pom.xml | 6 ++-- version.properties | 4 +-- 41 files changed, 210 insertions(+), 100 deletions(-) create mode 100644 asdcApi/provider/src/main/resources/OSGI-INF/blueprint/asdc-blueprint.xml create mode 100755 daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml create mode 100644 dataChange/provider/src/main/resources/OSGI-INF/blueprint/datachange-blueprint.xml create mode 100644 lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 42eeb71f6..b9f354ba8 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index be3dee2b5..7210cc270 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 2917abd74..3a09e3efb 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 6f6ac13f6..7a03ab51b 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 33af1bd52..b2d77b6ee 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index a5bb371c6..d5e835615 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} @@ -23,13 +23,11 @@ - org.opendaylight.mdsal.model - ietf-inet-types-2013-07-15 - - - org.opendaylight.mdsal.model - ietf-yang-types-20130715 + org.opendaylight.mdsal.binding.model.ietf + rfc6991 + + diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index d00afcb41..0fcc15370 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 34f65285f..071af8d8d 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/provider/src/main/resources/OSGI-INF/blueprint/asdc-blueprint.xml b/asdcApi/provider/src/main/resources/OSGI-INF/blueprint/asdc-blueprint.xml new file mode 100644 index 000000000..9ad08d3db --- /dev/null +++ b/asdcApi/provider/src/main/resources/OSGI-INF/blueprint/asdc-blueprint.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index d54eb208a..98b6de9fb 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index 632cad587..604d9173a 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-daexim-offsite-backup - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index d23a039c1..86c49397e 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index d58467bb0..a3abfcf1d 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index e0702fee5..58097f9a5 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,24 +4,22 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle - org.opendaylight.mdsal.model - ietf-inet-types-2013-07-15 - - - org.opendaylight.mdsal.model - ietf-yang-types-20130715 + org.opendaylight.mdsal.binding.model.ietf + rfc6991 + + diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 34e4e1953..40601e600 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 49bd6e7ec..4cedda69f 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle diff --git a/daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml b/daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml new file mode 100755 index 000000000..8e2101ad3 --- /dev/null +++ b/daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 635cbe5f7..8f9e1b647 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 5a50ef10a..4d36c4a38 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index d4fab812c..be06b9914 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index d3e7cb2b4..25511b3d9 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 57a8a8774..5586e4ad5 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} @@ -22,13 +22,11 @@ - org.opendaylight.mdsal.model - ietf-inet-types-2013-07-15 - - - org.opendaylight.mdsal.model - ietf-yang-types-20130715 + org.opendaylight.mdsal.binding.model.ietf + rfc6991 + + diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 1419661b2..6a3d3ea0f 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 204e9158a..121328389 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/provider/src/main/resources/OSGI-INF/blueprint/datachange-blueprint.xml b/dataChange/provider/src/main/resources/OSGI-INF/blueprint/datachange-blueprint.xml new file mode 100644 index 000000000..5a38c81f1 --- /dev/null +++ b/dataChange/provider/src/main/resources/OSGI-INF/blueprint/datachange-blueprint.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index d07f8111d..d010de56b 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener @@ -24,7 +24,7 @@ ${maven.build.timestamp} ${project.version}-${build.number} - ${project.version} + 0.5.1-SNAPSHOT ${project.version} diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index c5c1b914c..1df648428 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index fce265bbe..c98c303d7 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 46bdfdf3f..796eadd74 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 486ff093c..01d543294 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index cd80fb34d..0528e6e5b 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index cb7126187..68e2150ef 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index b59d2b92c..f5b49230c 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 3966c9d2f..fb3123df4 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 6f41820c3..e27875081 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} @@ -23,13 +23,11 @@ - org.opendaylight.mdsal.model - ietf-inet-types-2013-07-15 - - - org.opendaylight.mdsal.model - ietf-yang-types-20130715 + org.opendaylight.mdsal.binding.model.ietf + rfc6991 + + diff --git a/lcm/pom.xml b/lcm/pom.xml index 455beb899..d2299d154 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index def00a9b3..7eba7c9b7 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml b/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml new file mode 100644 index 000000000..5597d0801 --- /dev/null +++ b/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 76ad8082c..047eaf45e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT 4.0.0 @@ -104,7 +104,7 @@ ONAP - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 63b849ec6..d0cc96518 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener @@ -22,7 +22,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - ${project.version} + 0.5.1-SNAPSHOT ${project.version} diff --git a/version.properties b/version.properties index 74fd99918..54c44bc24 100644 --- a/version.properties +++ b/version.properties @@ -4,8 +4,8 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=5 -feature_revision=2 +sprint_number=6 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 944a56af64c77e67a2a11a3d963efb18f0c26ab8 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Wed, 14 Aug 2019 19:41:59 +0000 Subject: ASDC lib version updates and 2 bug fixes Changes made: Added remove dots to normalized VF name in SdncVFModel.insertVFModuleData. Fixed path to use_ipv4 and use_ipv6 in SdncNodeModel. Issue-ID: CCSDK-1424 Change-Id: Ib60fb652ee695025a6b505b750667c9c8ff1ab2d Signed-off-by: lalena.aria --- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModel.java | 4 ++-- .../java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModel.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 cf81b3cae..65b20e61f 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 @@ -65,7 +65,7 @@ public class SdncNodeModel extends SdncBaseModel { addParameter("trunk_network_indicator", trunkNetworkIndicator); // extract properties - network_assignments - ipv4_subnet_default_assignment - String useIpv4 = extractBooleanValue(nodeEntity, "network_assignments", "use_ipv4"); + String useIpv4 = extractBooleanValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "use_ipv4"); addParameter("use_ipv4", useIpv4); addParameter("ipv4_dhcp_enabled", extractBooleanValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "dhcp_enabled")); addParameter("ipv4_ip_version", extractValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "ip_version")); @@ -73,7 +73,7 @@ public class SdncNodeModel extends SdncBaseModel { addParameter("eipam_v4_address_plan", extractValue(nodeEntity, "network_assignments", "ipv4_subnet_default_assignment", "ip_network_address_plan")); // extract properties - network_assignments - ipv6_subnet_default_assignment - String useIpv6 = extractBooleanValue(nodeEntity, "network_assignments", "use_ipv6"); + String useIpv6 = extractBooleanValue(nodeEntity, "network_assignments", "ipv6_subnet_default_assignment", "use_ipv6"); addParameter("use_ipv6", useIpv6); addParameter("ipv6_dhcp_enabled", extractBooleanValue(nodeEntity, "network_assignments", "ipv6_subnet_default_assignment", "dhcp_enabled")); addParameter("ipv6_ip_version", extractValue(nodeEntity, "network_assignments", "ipv6_subnet_default_assignment", "ip_version")); 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 dd93f45db..76e208635 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 @@ -155,7 +155,7 @@ public class SdncVFModel extends SdncBaseModel { for (IEntityDetails vfModule : vfModules){ // If this vfModule name is prefixed with the VF name of the VF being processed, insert this VF Module in VF_MODULE_MODEL - String normailizedVfName = nodeTemplate.getName().toLowerCase().replace(" ", "").replace("-", ""); // need full set of normalization rules from ASDC + String normailizedVfName = nodeTemplate.getName().toLowerCase().replace(" ", "").replace("-", "").replace(".", ""); // need full set of normalization rules from ASDC if (!vfModule.getName().startsWith(normailizedVfName)) { continue; } -- cgit 1.2.3-korg From 4852d3577447aa8790b63442b6d5c48412e2eb21 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Mon, 19 Aug 2019 21:40:44 -0500 Subject: Bug fix to address DMAAPLISTENERROOT Modified rootDir to /opt/onap/sdnc/...where map and vt template files are transferred in the docker Issue-ID: CCSDK-1400 Signed-off-by: SandeepLinux Change-Id: Ie634ff60cf439be5f5136275f2ea19abf40949de --- .../onap/ccsdk/sli/northbound/dmaapclient/OofPciPocDmaapConsumers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9d78e8acf..e8dacb959 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 @@ -83,7 +83,7 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { rootDir = System.getenv(DMAAPLISTENERROOT); if ((rootDir == null) || (rootDir.length() == 0)) { - rootDir = "/opt/app/dmaap-listener/lib/"; + rootDir = "/opt/onap/sdnc/dmaap-listener/lib/"; } else { rootDir = rootDir + "/lib/"; -- cgit 1.2.3-korg From 7b76725b56304435b01c5b97c3424da0605119ee Mon Sep 17 00:00:00 2001 From: Matej Perina Date: Wed, 3 Apr 2019 14:38:29 +0200 Subject: Proposal to remove OSGi dependencies from the CCSDK project Dependencies on the OSGi frameworks and libraries are removed by integrating the CCSDK project with the lighty.io. It's a toolkit that allows to use ODL services (in this case core services and the Restconf) without the dependency on the Karaf framework and the Blueprint DI. In this change are created the lighty.io modules which initialize and expose same services as the Blueprint DI in the blueprint.xml files. More info about the lighty.io - https://lighty.io Change-Id: Ieb512990e191bbb5a9403f05cdce0b79640ce474 Signed-off-by: Matej Perina Signed-off-by: Samuel Kontris --- asdcApi/lighty/pom.xml | 47 ++++++++ .../northbound/asdcapi/lighty/AsdcApiModule.java | 61 +++++++++++ asdcApi/pom.xml | 1 + ccsdk-northbound-lighty/pom.xml | 39 +++++++ .../lighty/CcsdkNorhboundLightyModule.java | 119 +++++++++++++++++++++ dataChange/lighty/pom.xml | 47 ++++++++ .../dataChange/lighty/DataChangeModule.java | 62 +++++++++++ dataChange/pom.xml | 1 + dmaap-listener/pom.xml | 2 +- lcm/lighty/pom.xml | 47 ++++++++ .../ccsdk/sli/northbound/lcm/lighty/LcmModule.java | 64 +++++++++++ lcm/pom.xml | 1 + pom.xml | 1 + ueb-listener/pom.xml | 2 +- 14 files changed, 492 insertions(+), 2 deletions(-) create mode 100755 asdcApi/lighty/pom.xml create mode 100644 asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java create mode 100755 ccsdk-northbound-lighty/pom.xml create mode 100644 ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java create mode 100755 dataChange/lighty/pom.xml create mode 100644 dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java create mode 100755 lcm/lighty/pom.xml create mode 100644 lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java diff --git a/asdcApi/lighty/pom.xml b/asdcApi/lighty/pom.xml new file mode 100755 index 000000000..4bc9fd305 --- /dev/null +++ b/asdcApi/lighty/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.4.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + asdcApi-lighty + 0.6.0-SNAPSHOT + jar + + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + http://maven.apache.org + + + UTF-8 + + + + + + org.onap.ccsdk.sli.core + ccsdk-lighty-dependency-versions + ${project.version} + pom + import + + + + + + + io.lighty.core + lighty-controller + + + org.onap.ccsdk.sli.northbound + asdcApi-provider + ${project.version} + + + diff --git a/asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java b/asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java new file mode 100644 index 000000000..2895e17e4 --- /dev/null +++ b/asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java @@ -0,0 +1,61 @@ +/* + * ============LICENSE_START========================================== + * Copyright (c) 2019 PANTHEON.tech s.r.o. + * =================================================================== + * 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.asdcapi.lighty; + +import io.lighty.core.controller.api.AbstractLightyModule; +import io.lighty.core.controller.api.LightyModule; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiSliClient; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; + +/** + * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from + * the asdcApi-provicer artifact. + */ +public class AsdcApiModule extends AbstractLightyModule implements LightyModule { + + private final SvcLogicService svcLogicService; + private final DataBroker dataBroker; + private final NotificationPublishService publishService; + private final RpcProviderRegistry rpcRegistry; + private AsdcApiSliClient asdcApiClient; + private AsdcApiProvider asdcApiProvider; + + public AsdcApiModule(SvcLogicService svcLogicService, DataBroker dataBroker, + NotificationPublishService publishService, RpcProviderRegistry rpcRegistry) { + this.svcLogicService = svcLogicService; + this.dataBroker = dataBroker; + this.publishService = publishService; + this.rpcRegistry = rpcRegistry; + } + + @Override + protected boolean initProcedure() { + this.asdcApiClient = new AsdcApiSliClient(svcLogicService); + this.asdcApiProvider = new AsdcApiProvider(dataBroker, publishService, rpcRegistry, asdcApiClient); + return true; + } + + @Override + protected boolean stopProcedure() { + return true; + } + +} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 0fcc15370..bf28c44ea 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -25,6 +25,7 @@ features provider installer + lighty diff --git a/ccsdk-northbound-lighty/pom.xml b/ccsdk-northbound-lighty/pom.xml new file mode 100755 index 000000000..a75f235aa --- /dev/null +++ b/ccsdk-northbound-lighty/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.4.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-northbound-lighty + 0.6.0-SNAPSHOT + jar + + + + org.onap.ccsdk.sli.core + ccsdk-core-lighty + ${project.version} + + + org.onap.ccsdk.sli.northbound + asdcApi-lighty + ${project.version} + + + org.onap.ccsdk.sli.northbound + dataChange-lighty + ${project.version} + + + org.onap.ccsdk.sli.northbound + lcm-lighty + ${project.version} + + + diff --git a/ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java b/ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java new file mode 100644 index 000000000..ce907bd95 --- /dev/null +++ b/ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java @@ -0,0 +1,119 @@ +/* + * ============LICENSE_START========================================== + * Copyright (c) 2019 PANTHEON.tech s.r.o. + * =================================================================== + * 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.lighty; + +import io.lighty.core.controller.api.AbstractLightyModule; +import org.onap.ccsdk.sli.core.lighty.common.CcsdkLightyUtils; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.onap.ccsdk.sli.northbound.asdcapi.lighty.AsdcApiModule; +import org.onap.ccsdk.sli.northbound.dataChange.lighty.DataChangeModule; +import org.onap.ccsdk.sli.northbound.lcm.lighty.LcmModule; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that groups all other LightyModules + * from the ccsdk-sli-northbound repository so they can be all treated as one component (for example started/stopped at once). + * For more information about the lighty.io visit the website https://lighty.io. + */ +public class CcsdkNorhboundLightyModule extends AbstractLightyModule { + + private static final Logger LOG = LoggerFactory.getLogger(CcsdkNorhboundLightyModule.class); + + private final SvcLogicService svcLogicService; + private final DataBroker dataBroker; + private final NotificationPublishService publishService; + private final RpcProviderRegistry rpcProviderRegistry; + + private AsdcApiModule asdcApiModule; + private DataChangeModule dataChangeModule; + private LcmModule lcmModule; + + public CcsdkNorhboundLightyModule(SvcLogicService svcLogicService, DataBroker dataBroker, + NotificationPublishService publishService, RpcProviderRegistry rpcProviderRegistry) { + + this.svcLogicService = svcLogicService; + this.dataBroker = dataBroker; + this.publishService = publishService; + this.rpcProviderRegistry = rpcProviderRegistry; + } + + protected boolean initProcedure() { + LOG.debug("Initializing CCSDK Northbound Lighty module..."); + + this.asdcApiModule = new AsdcApiModule(svcLogicService, dataBroker, publishService, rpcProviderRegistry); + if (!CcsdkLightyUtils.startLightyModule(asdcApiModule)) { + LOG.error("Unable to start AsdcApiModule in CCSDK Northbound Lighty module!"); + return false; + } + + this.dataChangeModule = new DataChangeModule(svcLogicService, dataBroker, publishService, rpcProviderRegistry); + if (!CcsdkLightyUtils.startLightyModule(dataChangeModule)) { + LOG.error("Unable to start DataChangeModule in CCSDK Northbound Lighty module!"); + return false; + } + + this.lcmModule = new LcmModule(svcLogicService, dataBroker, publishService, rpcProviderRegistry); + if (!CcsdkLightyUtils.startLightyModule(lcmModule)) { + LOG.error("Unable to start LcmModule in CCSDK Northbound Lighty module!"); + return false; + } + + LOG.debug("CCSDK Northbound Lighty module was initialized successfully"); + return true; + } + + protected boolean stopProcedure() { + LOG.debug("Stopping CCSDK Northbound Lighty module..."); + + boolean stopSuccessful = true; + + if (!CcsdkLightyUtils.stopLightyModule(lcmModule)) { + stopSuccessful = false; + } + + if (!CcsdkLightyUtils.stopLightyModule(dataChangeModule)) { + stopSuccessful = false; + } + + if (!CcsdkLightyUtils.stopLightyModule(asdcApiModule)) { + stopSuccessful = false; + } + + if (stopSuccessful) { + LOG.debug("CCSDK Northbound Lighty module was stopped successfully"); + } else { + LOG.error("CCSDK Northbound Lighty module was not stopped successfully!"); + } + return stopSuccessful; + } + + public AsdcApiModule getAsdcApiModule() { + return asdcApiModule; + } + + public DataChangeModule getDataChangeModule() { + return dataChangeModule; + } + + public LcmModule getLcmModule() { + return lcmModule; + } +} diff --git a/dataChange/lighty/pom.xml b/dataChange/lighty/pom.xml new file mode 100755 index 000000000..91f1c96ac --- /dev/null +++ b/dataChange/lighty/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.4.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + dataChange-lighty + 0.6.0-SNAPSHOT + jar + + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + http://maven.apache.org + + + UTF-8 + + + + + + org.onap.ccsdk.sli.core + ccsdk-lighty-dependency-versions + ${project.version} + pom + import + + + + + + + io.lighty.core + lighty-controller + + + org.onap.ccsdk.sli.northbound + dataChange-provider + ${project.version} + + + diff --git a/dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java b/dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java new file mode 100644 index 000000000..412d46657 --- /dev/null +++ b/dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java @@ -0,0 +1,62 @@ +/* + * ============LICENSE_START========================================== + * Copyright (c) 2019 PANTHEON.tech s.r.o. + * =================================================================== + * 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.dataChange.lighty; + +import io.lighty.core.controller.api.AbstractLightyModule; +import io.lighty.core.controller.api.LightyModule; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.onap.ccsdk.sli.northbound.DataChangeClient; +import org.onap.ccsdk.sli.northbound.DataChangeProvider; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; + +/** + * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from + * the dataChange-provider artifact. + */ +public class DataChangeModule extends AbstractLightyModule implements LightyModule { + + private final SvcLogicService svcLogicService; + private final DataBroker dataBroker; + private final NotificationPublishService publishService; + private final RpcProviderRegistry rpcRegistry; + + private DataChangeClient dataChangeClient; + private DataChangeProvider dataChangeProvider; + + public DataChangeModule(SvcLogicService svcLogicService, DataBroker dataBroker, + NotificationPublishService publishService, RpcProviderRegistry rpcRegistry) { + this.svcLogicService = svcLogicService; + this.dataBroker = dataBroker; + this.publishService = publishService; + this.rpcRegistry = rpcRegistry; + } + + @Override + protected boolean initProcedure() { + this.dataChangeClient = new DataChangeClient(svcLogicService); + this.dataChangeProvider = new DataChangeProvider(dataBroker, publishService, rpcRegistry, dataChangeClient); + return true; + } + + @Override + protected boolean stopProcedure() { + return true; + } + +} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 6a3d3ea0f..7588c79cd 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -21,6 +21,7 @@ features provider installer + lighty diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index d010de56b..e111bb8c7 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -24,7 +24,7 @@ ${maven.build.timestamp} ${project.version}-${build.number} - 0.5.1-SNAPSHOT + 0.6.0-SNAPSHOT ${project.version} diff --git a/lcm/lighty/pom.xml b/lcm/lighty/pom.xml new file mode 100755 index 000000000..90c073233 --- /dev/null +++ b/lcm/lighty/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.4.0-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + lcm-lighty + 0.6.0-SNAPSHOT + jar + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + http://maven.apache.org + + + UTF-8 + + + + + + org.onap.ccsdk.sli.core + ccsdk-lighty-dependency-versions + ${project.version} + pom + import + + + + + + + io.lighty.core + lighty-controller + + + org.onap.ccsdk.sli.northbound + lcm-provider + ${project.version} + + + diff --git a/lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java b/lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java new file mode 100644 index 000000000..cbbf9fb2e --- /dev/null +++ b/lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java @@ -0,0 +1,64 @@ +/* + * ============LICENSE_START========================================== + * Copyright (c) 2019 PANTHEON.tech s.r.o. + * =================================================================== + * 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.lcm.lighty; + +import io.lighty.core.controller.api.AbstractLightyModule; +import io.lighty.core.controller.api.LightyModule; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.onap.ccsdk.sli.northbound.LcmProvider; +import org.onap.ccsdk.sli.northbound.LcmSliClient; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; + +/** + * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from + * the lcm-provider artifact. + */ +public class LcmModule extends AbstractLightyModule implements LightyModule { + + private final SvcLogicService svcLogicService; + private final DataBroker dataBroker; + private final NotificationPublishService publishService; + private final RpcProviderRegistry rpcRegistry; + + private LcmSliClient lcmSliClient; + private LcmProvider lcmProvider; + + public LcmModule(final SvcLogicService svcLogicService, + final DataBroker dataBroker, + final NotificationPublishService publishService, + final RpcProviderRegistry rpcRegistry) { + this.svcLogicService = svcLogicService; + this.dataBroker = dataBroker; + this.publishService = publishService; + this.rpcRegistry = rpcRegistry; + } + + @Override + protected boolean initProcedure() { + this.lcmSliClient = new LcmSliClient(svcLogicService); + this.lcmProvider = new LcmProvider(dataBroker, publishService, rpcRegistry, lcmSliClient); + return true; + } + + @Override + protected boolean stopProcedure() { + return true; + } + +} diff --git a/lcm/pom.xml b/lcm/pom.xml index d2299d154..3baeb96b6 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -21,6 +21,7 @@ features provider installer + lighty diff --git a/pom.xml b/pom.xml index 047eaf45e..04f681ac8 100644 --- a/pom.xml +++ b/pom.xml @@ -100,6 +100,7 @@ daexim-offsite-backup features artifacts + ccsdk-northbound-lighty ONAP diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index d0cc96518..f9c5474d1 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -22,7 +22,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - 0.5.1-SNAPSHOT + 0.6.0-SNAPSHOT ${project.version} -- cgit 1.2.3-korg From 9deeecffd743e0880a03c01e2acbc3323eddb0d5 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 27 Aug 2019 16:31:40 -0400 Subject: Release version 0.6.0 Release version 0.6.0 of ccsdk artifacts Change-Id: I1b1bfa0a9fce6c33ba5a8cad3b3cb1ccdb589558 Signed-off-by: Timoney, Dan (dt5972) --- releases/0.6.0.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/0.6.0.yaml diff --git a/releases/0.6.0.yaml b/releases/0.6.0.yaml new file mode 100644 index 000000000..5c2a60849 --- /dev/null +++ b/releases/0.6.0.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '0.6.0' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/189/' -- cgit 1.2.3-korg From b9de9b7836dc88ca6cf746b1199014850b04e853 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 28 Aug 2019 13:15:08 -0400 Subject: Roll versions Roll versions in master branch Change-Id: Idd6c405684fee6eaa860286359493c667a1bf50f Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/lighty/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- ccsdk-northbound-lighty/pom.xml | 4 ++-- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/lighty/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/lighty/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 41 files changed, 81 insertions(+), 81 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index b9f354ba8..b047d23c1 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 7210cc270..b112574c9 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 3a09e3efb..9927bce43 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 7a03ab51b..e1d4bf261 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index b2d77b6ee..5192bfa3f 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/lighty/pom.xml b/asdcApi/lighty/pom.xml index 4bc9fd305..5bfbf2bf2 100755 --- a/asdcApi/lighty/pom.xml +++ b/asdcApi/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index d5e835615..e0f70a34e 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index bf28c44ea..e6e6af694 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 071af8d8d..951368777 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/ccsdk-northbound-lighty/pom.xml b/ccsdk-northbound-lighty/pom.xml index a75f235aa..dd3921dc6 100755 --- a/ccsdk-northbound-lighty/pom.xml +++ b/ccsdk-northbound-lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-northbound-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 98b6de9fb..8754d11f6 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index 604d9173a..e3df29494 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-daexim-offsite-backup - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 86c49397e..1fcf9c486 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index a3abfcf1d..69216cbbe 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 58097f9a5..19346c001 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 40601e600..6a0e90db8 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 4cedda69f..d813b9082 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 8f9e1b647..97bd9a127 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 4d36c4a38..c47cecffd 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index be06b9914..aa5756437 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 25511b3d9..822e4016b 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/lighty/pom.xml b/dataChange/lighty/pom.xml index 91f1c96ac..28ff8ed87 100755 --- a/dataChange/lighty/pom.xml +++ b/dataChange/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 5586e4ad5..123f1a0da 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 7588c79cd..fed24d7bd 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 121328389..1f94f774c 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index e111bb8c7..2b3914a96 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 1df648428..78e1ee8ca 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index c98c303d7..cd6359cb9 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 796eadd74..327c59c5f 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 01d543294..6bfc1a1f2 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 0528e6e5b..380065bc6 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 68e2150ef..06ea67d23 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index f5b49230c..21ab47fd5 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index fb3123df4..c562038af 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/lighty/pom.xml b/lcm/lighty/pom.xml index 90c073233..53c88dd24 100755 --- a/lcm/lighty/pom.xml +++ b/lcm/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index e27875081..234cb6606 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 3baeb96b6..3316f3adf 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 7eba7c9b7..ebf1e7b0a 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 04f681ac8..9b3cc39c1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT 4.0.0 @@ -105,7 +105,7 @@ ONAP - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index f9c5474d1..f6a802f14 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 54c44bc24..54d8edb35 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=6 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 6a146258879e64344b5837dfa6dee566edba4dda Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 29 Aug 2019 11:16:02 -0400 Subject: Revert "Proposal to remove OSGi dependencies from the CCSDK project" This reverts commit 7b76725b56304435b01c5b97c3424da0605119ee. This must be reverted due to lack of jUnit test cases. Change-Id: I0a9116e3ed95553505cd7517f8f3aca53d0c9c5d Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/lighty/pom.xml | 47 -------- .../northbound/asdcapi/lighty/AsdcApiModule.java | 61 ----------- asdcApi/pom.xml | 1 - ccsdk-northbound-lighty/pom.xml | 39 ------- .../lighty/CcsdkNorhboundLightyModule.java | 119 --------------------- dataChange/lighty/pom.xml | 47 -------- .../dataChange/lighty/DataChangeModule.java | 62 ----------- dataChange/pom.xml | 1 - dmaap-listener/pom.xml | 2 +- lcm/lighty/pom.xml | 47 -------- .../ccsdk/sli/northbound/lcm/lighty/LcmModule.java | 64 ----------- lcm/pom.xml | 1 - pom.xml | 1 - ueb-listener/pom.xml | 2 +- 14 files changed, 2 insertions(+), 492 deletions(-) delete mode 100755 asdcApi/lighty/pom.xml delete mode 100644 asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java delete mode 100755 ccsdk-northbound-lighty/pom.xml delete mode 100644 ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java delete mode 100755 dataChange/lighty/pom.xml delete mode 100644 dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java delete mode 100755 lcm/lighty/pom.xml delete mode 100644 lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java diff --git a/asdcApi/lighty/pom.xml b/asdcApi/lighty/pom.xml deleted file mode 100755 index 5bfbf2bf2..000000000 --- a/asdcApi/lighty/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - binding-parent - 1.4.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - asdcApi-lighty - 0.6.1-SNAPSHOT - jar - - ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - http://maven.apache.org - - - UTF-8 - - - - - - org.onap.ccsdk.sli.core - ccsdk-lighty-dependency-versions - ${project.version} - pom - import - - - - - - - io.lighty.core - lighty-controller - - - org.onap.ccsdk.sli.northbound - asdcApi-provider - ${project.version} - - - diff --git a/asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java b/asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java deleted file mode 100644 index 2895e17e4..000000000 --- a/asdcApi/lighty/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/lighty/AsdcApiModule.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * ============LICENSE_START========================================== - * Copyright (c) 2019 PANTHEON.tech s.r.o. - * =================================================================== - * 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.asdcapi.lighty; - -import io.lighty.core.controller.api.AbstractLightyModule; -import io.lighty.core.controller.api.LightyModule; -import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; -import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiSliClient; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; - -/** - * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from - * the asdcApi-provicer artifact. - */ -public class AsdcApiModule extends AbstractLightyModule implements LightyModule { - - private final SvcLogicService svcLogicService; - private final DataBroker dataBroker; - private final NotificationPublishService publishService; - private final RpcProviderRegistry rpcRegistry; - private AsdcApiSliClient asdcApiClient; - private AsdcApiProvider asdcApiProvider; - - public AsdcApiModule(SvcLogicService svcLogicService, DataBroker dataBroker, - NotificationPublishService publishService, RpcProviderRegistry rpcRegistry) { - this.svcLogicService = svcLogicService; - this.dataBroker = dataBroker; - this.publishService = publishService; - this.rpcRegistry = rpcRegistry; - } - - @Override - protected boolean initProcedure() { - this.asdcApiClient = new AsdcApiSliClient(svcLogicService); - this.asdcApiProvider = new AsdcApiProvider(dataBroker, publishService, rpcRegistry, asdcApiClient); - return true; - } - - @Override - protected boolean stopProcedure() { - return true; - } - -} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index e6e6af694..4f2b816f4 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -25,7 +25,6 @@ features provider installer - lighty diff --git a/ccsdk-northbound-lighty/pom.xml b/ccsdk-northbound-lighty/pom.xml deleted file mode 100755 index dd3921dc6..000000000 --- a/ccsdk-northbound-lighty/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent-lite - 1.4.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - ccsdk-northbound-lighty - 0.6.1-SNAPSHOT - jar - - - - org.onap.ccsdk.sli.core - ccsdk-core-lighty - ${project.version} - - - org.onap.ccsdk.sli.northbound - asdcApi-lighty - ${project.version} - - - org.onap.ccsdk.sli.northbound - dataChange-lighty - ${project.version} - - - org.onap.ccsdk.sli.northbound - lcm-lighty - ${project.version} - - - diff --git a/ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java b/ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java deleted file mode 100644 index ce907bd95..000000000 --- a/ccsdk-northbound-lighty/src/main/java/org/onap/ccsdk/sli/northbound/lighty/CcsdkNorhboundLightyModule.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * ============LICENSE_START========================================== - * Copyright (c) 2019 PANTHEON.tech s.r.o. - * =================================================================== - * 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.lighty; - -import io.lighty.core.controller.api.AbstractLightyModule; -import org.onap.ccsdk.sli.core.lighty.common.CcsdkLightyUtils; -import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.onap.ccsdk.sli.northbound.asdcapi.lighty.AsdcApiModule; -import org.onap.ccsdk.sli.northbound.dataChange.lighty.DataChangeModule; -import org.onap.ccsdk.sli.northbound.lcm.lighty.LcmModule; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that groups all other LightyModules - * from the ccsdk-sli-northbound repository so they can be all treated as one component (for example started/stopped at once). - * For more information about the lighty.io visit the website https://lighty.io. - */ -public class CcsdkNorhboundLightyModule extends AbstractLightyModule { - - private static final Logger LOG = LoggerFactory.getLogger(CcsdkNorhboundLightyModule.class); - - private final SvcLogicService svcLogicService; - private final DataBroker dataBroker; - private final NotificationPublishService publishService; - private final RpcProviderRegistry rpcProviderRegistry; - - private AsdcApiModule asdcApiModule; - private DataChangeModule dataChangeModule; - private LcmModule lcmModule; - - public CcsdkNorhboundLightyModule(SvcLogicService svcLogicService, DataBroker dataBroker, - NotificationPublishService publishService, RpcProviderRegistry rpcProviderRegistry) { - - this.svcLogicService = svcLogicService; - this.dataBroker = dataBroker; - this.publishService = publishService; - this.rpcProviderRegistry = rpcProviderRegistry; - } - - protected boolean initProcedure() { - LOG.debug("Initializing CCSDK Northbound Lighty module..."); - - this.asdcApiModule = new AsdcApiModule(svcLogicService, dataBroker, publishService, rpcProviderRegistry); - if (!CcsdkLightyUtils.startLightyModule(asdcApiModule)) { - LOG.error("Unable to start AsdcApiModule in CCSDK Northbound Lighty module!"); - return false; - } - - this.dataChangeModule = new DataChangeModule(svcLogicService, dataBroker, publishService, rpcProviderRegistry); - if (!CcsdkLightyUtils.startLightyModule(dataChangeModule)) { - LOG.error("Unable to start DataChangeModule in CCSDK Northbound Lighty module!"); - return false; - } - - this.lcmModule = new LcmModule(svcLogicService, dataBroker, publishService, rpcProviderRegistry); - if (!CcsdkLightyUtils.startLightyModule(lcmModule)) { - LOG.error("Unable to start LcmModule in CCSDK Northbound Lighty module!"); - return false; - } - - LOG.debug("CCSDK Northbound Lighty module was initialized successfully"); - return true; - } - - protected boolean stopProcedure() { - LOG.debug("Stopping CCSDK Northbound Lighty module..."); - - boolean stopSuccessful = true; - - if (!CcsdkLightyUtils.stopLightyModule(lcmModule)) { - stopSuccessful = false; - } - - if (!CcsdkLightyUtils.stopLightyModule(dataChangeModule)) { - stopSuccessful = false; - } - - if (!CcsdkLightyUtils.stopLightyModule(asdcApiModule)) { - stopSuccessful = false; - } - - if (stopSuccessful) { - LOG.debug("CCSDK Northbound Lighty module was stopped successfully"); - } else { - LOG.error("CCSDK Northbound Lighty module was not stopped successfully!"); - } - return stopSuccessful; - } - - public AsdcApiModule getAsdcApiModule() { - return asdcApiModule; - } - - public DataChangeModule getDataChangeModule() { - return dataChangeModule; - } - - public LcmModule getLcmModule() { - return lcmModule; - } -} diff --git a/dataChange/lighty/pom.xml b/dataChange/lighty/pom.xml deleted file mode 100755 index 28ff8ed87..000000000 --- a/dataChange/lighty/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - binding-parent - 1.4.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - dataChange-lighty - 0.6.1-SNAPSHOT - jar - - ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - http://maven.apache.org - - - UTF-8 - - - - - - org.onap.ccsdk.sli.core - ccsdk-lighty-dependency-versions - ${project.version} - pom - import - - - - - - - io.lighty.core - lighty-controller - - - org.onap.ccsdk.sli.northbound - dataChange-provider - ${project.version} - - - diff --git a/dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java b/dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java deleted file mode 100644 index 412d46657..000000000 --- a/dataChange/lighty/src/main/java/org/onap/ccsdk/sli/northbound/dataChange/lighty/DataChangeModule.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ============LICENSE_START========================================== - * Copyright (c) 2019 PANTHEON.tech s.r.o. - * =================================================================== - * 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.dataChange.lighty; - -import io.lighty.core.controller.api.AbstractLightyModule; -import io.lighty.core.controller.api.LightyModule; -import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.onap.ccsdk.sli.northbound.DataChangeClient; -import org.onap.ccsdk.sli.northbound.DataChangeProvider; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; - -/** - * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from - * the dataChange-provider artifact. - */ -public class DataChangeModule extends AbstractLightyModule implements LightyModule { - - private final SvcLogicService svcLogicService; - private final DataBroker dataBroker; - private final NotificationPublishService publishService; - private final RpcProviderRegistry rpcRegistry; - - private DataChangeClient dataChangeClient; - private DataChangeProvider dataChangeProvider; - - public DataChangeModule(SvcLogicService svcLogicService, DataBroker dataBroker, - NotificationPublishService publishService, RpcProviderRegistry rpcRegistry) { - this.svcLogicService = svcLogicService; - this.dataBroker = dataBroker; - this.publishService = publishService; - this.rpcRegistry = rpcRegistry; - } - - @Override - protected boolean initProcedure() { - this.dataChangeClient = new DataChangeClient(svcLogicService); - this.dataChangeProvider = new DataChangeProvider(dataBroker, publishService, rpcRegistry, dataChangeClient); - return true; - } - - @Override - protected boolean stopProcedure() { - return true; - } - -} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index fed24d7bd..18c9e379d 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -21,7 +21,6 @@ features provider installer - lighty diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 2b3914a96..97853b22b 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -24,7 +24,7 @@ ${maven.build.timestamp} ${project.version}-${build.number} - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT ${project.version} diff --git a/lcm/lighty/pom.xml b/lcm/lighty/pom.xml deleted file mode 100755 index 53c88dd24..000000000 --- a/lcm/lighty/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - binding-parent - 1.4.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - lcm-lighty - 0.6.1-SNAPSHOT - jar - - ccsdk-sli-northbound :: lcm :: ${project.artifactId} - http://maven.apache.org - - - UTF-8 - - - - - - org.onap.ccsdk.sli.core - ccsdk-lighty-dependency-versions - ${project.version} - pom - import - - - - - - - io.lighty.core - lighty-controller - - - org.onap.ccsdk.sli.northbound - lcm-provider - ${project.version} - - - diff --git a/lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java b/lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java deleted file mode 100644 index cbbf9fb2e..000000000 --- a/lcm/lighty/src/main/java/org/onap/ccsdk/sli/northbound/lcm/lighty/LcmModule.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * ============LICENSE_START========================================== - * Copyright (c) 2019 PANTHEON.tech s.r.o. - * =================================================================== - * 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.lcm.lighty; - -import io.lighty.core.controller.api.AbstractLightyModule; -import io.lighty.core.controller.api.LightyModule; -import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.onap.ccsdk.sli.northbound.LcmProvider; -import org.onap.ccsdk.sli.northbound.LcmSliClient; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; - -/** - * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from - * the lcm-provider artifact. - */ -public class LcmModule extends AbstractLightyModule implements LightyModule { - - private final SvcLogicService svcLogicService; - private final DataBroker dataBroker; - private final NotificationPublishService publishService; - private final RpcProviderRegistry rpcRegistry; - - private LcmSliClient lcmSliClient; - private LcmProvider lcmProvider; - - public LcmModule(final SvcLogicService svcLogicService, - final DataBroker dataBroker, - final NotificationPublishService publishService, - final RpcProviderRegistry rpcRegistry) { - this.svcLogicService = svcLogicService; - this.dataBroker = dataBroker; - this.publishService = publishService; - this.rpcRegistry = rpcRegistry; - } - - @Override - protected boolean initProcedure() { - this.lcmSliClient = new LcmSliClient(svcLogicService); - this.lcmProvider = new LcmProvider(dataBroker, publishService, rpcRegistry, lcmSliClient); - return true; - } - - @Override - protected boolean stopProcedure() { - return true; - } - -} diff --git a/lcm/pom.xml b/lcm/pom.xml index 3316f3adf..0eb61fe3b 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -21,7 +21,6 @@ features provider installer - lighty diff --git a/pom.xml b/pom.xml index 9b3cc39c1..be4c7923c 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,6 @@ daexim-offsite-backup features artifacts - ccsdk-northbound-lighty ONAP diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index f6a802f14..e68364286 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -22,7 +22,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT ${project.version} -- cgit 1.2.3-korg From 3168c3f65abddac9ecf5321b93752d31a4edd9fa Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 5 Sep 2019 11:31:41 -0400 Subject: Add junit coverage Add junit test for asdcApi Change-Id: Ic564aa18795dabd32e664569be802cff7d823516 Issue-ID: CCSDK-1694 Signed-off-by: Timoney, Dan (dt5972) Add junit coverage Add junit test for asdcApi Change-Id: I21873f325177da0b03b7dd15c20bea962a641d4a Issue-ID: CCSDK-1694 Signed-off-by: Timoney, Dan (dt5972) --- .../sli/northbound/asdcapi/TestAsdcApiApi.java | 34 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java index 6ad9a829f..1f266365c 100644 --- a/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java +++ b/asdcApi/provider/src/test/java/org/onap/ccsdk/sli/northbound/asdcapi/TestAsdcApiApi.java @@ -25,18 +25,23 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.http.xmlns.onap.org.asdc.license.model._1._0.rev160427.vf.license.model.grouping.VfLicenseModelBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.VfLicenseModelUpdateOutput; import org.opendaylight.yangtools.yang.common.RpcResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Properties; + public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { private AsdcApiProvider asdcApiProvider; @@ -49,6 +54,13 @@ public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { NotificationPublishService mockNotification = mock(NotificationPublishService.class); RpcProviderRegistry mockRpcRegistry = mock(RpcProviderRegistry.class); AsdcApiSliClient mockSliClient = mock(AsdcApiSliClient.class); + Properties respProps = new Properties(); + respProps.setProperty("error-code", "200"); + respProps.setProperty("error-message", "Success"); + + when(mockSliClient.hasGraph("ASDC-API", "vf-license-model-update" , null, "sync")).thenReturn(true); + when(mockSliClient.execute("ASDC-API", "vf-license-model-update", null, "sync", respProps)).thenReturn(respProps); + asdcApiProvider = new AsdcApiProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient); } } @@ -72,7 +84,7 @@ public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { fail("Error : " + e); } LOG.info("result: {}", rpcResult); - assertEquals("503", rpcResult.getResult().getAsdcApiResponseCode()); + assertEquals("200", rpcResult.getResult().getAsdcApiResponseCode()); } //Input parameter validation @@ -89,11 +101,20 @@ public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { assertNull(future); } - @Test(expected = IllegalArgumentException.class) + @Test public void testVfLicenseModelUpdateValidation1() { VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(); + inputBuilder.setArtifactName("license1"); + inputBuilder.setArtifactVersion("version1"); + + VfLicenseModelBuilder vfLicenseModelBuilder = new VfLicenseModelBuilder(); + vfLicenseModelBuilder.setVfId("123"); + vfLicenseModelBuilder.setVendorName("acme"); + inputBuilder.setVfLicenseModel(vfLicenseModelBuilder.build()); + + java.util.concurrent.Future> future = asdcApiProvider .vfLicenseModelUpdate(inputBuilder.build()); RpcResult rpcResult = null; @@ -103,4 +124,13 @@ public class TestAsdcApiApi extends AbstractConcurrentDataBrokerTest { fail("Error : " + e); } } + + + + + @Test + public void testAddArtifactVersion() { + asdcApiProvider.addArtifactVersion("artifact1", + "version1"); + } } -- cgit 1.2.3-korg From d43009046d5b046206f864f5791419876334828c Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 6 Sep 2019 09:50:37 -0400 Subject: Fix errors in INFO.yaml Fix errors in INFO.yaml file Change-Id: Ifae036aa6c531c2b255a42f61845b948cc59fe21 Issue-ID: CCSDK-1696 Signed-off-by: Timoney, Dan (dt5972) --- INFO.yaml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/INFO.yaml b/INFO.yaml index 6545b24ad..c98ff0602 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -8,7 +8,7 @@ project_lead: &onap_releng_ptl email: 'dtimoney@att.com' id: 'djtimoney' company: 'ATT' - timezone: 'America/New York' + timezone: 'America/New_York' primary_contact: *onap_releng_ptl issue_tracking: type: 'jira' @@ -33,12 +33,12 @@ committers: email: 'jflucas@research.att.com' company: 'ATT' id: 'jackl' - timezone: 'America/New York' + timezone: 'America/New_York' - name: 'Jun (Nicolas) Hu' email: 'jh245g@att.com' company: 'ATT' id: 'jh245g' - timezone: 'America/New York' + timezone: 'America/New_York' - name: 'Gaurav Agrawal' email: 'gaurav.agrawal@huawei.com' company: 'Huawei' @@ -48,21 +48,9 @@ committers: email: 'brindasanth@in.ibm.com' company: 'IBM' id: 'brindasanthm' - timezone: 'America/New York' + timezone: 'America/New_York' repositories: - - ccsdk-apps - - ccsdk-cds - - ccsdk-distribution - - ccsdk-features - - ccsdk-parent - - ccsdk-platform-blueprints - - ccsdk-platform-plugins - - ccsdk-sli-adaptors - - ccsdk-sli-core - - ccsdk-sli-northbound - - ccsdk-sli-plugins - - ccsdk-storage-esaas - - ccsdk-utils + - ccsdk/sli/northbound tsc: approval: 'https://lists.onap.org/pipermail/onap-tsc' changes: -- cgit 1.2.3-korg From 763ac52a1a6bb4c4c2a900bafad4b902edd24d22 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 10 Sep 2019 16:32:13 -0400 Subject: Release version 0.6.1 Release CCSDK version 0.6.1 Change-Id: I126340b060630d7661226cfe39af3a542bca6629 Issue-ID: CCSDK-1701 Signed-off-by: Timoney, Dan (dt5972) --- releases/0.6.1.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/0.6.1.yaml diff --git a/releases/0.6.1.yaml b/releases/0.6.1.yaml new file mode 100644 index 000000000..d68cdc717 --- /dev/null +++ b/releases/0.6.1.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '0.6.1' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/206/' -- cgit 1.2.3-korg From 85962cd92a89187b61ca63a597c7f1f172cd98f2 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 11 Sep 2019 10:35:27 -0400 Subject: Roll versions for Frankfurt development Roll master version for Frankfurt development Change-Id: I78f77bff5b9b85076cfa85fee883ca9769f71ffc Issue-ID: CCSDK-1701 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- asdcApi/features/ccsdk-asdcApi/pom.xml | 4 ++-- asdcApi/features/features-asdcApi/pom.xml | 4 ++-- asdcApi/features/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/features/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/features/ccsdk-dataChange/pom.xml | 4 ++-- dataChange/features/features-dataChange/pom.xml | 4 ++-- dataChange/features/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/features/ccsdk-lcm/pom.xml | 4 ++-- lcm/features/features-lcm/pom.xml | 4 ++-- lcm/features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 4 ++-- 37 files changed, 74 insertions(+), 74 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index b047d23c1..9203e5386 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index b112574c9..38a0fee5e 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 9927bce43..85a371c82 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-asdcApi - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index e1d4bf261..350eaf07f 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 5192bfa3f..4e1d3f6db 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index e0f70a34e..9877e31c3 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 4f2b816f4..916d2da17 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 951368777..d9e6ca17b 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index 8754d11f6..a0de9fd86 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index e3df29494..fbc8b1b19 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-daexim-offsite-backup - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index 1fcf9c486..add8eef50 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 69216cbbe..89f69261d 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 19346c001..5c0f88856 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 6a0e90db8..d684f50bb 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index d813b9082..ca80301ca 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 97bd9a127..df9e73b02 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index c47cecffd..2bcaad903 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-dataChange - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index aa5756437..cd0b2d59e 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 822e4016b..cb56a375b 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 123f1a0da..8193faa6d 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 18c9e379d..ae9300f83 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 1f94f774c..b2cc3bf6b 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 97853b22b..f403fc3df 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 78e1ee8ca..b2d698d50 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index cd6359cb9..34717d428 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 327c59c5f..c5c73e7f0 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 6bfc1a1f2..2cbcdd5e8 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 380065bc6..484e974cb 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 06ea67d23..df507e611 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-lcm - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 21ab47fd5..003e1398e 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index c562038af..a51e09179 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 234cb6606..114c7988e 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 0eb61fe3b..ae83e81a5 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index ebf1e7b0a..eb328dd82 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index be4c7923c..280200f29 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT 4.0.0 @@ -104,7 +104,7 @@ ONAP - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index e68364286..00d7ead93 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 54d8edb35..d6537b40b 100644 --- a/version.properties +++ b/version.properties @@ -4,8 +4,8 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=6 -feature_revision=1 +sprint_number=7 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From ab4d7bb7087197977c464031239c202b220e6ad4 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Mon, 16 Sep 2019 18:43:54 +0000 Subject: Migrate SdncVFModel to getEntity Changes made: Replace deprecated APIs with getEntity for processing VF nodes in a model. Replace nodeTemplate with entityDetails in SdncVFModel. Corresponding changes in SdncVFModelTest. Issue-ID: CCSDK-1425 Change-Id: I2175af818c80f4526e0a57a196d03c9fba73bdbf Signed-off-by: lalena.aria --- .../sli/northbound/uebclient/SdncUebCallback.java | 46 +++++++-------- .../sli/northbound/uebclient/SdncVFModel.java | 65 +++++++++++----------- .../sli/northbound/uebclient/SdncVFModelTest.java | 23 +++++--- 3 files changed, 70 insertions(+), 64 deletions(-) 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 d7418824b..a3662604e 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 @@ -77,7 +77,6 @@ import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException; import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory; -import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.sdc.utils.ArtifactTypeEnum; import org.onap.sdc.utils.DistributionActionResultEnum; @@ -745,29 +744,30 @@ public class SdncUebCallback implements INotificationCallback { } } - // Ingest Network (VF) Data - 1707 - List vfNodeTemplatesList = sdcCsarHelper.getServiceVfList(); - - for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { - - SdncVFModel vfNodeModel = null; - try { - vfNodeModel = new SdncVFModel (sdcCsarHelper, nodeTemplate, jdbcDataSource, config); - vfNodeModel.setServiceUUID(serviceModel.getServiceUUID()); - vfNodeModel.setServiceInvariantUUID(serviceModel.getServiceInvariantUUID()); - vfNodeModel.insertData(); - - } catch (IOException e) { - deployStatus = DistributionStatusEnum.DEPLOY_ERROR; - } + // Ingest Network (VF) Data - 1707 / migrate to getEntity - 1911 + // Use getEntity to get all VFs in the service + if (vfEntities != null) { + for (IEntityDetails vfEntity : vfEntities){ - // For each VF, insert VNF Configuration data - DistributionStatusEnum vnfConfigDeployStatus = customProcessVnfConfig(sdcCsarHelper, vfNodeModel, jdbcDataSource); - if (vnfConfigDeployStatus == DistributionStatusEnum.DEPLOY_ERROR) { - deployStatus = DistributionStatusEnum.DEPLOY_ERROR; - } - - } // VF loop + SdncVFModel vfNodeModel = null; + try { + vfNodeModel = new SdncVFModel (sdcCsarHelper, vfEntity, jdbcDataSource, config); + vfNodeModel.setServiceUUID(serviceModel.getServiceUUID()); + vfNodeModel.setServiceInvariantUUID(serviceModel.getServiceInvariantUUID()); + vfNodeModel.insertData(); + + } catch (IOException e) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + } + + // For each VF, insert VNF Configuration data + DistributionStatusEnum vnfConfigDeployStatus = customProcessVnfConfig(sdcCsarHelper, vfNodeModel, jdbcDataSource); + if (vnfConfigDeployStatus == DistributionStatusEnum.DEPLOY_ERROR) { + deployStatus = DistributionStatusEnum.DEPLOY_ERROR; + } + + } // VF loop + } // Ingest Network (PNF) Data - Dublin/1906 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 76e208635..fa54c7c41 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 @@ -32,8 +32,6 @@ import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; -import org.onap.sdc.toscaparser.api.Group; -import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.Property; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @@ -51,19 +49,12 @@ public class SdncVFModel extends SdncBaseModel { private String serviceUUID = null; private String serviceInvariantUUID = null; - public SdncVFModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { + public SdncVFModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails entityDetails, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { - super(sdcCsarHelper, nodeTemplate, jdbcDataSource, config); + super(sdcCsarHelper, entityDetails, jdbcDataSource, config); - // Since SdncVFModel is not yet converted for getEntity, find the entity for this nodeTemplate - EntityQuery vfEntityQuery = EntityQuery.newBuilder(SdcTypes.VF).customizationUUID(getCustomizationUUIDNoQuotes()).build(); - TopologyTemplateQuery vfTopologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(); - List vfEntities = sdcCsarHelper.getEntity(vfEntityQuery, vfTopologyTemplateQuery, true); - if (vfEntities != null && !vfEntities.isEmpty()) { - entityDetails = vfEntities.get(0); - } // extract metadata - Metadata metadata = nodeTemplate.getMetaData(); + Metadata metadata = entityDetails.getMetadata(); addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME)); vendor = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR); addParameter("vendor", vendor); @@ -71,30 +62,36 @@ public class SdncVFModel extends SdncBaseModel { addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); // extract properties - addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, "nf_naming#ecomp_generated_naming")); - addParameter("naming_policy", extractValue(nodeTemplate, "nf_naming#naming_policy")); - addParameter("nf_type", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); - addParameter("nf_role", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)); - nfNamingCode = extractValue(nodeTemplate, "nf_naming_code"); + addParameter("ecomp_generated_naming", extractBooleanValue(entityDetails, "nf_naming", "ecomp_generated_naming")); + addParameter("naming_policy", extractValue(entityDetails, "nf_naming", "naming_policy")); + addParameter("nf_type", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); + addParameter("nf_role", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFROLE)); + nfNamingCode = extractValue(entityDetails, "nf_naming_code"); addParameter("nf_code", nfNamingCode); - addParameter("nf_function", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); - addIntParameter("avail_zone_max_count", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); - addParameter("sdnc_model_name", extractValue(nodeTemplate, "sdnc_model_name")); - addParameter("sdnc_model_version", extractValue(nodeTemplate, "sdnc_model_version")); - addParameter("sdnc_artifact_name", extractValue(nodeTemplate, "sdnc_artifact_name")); + addParameter("nf_function", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); + addIntParameter("avail_zone_max_count", extractValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONEMAXCOUNT)); + addParameter("sdnc_model_name", extractValue(entityDetails, "sdnc_model_name")); + addParameter("sdnc_model_version", extractValue(entityDetails, "sdnc_model_version")); + addParameter("sdnc_artifact_name", extractValue(entityDetails, "sdnc_artifact_name")); // store additional properties in ATTRIBUTE_VALUE_PAIR // additional complex properties are extracted via VfcInstanceGroup - - List vfcInstanceGroupListForVf = sdcCsarHelper.getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate, "org.openecomp.groups.VfcInstanceGroup"); - for (Group group : vfcInstanceGroupListForVf){ - - String vfcInstanceGroupFunction = extractGetInputValue(group, nodeTemplate, "vfc_instance_group_function"); - addParameter("vfc_instance_group_function", vfcInstanceGroupFunction, attributeValueParams); - String networkCollectionFunction = extractGetInputValue(group, nodeTemplate, "network_collection_function"); - addParameter("network_collection_function", networkCollectionFunction, attributeValueParams); - String initSubinterfaceQuantity = extractGetInputValue(group, nodeTemplate, "init_subinterface_quantity"); - addParameter("init_subinterface_quantity", initSubinterfaceQuantity, attributeValueParams); + EntityQuery entityQuery = EntityQuery.newBuilder("org.openecomp.groups.VfcInstanceGroup").build(); + String vfCustomizationUuid = getCustomizationUUIDNoQuotes(); + TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF) + .customizationUUID(vfCustomizationUuid).build(); + List vfcInstanceGroupListForVf = sdcCsarHelper.getEntity(entityQuery, topologyTemplateQuery, false); + if (vfcInstanceGroupListForVf != null) { + + for (IEntityDetails group : vfcInstanceGroupListForVf){ + + String vfcInstanceGroupFunction = extractGetInputValue(group, entityDetails, "vfc_instance_group_function"); + addParameter("vfc_instance_group_function", vfcInstanceGroupFunction, attributeValueParams); + String networkCollectionFunction = extractGetInputValue(group, entityDetails, "network_collection_function"); + addParameter("network_collection_function", networkCollectionFunction, attributeValueParams); + String initSubinterfaceQuantity = extractGetInputValue(group, entityDetails, "init_subinterface_quantity"); + addParameter("init_subinterface_quantity", initSubinterfaceQuantity, attributeValueParams); + } } } @@ -155,7 +152,7 @@ public class SdncVFModel extends SdncBaseModel { for (IEntityDetails vfModule : vfModules){ // If this vfModule name is prefixed with the VF name of the VF being processed, insert this VF Module in VF_MODULE_MODEL - String normailizedVfName = nodeTemplate.getName().toLowerCase().replace(" ", "").replace("-", "").replace(".", ""); // need full set of normalization rules from ASDC + String normailizedVfName = entityDetails.getName().toLowerCase().replace(" ", "").replace("-", "").replace(".", ""); // need full set of normalization rules from ASDC if (!vfModule.getName().startsWith(normailizedVfName)) { continue; } @@ -434,7 +431,7 @@ public class SdncVFModel extends SdncBaseModel { } // For each target node, get External policies - SdcTypes queryType = SdcTypes.valueOf(extractValue(nodeTemplate.getMetaData(), SdcPropertyNames.PROPERTY_NAME_TYPE)); + SdcTypes queryType = SdcTypes.valueOf(extractValue(entityDetails.getMetadata(), SdcPropertyNames.PROPERTY_NAME_TYPE)); insertEntityPolicyData(getCustomizationUUIDNoQuotes(), getUUID().replace("\"", ""), queryType, targetNodeCustomizationUuid, targetNodeUuid, targetNodeType, "org.openecomp.policies.External"); // AFTER getEntity } } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java index 3f795a354..f20c1edbf 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java @@ -4,11 +4,15 @@ import static org.junit.Assert.*; import static org.mockito.Mockito.*; import java.io.IOException; +import java.util.HashMap; +import java.util.Map; import org.junit.Before; import org.junit.Test; +import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; +import org.onap.sdc.toscaparser.api.Property; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @@ -19,17 +23,22 @@ import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @Before public void setUp() throws Exception { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); - NodeTemplate nodeTemplate = mock(NodeTemplate.class); + IEntityDetails mockEntityDetails = mock(IEntityDetails.class); Metadata mockMetadata = mock(Metadata.class); - DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); - when(nodeTemplate.getMetaData()).thenReturn(mockMetadata); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); - when(mockCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "nf_naming_code")).thenReturn("test-nf-naming-code"); + Property mockProperty = mock(Property.class); + Map mockProperties = new HashMap(); + when(mockEntityDetails.getMetadata()).thenReturn(mockMetadata); + when(mockEntityDetails.getProperties()).thenReturn(mockProperties); + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn("VF"); + mockProperty.setValue("test-nf-naming-code"); + when(mockProperties.get("nf_naming_code")).thenReturn(mockProperty); try { - testSdncVFModel = new SdncVFModel(mockCsarHelper,nodeTemplate,mockDBResourceManager,mockSdncUebConfiguration); + testSdncVFModel = new SdncVFModel(mockCsarHelper,mockEntityDetails,mockDBResourceManager,mockSdncUebConfiguration); testSdncVFModel.setServiceUUID("bbbb-cccc-dddd-eeee"); testSdncVFModel.setServiceInvariantUUID("cccc-dddd-eeee-ffff"); testSdncVFModel.setVendor("Cisco"); -- cgit 1.2.3-korg From 2e7e531a8d80178410a1c4e78e62443c9d9a7684 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 8 Oct 2019 20:57:16 +0000 Subject: UEB Listener SdncBaseModel add extractValue for CapabilityAssignment Changes made: Add UEB Listener SdncBaseModel add extractValue for extracting properties on CapabilityAssignment objects. Issue-ID: CCSDK-1820 Change-Id: I10bbced5e9279bc8ef2bf48a87b2e2de0cb74942 Signed-off-by: lalena.aria --- dmaap-listener/pom.xml | 2 +- ueb-listener/pom.xml | 2 +- .../ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index f403fc3df..4d2395a8e 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -24,7 +24,7 @@ ${maven.build.timestamp} ${project.version}-${build.number} - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT ${project.version} diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 00d7ead93..9e7e41691 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -22,7 +22,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT ${project.version} 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 d3fef173f..7ab431dac 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 @@ -794,6 +794,23 @@ public class SdncBaseModel { } } + protected String extractValue (CapabilityAssignment capability, String path, String name) { + String value = ""; + + if (capability.getProperties().containsKey(path)) { + Property property = capability.getProperties().get(path); + if (property != null && !property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + } + + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { + return value; + } else { + return ""; + } + } + protected String extractBooleanValue (NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); if (value != null && !value.isEmpty()) { -- cgit 1.2.3-korg From 84db6f1d6b4c975eba30dc45556ada876c262a87 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Fri, 1 Nov 2019 18:19:55 +0000 Subject: UEB Listener Final cleanup of deprecated sdc-tosca parser APIs Changes made: Replace references to all deprecated sdc-tosca parser APIs and replace with Entity-based equivalent. Changes are primarily in SdncBaseModel and junit test files. Issue-ID: CCSDK-1880 Change-Id: I5d7f12cdbebcfcb7d2487b6474cd7eb92eb32b9b Signed-off-by: lalena.aria --- .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 3 +- ueb-listener/pom.xml | 6 + .../sli/northbound/uebclient/SdncBaseModel.java | 167 ++++++++------------- .../sli/northbound/uebclient/SdncNodeModel.java | 73 ++++----- .../sli/northbound/uebclient/SdncUebCallback.java | 2 +- .../sli/northbound/uebclient/SdncARModelTest.java | 6 +- .../northbound/uebclient/SdncGroupModelTest.java | 6 + .../northbound/uebclient/SdncNodeModelTest.java | 2 +- .../sli/northbound/uebclient/SdncPNFModelTest.java | 2 +- .../northbound/uebclient/SdncServiceModelTest.java | 9 +- .../sli/northbound/uebclient/SdncVFCModelTest.java | 10 +- .../sli/northbound/uebclient/SdncVFModelTest.java | 4 +- .../uebclient/SdncVFModuleModelTest.java | 11 +- .../northbound/uebclient/TestSdncUebCallback.java | 2 +- 14 files changed, 138 insertions(+), 165 deletions(-) diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 002e05ed4..0e4413a64 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -22,6 +22,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicLoader; import org.onap.ccsdk.sli.core.sli.SvcLogicParser; import org.onap.ccsdk.sli.core.sli.SvcLogicStore; import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicClassResolver; import org.onap.ccsdk.sli.core.sli.provider.base.BlockNodeExecutor; import org.onap.ccsdk.sli.core.sli.provider.base.CallNodeExecutor; import org.onap.ccsdk.sli.core.sli.provider.base.ConfigureNodeExecutor; @@ -171,7 +172,7 @@ public class TestLcmProvider { loader.loadAndActivate(); // Create a ServiceLogicService - SvcLogicServiceImpl svc = new SvcLogicServiceImpl(new SvcLogicPropertiesProviderImpl()); + SvcLogicServiceImpl svc = new SvcLogicServiceImpl(new SvcLogicPropertiesProviderImpl(), new SvcLogicClassResolver()); // Finally ready to create sliapiProvider LcmSliClient client = new LcmSliClient(svc); diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 9e7e41691..8bd81fee5 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -44,6 +44,7 @@ org.onap.sdc.sdc-distribution-client sdc-distribution-client + 1.4.1-SNAPSHOT compile @@ -91,6 +92,11 @@ org.onap.ccsdk.sli.core dblib-provider + + commons-codec + commons-codec + 1.13 + 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 7ab431dac..bced6a830 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 @@ -39,9 +39,6 @@ import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.tosca.parser.impl.SdcPropertyNames; import org.onap.sdc.toscaparser.api.CapabilityAssignment; import org.onap.sdc.toscaparser.api.CapabilityAssignments; -import org.onap.sdc.toscaparser.api.Group; -import org.onap.sdc.toscaparser.api.NodeTemplate; -import org.onap.sdc.toscaparser.api.Policy; import org.onap.sdc.toscaparser.api.Property; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @@ -74,37 +71,22 @@ public class SdncBaseModel { protected ISdcCsarHelper sdcCsarHelper = null; protected static DBResourceManager jdbcDataSource = null; protected static SdncUebConfiguration config = null; - protected NodeTemplate nodeTemplate = null; protected IEntityDetails entityDetails = null; - - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource) { - this (sdcCsarHelper, nodeTemplate); - this.sdcCsarHelper = sdcCsarHelper; - this.nodeTemplate = nodeTemplate; - this.jdbcDataSource = jdbcDataSource; - } - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { - this (sdcCsarHelper, nodeTemplate); - this.sdcCsarHelper = sdcCsarHelper; - this.nodeTemplate = nodeTemplate; - this.jdbcDataSource = jdbcDataSource; - this.config = config; - } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails entityDetails, DBResourceManager jdbcDataSource, SdncUebConfiguration config) throws IOException { this (sdcCsarHelper, entityDetails); this.sdcCsarHelper = sdcCsarHelper; this.entityDetails = entityDetails; - this.jdbcDataSource = jdbcDataSource; - this.config = config; + SdncBaseModel.jdbcDataSource = jdbcDataSource; + SdncBaseModel.config = config; } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata, DBResourceManager jdbcDataSource) { params = new HashMap(); this.sdcCsarHelper = sdcCsarHelper; - this.jdbcDataSource = jdbcDataSource; + SdncBaseModel.jdbcDataSource = jdbcDataSource; // extract service metadata invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); @@ -116,28 +98,6 @@ public class SdncBaseModel { addParameter(PARAM_TYPE_KEY,extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_TYPE)); addParameter(PARAM_CATEGORY_KEY,extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY)); } - - public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) { - - params = new HashMap(); - attributeValueParams = new HashMap(); - this.sdcCsarHelper = sdcCsarHelper; - this.nodeTemplate = nodeTemplate; - - // extract common nodeTemplate metadata - Metadata metadata = nodeTemplate.getMetaData(); - customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); - invariantUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); - addParameter(PARAM_INVARIANT_UUID_KEY, invariantUUID); - UUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID); - addParameter(PARAM_UUID_KEY, UUID); - addParameter(PARAM_VERSION_KEY, extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); - - // extract common nodeTemplate properties - //addParameter("ecomp_generated_naming", extractValue (nodeTemplate, "naming#ecompnaming")); // should be extractBooleanValue? - //addParameter("naming_policy", extractValue (nodeTemplate, "naming#namingpolicy")); - - } public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails entityDetails) { @@ -192,8 +152,8 @@ public class SdncBaseModel { String metadataType = ""; if (!type.isEmpty()) metadataType = type; else { - Metadata metadata = nodeTemplate.getMetaData(); - metadataType = sdcCsarHelper.getMetadataPropertyValue(metadata, PARAM_TYPE_KEY); + Metadata metadata = entityDetails.getMetadata(); + metadataType = extractValue (metadata, PARAM_TYPE_KEY); } // Clean up all attributes for this resource @@ -466,7 +426,7 @@ public class SdncBaseModel { CachedRowSet rowData = getToscaData("NODE_CAPABILITY", nodeCapabilityParams); rowData.first(); int capabilityIdint = rowData.getInt("capability_id"); - capabilityId = capabilityId.valueOf(capabilityIdint); + capabilityId = String.valueOf(capabilityIdint); } catch (IOException | SQLException e) { LOG.error("Could not insert Tosca CSAR data into the NODE_CAPABILITY table"); @@ -477,12 +437,11 @@ public class SdncBaseModel { } } - protected void insertNodeCapabilitiesEntityData (Map capabilities) throws IOException { + protected void insertNodeCapabilitiesEntityData (List capabilities) throws IOException { // Process the capabilities - for (Map.Entry entry : capabilities.entrySet()) { - CapabilityAssignment capability = entry.getValue(); - + for (CapabilityAssignment capability : capabilities) { + // Insert into NODE_CAPABILITY: // capability_id (generated) // capability_provider_uuid - UUID of this node @@ -528,7 +487,7 @@ public class SdncBaseModel { CachedRowSet rowData = getToscaData("NODE_CAPABILITY", nodeCapabilityParams); rowData.first(); int capabilityIdint = rowData.getInt("capability_id"); - capabilityId = capabilityId.valueOf(capabilityIdint); + capabilityId = String.valueOf(capabilityIdint); } catch (IOException | SQLException e) { LOG.error("Could not insert Tosca CSAR data into the NODE_CAPABILITY table"); @@ -596,7 +555,7 @@ public class SdncBaseModel { } protected String extractValue (Metadata metadata, String name) { - String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); + String value = metadata.getValue(name); if (value != null) { return value; } else { @@ -605,7 +564,7 @@ public class SdncBaseModel { } protected String extractBooleanValue (Metadata metadata, String name) { - String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); + String value = metadata.getValue(name); if (value != null && !value.isEmpty()) { return value.contains("true") ? "Y" : "N"; } else { @@ -614,16 +573,7 @@ public class SdncBaseModel { } public static String extractValue (ISdcCsarHelper sdcCsarHelper, Metadata metadata, String name) { - String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name); - if (value != null) { - return value; - } else { - return ""; - } - } - - protected String extractValue (NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); + String value = metadata.getValue(name); if (value != null) { return value; } else { @@ -676,6 +626,18 @@ public class SdncBaseModel { } } + protected String extractValue (IEntityDetails entityDetails, String path1, String path2, String path3, String name) { + String value = ""; + + value = extractNestedValue (entityDetails, path1, path2, path3, name); + + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { + return value; + } else { + return ""; + } + } + protected String extractBooleanValue (IEntityDetails entityDetails, String path1, String path2, String name) { String value = ""; @@ -707,6 +669,28 @@ public class SdncBaseModel { return value; } + protected String extractNestedValue (IEntityDetails entityDetails, String path1, String path2, String path3, String name) { + String value = ""; + + if (entityDetails.getProperties().containsKey(path1)) { + Property path1Property = entityDetails.getProperties().get(path1); + if (path1Property != null) { + Map path1PropertyValue = (Map) path1Property.getValue(); + if (path1PropertyValue.containsKey(path2)) { + Map path2PropertyValue = (Map) path1PropertyValue.get(path2); + if (path2PropertyValue != null && path2PropertyValue.containsKey(path3)) { + Map path3PropertyValue = (Map) path2PropertyValue.get(path3); + if (path3PropertyValue != null && path3PropertyValue.containsKey(name)) { + value = path3PropertyValue.get(name).toString(); + } + } + } + } + } + + return value; + } + protected String extractIntegerValue (Property property, String name) { String value = ""; @@ -758,36 +742,15 @@ public class SdncBaseModel { } - // Remove this after migrate SdncVFModel to getEntity - protected String extractGetInputValue (Group group, NodeTemplate nodeTemplate, String name) { - - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (group, name)); - if (value != null) { - return value; - } else { - return ""; - } - } - - // Remove this after migrate SdncVFModel to getEntity - protected String extractGetInputName (Group group, String name) { + protected String extractValue (CapabilityAssignment capability, String name) { + String value = ""; - String getInputName = name; - String groupProperty = sdcCsarHelper.getGroupPropertyLeafValue(group, name); - if (groupProperty != null) { - int getInputIndex = groupProperty.indexOf("{get_input="); - if (getInputIndex > -1) { - getInputName = groupProperty.substring(getInputIndex+11, groupProperty.length()-1); - } - } + if (capability.getProperties().containsKey(name)) { + Property property = capability.getProperties().get(name); + value = property.getLeafPropertyValue(name).get(0); + } - return getInputName; - - } - - protected String extractValue (CapabilityAssignment capability, String name) { - String value = sdcCsarHelper.getCapabilityPropertyLeafValue(capability, name); - if (value != null) { + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { return value; } else { return ""; @@ -810,15 +773,6 @@ public class SdncBaseModel { return ""; } } - - protected String extractBooleanValue (NodeTemplate nodeTemplate, String name) { - String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); - if (value != null && !value.isEmpty()) { - return value.contains("true") ? "Y" : "N"; - } else { - return ""; - } - } protected String extractBooleanValue (IEntityDetails entityDetails, String name) { String value = null; @@ -854,8 +808,15 @@ public class SdncBaseModel { } } - protected Object extractObjectValue (NodeTemplate nodeTemplate, String name) { - Object value = sdcCsarHelper.getNodeTemplatePropertyValueAsObject(nodeTemplate, name); + protected Object extractObjectValue (IEntityDetails entityDetails, String name) { + Object value = ""; + if (entityDetails.getProperties().containsKey(name)) { + Property property = entityDetails.getProperties().get(name); + if (property != null && property.getValue() != null) { + value = property.getValue(); + } + } + if (value != null) { return value; } else { @@ -1030,7 +991,7 @@ public class SdncBaseModel { protected boolean cleanupExistingToscaData(String tableName, Map keyParams) throws IOException { - return SdncBaseModel.cleanupExistingToscaData(this.jdbcDataSource, tableName, keyParams); + return SdncBaseModel.cleanupExistingToscaData(SdncBaseModel.jdbcDataSource, tableName, keyParams); } public static boolean cleanupExistingToscaData(DBResourceManager jdbcDataSource, String tableName, Map keyParams) throws IOException 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 65b20e61f..8e790d9be 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 @@ -137,44 +137,47 @@ public class SdncNodeModel extends SdncBaseModel { public void insertRelatedNetworkRoleData () throws IOException { - if (entityDetails.getProperties().containsKey("related_networks")) { + if (entityDetails.getProperties().containsKey("network_assignments")) { - Property relatedNetworksProperty = entityDetails.getProperties().get("related_networks"); - List relatedNetworkRoles = relatedNetworksProperty.getLeafPropertyValue("related_network_role"); + Map networkAssignmentsPropertyValue = (Map) entityDetails.getProperties().get("network_assignments").getValue(); - String networkModelCustomizationUUID = getCustomizationUUID(); - - try { - cleanUpExistingToscaData("RELATED_NETWORK_ROLE", "network_model_customization_uuid", networkModelCustomizationUUID); - } catch (IOException e) { - LOG.error("Could not clean up Tosca CSAR data in the RELATED_NETWORK_ROLE table"); - throw new IOException (e); - } - - for (String relatedNetworkRole : relatedNetworkRoles) { - - LOG.debug("Node Template [" + entityDetails.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkRole); - - try { - // Table cleanup RELATED_NETWORK_ROLE occurs per network - // If related_network_role for this service already exist in RELATED_NETWORK_ROLE, don't attempt insertion - Map relatedNetworkRoleParamsCheck = new HashMap(); - addParameter("related_network_role", relatedNetworkRole, relatedNetworkRoleParamsCheck); - addParameter("network_model_customization_uuid", networkModelCustomizationUUID, relatedNetworkRoleParamsCheck); - if (checkForExistingToscaData("RELATED_NETWORK_ROLE", relatedNetworkRoleParamsCheck) == false) { - relatedNetworkRoleParamsCheck.remove("related_network_role"); - LOG.info("Call insertToscaData for RELATED_NETWORK_ROLE where network_model_customization_uuid = " + networkModelCustomizationUUID); - insertToscaData(buildSql("RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRole + "\"", model_yaml, relatedNetworkRoleParamsCheck), null); + if (networkAssignmentsPropertyValue != null && networkAssignmentsPropertyValue.containsKey("related_networks")) { + + ArrayList> relatedNetworkList = (ArrayList) networkAssignmentsPropertyValue.get("related_networks"); + String networkModelCustomizationUUID = getCustomizationUUID(); + + try { + cleanUpExistingToscaData("RELATED_NETWORK_ROLE", "network_model_customization_uuid", networkModelCustomizationUUID); + } catch (IOException e) { + LOG.error("Could not clean up Tosca CSAR data in the RELATED_NETWORK_ROLE table"); + throw new IOException (e); + } + + for (Map relatedNetworkValue : relatedNetworkList) { + String relatedNetworkRoleValue = relatedNetworkValue.get("related_network_role"); + LOG.debug("Node Template [" + entityDetails.getName() + "], property [" + "related_network_role" + "] property value: " + relatedNetworkRoleValue); + + try { + // Table cleanup RELATED_NETWORK_ROLE occurs per network + // If related_network_role for this service already exist in RELATED_NETWORK_ROLE, don't attempt insertion + Map relatedNetworkRoleParamsCheck = new HashMap(); + addParameter("related_network_role", relatedNetworkRoleValue, relatedNetworkRoleParamsCheck); + addParameter("network_model_customization_uuid", networkModelCustomizationUUID, relatedNetworkRoleParamsCheck); + if (checkForExistingToscaData("RELATED_NETWORK_ROLE", relatedNetworkRoleParamsCheck) == false) { + relatedNetworkRoleParamsCheck.remove("related_network_role"); + LOG.info("Call insertToscaData for RELATED_NETWORK_ROLE where network_model_customization_uuid = " + networkModelCustomizationUUID); + insertToscaData(buildSql("RELATED_NETWORK_ROLE", "related_network_role", "\"" + relatedNetworkRoleValue + "\"", model_yaml, relatedNetworkRoleParamsCheck), null); + } + } catch (IOException e) { + LOG.debug("Could not insert Tosca CSAR data into the RELATED_NETWORK_ROLE table"); + throw new IOException (e); } - } catch (IOException e) { - LOG.debug("Could not insert Tosca CSAR data into the RELATED_NETWORK_ROLE table"); - throw new IOException (e); - } - } - } - else { - LOG.debug("Node Template [" + entityDetails.getName() + "], property [" + "related_networks" + "] property value: " + null); - } + } + } + else { + LOG.debug("Node Template [" + entityDetails.getName() + "], property [" + "related_networks" + "] property value: " + null); + } + } } 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 a3662604e..8c3a290e0 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 @@ -195,7 +195,7 @@ public class SdncUebCallback implements INotificationCallback { } private final IDistributionClient client; - private final SdncUebConfiguration config; + protected final SdncUebConfiguration config; private LinkedList deployList[]; diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java index 734dee229..11556df1b 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java @@ -9,7 +9,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncARModelTest { @@ -19,10 +19,12 @@ import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @Before public void setUp() throws Exception { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); - NodeTemplate nodeTemplate = mock(NodeTemplate.class); + Metadata mockMetadata = mock(Metadata.class); IEntityDetails mockEntityDetails = mock(IEntityDetails.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); + + when(mockEntityDetails.getMetadata()).thenReturn(mockMetadata); testSdncARModel = new SdncARModel(mockCsarHelper,mockEntityDetails,mockDBResourceManager,mockSdncUebConfiguration); assertNotNull(testSdncARModel); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java index 3b2cd96a1..0dfbf087f 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java @@ -8,6 +8,7 @@ import java.io.IOException; import org.junit.Test; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncGroupModelTest { @@ -17,8 +18,13 @@ import org.onap.ccsdk.sli.core.dblib.DBResourceManager; ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); IEntityDetails group = mock(IEntityDetails.class); IEntityDetails entityDetails = mock(IEntityDetails.class); + Metadata mockMetadata = mock(Metadata.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); + + when(entityDetails.getMetadata()).thenReturn(mockMetadata); + when(group.getMetadata()).thenReturn(mockMetadata); + SdncGroupModel testSdncGroupModel = null; try { testSdncGroupModel = new SdncGroupModel(mockCsarHelper,group,entityDetails,mockSdncUebConfiguration,mockDBResourceManager); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java index 9f859e793..3f4728f07 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java @@ -26,7 +26,7 @@ public class SdncNodeModelTest { DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); when(entityDetails.getMetadata()).thenReturn(mockMetadata); - when(isdcCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockMetadata.getValue("customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); sdncNodeModel = new SdncNodeModel(isdcCsarHelper, entityDetails, mockDBResourceManager, config); sdncNodeModel.setServiceUUID("0e8d757f-1c80-40af-85de-31d64f1f5af8"); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java index d4c06b049..97c3942dc 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncPNFModelTest.java @@ -31,7 +31,7 @@ import org.onap.ccsdk.sli.core.dblib.DBResourceManager; SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); when(mockEntityDetails.getMetadata()).thenReturn(mockMetadata); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockMetadata.getValue("customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); mockProperty.setValue("test-nf-naming-code"); when(mockProperties.get("nf_naming_code")).thenReturn(mockProperty); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java index af17e2291..b86a8e131 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java @@ -3,8 +3,6 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.junit.Assert.*; import static org.mockito.Mockito.*; -import java.io.IOException; - import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; @@ -21,10 +19,9 @@ import org.onap.sdc.toscaparser.api.elements.Metadata; DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); Metadata mockMetadata = mock(Metadata.class); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "UUID")).thenReturn("aaaa-bbbb-cccc-dddd"); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "invariantUUID")).thenReturn("bbbb-cccc-dddd-eeee"); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "namingPolicy")).thenReturn("test-naming-policy"); - + when(mockMetadata.getValue("UUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockMetadata.getValue("invariantUUID")).thenReturn("bbbb-cccc-dddd-eeee"); + when(mockMetadata.getValue("namingPolicy")).thenReturn("test-naming-policy"); testSdncServiceModel = new SdncServiceModel(mockCsarHelper,mockMetadata,mockDBResourceManager); assertNotNull(testSdncServiceModel); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java index 768eed86c..f8680522f 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java @@ -7,36 +7,29 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; -import java.util.ArrayList; import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncVFCModelTest { SdncVFCModel testSdncVFCModel; - NodeTemplate mockVFCNodeTemplate = null; IEntityDetails mockEntityDetails = null; @Before public void setup() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); - NodeTemplate mockNodeTemplate = mock(NodeTemplate.class); mockEntityDetails = mock(IEntityDetails.class); - mockVFCNodeTemplate = mock(NodeTemplate.class); Metadata mockMetadata = mock(Metadata.class); DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class); - when(mockNodeTemplate.getMetaData()).thenReturn(mockMetadata); when(mockEntityDetails.getMetadata()).thenReturn(mockMetadata); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); - when(mockCsarHelper.getNodeTemplatePropertyLeafValue(mockNodeTemplate, "nfc_naming_code")).thenReturn("test-nfc-naming-code"); + when(mockMetadata.getValue("customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); Map> cpPropertiesMap = new HashMap>(); Map propertiesMap = new HashMap(); @@ -53,7 +46,6 @@ public class SdncVFCModelTest { propertiesMap.put("ip_requirements", ipRequirementsList); cpPropertiesMap.put("cp-node-1", propertiesMap); - when(mockCsarHelper.getCpPropertiesFromVfcAsObject(mockVFCNodeTemplate)).thenReturn(cpPropertiesMap); try { testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockEntityDetails, mockDBResourceManager, mockSdncUebConfiguration); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java index f20c1edbf..93f7d3467 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java @@ -33,8 +33,8 @@ import org.onap.ccsdk.sli.core.dblib.DBResourceManager; when(mockEntityDetails.getMetadata()).thenReturn(mockMetadata); when(mockEntityDetails.getProperties()).thenReturn(mockProperties); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); - when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn("VF"); + when(mockMetadata.getValue("customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd"); + when(mockMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn("VF"); mockProperty.setValue("test-nf-naming-code"); when(mockProperties.get("nf_naming_code")).thenReturn(mockProperty); try { diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java index 846b79b49..e19e8dfa9 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java @@ -1,12 +1,13 @@ package org.onap.ccsdk.sli.northbound.uebclient; import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; - +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import org.junit.Test; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; -import org.onap.sdc.toscaparser.api.Group; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.ccsdk.sli.northbound.uebclient.SdncVFModel; public class SdncVFModuleModelTest { @@ -14,8 +15,12 @@ public class SdncVFModuleModelTest { @Test public void testSdncVFModuleModelConstructor() { IEntityDetails mockEntity = mock(IEntityDetails.class); + Metadata mockMetadata = mock(Metadata.class); ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); SdncVFModel mockSdncVFModel = mock(SdncVFModel.class); + + when(mockEntity.getMetadata()).thenReturn(mockMetadata); + SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockEntity, mockSdncVFModel); assertNotNull(testSdncVFModel); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index 2c44ba732..24dfd36b1 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -416,7 +416,7 @@ public class TestSdncUebCallback { IDistributionClient iDistClient = mock(IDistributionClient.class); SdncUebCallback cb = new SdncUebCallback(iDistClient, config); - cb.setJdbcDataSource(dblibSvc); + SdncUebCallback.setJdbcDataSource(dblibSvc); INotificationData iData = mock(INotificationData.class); /*IArtifactInfo iArtifactInfo = mock(IArtifactInfo.class); -- cgit 1.2.3-korg From 51d6ad1da02eaa8f28f51f7a8b248ab83a7f54ad Mon Sep 17 00:00:00 2001 From: Samuel Kontris Date: Thu, 5 Sep 2019 16:32:25 +0200 Subject: Fix compilation error after change in the core repository Change https://gerrit.onap.org/r/#/c/ccsdk/sli/core/+/94939/ changes the constructor of the SvcLogicServiceImpl class which causes compilation error in test class TestLcmProvider Issue-ID: CCSDK-1688 Depends-On: I26ce01b761ab5d17f1cc19e39af581b1963658a5 Signed-off-by: Samuel Kontris Change-Id: If9458dc4491b3557439d141375b4056c5210cf35 --- .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 31 +++------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 0e4413a64..8e82ccadf 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -1,6 +1,7 @@ package org.onap.ccsdk.sli.northbound; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -9,41 +10,17 @@ import java.io.InputStream; import java.net.URL; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.HashMap; -import java.util.Map; import java.util.Properties; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicLoader; -import org.onap.ccsdk.sli.core.sli.SvcLogicParser; import org.onap.ccsdk.sli.core.sli.SvcLogicStore; import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicClassResolver; -import org.onap.ccsdk.sli.core.sli.provider.base.BlockNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.CallNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.ConfigureNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.DeleteNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.ExecuteNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.ExistsNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.ForNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.GetResourceNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.IsAvailableNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.NotifyNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.RecordNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.ReleaseNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.ReserveNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.ReturnNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.SaveNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.SetNodeExecutor; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl; -import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor; -import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; @@ -132,7 +109,6 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; -import org.opendaylight.yangtools.yang.common.RpcResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -172,7 +148,8 @@ public class TestLcmProvider { loader.loadAndActivate(); // Create a ServiceLogicService - SvcLogicServiceImpl svc = new SvcLogicServiceImpl(new SvcLogicPropertiesProviderImpl(), new SvcLogicClassResolver()); + SvcLogicServiceImpl svc = new SvcLogicServiceImpl(new SvcLogicPropertiesProviderImpl(), + new SvcLogicClassResolver()); // Finally ready to create sliapiProvider LcmSliClient client = new LcmSliClient(svc); -- cgit 1.2.3-korg From df4a1a7d79b6d6054949ad7acde5f41f6761d677 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 13 Nov 2019 10:18:56 -0500 Subject: Use 1.5.0 parent pom Use released 1.5.0 version of parent pom Change-Id: I44ccdbd0f064ddbdb3caaf508fc4c164a26afe9a Issue-ID: CCSDK-1920 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 2 +- .../features/features-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/pom.xml | 2 +- daexim-offsite-backup/installer/pom.xml | 2 +- daexim-offsite-backup/model/pom.xml | 2 +- daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 7 +++++-- 36 files changed, 40 insertions(+), 37 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 9203e5386..2e0cbc5e5 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 38a0fee5e..e9751132e 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 85a371c82..93563c54c 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index 350eaf07f..b674f4161 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 4e1d3f6db..fce6cfbca 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 9877e31c3..820780b98 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 916d2da17..b31cb3cb2 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index d9e6ca17b..390621318 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index a0de9fd86..f954dd1b7 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index fbc8b1b19..58cd63f80 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index add8eef50..d4c3eefef 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.northbound diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 89f69261d..f298954e7 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 5c0f88856..454b86e88 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index d684f50bb..d4437fa06 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index ca80301ca..d54f28ab3 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index df9e73b02..5674afc98 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index 2bcaad903..c92f88139 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index cd0b2d59e..8641baa49 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index cb56a375b..b81f1802a 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 8193faa6d..db673bc03 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index ae9300f83..8e285fa57 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index b2cc3bf6b..12dd03139 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 4d2395a8e..60edc43a0 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index b2d698d50..905d40e92 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 34717d428..1c28a36e7 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index c5c73e7f0..ca4189bf8 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/features/pom.xml b/features/pom.xml index 2cbcdd5e8..11a6c3e46 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 484e974cb..67258ac99 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index df507e611..9dbc58eba 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 003e1398e..5c48c5f9c 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index a51e09179..d948e9273 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 114c7988e..281976b5a 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/lcm/pom.xml b/lcm/pom.xml index ae83e81a5..5c933dbc5 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index eb328dd82..f5e86837d 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/pom.xml b/pom.xml index 280200f29..cf38779fe 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 8bd81fee5..7199561c6 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.northbound @@ -24,6 +24,8 @@ ${project.version}-${build.number} 0.7.0-SNAPSHOT ${project.version} + 1.4.1-SNAPSHOT + 1.6.5 @@ -44,12 +46,13 @@ org.onap.sdc.sdc-distribution-client sdc-distribution-client - 1.4.1-SNAPSHOT + ${sdc.client.version} compile org.onap.sdc.sdc-tosca sdc-tosca + ${sdc.tosca.version} compile -- cgit 1.2.3-korg From a16027bfd6c7451fb6be7d70e3af3fd6c0569f3a Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 15 Nov 2019 14:56:03 -0500 Subject: Add new committers Kevin and Kapil Add new committers Kevin Smokowski and Kapil Singal Change-Id: I5f29087b8d009e59092be8cc50bb77daee4bcd64 Issue-ID: CCSDK-1934 Signed-off-by: Timoney, Dan (dt5972) --- INFO.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/INFO.yaml b/INFO.yaml index c98ff0602..57a8cf301 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -49,6 +49,16 @@ committers: company: 'IBM' id: 'brindasanthm' timezone: 'America/New_York' + - name: 'Kevin Smokowski' + email: 'ks6305@att.com' + company: 'ATT' + id: 'nullop' + timezone: 'America/New_York' + - name: 'Kapil Singal' + email: 'kaggarwal@in.ibm.com' + company: 'IBM' + id: 'kasingal' + timezone: 'America/New_York' repositories: - ccsdk/sli/northbound tsc: @@ -63,3 +73,9 @@ tsc: - type: 'Addition' name: 'Brinda Santh Muthuramalingam' link: 'https://lists.onap.org/g/onap-tsc/message/5208' + - type: 'Addition' + name: 'Kevin Smokowski' + link: 'https://lists.onap.org/g/onap-tsc/message/5635' + - type: 'Addition' + name: 'Kapil Singal' + link: 'https://lists.onap.org/g/onap-tsc/message/5635' -- cgit 1.2.3-korg From fc54469234abffaefe85a6ac3e3e58fd2a869af1 Mon Sep 17 00:00:00 2001 From: Miroslav Los Date: Fri, 8 Nov 2019 14:05:39 +0100 Subject: Make yang2props used with python3 Besides print use, all indentation was normalized on spaces. The output is text, hence binary flag was dropped as well. Signed-off-by: Miroslav Los Issue-ID: CCSDK-1919 Change-Id: I5845f50c817454c91b6aec023b40fdbb6e3a9bcf --- .../model/scripts/python/yang2props.py | 41 ++++++++++------------ 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/daexim-offsite-backup/model/scripts/python/yang2props.py b/daexim-offsite-backup/model/scripts/python/yang2props.py index 559d31b8b..97ceaa760 100755 --- a/daexim-offsite-backup/model/scripts/python/yang2props.py +++ b/daexim-offsite-backup/model/scripts/python/yang2props.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 import re import sys @@ -18,40 +18,35 @@ val = "" li = [] if len(sys.argv) < 3: - print 'yang2props.py ' - sys.exit(2) + print('yang2props.py ') + sys.exit(2) with open(sys.argv[1], "r") as ins: for line in ins: # if we see a leaf save the name for later if "leaf " in line: - match = re.search(r'leaf (\S+)', line) - if match: - leaf = match.group(1) - + match = re.search(r'leaf (\S+)', line) + if match: + leaf = match.group(1) + # if we see enum convert the value to enum format and see if it changed # if the value is different write a property entry if "enum " in line: - match = re.search(r'enum "(\S+)";', line) - if match: + match = re.search(r'enum "(\S+)";', line) + if match: val = match.group(1) - enum = to_enum(val) + enum = to_enum(val) # see if converting to enum changed the string - if val != enum: + if val != enum: property = "yang."+leaf+"."+enum+"="+val - if property not in li: - li.append( property) - + if property not in li: + li.append( property) -# Open output file -fo = open(sys.argv[2], "wb") -fo.write("# yang conversion properties \n") -fo.write("# used to convert Enum back to the original yang value \n") -fo.write("\n".join(li)) -fo.write("\n") -# Close opend file -fo.close() +with open(sys.argv[2], "w") as fo: + fo.write("# yang conversion properties \n") + fo.write("# used to convert Enum back to the original yang value \n") + fo.write("\n".join(li)) + fo.write("\n") - -- cgit 1.2.3-korg From 82f3456de2698dd7e114bb18c7becb560d1905d8 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 19 Nov 2019 12:43:42 -0500 Subject: Add id for Kapil Add Kapil's ATT id as committer Change-Id: Ica387f2ddffe33fc81ea6cb793e402472cd5f26b Issue-ID: CCSDK-1934 Signed-off-by: Timoney, Dan (dt5972) --- INFO.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/INFO.yaml b/INFO.yaml index 57a8cf301..17d4ca2a5 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -59,6 +59,11 @@ committers: company: 'IBM' id: 'kasingal' timezone: 'America/New_York' + - name: 'Kapil Singal' + email: 'ks220y@att.com' + company: 'IBM' + id: 'ks220y' + timezone: 'America/New_York' repositories: - ccsdk/sli/northbound tsc: -- cgit 1.2.3-korg From 083f91d1de09cc087e33c58476ffc301569f7841 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 19 Nov 2019 13:19:44 -0500 Subject: Fix versions of sli core dependencies Fix to override ccsdk sli core version from parent pom with current version Change-Id: Ibde08052ea5fe974e3e864fba5578443cdc1bd0f Issue-ID: CCSDK-1944 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 1 + asdcApi/provider/pom.xml | 1 + daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++++ dataChange/features/ccsdk-dataChange/pom.xml | 1 + dataChange/provider/pom.xml | 1 + dmaap-listener/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 1 + lcm/provider/pom.xml | 1 + ueb-listener/pom.xml | 2 +- 9 files changed, 12 insertions(+), 2 deletions(-) diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index e9751132e..0543fedfa 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -17,6 +17,7 @@ ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + ${project.version} ${project.version} diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 390621318..5ae3a2558 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -17,6 +17,7 @@ ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + ${project.version} ${project.version} diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index f954dd1b7..c0843a322 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -16,6 +16,10 @@ ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + + ${project.version} + + org.opendaylight.controller diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index 5674afc98..d213797f6 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -17,6 +17,7 @@ ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + ${project.version} ${project.version} diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 12dd03139..dc38b8deb 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -17,6 +17,7 @@ ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + ${project.version} ${project.version} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 60edc43a0..fef491db1 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -24,7 +24,7 @@ ${maven.build.timestamp} ${project.version}-${build.number} - 0.7.0-SNAPSHOT + ${project.version} ${project.version} diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index 67258ac99..ffd8b1af9 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -17,6 +17,7 @@ ccsdk-sli-northbound :: lcm :: ${project.artifactId} + ${project.version} ${project.version} diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index f5e86837d..418efe97a 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -17,6 +17,7 @@ ccsdk-sli-northbound :: lcm :: ${project.artifactId} + ${project.version} ${project.version} diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 7199561c6..87aea81aa 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -22,7 +22,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - 0.7.0-SNAPSHOT + ${project.version} ${project.version} 1.4.1-SNAPSHOT 1.6.5 -- cgit 1.2.3-korg From fc2a8c873189ee8d46e5973176777a4dad1e353f Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Fri, 22 Nov 2019 11:14:57 -0600 Subject: DMAAP Listener for ORAN A1 Adapter Policy Mgmt Support DMAAP listener for A1 Adapter related DMAAP messages for policy management. Also included are JUNIT test files. DMAAP topic is A1-P. Issue-ID: CCSDK-1964 Signed-off-by: SandeepLinux Change-Id: Ied78e8c14538136fede0f420804232770bcbdf3b --- .../dmaapclient/A1AdapterPolicyDmaapConsumer.java | 92 ++++++++++++++ .../TestA1AdapterPolicyDmaapConsumer.java | 136 +++++++++++++++++++++ .../dmaap-consumer-a1Adapter-policy-1.properties | 35 ++++++ 3 files changed, 263 insertions(+) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestA1AdapterPolicyDmaapConsumer.java create mode 100644 dmaap-listener/src/test/resources/dmaap-consumer-a1Adapter-policy-1.properties diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java new file mode 100644 index 000000000..778a77b80 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * Modifications Copyright © 2019 IBM. + * ================================================================================ + * 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class A1AdapterPolicyDmaapConsumer extends SdncDmaapConsumerImpl { + + private static final Logger LOG = LoggerFactory.getLogger(A1AdapterPolicyDmaapConsumer.class); + + private static final String BODY = "body"; + private static final String RPC = "rpc-name"; + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null A1-ADAPTER-DMAAP message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode a1AdapterRootNode; + try { + a1AdapterRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse A1-ADAPTER-DMAAP json input", e); + } + + JsonNode bodyNode = a1AdapterRootNode.get(BODY); + if(bodyNode == null) { + LOG.warn("Missing body in A1-ADAPTER-DMAAP message"); + return; + } + String rpcMsgbody; + try { + ObjectMapper mapper = new ObjectMapper(); + rpcMsgbody = mapper.writeValueAsString(bodyNode); + + } catch (Exception e) { + LOG.error("Unable to parse body in A1-ADAPTER-DMAAP message", e); + return; + } + + JsonNode rpcNode = a1AdapterRootNode.get(RPC); + if(rpcNode == null) { + LOG.warn("Missing node in A1-ADAPTER-DMAAP message- " + RPC); + return; + } + String rpc = rpcNode.textValue(); + String sdncEndpoint = "A1-ADAPTER-API:" + rpc; + + try { + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); + LOG.info("POST A1-ADAPTER-API Request " + rpcMsgbody); + if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword); + + conn.send("POST", "application/json", rpcMsgbody); + } else { + LOG.warn("Unable to POST A1-ADAPTER-API message. SDNC URL not available. body:\n" + rpcMsgbody); + } + } catch (Exception e) { + LOG.error("Unable to process message", e); + } + } +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestA1AdapterPolicyDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestA1AdapterPolicyDmaapConsumer.java new file mode 100644 index 000000000..8b7044f69 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestA1AdapterPolicyDmaapConsumer.java @@ -0,0 +1,136 @@ +/* + * 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.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.Properties; + +import org.apache.commons.io.FileUtils; + +import org.junit.Before; +import org.junit.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class TestA1AdapterPolicyDmaapConsumer { + private static final String a1AdapterInput = "{\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\": \"getHealthCheck\",\n" + + " \"Payload\": {\n" + + " \"near-rt-ric-id\": \"near-RT-ric1\",\n" + + " \"policy-type-id\": \"20000\",\n" + + " \"description\": \"parameters to control policy \",\n" + + " \"name\": \"admission_control_policy\",\n" + + " \"policy-type\": \"object\"\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"getHealthCheck\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + " }\n" + + "}"; + + @Test + public void test() throws Exception { + Properties props = new Properties(); + + A1AdapterPolicyDmaapConsumer consumer = new A1AdapterPolicyDmaapConsumer(); + InputStream propStr = TestA1AdapterPolicyDmaapConsumer.class.getResourceAsStream("/dmaap-consumer-a1Adapter-policy-1.properties"); + props.load(propStr); + consumer.init(props, "src/test/resources/dmaap-consumer-1.properties"); + consumer.processMsg(a1AdapterInput); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullMessage() throws Exception { + A1AdapterPolicyDmaapConsumer consumer = new A1AdapterPolicyDmaapConsumer(); + consumer.processMsg(null); + } + + @Test + public void testProcessMsgMissingBody() throws Exception { + String msg = "{\n" + + " \"body1\": {\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\": \"getHealthCheck\",\n" + + " \"Payload\": {\n" + + " \"near-rt-ric-id\": \"near-RT-ric1\",\n" + + " \"policy-type-id\": \"20000\",\n" + + " \"description\": \"parameters to control policy \",\n" + + " \"name\": \"admission_control_policy\",\n" + + " \"policy-type\": \"object\"\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"getHealthCheck\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + " }\n" + + "}"; + + A1AdapterPolicyDmaapConsumer consumer = new A1AdapterPolicyDmaapConsumer(); + consumer.processMsg(msg); + } + + @Test + public void testProcessMsgInvalidRPC() 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\": \"getHealthCheck\",\n" + + " \"Payload\": {\n" + + " \"near-rt-ric-id\": \"near-RT-ric1\",\n" + + " \"policy-type-id\": \"20000\",\n" + + " \"description\": \"parameters to control policy \",\n" + + " \"name\": \"admission_control_policy\",\n" + + " \"policy-type\": \"object\"\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name1\": \"getHealthCheck\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + " }\n" + + "}"; + + A1AdapterPolicyDmaapConsumer consumer = new A1AdapterPolicyDmaapConsumer(); + consumer.processMsg(msg); + } + +} diff --git a/dmaap-listener/src/test/resources/dmaap-consumer-a1Adapter-policy-1.properties b/dmaap-listener/src/test/resources/dmaap-consumer-a1Adapter-policy-1.properties new file mode 100644 index 000000000..edb7c453e --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-consumer-a1Adapter-policy-1.properties @@ -0,0 +1,35 @@ +TransportType=HTTPNOAUTH +Latitude =50.000000 +Longitude =-100.000000 +Version =1.0 +ServiceName =message-router.onap:3904/events +Environment =TEST +Partner = +routeOffer=MR1 +SubContextPath =/ +Protocol =http +MethodType =GET +username =admin +password =admin +contenttype =application/json +authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs= +authDate=2019-04-09T04:28:40-05:00 +host=message-router.onap:3904 +topic=A1-P +group=users +id=sdnc1 +timeout=15000 +limit=1000 +filter= +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=15000 +AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 +AFT_DME2_EP_READ_TIMEOUT_MS=50000 +sessionstickinessrequired=NO +DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt +sdnc.odl.user=admin +sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations -- cgit 1.2.3-korg From 32dab99f3a01cedb20b6af8b85343c61fbd7a6fb Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Mon, 2 Dec 2019 12:35:46 -0500 Subject: Use 1.5.1-SNAPSHOT version of parent pom Fixed version of parent pom to use snapshot version Change-Id: Id028def6885e2452c1f1f304d0da62a14e324337 Issue-ID: CCSDK-1935 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- asdcApi/features/ccsdk-asdcApi/pom.xml | 2 +- asdcApi/features/features-asdcApi/pom.xml | 2 +- asdcApi/features/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/features/pom.xml | 2 +- daexim-offsite-backup/installer/pom.xml | 2 +- daexim-offsite-backup/model/pom.xml | 2 +- daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/provider/pom.xml | 2 +- dataChange/features/ccsdk-dataChange/pom.xml | 2 +- dataChange/features/features-dataChange/pom.xml | 2 +- dataChange/features/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/features/ccsdk-lcm/pom.xml | 2 +- lcm/features/features-lcm/pom.xml | 2 +- lcm/features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 2e0cbc5e5..f4ae85c2f 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml index 0543fedfa..35e2a54b6 100644 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ b/asdcApi/features/ccsdk-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml index 93563c54c..571175b92 100644 --- a/asdcApi/features/features-asdcApi/pom.xml +++ b/asdcApi/features/features-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml index b674f4161..36d0245b3 100755 --- a/asdcApi/features/pom.xml +++ b/asdcApi/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index fce6cfbca..93ddb55f5 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 820780b98..ffaa12a79 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index b31cb3cb2..6dcaf5cc6 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 5ae3a2558..43c51ea32 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml index c0843a322..bdf789fa1 100644 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml index 58cd63f80..3a9d260c7 100644 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml index d4c3eefef..9152cf598 100755 --- a/daexim-offsite-backup/features/pom.xml +++ b/daexim-offsite-backup/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index f298954e7..3e36f56ed 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 454b86e88..fbb96800b 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index d4437fa06..3af575352 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index d54f28ab3..15e742812 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml index d213797f6..6621ee9c1 100644 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ b/dataChange/features/ccsdk-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml index c92f88139..9a34429ca 100644 --- a/dataChange/features/features-dataChange/pom.xml +++ b/dataChange/features/features-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml index 8641baa49..f16ed6951 100755 --- a/dataChange/features/pom.xml +++ b/dataChange/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index b81f1802a..abd4cc8bd 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index db673bc03..a23b81331 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 8e285fa57..617f6b36a 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index dc38b8deb..f2a4ba5a1 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index fef491db1..0436b8ebc 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.0 + 1.5.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 905d40e92..8fd22d15d 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 1c28a36e7..d5f70a0fe 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/features/installer/pom.xml b/features/installer/pom.xml index ca4189bf8..49196e71d 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/features/pom.xml b/features/pom.xml index 11a6c3e46..560f3a0f4 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml index ffd8b1af9..69ea1f2e9 100644 --- a/lcm/features/ccsdk-lcm/pom.xml +++ b/lcm/features/ccsdk-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml index 9dbc58eba..600ed4305 100644 --- a/lcm/features/features-lcm/pom.xml +++ b/lcm/features/features-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml index 5c48c5f9c..ac0258b71 100755 --- a/lcm/features/pom.xml +++ b/lcm/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT org.onap.ccsdk.sli.northbound diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index d948e9273..b7aa65f79 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 281976b5a..f5c1aec59 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/lcm/pom.xml b/lcm/pom.xml index 5c933dbc5..555900372 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 418efe97a..496e81909 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0 + 1.5.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index cf38779fe..b376605e7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0 + 1.5.1-SNAPSHOT 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 87aea81aa..cd39863f6 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.0 + 1.5.1-SNAPSHOT org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From 1ee69b1f0a3fde8d77393f541b12ff6daee11600 Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Wed, 4 Dec 2019 21:14:48 +0800 Subject: Add LCM APIs for DownloadNeSw and ActivateNeSw actions Add two LCM APIs of DownloadNeSw and ActivateNeSw for PNF Software Upgrade. Change-Id: I5a8f143c2d7d54fd96772eeb1d31b2d2e8bfb523 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang --- lcm/model/src/main/resources/lcm.20180329.json | 216 +++++++++++++++++++++ lcm/model/src/main/yang/lcm.yang | 62 ++++++ .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 48 +++++ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 72 +++++++ .../resources/graphs/lcm/LCM_activate-ne-sw.xml | 30 +++ .../resources/graphs/lcm/LCM_download-ne-sw.xml | 30 +++ .../src/test/resources/graphs/lcm/graph.versions | 2 + 7 files changed, 460 insertions(+) create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json index 291e18fb1..2e9eabe6f 100644 --- a/lcm/model/src/main/resources/lcm.20180329.json +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -1252,6 +1252,70 @@ "description": "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status .", "operationId": "upgrade-software" } + }, + "/operations/LCM:download-ne-sw": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(download-ne-sw)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(download-ne-sw)output-TOP" + } + } + }, + "description": "An operation to download NE software.", + "operationId": "download-ne-sw" + } + }, + "/operations/LCM:activate-ne-sw": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(activate-ne-sw)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(activate-ne-sw)output-TOP" + } + } + }, + "description": "An operation to activate NE software.", + "operationId": "activate-ne-sw" + } } }, "definitions": { @@ -4116,6 +4180,158 @@ }, "type": "object" }, + "(download-ne-sw)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(download-ne-sw)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(download-ne-sw)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(download-ne-sw)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "required": [ + "LCM:payload" + ], + "type": "object" + }, + "(download-ne-sw)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(download-ne-sw)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(activate-ne-sw)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(activate-ne-sw)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(activate-ne-sw)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(activate-ne-sw)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "required": [ + "LCM:payload" + ], + "type": "object" + }, + "(activate-ne-sw)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(activate-ne-sw)output" + }, + "type": "object" + } + }, + "type": "object" + }, "LCM(config)action-identifiers": { "properties": { "LCM:service-instance-id": { diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index cbb772fb0..55af1159d 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -114,6 +114,8 @@ module LCM { enum "DistributeTraffic"; enum "UpgradePreCheck"; enum "UpgradeSoftware"; + enum "DownloadNeSw"; + enum "ActivateNeSw"; enum "UpgradePostCheck"; enum "UpgradeBackup"; enum "UpgradeBackout"; @@ -311,6 +313,12 @@ module LCM { type string; mandatory false; } + leaf pnf-id { + description "identifies the PNF to which this action is to be applied."; + type string; + mandatory false; + } + } } @@ -591,6 +599,60 @@ module LCM { } } + /********************************************************************************** + * Define the downloadNeSw operation + **********************************************************************************/ + rpc download-ne-sw { + description "An operation to download NE software"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory true; + } + } + } + + /********************************************************************************** + * Define the activateNeSw operation + **********************************************************************************/ + rpc activate-ne-sw { + description "An operation to activate NE software"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory true; + } + } + } + /********************************************************************************** * Define the VNF UpgradePostCheck service **********************************************************************************/ diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 0074dfc65..6fd494360 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -760,6 +760,54 @@ public class LcmProvider implements AutoCloseable, LCMService { return Futures.immediateFuture(rpcResult); } + @Override + public ListenableFuture> downloadNeSw(DownloadNeSwInput input) { + DownloadNeSwInputBuilder iBuilder = new DownloadNeSwInputBuilder(input); + DownloadNeSwOutputBuilder oBuilder = new DownloadNeSwOutputBuilder(); + + try { + CommonLcmFields retval = callDG("download-ne-sw", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture> activateNeSw(ActivateNeSwInput input) { + ActivateNeSwInputBuilder iBuilder = new ActivateNeSwInputBuilder(input); + ActivateNeSwOutputBuilder oBuilder = new ActivateNeSwOutputBuilder(); + + try { + CommonLcmFields retval = callDG("activate-ne-sw", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + @Override public ListenableFuture> stop(StopInput input) { StopInputBuilder iBuilder = new StopInputBuilder(input); diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 8e82ccadf..e0d8e577e 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -106,6 +106,10 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; @@ -1150,6 +1154,74 @@ public class TestLcmProvider { } } + @Test + public void testDownloadNeSw() { + DownloadNeSwInputBuilder builder = new DownloadNeSwInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DownloadNeSw); + builder.setPayload(mock(Payload.class)); + + + try { + DownloadNeSwOutput results = provider.downloadNeSw(builder.build()).get().getResult(); + LOG.info("DownloadNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DownloadNeSw threw exception"); + } + } + + @Test + public void testActivateNeSw() { + ActivateNeSwInputBuilder builder = new ActivateNeSwInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ActivateNeSw); + builder.setPayload(mock(Payload.class)); + + + try { + ActivateNeSwOutput results = provider.activateNeSw(builder.build()).get().getResult(); + LOG.info("ActivateNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ActivateNeSw threw exception"); + } + } + @Test public void testStop() { StopInputBuilder builder = new StopInputBuilder(); diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml new file mode 100644 index 000000000..99f74b6e9 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml new file mode 100644 index 000000000..fd586cce5 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index 233aa459f..466be55b6 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -30,6 +30,8 @@ LCM resume-traffic 1.0.0 sync LCM distribute-traffic 1.0.0 sync LCM upgrade-pre-check 1.0.0 sync LCM upgrade-software 1.0.0 sync +LCM download-ne-sw 1.0.0 sync +LCM activate-ne-sw 1.0.0 sync LCM upgrade-post-check 1.0.0 sync LCM upgrade-backup 1.0.0 sync LCM upgrade-backout 1.0.0 sync -- cgit 1.2.3-korg From 3b423f520594457ab8bf98d576ea1f8987ba3aab Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 11 Dec 2019 08:16:13 -0500 Subject: Generate dependency list Generate list of direct dependencies for repository and publish to Nexus. Change-Id: If8a89cc6d3a46e896159d30682a7196df45dd258 Issue-ID: CCSDK-1986 Signed-off-by: Timoney, Dan (dt5972) --- .gitignore | 3 +++ pom.xml | 44 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d66d73564..7943e8332 100755 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ yang-gen-sal/ sdnc-northbound_bdio.jsonld blackDuckHubProjectName.txt blackDuckHubProjectVersionName.txt + +# Generated dependencies list +direct-dependencies.txt diff --git a/pom.xml b/pom.xml index b376605e7..c3df62b56 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,49 @@ - + + dependency-list + + + + com.github.ferstl + depgraph-maven-plugin + + + validate + false + + aggregate + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + package + false + + attach-artifact + + + + + ${dependency-list.file} + txt + dependencies + + + + + + + + + -- cgit 1.2.3-korg From 893680f892ab0dc6871c35cdf21af1da2d38edf2 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 13 Dec 2019 14:48:58 -0500 Subject: Refactor features to separate installer Refactor karaf feature.xml files to separate installer Change-Id: I32eace0e537ff302bf52c664f8c90dfbbe01a545 Issue-ID: CCSDK-1754 Signed-off-by: Timoney, Dan (dt5972) --- asdcApi/features/ccsdk-asdcApi/pom.xml | 44 ------------------ asdcApi/features/features-asdcApi/pom.xml | 33 -------------- asdcApi/features/pom.xml | 22 --------- asdcApi/installer/pom.xml | 13 ------ asdcApi/pom.xml | 1 - .../features/ccsdk-daexim-offsite-backup/pom.xml | 49 -------------------- .../src/main/feature/feature.xml | 7 --- .../features-daexim-offsite-backup/pom.xml | 28 ------------ daexim-offsite-backup/features/pom.xml | 22 --------- daexim-offsite-backup/installer/pom.xml | 13 ------ daexim-offsite-backup/pom.xml | 1 - dataChange/features/ccsdk-dataChange/pom.xml | 45 ------------------ dataChange/features/features-dataChange/pom.xml | 33 -------------- dataChange/features/pom.xml | 23 ---------- dataChange/installer/pom.xml | 13 ------ dataChange/pom.xml | 1 - features/ccsdk-asdcApi/pom.xml | 44 ++++++++++++++++++ features/ccsdk-daexim-offsite-backup/pom.xml | 49 ++++++++++++++++++++ .../src/main/feature/feature.xml | 7 +++ features/ccsdk-dataChange/pom.xml | 45 ++++++++++++++++++ features/ccsdk-lcm/pom.xml | 45 ++++++++++++++++++ features/installer/pom.xml | 53 ++++++++++++++++++++++ features/pom.xml | 4 ++ lcm/features/ccsdk-lcm/pom.xml | 45 ------------------ lcm/features/features-lcm/pom.xml | 33 -------------- lcm/features/pom.xml | 22 --------- lcm/installer/pom.xml | 13 ------ lcm/pom.xml | 1 - 28 files changed, 247 insertions(+), 462 deletions(-) delete mode 100644 asdcApi/features/ccsdk-asdcApi/pom.xml delete mode 100644 asdcApi/features/features-asdcApi/pom.xml delete mode 100755 asdcApi/features/pom.xml delete mode 100644 daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml delete mode 100644 daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml delete mode 100644 daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml delete mode 100755 daexim-offsite-backup/features/pom.xml delete mode 100644 dataChange/features/ccsdk-dataChange/pom.xml delete mode 100644 dataChange/features/features-dataChange/pom.xml delete mode 100755 dataChange/features/pom.xml create mode 100644 features/ccsdk-asdcApi/pom.xml create mode 100644 features/ccsdk-daexim-offsite-backup/pom.xml create mode 100644 features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml create mode 100644 features/ccsdk-dataChange/pom.xml create mode 100644 features/ccsdk-lcm/pom.xml delete mode 100644 lcm/features/ccsdk-lcm/pom.xml delete mode 100644 lcm/features/features-lcm/pom.xml delete mode 100755 lcm/features/pom.xml diff --git a/asdcApi/features/ccsdk-asdcApi/pom.xml b/asdcApi/features/ccsdk-asdcApi/pom.xml deleted file mode 100644 index 35e2a54b6..000000000 --- a/asdcApi/features/ccsdk-asdcApi/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - ccsdk-asdcApi - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - - - ${project.version} - ${project.version} - - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - asdcApi-model - ${project.version} - - - ${project.groupId} - asdcApi-provider - ${project.version} - - - - diff --git a/asdcApi/features/features-asdcApi/pom.xml b/asdcApi/features/features-asdcApi/pom.xml deleted file mode 100644 index 571175b92..000000000 --- a/asdcApi/features/features-asdcApi/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - feature-repo-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - features-asdcApi - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - - - ${project.version} - - - - - ${project.groupId} - ccsdk-asdcApi - ${project.version} - xml - features - - - - diff --git a/asdcApi/features/pom.xml b/asdcApi/features/pom.xml deleted file mode 100755 index 36d0245b3..000000000 --- a/asdcApi/features/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent-lite - 1.5.1-SNAPSHOT - - - org.onap.ccsdk.sli.northbound - asdcApi-features - 0.7.0-SNAPSHOT - pom - - ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - - - ccsdk-asdcApi - features-asdcApi - - diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 93ddb55f5..cad3fb8b3 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -25,19 +25,6 @@ - - org.onap.ccsdk.sli.northbound - ${application.name} - ${project.version} - xml - features - - - * - * - - - org.onap.ccsdk.sli.northbound asdcApi-model diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 6dcaf5cc6..baac617c2 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -22,7 +22,6 @@ model - features provider installer diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml deleted file mode 100644 index bdf789fa1..000000000 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - ccsdk-daexim-offsite-backup - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} - - - ${project.version} - - - - - org.opendaylight.controller - odl-mdsal-broker - xml - features - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - provided - - - ${project.groupId} - daexim-offsite-backup-model - ${project.version} - - - ${project.groupId} - daexim-offsite-backup-provider - ${project.version} - - - diff --git a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml b/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml deleted file mode 100644 index 3dcb9002c..000000000 --- a/daexim-offsite-backup/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - mvn:org.onap.ccsdk.sli.core/ccsdk-sli/LATEST/xml/features - - ccsdk-sli - - diff --git a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml b/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml deleted file mode 100644 index 3a9d260c7..000000000 --- a/daexim-offsite-backup/features/features-daexim-offsite-backup/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - feature-repo-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - features-daexim-offsite-backup - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} - - - - ${project.groupId} - ccsdk-daexim-offsite-backup - ${project.version} - xml - features - - - diff --git a/daexim-offsite-backup/features/pom.xml b/daexim-offsite-backup/features/pom.xml deleted file mode 100755 index 9152cf598..000000000 --- a/daexim-offsite-backup/features/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent-lite - 1.5.1-SNAPSHOT - - - org.onap.ccsdk.sli.northbound - daexim-offsite-backup-features - 0.7.0-SNAPSHOT - pom - - ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} - - - ccsdk-daexim-offsite-backup - features-daexim-offsite-backup - - diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 3e36f56ed..dae4a4fd3 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -20,19 +20,6 @@ false - - org.onap.ccsdk.sli.northbound - ${application.name} - ${project.version} - xml - features - - - * - * - - - org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 3af575352..65cf987d9 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -20,7 +20,6 @@ model provider - features installer diff --git a/dataChange/features/ccsdk-dataChange/pom.xml b/dataChange/features/ccsdk-dataChange/pom.xml deleted file mode 100644 index 6621ee9c1..000000000 --- a/dataChange/features/ccsdk-dataChange/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - ccsdk-dataChange - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - - - ${project.version} - ${project.version} - - - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - dataChange-model - ${project.version} - - - ${project.groupId} - dataChange-provider - ${project.version} - - - - diff --git a/dataChange/features/features-dataChange/pom.xml b/dataChange/features/features-dataChange/pom.xml deleted file mode 100644 index 9a34429ca..000000000 --- a/dataChange/features/features-dataChange/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - feature-repo-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - features-dataChange - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - - - ${project.version} - - - - - ${project.groupId} - ccsdk-dataChange - ${project.version} - xml - features - - - - diff --git a/dataChange/features/pom.xml b/dataChange/features/pom.xml deleted file mode 100755 index f16ed6951..000000000 --- a/dataChange/features/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent-lite - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - dataChange-features - 0.7.0-SNAPSHOT - pom - - ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - - - ccsdk-dataChange - features-dataChange - - diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index abd4cc8bd..7516f0b56 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -25,19 +25,6 @@ - - org.onap.ccsdk.sli.northbound - ${application.name} - ${project.version} - xml - features - - - * - * - - - org.onap.ccsdk.sli.northbound dataChange-model diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 617f6b36a..75637886d 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -18,7 +18,6 @@ model - features provider installer diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml new file mode 100644 index 000000000..35e2a54b6 --- /dev/null +++ b/features/ccsdk-asdcApi/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.5.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-asdcApi + 0.7.0-SNAPSHOT + feature + + ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} + + + ${project.version} + ${project.version} + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + asdcApi-model + ${project.version} + + + ${project.groupId} + asdcApi-provider + ${project.version} + + + + diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml new file mode 100644 index 000000000..bdf789fa1 --- /dev/null +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.5.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-daexim-offsite-backup + 0.7.0-SNAPSHOT + feature + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + + + ${project.version} + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + provided + + + ${project.groupId} + daexim-offsite-backup-model + ${project.version} + + + ${project.groupId} + daexim-offsite-backup-provider + ${project.version} + + + diff --git a/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml b/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml new file mode 100644 index 000000000..3dcb9002c --- /dev/null +++ b/features/ccsdk-daexim-offsite-backup/src/main/feature/feature.xml @@ -0,0 +1,7 @@ + + + mvn:org.onap.ccsdk.sli.core/ccsdk-sli/LATEST/xml/features + + ccsdk-sli + + diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml new file mode 100644 index 000000000..6621ee9c1 --- /dev/null +++ b/features/ccsdk-dataChange/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.5.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-dataChange + 0.7.0-SNAPSHOT + feature + + ccsdk-sli-northbound :: dataChange :: ${project.artifactId} + + + ${project.version} + ${project.version} + + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + dataChange-model + ${project.version} + + + ${project.groupId} + dataChange-provider + ${project.version} + + + + diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml new file mode 100644 index 000000000..69ea1f2e9 --- /dev/null +++ b/features/ccsdk-lcm/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.5.1-SNAPSHOT + + + + org.onap.ccsdk.sli.northbound + ccsdk-lcm + 0.7.0-SNAPSHOT + feature + + ccsdk-sli-northbound :: lcm :: ${project.artifactId} + + + ${project.version} + ${project.version} + + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + lcm-model + ${project.version} + + + ${project.groupId} + lcm-provider + ${project.version} + + + + diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 49196e71d..b9ad99f17 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -24,6 +24,59 @@ + + org.onap.ccsdk.sli.northbound + ccsdk-asdcApi + ${project.version} + xml + features + + + * + * + + + + + org.onap.ccsdk.sli.northbound + ccsdk-daexim-offsite-backup + ${project.version} + xml + features + + + * + * + + + + + org.onap.ccsdk.sli.northbound + ccsdk-dataChange + ${project.version} + xml + features + + + * + * + + + + + org.onap.ccsdk.sli.northbound + ccsdk-lcm + ${project.version} + xml + features + + + * + * + + + + org.onap.ccsdk.sli.northbound diff --git a/features/pom.xml b/features/pom.xml index 560f3a0f4..4f3c2ae17 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -17,6 +17,10 @@ ccsdk-sli-northbound :: features + ccsdk-asdcApi + ccsdk-daexim-offsite-backup + ccsdk-dataChange + ccsdk-lcm ccsdk-sli-northbound-all features-sli-northbound installer diff --git a/lcm/features/ccsdk-lcm/pom.xml b/lcm/features/ccsdk-lcm/pom.xml deleted file mode 100644 index 69ea1f2e9..000000000 --- a/lcm/features/ccsdk-lcm/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - ccsdk-lcm - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: lcm :: ${project.artifactId} - - - ${project.version} - ${project.version} - - - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - lcm-model - ${project.version} - - - ${project.groupId} - lcm-provider - ${project.version} - - - - diff --git a/lcm/features/features-lcm/pom.xml b/lcm/features/features-lcm/pom.xml deleted file mode 100644 index 600ed4305..000000000 --- a/lcm/features/features-lcm/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - feature-repo-parent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.sli.northbound - features-lcm - 0.7.0-SNAPSHOT - feature - - ccsdk-sli-northbound :: lcm :: ${project.artifactId} - - - ${project.version} - - - - - ${project.groupId} - ccsdk-lcm - ${project.version} - xml - features - - - - diff --git a/lcm/features/pom.xml b/lcm/features/pom.xml deleted file mode 100755 index ac0258b71..000000000 --- a/lcm/features/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent-lite - 1.5.1-SNAPSHOT - - - org.onap.ccsdk.sli.northbound - lcm-features - 0.7.0-SNAPSHOT - pom - - ccsdk-sli-northbound :: lcm :: ${project.artifactId} - - - ccsdk-lcm - features-lcm - - diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index b7aa65f79..38b4f84b0 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -25,19 +25,6 @@ - - org.onap.ccsdk.sli.northbound - ${application.name} - ${project.version} - xml - features - - - * - * - - - org.onap.ccsdk.sli.northbound lcm-model diff --git a/lcm/pom.xml b/lcm/pom.xml index 555900372..4f19f8cdd 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -18,7 +18,6 @@ model - features provider installer -- cgit 1.2.3-korg From fff922790262500c1cced5e674179bf8873acb83 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Tue, 17 Dec 2019 00:22:14 -0600 Subject: Bug fix in DMAAP listener for A1 Adapter Modification to use the payload node to be sent as an RPC message to stay in alignment with YANG model for A1 adapter Issue-ID: CCSDK-2001 Signed-off-by: SandeepLinux Change-Id: I023cf27ec9ac0305f1bc23bc9762603192c09e27 --- .../dmaapclient/A1AdapterPolicyDmaapConsumer.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java index 778a77b80..dd59f5868 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java @@ -34,6 +34,9 @@ public class A1AdapterPolicyDmaapConsumer extends SdncDmaapConsumerImpl { private static final String BODY = "body"; private static final String RPC = "rpc-name"; + private static final String INPUT = "input"; + private static final String PAYLOAD = "Payload"; + @Override public void processMsg(String msg) throws InvalidMessageException { @@ -55,13 +58,26 @@ public class A1AdapterPolicyDmaapConsumer extends SdncDmaapConsumerImpl { LOG.warn("Missing body in A1-ADAPTER-DMAAP message"); return; } + + JsonNode input = bodyNode.get(INPUT); + if(input == null) { + LOG.info("Missing input node."); + return; + } + + JsonNode payloadNode = input.get(PAYLOAD); + if(payloadNode == null) { + LOG.info("Missing payload node."); + return; + } + String rpcMsgbody; try { ObjectMapper mapper = new ObjectMapper(); - rpcMsgbody = mapper.writeValueAsString(bodyNode); + rpcMsgbody = mapper.writeValueAsString(payloadNode); } catch (Exception e) { - LOG.error("Unable to parse body in A1-ADAPTER-DMAAP message", e); + LOG.error("Unable to parse payload in A1-ADAPTER-DMAAP message", e); return; } -- cgit 1.2.3-korg From 259dc1ff083206ea3a8425c8e9f3c6988d20e524 Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Tue, 7 Jan 2020 16:32:30 +0800 Subject: Fix action names of DownloadNESw and ActivateNESw Change-Id: I2a7b5ca9554e52f219afe9248d39732c485ab037 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang --- lcm/model/src/main/resources/lcm.20180329.json | 48 +++++++++++++--------- lcm/model/src/main/yang/lcm.yang | 12 +++--- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 24 +++++------ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 34 +++++++-------- .../resources/graphs/lcm/LCM_activate-n-e-sw.xml | 30 ++++++++++++++ .../resources/graphs/lcm/LCM_activate-ne-sw.xml | 30 -------------- .../resources/graphs/lcm/LCM_download-n-e-sw.xml | 30 ++++++++++++++ .../resources/graphs/lcm/LCM_download-ne-sw.xml | 30 -------------- .../src/test/resources/graphs/lcm/graph.versions | 4 +- 9 files changed, 126 insertions(+), 116 deletions(-) create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json index 2e9eabe6f..18512fc35 100644 --- a/lcm/model/src/main/resources/lcm.20180329.json +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -1253,7 +1253,7 @@ "operationId": "upgrade-software" } }, - "/operations/LCM:download-ne-sw": { + "/operations/LCM:download-n-e-sw": { "post": { "consumes": [ "application/json", @@ -1269,7 +1269,7 @@ "name": "body", "required": false, "schema": { - "$ref": "#/definitions/(download-ne-sw)input-TOP" + "$ref": "#/definitions/(download-n-e-sw)input-TOP" } } ], @@ -1277,15 +1277,15 @@ "200": { "description": "No response was specified", "schema": { - "$ref": "#/definitions/(download-ne-sw)output-TOP" + "$ref": "#/definitions/(download-n-e-sw)output-TOP" } } }, "description": "An operation to download NE software.", - "operationId": "download-ne-sw" + "operationId": "download-n-e-sw" } }, - "/operations/LCM:activate-ne-sw": { + "/operations/LCM:activate-n-e-sw": { "post": { "consumes": [ "application/json", @@ -1301,7 +1301,7 @@ "name": "body", "required": false, "schema": { - "$ref": "#/definitions/(activate-ne-sw)input-TOP" + "$ref": "#/definitions/(activate-n-e-sw)input-TOP" } } ], @@ -1309,12 +1309,12 @@ "200": { "description": "No response was specified", "schema": { - "$ref": "#/definitions/(activate-ne-sw)output-TOP" + "$ref": "#/definitions/(activate-n-e-sw)output-TOP" } } }, "description": "An operation to activate NE software.", - "operationId": "activate-ne-sw" + "operationId": "activate-n-e-sw" } } }, @@ -1627,6 +1627,10 @@ "vserver-id": { "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + }, + "pnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the PNF to which this action is to be applied." } }, "type": "object" @@ -4180,7 +4184,7 @@ }, "type": "object" }, - "(download-ne-sw)input": { + "(download-n-e-sw)input": { "properties": { "LCM:action": { "$ref": "#/definitions/Optional.empty" @@ -4209,18 +4213,18 @@ ], "type": "object" }, - "(download-ne-sw)input-TOP": { + "(download-n-e-sw)input-TOP": { "properties": { "LCM:input": { "items": { - "$ref": "#/definitions/(download-ne-sw)input" + "$ref": "#/definitions/(download-n-e-sw)input" }, "type": "object" } }, "type": "object" }, - "(download-ne-sw)output": { + "(download-n-e-sw)output": { "properties": { "LCM:common-header": { "description": "A common header for all APP-C requests", @@ -4245,18 +4249,18 @@ ], "type": "object" }, - "(download-ne-sw)output-TOP": { + "(download-n-e-sw)output-TOP": { "properties": { "LCM:output": { "items": { - "$ref": "#/definitions/(download-ne-sw)output" + "$ref": "#/definitions/(download-n-e-sw)output" }, "type": "object" } }, "type": "object" }, - "(activate-ne-sw)input": { + "(activate-n-e-sw)input": { "properties": { "LCM:action": { "$ref": "#/definitions/Optional.empty" @@ -4285,18 +4289,18 @@ ], "type": "object" }, - "(activate-ne-sw)input-TOP": { + "(activate-n-e-sw)input-TOP": { "properties": { "LCM:input": { "items": { - "$ref": "#/definitions/(activate-ne-sw)input" + "$ref": "#/definitions/(activate-n-e-sw)input" }, "type": "object" } }, "type": "object" }, - "(activate-ne-sw)output": { + "(activate-n-e-sw)output": { "properties": { "LCM:common-header": { "description": "A common header for all APP-C requests", @@ -4321,11 +4325,11 @@ ], "type": "object" }, - "(activate-ne-sw)output-TOP": { + "(activate-n-e-sw)output-TOP": { "properties": { "LCM:output": { "items": { - "$ref": "#/definitions/(activate-ne-sw)output" + "$ref": "#/definitions/(activate-n-e-sw)output" }, "type": "object" } @@ -4353,6 +4357,10 @@ "LCM:vserver-id": { "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + }, + "LCM:pnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the PNF to which this action is to be applied." } }, "type": "object" diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index 55af1159d..d2ca5feb5 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -114,8 +114,8 @@ module LCM { enum "DistributeTraffic"; enum "UpgradePreCheck"; enum "UpgradeSoftware"; - enum "DownloadNeSw"; - enum "ActivateNeSw"; + enum "DownloadNESw"; + enum "ActivateNESw"; enum "UpgradePostCheck"; enum "UpgradeBackup"; enum "UpgradeBackout"; @@ -600,9 +600,9 @@ module LCM { } /********************************************************************************** - * Define the downloadNeSw operation + * Define the downloadNESw operation **********************************************************************************/ - rpc download-ne-sw { + rpc download-n-e-sw { description "An operation to download NE software"; input { uses common-header; @@ -627,9 +627,9 @@ module LCM { } /********************************************************************************** - * Define the activateNeSw operation + * Define the activateNESw operation **********************************************************************************/ - rpc activate-ne-sw { + rpc activate-n-e-sw { description "An operation to activate NE software"; input { uses common-header; diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 6fd494360..100496e39 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -761,12 +761,12 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public ListenableFuture> downloadNeSw(DownloadNeSwInput input) { - DownloadNeSwInputBuilder iBuilder = new DownloadNeSwInputBuilder(input); - DownloadNeSwOutputBuilder oBuilder = new DownloadNeSwOutputBuilder(); + public ListenableFuture> downloadNESw(DownloadNESwInput input) { + DownloadNESwInputBuilder iBuilder = new DownloadNESwInputBuilder(input); + DownloadNESwOutputBuilder oBuilder = new DownloadNESwOutputBuilder(); try { - CommonLcmFields retval = callDG("download-ne-sw", iBuilder.build()); + CommonLcmFields retval = callDG("download-n-e-sw", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); if (retval.getPayload() != null) { @@ -778,19 +778,19 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(e.getStatus()); } - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); // return error return Futures.immediateFuture(rpcResult); } @Override - public ListenableFuture> activateNeSw(ActivateNeSwInput input) { - ActivateNeSwInputBuilder iBuilder = new ActivateNeSwInputBuilder(input); - ActivateNeSwOutputBuilder oBuilder = new ActivateNeSwOutputBuilder(); + public ListenableFuture> activateNESw(ActivateNESwInput input) { + ActivateNESwInputBuilder iBuilder = new ActivateNESwInputBuilder(input); + ActivateNESwOutputBuilder oBuilder = new ActivateNESwOutputBuilder(); try { - CommonLcmFields retval = callDG("activate-ne-sw", iBuilder.build()); + CommonLcmFields retval = callDG("activate-n-e-sw", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); if (retval.getPayload() != null) { @@ -802,8 +802,8 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(e.getStatus()); } - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); // return error return Futures.immediateFuture(rpcResult); } diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index e0d8e577e..a7e1e1f2e 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -106,10 +106,10 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareOutput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwOutput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; @@ -1155,8 +1155,8 @@ public class TestLcmProvider { } @Test - public void testDownloadNeSw() { - DownloadNeSwInputBuilder builder = new DownloadNeSwInputBuilder(); + public void testDownloadNESw() { + DownloadNESwInputBuilder builder = new DownloadNESwInputBuilder(); CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); hdrBuilder.setApiVer("1"); @@ -1171,26 +1171,27 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); + aBuilder.setPnfId("456"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); - builder.setAction(Action.DownloadNeSw); + builder.setAction(Action.DownloadNESw); builder.setPayload(mock(Payload.class)); try { - DownloadNeSwOutput results = provider.downloadNeSw(builder.build()).get().getResult(); - LOG.info("DownloadNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + DownloadNESwOutput results = provider.downloadNESw(builder.build()).get().getResult(); + LOG.info("DownloadNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); assert(results.getStatus().getCode() == 400); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught exception", e); - fail("DownloadNeSw threw exception"); + fail("DownloadNESw threw exception"); } } @Test - public void testActivateNeSw() { - ActivateNeSwInputBuilder builder = new ActivateNeSwInputBuilder(); + public void testActivateNESw() { + ActivateNESwInputBuilder builder = new ActivateNESwInputBuilder(); CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); hdrBuilder.setApiVer("1"); @@ -1205,20 +1206,21 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); + aBuilder.setPnfId("456"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); - builder.setAction(Action.ActivateNeSw); + builder.setAction(Action.ActivateNESw); builder.setPayload(mock(Payload.class)); try { - ActivateNeSwOutput results = provider.activateNeSw(builder.build()).get().getResult(); - LOG.info("ActivateNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + ActivateNESwOutput results = provider.activateNESw(builder.build()).get().getResult(); + LOG.info("ActivateNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); assert(results.getStatus().getCode() == 400); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught exception", e); - fail("ActivateNeSw threw exception"); + fail("ActivateNESw threw exception"); } } diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml new file mode 100644 index 000000000..44343dd5f --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml deleted file mode 100644 index 99f74b6e9..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml new file mode 100644 index 000000000..6bb0e765c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml deleted file mode 100644 index fd586cce5..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index 466be55b6..420bcf619 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -30,8 +30,8 @@ LCM resume-traffic 1.0.0 sync LCM distribute-traffic 1.0.0 sync LCM upgrade-pre-check 1.0.0 sync LCM upgrade-software 1.0.0 sync -LCM download-ne-sw 1.0.0 sync -LCM activate-ne-sw 1.0.0 sync +LCM download-n-e-sw 1.0.0 sync +LCM activate-n-e-sw 1.0.0 sync LCM upgrade-post-check 1.0.0 sync LCM upgrade-backup 1.0.0 sync LCM upgrade-backout 1.0.0 sync -- cgit 1.2.3-korg From 6a90726a7134f16c36ce2aacfaf96e2f88476c4f Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Mon, 20 Jan 2020 14:51:13 +0800 Subject: Update pnf-id to pnf-name in LCM API In order to be compatible with Pnf entry in A&AI, update pnf-id to pnf-name. Change-Id: Ibb76fd754c4a657a6f4af4453b3c819670fb96c2 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang --- lcm/model/src/main/resources/lcm.20180329.json | 4 ++-- lcm/model/src/main/yang/lcm.yang | 3 +-- .../src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json index 18512fc35..b84189858 100644 --- a/lcm/model/src/main/resources/lcm.20180329.json +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -1628,7 +1628,7 @@ "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" }, - "pnf-id": { + "pnf-name": { "$ref": "#/definitions/Optional.empty", "description": "identifies the PNF to which this action is to be applied." } @@ -4358,7 +4358,7 @@ "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" }, - "LCM:pnf-id": { + "LCM:pnf-name": { "$ref": "#/definitions/Optional.empty", "description": "identifies the PNF to which this action is to be applied." } diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index d2ca5feb5..188068a68 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -313,12 +313,11 @@ module LCM { type string; mandatory false; } - leaf pnf-id { + leaf pnf-name { description "identifies the PNF to which this action is to be applied."; type string; mandatory false; } - } } diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index a7e1e1f2e..b73151e8d 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -1171,7 +1171,7 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); - aBuilder.setPnfId("456"); + aBuilder.setPnfName("my-pnf"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); @@ -1206,7 +1206,7 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); - aBuilder.setPnfId("456"); + aBuilder.setPnfName("my-pnf"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); -- cgit 1.2.3-korg From 3f9e606b1bf7e21f6a143e3aab5a03fb2b125a7a Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 23 Jan 2020 14:40:48 -0500 Subject: Use released parent pom Use released version of ccsdk/parent poms Change-Id: If15e626db13cf5a0194a3643fb9174a2b9dc88f7 Issue-ID: CCSDK-1963 Signed-off-by: Dan Timoney --- artifacts/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- daexim-offsite-backup/installer/pom.xml | 2 +- daexim-offsite-backup/model/pom.xml | 2 +- daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/provider/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-asdcApi/pom.xml | 2 +- features/ccsdk-daexim-offsite-backup/pom.xml | 2 +- features/ccsdk-dataChange/pom.xml | 2 +- features/ccsdk-lcm/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index f4ae85c2f..518716262 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index cad3fb8b3..84bcc0b40 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index ffaa12a79..77cb4c81d 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index baac617c2..2cbdc71fd 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 43c51ea32..f59649a91 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index dae4a4fd3..2ed2b064d 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index fbb96800b..8d82f66d7 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 65cf987d9..71463e2e8 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 15e742812..0b5a5858d 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 7516f0b56..6cbadc8b1 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index a23b81331..01632f240 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 75637886d..3291a5d28 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index f2a4ba5a1..5c7e21e02 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 0436b8ebc..4018c9610 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.1-SNAPSHOT + 1.5.1 org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml index 35e2a54b6..79496ab09 100644 --- a/features/ccsdk-asdcApi/pom.xml +++ b/features/ccsdk-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml index bdf789fa1..59c9ee861 100644 --- a/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml index 6621ee9c1..81571efe1 100644 --- a/features/ccsdk-dataChange/pom.xml +++ b/features/ccsdk-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml index 69ea1f2e9..bcbf97ab6 100644 --- a/features/ccsdk-lcm/pom.xml +++ b/features/ccsdk-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 8fd22d15d..2c50a4489 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index d5f70a0fe..987071863 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index b9ad99f17..4eefa81a7 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/features/pom.xml b/features/pom.xml index 4f3c2ae17..1eff8e57c 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 38b4f84b0..59c29394a 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index f5c1aec59..98041386c 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/lcm/pom.xml b/lcm/pom.xml index 4f19f8cdd..0206097ea 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 496e81909..438d7573a 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.1-SNAPSHOT + 1.5.1 diff --git a/pom.xml b/pom.xml index c3df62b56..6b7998bc5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1-SNAPSHOT + 1.5.1 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index cd39863f6..881220b82 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.1-SNAPSHOT + 1.5.1 org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From 3ad1927084a5c4247ca4b62e9928d7f1ea74f51a Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Fri, 24 Jan 2020 10:51:34 -0500 Subject: Release CCSDK version 0.7.0 Release version 0.7.0 of CCSDK maven artifacts. Change-Id: I4f19554ede3f6b1860c02ffe7a900a1a9f81daff Issue-ID: CCSDK-1963 Signed-off-by: Dan Timoney --- releases/0.7.0.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/0.7.0.yaml diff --git a/releases/0.7.0.yaml b/releases/0.7.0.yaml new file mode 100644 index 000000000..ac468fd74 --- /dev/null +++ b/releases/0.7.0.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '0.7.0' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/301/' -- cgit 1.2.3-korg From f0594b8f4684ddbb81e490c630e5a968abd2170f Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Fri, 24 Jan 2020 16:10:06 -0500 Subject: Roll versions to next snapshot Roll CCSDK to next snapshot version Change-Id: I4441d1d1e2ead1912281109dcf7fbb4961198b36 Issue-ID: CCSDK-1963 Signed-off-by: Dan Timoney --- artifacts/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-asdcApi/pom.xml | 4 ++-- features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- features/ccsdk-dataChange/pom.xml | 4 ++-- features/ccsdk-lcm/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 29 files changed, 57 insertions(+), 57 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 518716262..1d22a357a 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.5.1 + 1.5.2-SNAPSHOT diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 84bcc0b40..25234e6ac 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 77cb4c81d..984d468ae 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 2cbdc71fd..8a21a30c6 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index f59649a91..47a11ecde 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 2ed2b064d..4d0e59655 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-daexim-offsite-backup diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 8d82f66d7..c546305bf 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 71463e2e8..8b2c5a9fa 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 0b5a5858d..059c5581f 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 6cbadc8b1..a9db69311 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 01632f240..8e10c1892 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 3291a5d28..03e4f6061 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 5c7e21e02..0104d5f2d 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 4018c9610..4185dee5f 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml index 79496ab09..694b0e848 100644 --- a/features/ccsdk-asdcApi/pom.xml +++ b/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml index 59c9ee861..cdab873f7 100644 --- a/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml index 81571efe1..493a944f7 100644 --- a/features/ccsdk-dataChange/pom.xml +++ b/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml index bcbf97ab6..f9fd204f1 100644 --- a/features/ccsdk-lcm/pom.xml +++ b/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 2c50a4489..835cf965f 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 987071863..0053bef45 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 4eefa81a7..bd76a4b5d 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 1eff8e57c..bd0d4ea27 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 59c29394a..9884f7603 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 98041386c..b94bdbeff 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 0206097ea..c0dc54d9d 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 438d7573a..52d2e68f7 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 6b7998bc5..b74f9ec26 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.1 + 1.5.2-SNAPSHOT 4.0.0 @@ -146,7 +146,7 @@ ONAP - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 881220b82..30023d782 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.5.1 + 1.5.2-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index d6537b40b..c11ada9fe 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=7 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 66ce8b86e11159bc833a64685333f7676055e38d Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Tue, 3 Mar 2020 10:10:48 -0600 Subject: DMAAP Listener for ORAN CMNotify VES events DMAAP listener for VES events originating from ORAN. Will invoke RPC/DG for updating RuntimeDB Issue-ID: CCSDK-2133 Signed-off-by: SandeepLinux Change-Id: Ia17a7b2da1c58f5624c1d331aac56ce566d097bf --- .../dmaapclient/CMNotifyDmaapConsumer.java | 112 +++++++++++++++++ .../dmaapclient/TestCMNotifyDmaapConsumer.java | 140 +++++++++++++++++++++ .../resources/dmaap-consumer-cMNotify-1.properties | 35 ++++++ 3 files changed, 287 insertions(+) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestCMNotifyDmaapConsumer.java create mode 100644 dmaap-listener/src/test/resources/dmaap-consumer-cMNotify-1.properties diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java new file mode 100644 index 000000000..e49e77ea8 --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java @@ -0,0 +1,112 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * Modifications Copyright © 2019 IBM. + * ================================================================================ + * 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 org.json.JSONObject; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CMNotifyDmaapConsumer extends SdncDmaapConsumerImpl { + + private static final Logger LOG = LoggerFactory.getLogger(CMNotifyDmaapConsumer.class); + + private static final String BODY = "body"; + private static final String RPC = "rpc-name"; + private static final String INPUT = "input"; + private static final String PAYLOAD = "Payload"; + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null CMNotify-DMAAP message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode CMNotifyRootNode; + try { + CMNotifyRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse CMNotify-DMAAP json input", e); + } + + JsonNode bodyNode = CMNotifyRootNode.get(BODY); + if(bodyNode == null) { + LOG.warn("Missing body in CMNotify-DMAAP message"); + return; + } + + JsonNode input = bodyNode.get(INPUT); + if(input == null) { + LOG.info("Missing input node."); + return; + } + + JsonNode payloadNode = input.get(PAYLOAD); + if(payloadNode == null) { + LOG.info("Missing payload node."); + return; + } + + JSONObject rpcMsgBodyNode = new JSONObject(); + + rpcMsgBodyNode.put(INPUT,payloadNode); + + String rpcMsgbody; + try { + ObjectMapper mapper = new ObjectMapper(); + rpcMsgbody = mapper.writeValueAsString(rpcMsgBodyNode); + + } catch (Exception e) { + LOG.error("Unable to parse payload in CMNotify-DMAAP message", e); + return; + } + + JsonNode rpcNode = CMNotifyRootNode.get(RPC); + if(rpcNode == null) { + LOG.warn("Missing node in CMNotify-DMAAP message- " + RPC); + return; + } + String rpc = rpcNode.textValue(); + String sdncEndpoint = "CM-NOTIFY-API:" + rpc; + + try { + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); + LOG.info("POST CM-NOTIFY-API Request " + rpcMsgbody); + if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword); + + conn.send("POST", "application/json", rpcMsgbody); + } else { + LOG.warn("Unable to POST CM-NOTIFY-API message. SDNC URL not available. body:\n" + rpcMsgbody); + } + } catch (Exception e) { + LOG.error("Unable to process message", e); + } + } +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestCMNotifyDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestCMNotifyDmaapConsumer.java new file mode 100644 index 000000000..122a6d40b --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestCMNotifyDmaapConsumer.java @@ -0,0 +1,140 @@ +/* + * 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.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.Properties; + +import org.apache.commons.io.FileUtils; + +import org.junit.Before; +import org.junit.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + + +public class TestCMNotifyDmaapConsumer { + private static final String cMNotifyInput = "{\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\": \"nbrlist-change-notification\",\n" + + " \"Payload\": {\n" + + " \"fap-service-number-of-entries-changed\": 1,\n" + + " \"fap-service\": [{ \"alias\": \n" + + " \"Chn0001\", \"cid\": \"Chn0001\", \"lte-cell-number-of-entries\": 1,\n" + + " \"lte-ran-neighbor-list-in-use-lte-cell-changed\": \n" + + " [{ \"plmnid\": \"ran-1\", \"cid\": \"Chn0002\", \"phy-cell-id\": 4,\n" + + " \"pnf-name\": \"ncserver1\",\n" + + " \"blacklisted\": false }] }] }\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"nbrlist-change-notification\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + "}"; + + + @Test + public void test() throws Exception { + Properties props = new Properties(); + + CMNotifyDmaapConsumer consumer = new CMNotifyDmaapConsumer(); + InputStream propStr = TestCMNotifyDmaapConsumer.class.getResourceAsStream("/dmaap-consumer-cMNotify-1.properties"); + props.load(propStr); + consumer.init(props, "src/test/resources/dmaap-consumer-1.properties"); + consumer.processMsg(cMNotifyInput); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullMessage() throws Exception { + CMNotifyDmaapConsumer consumer = new CMNotifyDmaapConsumer(); + consumer.processMsg(null); + } + + @Test + public void testProcessMsgMissingBody() throws Exception { + String msg = "{\n" + + " \"bodyTest\": {\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\": \"nbrlist-change-notification\",\n" + + " \"Payload\": {\n" + + " \"fap-service-number-of-entries-changed\": 1,\n" + + " \"fap-service\": [{ \"alias\": \n" + + " \"Chn0001\", \"cid\": \"Chn0001\", \"lte-cell-number-of-entries\": 1,\n" + + " \"lte-ran-neighbor-list-in-use-lte-cell-changed\": \n" + + " [{ \"plmnid\": \"ran-1\", \"cid\": \"Chn0002\", \"phy-cell-id\": 4,\n" + + " \"pnf-name\": \"ncserver1\",\n" + + " \"blacklisted\": false }] }] }\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-name\": \"nbrlist-change-notification\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + "}"; + CMNotifyDmaapConsumer consumer = new CMNotifyDmaapConsumer(); + consumer.processMsg(msg); + } + + @Test + public void testProcessMsgInvalidRPC() 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\": \"nbrlist-change-notification\",\n" + + " \"Payload\": {\n" + + " \"fap-service-number-of-entries-changed\": 1,\n" + + " \"fap-service\": [{ \"alias\": \n" + + " \"Chn0001\", \"cid\": \"Chn0001\", \"lte-cell-number-of-entries\": 1,\n" + + " \"lte-ran-neighbor-list-in-use-lte-cell-changed\": \n" + + " [{ \"plmnid\": \"ran-1\", \"cid\": \"Chn0002\", \"phy-cell-id\": 4,\n" + + " \"pnf-name\": \"ncserver1\",\n" + + " \"blacklisted\": false }] }] }\n" + + " }\n" + + " },\n" + + " \"version\": \"1.0\",\n" + + " \"rpc-nameTest\": \"nbrlist-change-notification\",\n" + + " \"correlation-id\": \"9d2d790e-a5f0-11e8-98d0-529269fb1459-1\",\n" + + " \"type\": \"request\"\n" + + "}"; + + CMNotifyDmaapConsumer consumer = new CMNotifyDmaapConsumer(); + consumer.processMsg(msg); + } + +} diff --git a/dmaap-listener/src/test/resources/dmaap-consumer-cMNotify-1.properties b/dmaap-listener/src/test/resources/dmaap-consumer-cMNotify-1.properties new file mode 100644 index 000000000..aae34a26f --- /dev/null +++ b/dmaap-listener/src/test/resources/dmaap-consumer-cMNotify-1.properties @@ -0,0 +1,35 @@ +TransportType=HTTPNOAUTH +Latitude =50.000000 +Longitude =-100.000000 +Version =1.0 +ServiceName =message-router.onap:3904/events +Environment =TEST +Partner = +routeOffer=MR1 +SubContextPath =/ +Protocol =http +MethodType =GET +username =admin +password =admin +contenttype =application/json +authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs= +authDate=2019-04-09T04:28:40-05:00 +host=message-router.onap:3904 +topic=CM-NOTIFICATION +group=users +id=sdnc1 +timeout=15000 +limit=1000 +filter= +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=15000 +AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 +AFT_DME2_EP_READ_TIMEOUT_MS=50000 +sessionstickinessrequired=NO +DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt +sdnc.odl.user=admin +sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations -- cgit 1.2.3-korg From 44924cf809a463f576ad881bd70e84a0e2d8a026 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 3 Mar 2020 12:56:07 -0500 Subject: Use released 1.5.2 CCSDK parent Update to use released version of CCSDK parent pom Change-Id: I27885e3e08b774fb9f7737111641d7dd585906de Issue-ID: CCSDK-2152 Signed-off-by: Dan Timoney --- artifacts/pom.xml | 2 +- asdcApi/installer/pom.xml | 2 +- asdcApi/model/pom.xml | 2 +- asdcApi/pom.xml | 2 +- asdcApi/provider/pom.xml | 2 +- daexim-offsite-backup/installer/pom.xml | 2 +- daexim-offsite-backup/model/pom.xml | 2 +- daexim-offsite-backup/pom.xml | 2 +- daexim-offsite-backup/provider/pom.xml | 2 +- dataChange/installer/pom.xml | 2 +- dataChange/model/pom.xml | 2 +- dataChange/pom.xml | 2 +- dataChange/provider/pom.xml | 2 +- dmaap-listener/pom.xml | 2 +- features/ccsdk-asdcApi/pom.xml | 2 +- features/ccsdk-daexim-offsite-backup/pom.xml | 2 +- features/ccsdk-dataChange/pom.xml | 2 +- features/ccsdk-lcm/pom.xml | 2 +- features/ccsdk-sli-northbound-all/pom.xml | 2 +- features/features-sli-northbound/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- lcm/installer/pom.xml | 2 +- lcm/model/pom.xml | 2 +- lcm/pom.xml | 2 +- lcm/provider/pom.xml | 2 +- pom.xml | 2 +- ueb-listener/pom.xml | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 1d22a357a..ecb07c915 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 25234e6ac..df3b544b4 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 984d468ae..c3a3d68af 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 8a21a30c6..e35119cd9 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 47a11ecde..8ed6cee88 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 4d0e59655..3f2e877f1 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index c546305bf..f05ee0cb7 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 8b2c5a9fa..89d4500f7 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 059c5581f..66426dbca 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index a9db69311..e0ef6c177 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 8e10c1892..8613dbd31 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 03e4f6061..18e73c841 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 0104d5f2d..8d1673182 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 4185dee5f..bef0a7024 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.2-SNAPSHOT + 1.5.2 org.onap.ccsdk.sli.northbound diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml index 694b0e848..e2013c053 100644 --- a/features/ccsdk-asdcApi/pom.xml +++ b/features/ccsdk-asdcApi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml index cdab873f7..0c9fcc447 100644 --- a/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml index 493a944f7..2bf44d23a 100644 --- a/features/ccsdk-dataChange/pom.xml +++ b/features/ccsdk-dataChange/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml index f9fd204f1..03c0eecbe 100644 --- a/features/ccsdk-lcm/pom.xml +++ b/features/ccsdk-lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 835cf965f..ee0433d00 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 0053bef45..06374bed2 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index bd76a4b5d..b4d9bb5f7 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/features/pom.xml b/features/pom.xml index bd0d4ea27..5adda28a2 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 9884f7603..ef471fe12 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index b94bdbeff..29f7b0d13 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/lcm/pom.xml b/lcm/pom.xml index c0dc54d9d..a13e2f3a8 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 52d2e68f7..4298dfde6 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.2-SNAPSHOT + 1.5.2 diff --git a/pom.xml b/pom.xml index b74f9ec26..896a60f15 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2-SNAPSHOT + 1.5.2 4.0.0 diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 30023d782..f4ff554c1 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent standalone-parent - 1.5.2-SNAPSHOT + 1.5.2 org.onap.ccsdk.sli.northbound -- cgit 1.2.3-korg From 3231896861d60bda419d69d76a526cf2ea961b13 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 5 Mar 2020 11:55:59 -0500 Subject: Release version 0.7.1 Release version 0.7.1 (Frankfurt M4) Change-Id: Ib09f8dca24ee0f7143d429dd46fd72a745275d20 Issue-ID: CCSDK-2152 Signed-off-by: Dan Timoney --- releases/0.7.1.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/0.7.1.yaml diff --git a/releases/0.7.1.yaml b/releases/0.7.1.yaml new file mode 100644 index 000000000..4cda320e1 --- /dev/null +++ b/releases/0.7.1.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '0.7.1' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/302/' -- cgit 1.2.3-korg From 8a620f7b9ab473ec1399137aa05ed65c8b3fe970 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 5 Mar 2020 15:09:19 -0500 Subject: Roll master to Guilin Roll master to new versions for early Guilin development Change-Id: I8b7098b789ba57291c3748ea7d84c547fa8cadd3 Issue-ID: CCSDK-2152 Signed-off-by: Dan Timoney --- artifacts/pom.xml | 17 +++--- asdcApi/installer/pom.xml | 8 +-- asdcApi/model/pom.xml | 6 +-- asdcApi/pom.xml | 12 ++--- asdcApi/provider/pom.xml | 17 +++--- daexim-offsite-backup/installer/pom.xml | 11 ++-- daexim-offsite-backup/model/pom.xml | 8 +-- daexim-offsite-backup/pom.xml | 10 ++-- daexim-offsite-backup/provider/pom.xml | 42 ++++++++------- dataChange/installer/pom.xml | 4 +- dataChange/model/pom.xml | 6 +-- dataChange/pom.xml | 5 +- dataChange/provider/pom.xml | 19 +++---- dmaap-listener/pom.xml | 5 +- features/ccsdk-asdcApi/pom.xml | 6 +-- features/ccsdk-daexim-offsite-backup/pom.xml | 4 +- features/ccsdk-dataChange/pom.xml | 4 +- features/ccsdk-lcm/pom.xml | 6 +-- features/ccsdk-sli-northbound-all/pom.xml | 5 +- features/features-sli-northbound/pom.xml | 4 +- features/installer/pom.xml | 4 +- features/pom.xml | 4 +- lcm/installer/pom.xml | 4 +- lcm/model/pom.xml | 6 +-- lcm/pom.xml | 6 +-- lcm/provider/pom.xml | 18 +++---- pom.xml | 78 +++++++++++++--------------- ueb-listener/pom.xml | 9 ++-- version.properties | 6 +-- 29 files changed, 157 insertions(+), 177 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index ecb07c915..dcbb22d7e 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -2,9 +2,15 @@ 4.0.0 + + org.onap.ccsdk.parent + parent + 2.0.0-SNAPSHOT + + org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts @@ -13,17 +19,11 @@ ONAP - - - org.onap.ccsdk.parent - parent - 1.5.2 - ${project.version} - + @@ -94,5 +94,4 @@ - diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index df3b544b4..f68cbeab3 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 - + 2.0.0-SNAPSHOT + - org.onap.ccsdk.sli.northbound + org.onap.ccsdk.sli.northbound asdcApi-installer - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index c3a3d68af..03255e132 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} @@ -29,6 +29,4 @@ - - diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index e35119cd9..cf811281c 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,26 +5,24 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi - - ${project.version} - - model provider installer - + + ${project.version} + diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 8ed6cee88..bdf9c5e70 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} @@ -24,15 +24,14 @@ - org.onap.ccsdk.sli.core - sli-core-artifacts - ${ccsdk.sli.core.version} - pom - import + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import - org.onap.ccsdk.sli.northbound @@ -94,6 +93,4 @@ test - - diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 3f2e877f1..cd5d5b151 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -1,24 +1,28 @@ 4.0.0 + org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT - ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom + + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + ccsdk-daexim-offsite-backup ${application.name} mvn:org.onap.ccsdk.sli.northbound/${features.boot}/${project.version}/xml/features false + org.onap.ccsdk.sli.northbound @@ -31,6 +35,7 @@ ${project.version} + diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index f05ee0cb7..c281e355b 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -1,19 +1,21 @@ 4.0.0 + org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT - ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} + org.opendaylight.mdsal.binding.model.ietf diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 89d4500f7..0d7f8e0ce 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -1,17 +1,17 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup @@ -28,9 +28,9 @@ org.onap.ccsdk.sli.northbound daexim-offsite-backup-features - features - xml ${project.version} + xml + features org.onap.ccsdk.sli.northbound diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 66426dbca..94ffc4411 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -1,34 +1,20 @@ 4.0.0 + org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT - ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle - - - - org.apache.felix - maven-bundle-plugin - true - - - org.opendaylight.controller.config.yang.config.daexim-offsite-backup_provider - * - - - - - + ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} @@ -45,8 +31,8 @@ sal-common-util - sal-test-model org.opendaylight.controller + sal-test-model test @@ -57,8 +43,8 @@ org.opendaylight.controller sal-binding-broker-impl - tests test-jar + tests test @@ -86,4 +72,20 @@ test + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.controller.config.yang.config.daexim-offsite-backup_provider + * + + + + + diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index e0ef6c177..3bbd645b1 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 8613dbd31..54fdeeb66 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} @@ -28,6 +28,4 @@ - - diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 18e73c841..04b4019ef 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange @@ -21,5 +21,4 @@ provider installer - diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 8d1673182..d0010702f 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} @@ -20,19 +20,18 @@ ${project.version} ${project.version} - + - org.onap.ccsdk.sli.core - sli-core-artifacts - ${ccsdk.sli.core.version} - pom - import + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import - org.onap.ccsdk.sli.northbound @@ -88,6 +87,4 @@ test - - diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index bef0a7024..a6c4eea5c 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener @@ -46,7 +46,6 @@ - diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml index e2013c053..837630272 100644 --- a/features/ccsdk-asdcApi/pom.xml +++ b/features/ccsdk-asdcApi/pom.xml @@ -5,17 +5,17 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - + ${project.version} ${project.version} diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml index 0c9fcc447..b5ca937cf 100644 --- a/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml index 2bf44d23a..a4c509e30 100644 --- a/features/ccsdk-dataChange/pom.xml +++ b/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml index 03c0eecbe..39b1788e5 100644 --- a/features/ccsdk-lcm/pom.xml +++ b/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} @@ -20,7 +20,7 @@ ${project.version} ${project.version} - + diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index ee0433d00..99c5ee499 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} @@ -19,6 +19,7 @@ ${project.version} + ${project.groupId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 06374bed2..f8804b001 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index b4d9bb5f7..4ebbe27d0 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 5adda28a2..e2b59a01e 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index ef471fe12..ac6e7554f 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 29f7b0d13..5fc328cad 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} @@ -29,6 +29,4 @@ - - diff --git a/lcm/pom.xml b/lcm/pom.xml index a13e2f3a8..1eec115e6 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm @@ -21,6 +21,4 @@ provider installer - - diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index 4298dfde6..b7f9fe837 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} @@ -21,19 +21,17 @@ ${project.version} - - org.onap.ccsdk.sli.core - sli-core-artifacts - ${ccsdk.sli.core.version} - pom - import + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import - org.onap.ccsdk.sli.northbound @@ -101,6 +99,4 @@ test - - diff --git a/pom.xml b/pom.xml index 896a60f15..1db4911bc 100644 --- a/pom.xml +++ b/pom.xml @@ -1,27 +1,35 @@ - + + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.5.2 + 2.0.0-SNAPSHOT - 4.0.0 - pom org.onap.ccsdk.sli.northbound ccsdk-sli-northbound + 1.0.0-SNAPSHOT + pom ccsdk-sli-northbound - https://wiki.onap.org The SDN-C Northbound APIs repo contains code for northbound API adaptors, typically MD-SAL applications + https://wiki.onap.org + + ONAP + - - - JIRA - https://jira.onap.org/ - - + + asdcApi + dataChange + lcm + dmaap-listener + ueb-listener + daexim-offsite-backup + features + artifacts + scm:git:ssh://git@${onap.git.host}/sdnc-northbound.git @@ -29,18 +37,33 @@ scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/sdnc-northbound.git ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/sdnc-northbound/browse - + + JIRA + https://jira.onap.org/ + Jenkins https://jenkins.onap.org/ - sdnc-javadoc dav:https://${onap.nexus.host}:${onap.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + + + + blackduck @@ -120,33 +143,4 @@ - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - - - - - - asdcApi - dataChange - lcm - dmaap-listener - ueb-listener - daexim-offsite-backup - features - artifacts - - - ONAP - - 0.7.1-SNAPSHOT - - diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index f4ff554c1..42546fd7b 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 1.5.2 + 2.0.0-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 0.7.1-SNAPSHOT + 1.0.0-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener @@ -27,7 +27,7 @@ 1.4.1-SNAPSHOT 1.6.5 - + @@ -39,7 +39,6 @@ - @@ -52,7 +51,7 @@ org.onap.sdc.sdc-tosca sdc-tosca - ${sdc.tosca.version} + ${sdc.tosca.version} compile diff --git a/version.properties b/version.properties index c11ada9fe..feea7088f 100644 --- a/version.properties +++ b/version.properties @@ -3,9 +3,9 @@ # Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) # because they are used in Jenkins, whose plug-in doesn't support -release_name=0 -sprint_number=7 -feature_revision=1 +release_name=1 +sprint_number=0 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- 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 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 From b1f7ad239ed681f473970538d17849281692578c Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Fri, 22 May 2020 23:06:07 -0500 Subject: Bug fix in DMAAP message parsing for CMNotify Minor bug fix in the DMAAP message for CMNotify Issue-ID: CCSDK-2383 Signed-off-by: SandeepLinux Change-Id: Ia080adafecf6d6b3a12682aaab3f244a33a16de5 --- .../ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java index e49e77ea8..fa14fbb24 100644 --- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/CMNotifyDmaapConsumer.java @@ -71,14 +71,10 @@ public class CMNotifyDmaapConsumer extends SdncDmaapConsumerImpl { return; } - JSONObject rpcMsgBodyNode = new JSONObject(); - - rpcMsgBodyNode.put(INPUT,payloadNode); - String rpcMsgbody; try { ObjectMapper mapper = new ObjectMapper(); - rpcMsgbody = mapper.writeValueAsString(rpcMsgBodyNode); + rpcMsgbody = "{\"input\":" + mapper.writeValueAsString(payloadNode) + "}"; } catch (Exception e) { LOG.error("Unable to parse payload in CMNotify-DMAAP message", e); -- cgit 1.2.3-korg From 9bfbca954ba6fe021e1c166990b86ab0d9830d79 Mon Sep 17 00:00:00 2001 From: Franklin Dsilva Date: Tue, 26 May 2020 09:10:33 +0000 Subject: Path-/opt/app/dmaap-listener/lib does not exist in sdnc-dmaap-listener pod Change-Id: I21a1f00adef418d29e68cf7cdd1939761b87750f Issue-ID: CCSDK-2388 Signed-off-by: Franklin Dsilva --- .../org/onap/ccsdk/sli/northbound/dmaapclient/SdncAaiDmaapConsumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5cf369403..f35e6f1e3 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 @@ -68,7 +68,7 @@ public class SdncAaiDmaapConsumer extends SdncDmaapConsumerImpl { rootDir = System.getenv(DMAAPLISTENERROOT); if ((rootDir == null) || (rootDir.length() == 0)) { - rootDir = "/opt/app/dmaap-listener/lib/"; + rootDir = "/opt/onap/sdnc/dmaap-listener/lib/"; } else { rootDir = rootDir + "/lib/"; -- cgit 1.2.3-korg From 1ed8346da11ee15694246c432a8ac3b27bce2468 Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Thu, 4 Jun 2020 19:02:10 -0500 Subject: Aiign requestID, subrequestID for DMAAP msgs Updated DMAAP listener to keep track of requestID and subRequestID for DMAAP message publication. These values are sent to DG as part of SLI parms Issue-ID: CCSDK-2413 Signed-off-by: SandeepLinux Change-Id: I207a7d1223416475de0b44ba80944ed2f4f57305 --- .../dmaapclient/OofPciPocDmaapConsumers.java | 65 ++++++++++++++++++++-- 1 file changed, 61 insertions(+), 4 deletions(-) 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 e8dacb959..9ff6fd616 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 @@ -64,6 +64,16 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { private static final String RPC_NAME = "rpc-name"; private static final String BODY = "body"; private static final String INPUT = "input"; + private static final String COMMON_HEADER = "CommonHeader"; + private static final String TIME_STAMP = "TimeStamp"; + private static final String REQUEST_ID = "RequestID"; + private static final String SUB_REQUEST_ID = "SubRequestID"; + + private static final String TIME_STAMP_FOR_SLI = "timeStamp"; + private static final String REQUEST_ID_FOR_SLI = "requestID"; + private static final String SUB_REQUEST_ID_FOR_SLI = "subRequestID"; + + private static final String CONFIGURATION_PHY_CELL_ID_INPUT = "configuration-phy-cell-id-input."; private static final String EMPTY = ""; private static final String ESCAPE_SEQUENCE_QUOTES = "\""; @@ -104,9 +114,9 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { protected String publish(String templatePath, String jsonString, JsonNode configurationsOrDataNode, boolean invokePciChangesPublish, boolean invokeAnrChangesPublish) throws IOException, InvalidMessageException { if (invokePciChangesPublish){ - return publishPciChangesFromPolicyToSDNR(templatePath, configurationsOrDataNode); + return publishPciChangesFromPolicyToSDNR(templatePath, configurationsOrDataNode, jsonString); } else if (invokeAnrChangesPublish){ - return publishANRChangesFromPolicyToSDNR(templatePath, configurationsOrDataNode); + return publishANRChangesFromPolicyToSDNR(templatePath, configurationsOrDataNode, jsonString); } else { return publishFullMessage(templatePath, jsonString); } @@ -138,7 +148,7 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { return writer.toString(); } - private String publishANRChangesFromPolicyToSDNR(String templatePath, JsonNode dataNode) throws IOException, InvalidMessageException + private String publishANRChangesFromPolicyToSDNR(String templatePath, JsonNode dataNode, String msg) throws IOException, InvalidMessageException { VelocityContext context = new VelocityContext(); @@ -156,6 +166,29 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { JSONObject alias = new JSONObject(); JSONArray sliParametersArray = new JSONArray(); + ObjectMapper oMapper = new ObjectMapper(); + + JsonNode dmaapMessageRootNode; + try { + dmaapMessageRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + JsonNode commonHeader = dmaapMessageRootNode.get(BODY).get(INPUT).get(COMMON_HEADER); + + JsonNode timeStamp = commonHeader.get(TIME_STAMP); + + JsonNode requestID = commonHeader.get(REQUEST_ID); + + JsonNode subRequestID = commonHeader.get(SUB_REQUEST_ID); + + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT+TIME_STAMP_FOR_SLI).put(STRING_VALUE,timeStamp)); + + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT+REQUEST_ID_FOR_SLI).put(STRING_VALUE,requestID)); + + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, GENERIC_NEIGHBOR_CONFIGURATION_INPUT+SUB_REQUEST_ID_FOR_SLI).put(STRING_VALUE,subRequestID)); + 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); @@ -203,7 +236,7 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { } - private String publishPciChangesFromPolicyToSDNR(String templatePath, JsonNode configurationsJsonNode) throws IOException, InvalidMessageException + private String publishPciChangesFromPolicyToSDNR(String templatePath, JsonNode configurationsJsonNode, String msg) throws IOException, InvalidMessageException { String RPC_NAME_KEY_IN_VT = "rpc_name"; String RPC_NAME_VALUE_IN_VT = "configuration-phy-cell-id"; @@ -217,6 +250,29 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { JsonNode configurations = configurationsJsonNode.get(CONFIGURATIONS); + ObjectMapper oMapper = new ObjectMapper(); + + JsonNode dmaapMessageRootNode; + try { + dmaapMessageRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse json object", e); + } + + JsonNode commonHeader = dmaapMessageRootNode.get(BODY).get(INPUT).get(COMMON_HEADER); + + JsonNode timeStamp = commonHeader.get(TIME_STAMP); + + JsonNode requestID = commonHeader.get(REQUEST_ID); + + JsonNode subRequestID = commonHeader.get(SUB_REQUEST_ID); + + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, CONFIGURATION_PHY_CELL_ID_INPUT+TIME_STAMP_FOR_SLI).put(STRING_VALUE,timeStamp)); + + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, CONFIGURATION_PHY_CELL_ID_INPUT+REQUEST_ID_FOR_SLI).put(STRING_VALUE,requestID)); + + sliParametersArray.put(new JSONObject().put(PARAMETER_NAME, CONFIGURATION_PHY_CELL_ID_INPUT+SUB_REQUEST_ID_FOR_SLI).put(STRING_VALUE,subRequestID)); + int entryCount = 0; if(configurations.isArray()) { @@ -390,6 +446,7 @@ public class OofPciPocDmaapConsumers extends SdncDmaapConsumerImpl { return; } + if(!MODIFY_CONFIG.equals(action.textValue())) { LOG.info("Unknown Action {}", action); return; -- cgit 1.2.3-korg From 73bf30dec7bbda557752ae7024f3d8e329409635 Mon Sep 17 00:00:00 2001 From: Michael Dürre Date: Fri, 10 Jul 2020 05:07:17 +0200 Subject: upgrade northbound to sodium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixed unit test due changes in sodium Issue-ID: CCSDK-2544 Signed-off-by: Michael Dürre Change-Id: I69af992f1db267e282a0ed66b4e4bed72d4f2bd4 --- daexim-offsite-backup/provider/pom.xml | 4 +++ .../DaeximOffsiteBackupProviderTest.java | 39 +++++++++------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 94ffc4411..a9f72b1ce 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -61,6 +61,10 @@ sli-provider ${sdnctl.sli.version} + + com.google.code.findbugs + annotations + junit junit diff --git a/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java b/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java index 65d0dcaf2..d070c30e2 100644 --- a/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java +++ b/daexim-offsite-backup/provider/src/test/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProviderTest.java @@ -21,23 +21,12 @@ package org.onap.ccsdk.sli.northbound.daeximoffsitebackup; -import org.eclipse.jdt.annotation.Nullable; -import org.junit.Before; -import org.junit.Test; - -import org.opendaylight.controller.md.sal.binding.api.*; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; - -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.DaeximOffsiteBackupService; - -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataInput; - -import org.opendaylight.yangtools.yang.binding.Augmentation; -import org.opendaylight.yangtools.yang.binding.DataContainer; - +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import com.google.common.util.concurrent.CheckedFuture; - import java.io.File; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; @@ -46,9 +35,16 @@ import java.util.Arrays; import java.util.List; import java.util.Properties; import java.util.concurrent.ExecutionException; - -import static org.mockito.Mockito.*; -import static org.junit.Assert.*; +import org.eclipse.jdt.annotation.Nullable; +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.DaeximOffsiteBackupService; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataInput; +import org.opendaylight.yangtools.yang.binding.Augmentation; public class DaeximOffsiteBackupProviderTest { public DataBroker dataBroker; @@ -153,10 +149,7 @@ public class DaeximOffsiteBackupProviderTest { return "Some Timestamp"; } - @Override - public Class getImplementedInterface() { - return null; - } + }; try { assertNotNull(provider.retrieveData(input)); -- cgit 1.2.3-korg From e586f985fe9add6fe55f891148d9e786d7081cee Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 6 Aug 2020 15:21:02 -0400 Subject: Release version 1.0.0 of sli/northbound Release version 1.0.0 of ccsdk/sli/northbound Change-Id: I664827d2975f9db5b04bcb11cb1a1e5c869fed7a Issue-ID: CCSDK-2635 Signed-off-by: Dan Timoney --- releases/1.0.0.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/1.0.0.yaml diff --git a/releases/1.0.0.yaml b/releases/1.0.0.yaml new file mode 100644 index 000000000..2a0c585c6 --- /dev/null +++ b/releases/1.0.0.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '1.0.0' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/303/' -- cgit 1.2.3-korg From 6d6539407e4c28aae0c321835bbf754086fb7791 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 6 Aug 2020 15:21:47 -0400 Subject: Roll to next snapshot Roll to snapshot version 1.0.1-SNAPSHOT Change-Id: I1fd08b6b4de998d0bc2e7acb03fcf4c87eeae165 Issue-ID: CCSDK-2635 Signed-off-by: Dan Timoney --- artifacts/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-asdcApi/pom.xml | 4 ++-- features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- features/ccsdk-dataChange/pom.xml | 4 ++-- features/ccsdk-lcm/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 2 +- 29 files changed, 57 insertions(+), 57 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index dcbb22d7e..16a147cf8 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index f68cbeab3..cb2a8c8e2 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 03255e132..3e2b46f91 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index cf811281c..3bc7079ca 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index bdf9c5e70..7024ddfe4 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index cd5d5b151..6d00e438a 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index c281e355b..04a361aa9 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 0d7f8e0ce..2a19680dc 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index a9f72b1ce..2095afe21 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index 3bbd645b1..b96c29403 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 54fdeeb66..6551501e8 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 04b4019ef..452d80f8b 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index d0010702f..666aeec4b 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index a6c4eea5c..6325baf45 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml index 837630272..a1a44b6eb 100644 --- a/features/ccsdk-asdcApi/pom.xml +++ b/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml index b5ca937cf..8df21287b 100644 --- a/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml index a4c509e30..c281d47d8 100644 --- a/features/ccsdk-dataChange/pom.xml +++ b/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml index 39b1788e5..5260757a2 100644 --- a/features/ccsdk-lcm/pom.xml +++ b/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 99c5ee499..e4a7175d6 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index f8804b001..76c5913cb 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 4ebbe27d0..7acb7a660 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index e2b59a01e..32b90e383 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index ac6e7554f..c889970e3 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 5fc328cad..7ca82d4dc 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 1eec115e6..138447bd7 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index b7f9fe837..c9d927034 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 1db4911bc..b5f67110e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom ccsdk-sli-northbound diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 1df9f35b2..49084e5dd 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index feea7088f..6e5a89dbc 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=1 sprint_number=0 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From e73281177c4d6069d410a47d152cdaf598d09dac Mon Sep 17 00:00:00 2001 From: Sandeep Shah Date: Wed, 2 Sep 2020 17:50:30 -0500 Subject: DMAAP Listener for ranSlice Feature support DMAAP listener for ranSlide related DMAAP messages from Policy and other ONAP components Issue-ID: CCSDK-2722 Signed-off-by: SandeepLinux Change-Id: I14267bc5247a383039ab11ada82d67b0f3f3c13c --- .../dmaapclient/SdncRANSliceDmaapConsumer.java | 92 ++++++++++++ .../dmaapclient/TestSdncRANSliceDmaapConsumer.java | 166 +++++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncRANSliceDmaapConsumer.java create mode 100644 dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncRANSliceDmaapConsumer.java diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncRANSliceDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncRANSliceDmaapConsumer.java new file mode 100644 index 000000000..f1749f99b --- /dev/null +++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncRANSliceDmaapConsumer.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * Modifications Copyright © 2018 IBM. + * ================================================================================ + * 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SdncRANSliceDmaapConsumer extends SdncDmaapConsumerImpl { + + private static final Logger LOG = LoggerFactory.getLogger(SdncRANSliceDmaapConsumer.class); + + private static final String BODY = "body"; + private static final String RPC = "rpc-name"; + + @Override + public void processMsg(String msg) throws InvalidMessageException { + + if (msg == null) { + throw new InvalidMessageException("Null RANSlice message"); + } + + ObjectMapper oMapper = new ObjectMapper(); + JsonNode ranSliceRootNode; + try { + ranSliceRootNode = oMapper.readTree(msg); + } catch (Exception e) { + throw new InvalidMessageException("Cannot parse RANSlice json input", e); + } + + JsonNode bodyNode = ranSliceRootNode.get(BODY); + if(bodyNode == null) { + LOG.warn("Missing body in RANSlice message"); + return; + } + String rpcMsgbody; + try { + ObjectMapper mapper = new ObjectMapper(); + rpcMsgbody = mapper.writeValueAsString(bodyNode); + + } catch (Exception e) { + LOG.error("Unable to parse body in RANSlice message", e); + return; + } + + JsonNode rpcNode = ranSliceRootNode.get(RPC); + if(rpcNode == null) { + LOG.warn("Missing node in RANSlice message- " + RPC); + return; + } + String rpc = rpcNode.textValue(); + String sdncEndpoint = "ran-slice-api:" + rpc; + + try { + String odlUrlBase = getProperty("sdnc.odl.url-base"); + String odlUser = getProperty("sdnc.odl.user"); + String odlPassword = getProperty("sdnc.odl.password"); + LOG.info("POST RANSlice Request " + rpcMsgbody); + if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) { + SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword); + + conn.send("POST", "application/json", rpcMsgbody); + } else { + LOG.warn("Unable to POST RANSlice message. SDNC URL not available. body:\n" + rpcMsgbody); + } + } catch (Exception e) { + LOG.error("Unable to process message", e); + } + } +} diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncRANSliceDmaapConsumer.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncRANSliceDmaapConsumer.java new file mode 100644 index 000000000..50c427ec1 --- /dev/null +++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncRANSliceDmaapConsumer.java @@ -0,0 +1,166 @@ +/* + * 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.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.Properties; + +import org.apache.commons.io.FileUtils; + +import org.junit.Before; +import org.junit.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class TestSdncRANSliceDmaapConsumer { + private static final String ranSliceInput = + "{\r\n" + + " \"version\": \"ranSlice-dmaap.version\",\r\n" + + " \"cambria.partition\": \"SDNC\",\r\n" + + " \"correlation-id\": \"ranSlice-dmaap.correlation-id\",\r\n" + + " \"rpc-name\": \"upgrade-software\",\r\n" + + " \"type\": \"ranSlice-dmaap.type\",\r\n" + + " \"body\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"ranSlice-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"ranSlice-dmaap.flags.mode\",\r\n" + + " \"force\": \"ranSlice-dmaap.flags.force\",\r\n" + + " \"mode\": \"ranSlice-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"ranSlice-dmaap.originator-id\",\r\n" + + " \"request-id\": \"ranSlice-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"ranSlice-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"ranSlice-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"ranSlice-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + + @Test + public void test() throws Exception { + Properties props = new Properties(); + + SdncRANSliceDmaapConsumer consumer = new SdncRANSliceDmaapConsumer(); + InputStream propStr = TestSdncRANSliceDmaapConsumer.class.getResourceAsStream("/dmaap-consumer-1.properties"); + props.load(propStr); + consumer.init(props, "src/test/resources/dmaap-consumer-1.properties"); + consumer.processMsg(ranSliceInput); + } + + @Test(expected = InvalidMessageException.class) + public void testProcessMsgNullMessage() throws Exception { + SdncRANSliceDmaapConsumer consumer = new SdncRANSliceDmaapConsumer(); + consumer.processMsg(null); + } + + @Test + public void testProcessMsgMissingBody() throws Exception { + String msg = "{\r\n" + + " \"version\": \"ranSlice-dmaap.version\",\r\n" + + " \"cambria.partition\": \"SDNC\",\r\n" + + " \"correlation-id\": \"ranSlice-dmaap.correlation-id\",\r\n" + + " \"rpc-name\": \"upgrade-software\",\r\n" + + " \"type\": \"ranSlice-dmaap.type\",\r\n" + + " \"body1\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"ranSlice-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"ranSlice-dmaap.flags.mode\",\r\n" + + " \"force\": \"ranSlice-dmaap.flags.force\",\r\n" + + " \"mode\": \"ranSlice-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"ranSlice-dmaap.originator-id\",\r\n" + + " \"request-id\": \"ranSlice-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"ranSlice-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"ranSlice-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"ranSlice-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + SdncRANSliceDmaapConsumer consumer = new SdncRANSliceDmaapConsumer(); + consumer.processMsg(msg); + } + + @Test + public void testProcessMsgInvalidRPC() throws Exception { + String msg = "{\r\n" + + " \"version\": \"ranSlice-dmaap.version\",\r\n" + + " \"cambria.partition\": \"SDNC\",\r\n" + + " \"correlation-id\": \"ranSlice-dmaap.correlation-id\",\r\n" + + " \"rpc-name1\": \"upgrade-software\",\r\n" + + " \"type\": \"ranSlice-dmaap.type\",\r\n" + + " \"body\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"ranSlice-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"ranSlice-dmaap.flags.mode\",\r\n" + + " \"force\": \"ranSlice-dmaap.flags.force\",\r\n" + + " \"mode\": \"ranSlice-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"ranSlice-dmaap.originator-id\",\r\n" + + " \"request-id\": \"ranSlice-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"ranSlice-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"ranSlice-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"ranSlice-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + SdncRANSliceDmaapConsumer consumer = new SdncRANSliceDmaapConsumer(); + consumer.processMsg(msg); + } + + @Test + public void testProcessMsgInvalidPartition() throws Exception { + String msg = "{\r\n" + + " \"version\": \"ranSlice-dmaap.version\",\r\n" + + " \"cambria.partition\": \"BAD\",\r\n" + + " \"correlation-id\": \"ranSlice-dmaap.correlation-id\",\r\n" + + " \"rpc-name\": \"upgrade-software\",\r\n" + + " \"type\": \"ranSlice-dmaap.type\",\r\n" + + " \"body\": {\r\n" + + " \"input\": {\r\n" + + " \"common-header\": {\r\n" + + " \"api-ver\": \"ranSlice-dmaap.api-ver\",\r\n" + + " \"flags\": {\r\n" + + " \"ttl\": \"ranSlice-dmaap.flags.mode\",\r\n" + + " \"force\": \"ranSlice-dmaap.flags.force\",\r\n" + + " \"mode\": \"ranSlice-dmaap.flags.mode\"\r\n" + + " },\r\n" + + " \"originator-id\": \"ranSlice-dmaap.originator-id\",\r\n" + + " \"request-id\": \"ranSlice-dmaap.request-id\",\r\n" + + " \"sub-request-id\": \"ranSlice-dmaap.sub-request-id\",\r\n" + + " \"timestamp\": \"ranSlice-dmaap.timestamp\"\r\n" + + " },\r\n" + + " \"payload\": \"ranSlice-dmaap.payload\"\r\n" + + " }\r\n" + + " }\r\n" + + "}"; + + + SdncRANSliceDmaapConsumer consumer = new SdncRANSliceDmaapConsumer(); + consumer.processMsg(msg); + } +} -- cgit 1.2.3-korg From 963fc801d8a38f047e67b0b8aa2bdfeba6a58c81 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 3 Sep 2020 10:05:32 -0400 Subject: Update lifecycle state Update lifecycle state to Mature Change-Id: I0ce9d0608712b3589071342cdb9da4d2a7545068 Issue-ID: CCSDK-2660 Signed-off-by: Dan Timoney --- INFO.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INFO.yaml b/INFO.yaml index 17d4ca2a5..9fd0908e3 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -1,7 +1,7 @@ --- project: 'ccsdk-sli-northbound' project_creation_date: '2017-06-27' -lifecycle_state: 'Incubation' +lifecycle_state: 'Mature' project_category: '' project_lead: &onap_releng_ptl name: 'Dan Timoney' -- cgit 1.2.3-korg From 7315d01475bf4f750dc2b75656ed0230f1b4672d Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 9 Sep 2020 14:38:16 -0400 Subject: Release M4 version of sli/northbound Release M4 version of sli/northbound Change-Id: I4f7f6abd7f46bc535e555e17991af253d4396a13 Issue-ID: CCSDK-2742 Signed-off-by: Dan Timoney --- releases/1.0.1.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/1.0.1.yaml diff --git a/releases/1.0.1.yaml b/releases/1.0.1.yaml new file mode 100644 index 000000000..204f71f52 --- /dev/null +++ b/releases/1.0.1.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '1.0.1' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/304/' -- cgit 1.2.3-korg From f80e79706a7cd030f7a6185da8ccf920e125b0c5 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 9 Sep 2020 17:38:04 -0400 Subject: Roll to initial Honolulu release version Roll master branch to initial Honolulu release version Change-Id: I9a355141a5234f08fd09d0712b4b9d6166d01f11 Issue-ID: CCSDK-2742 Signed-off-by: Dan Timoney --- artifacts/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 4 ++-- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 4 ++-- dmaap-listener/pom.xml | 4 ++-- features/ccsdk-asdcApi/pom.xml | 4 ++-- features/ccsdk-daexim-offsite-backup/pom.xml | 4 ++-- features/ccsdk-dataChange/pom.xml | 4 ++-- features/ccsdk-lcm/pom.xml | 4 ++-- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- ueb-listener/pom.xml | 4 ++-- version.properties | 4 ++-- 29 files changed, 58 insertions(+), 58 deletions(-) diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 16a147cf8..f18e900df 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index cb2a8c8e2..41150f044 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-installer - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index 3e2b46f91..ac2ee86e1 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-model - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 3bc7079ca..0c2abb6e4 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 7024ddfe4..618d463a5 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound asdcApi-provider - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 6d00e438a..24e3cce7d 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index 04a361aa9..c211c8049 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index 2a19680dc..f9bc47407 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 2095afe21..26010c7d2 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index b96c29403..d6fef43b5 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-installer - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 6551501e8..9e305f634 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-model - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 452d80f8b..01e366ac5 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 666aeec4b..7d0065170 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dataChange-provider - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 6325baf45..6585f0aae 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound dmaap-listener - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml index a1a44b6eb..5b265dc3a 100644 --- a/features/ccsdk-asdcApi/pom.xml +++ b/features/ccsdk-asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml index 8df21287b..bba1dd94b 100644 --- a/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml index c281d47d8..001dbd3e5 100644 --- a/features/ccsdk-dataChange/pom.xml +++ b/features/ccsdk-dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-dataChange - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml index 5260757a2..101d21eda 100644 --- a/features/ccsdk-lcm/pom.xml +++ b/features/ccsdk-lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-lcm - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index e4a7175d6..6ad30b881 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 76c5913cb..548605e25 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound features-sli-northbound - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 7acb7a660..cc681d33a 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 32b90e383..de7679586 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index c889970e3..62e0a122e 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-installer - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 7ca82d4dc..67d455e05 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-model - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 138447bd7..2d9cb6f77 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index c9d927034..f08ca79c7 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound lcm-provider - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index b5f67110e..6ddb50ebe 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT pom ccsdk-sli-northbound diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 49084e5dd..63b2fdf79 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 2.0.1-SNAPSHOT + 2.1.0-SNAPSHOT org.onap.ccsdk.sli.northbound ueb-listener - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener diff --git a/version.properties b/version.properties index 6e5a89dbc..60b87d41c 100644 --- a/version.properties +++ b/version.properties @@ -4,8 +4,8 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=1 -sprint_number=0 -feature_revision=1 +sprint_number=1 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 46c69f518bd200e25d46f28cc32473ba08cdfe3d Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 25 Nov 2020 16:07:46 -0500 Subject: Release version 1.1.0 of sli/northbound Release initial Honolulu version of sli/northbound and roll version to next snapshot Change-Id: I21ee4f2431d6e15573998fd615fc2090aee15810 Issue-ID: CCSDK-3002 Signed-off-by: Dan Timoney --- .gitignore | 1 + artifacts/pom.xml | 4 ++-- asdcApi/installer/pom.xml | 4 ++-- asdcApi/model/pom.xml | 4 ++-- asdcApi/pom.xml | 4 ++-- asdcApi/provider/pom.xml | 5 ++--- daexim-offsite-backup/installer/pom.xml | 4 ++-- daexim-offsite-backup/model/pom.xml | 4 ++-- daexim-offsite-backup/pom.xml | 4 ++-- daexim-offsite-backup/provider/pom.xml | 4 ++-- dataChange/installer/pom.xml | 4 ++-- dataChange/model/pom.xml | 4 ++-- dataChange/pom.xml | 4 ++-- dataChange/provider/pom.xml | 5 ++--- dmaap-listener/pom.xml | 6 +++--- features/ccsdk-asdcApi/pom.xml | 5 ++--- features/ccsdk-daexim-offsite-backup/pom.xml | 8 ++------ features/ccsdk-dataChange/pom.xml | 5 ++--- features/ccsdk-lcm/pom.xml | 5 ++--- features/ccsdk-sli-northbound-all/pom.xml | 4 ++-- features/features-sli-northbound/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- lcm/installer/pom.xml | 4 ++-- lcm/model/pom.xml | 4 ++-- lcm/pom.xml | 4 ++-- lcm/provider/pom.xml | 5 ++--- pom.xml | 4 ++-- releases/1.1.0.yaml | 5 +++++ ueb-listener/pom.xml | 8 ++++---- version.properties | 2 +- 31 files changed, 66 insertions(+), 70 deletions(-) create mode 100644 releases/1.1.0.yaml diff --git a/.gitignore b/.gitignore index 7943e8332..6b9838c77 100755 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ org.eclipse.core.resources.prefs .idea .externalToolBuilders .checkstyle +.factorypath maven-eclipse.xml workspace diff --git a/artifacts/pom.xml b/artifacts/pom.xml index f18e900df..c4fca9fb6 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound sli-northbound-artifacts - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: sli-northbound-artifacts diff --git a/asdcApi/installer/pom.xml b/asdcApi/installer/pom.xml index 41150f044..bbdeb0cba 100755 --- a/asdcApi/installer/pom.xml +++ b/asdcApi/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound asdcApi-installer - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/model/pom.xml b/asdcApi/model/pom.xml index ac2ee86e1..53fed3587 100755 --- a/asdcApi/model/pom.xml +++ b/asdcApi/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound asdcApi-model - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} diff --git a/asdcApi/pom.xml b/asdcApi/pom.xml index 0c2abb6e4..b5cea9931 100755 --- a/asdcApi/pom.xml +++ b/asdcApi/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound asdcApi - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: asdcApi diff --git a/asdcApi/provider/pom.xml b/asdcApi/provider/pom.xml index 618d463a5..97c4ba9aa 100755 --- a/asdcApi/provider/pom.xml +++ b/asdcApi/provider/pom.xml @@ -5,19 +5,18 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound asdcApi-provider - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - ${project.version} ${project.version} diff --git a/daexim-offsite-backup/installer/pom.xml b/daexim-offsite-backup/installer/pom.xml index 24e3cce7d..6fbabb426 100755 --- a/daexim-offsite-backup/installer/pom.xml +++ b/daexim-offsite-backup/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound daexim-offsite-backup-installer - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/model/pom.xml b/daexim-offsite-backup/model/pom.xml index c211c8049..4f338c786 100755 --- a/daexim-offsite-backup/model/pom.xml +++ b/daexim-offsite-backup/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound daexim-offsite-backup-model - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/daexim-offsite-backup/pom.xml b/daexim-offsite-backup/pom.xml index f9bc47407..aa98f5137 100755 --- a/daexim-offsite-backup/pom.xml +++ b/daexim-offsite-backup/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound daexim-offsite-backup - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: daexim-offsite-backup diff --git a/daexim-offsite-backup/provider/pom.xml b/daexim-offsite-backup/provider/pom.xml index 26010c7d2..8d060bb94 100755 --- a/daexim-offsite-backup/provider/pom.xml +++ b/daexim-offsite-backup/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound daexim-offsite-backup-provider - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} diff --git a/dataChange/installer/pom.xml b/dataChange/installer/pom.xml index d6fef43b5..60217baa6 100755 --- a/dataChange/installer/pom.xml +++ b/dataChange/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound dataChange-installer - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/model/pom.xml b/dataChange/model/pom.xml index 9e305f634..bce47e949 100755 --- a/dataChange/model/pom.xml +++ b/dataChange/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound dataChange-model - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} diff --git a/dataChange/pom.xml b/dataChange/pom.xml index 01e366ac5..6110bdf1d 100755 --- a/dataChange/pom.xml +++ b/dataChange/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound dataChange - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: dataChange diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml index 7d0065170..cdefb5437 100755 --- a/dataChange/provider/pom.xml +++ b/dataChange/provider/pom.xml @@ -5,19 +5,18 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound dataChange-provider - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - ${project.version} ${project.version} diff --git a/dmaap-listener/pom.xml b/dmaap-listener/pom.xml index 6585f0aae..65e43886c 100755 --- a/dmaap-listener/pom.xml +++ b/dmaap-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound dmaap-listener - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT jar ccsdk-sli-northbound :: dmaap-listener @@ -24,7 +24,7 @@ ${maven.build.timestamp} ${project.version}-${build.number} - ${project.version} + 1.1.0 ${project.version} diff --git a/features/ccsdk-asdcApi/pom.xml b/features/ccsdk-asdcApi/pom.xml index 5b265dc3a..a744c4a08 100644 --- a/features/ccsdk-asdcApi/pom.xml +++ b/features/ccsdk-asdcApi/pom.xml @@ -5,19 +5,18 @@ org.onap.ccsdk.parent single-feature-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound ccsdk-asdcApi - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT feature ccsdk-sli-northbound :: asdcApi :: ${project.artifactId} - ${project.version} ${project.version} diff --git a/features/ccsdk-daexim-offsite-backup/pom.xml b/features/ccsdk-daexim-offsite-backup/pom.xml index bba1dd94b..6f57b66ea 100644 --- a/features/ccsdk-daexim-offsite-backup/pom.xml +++ b/features/ccsdk-daexim-offsite-backup/pom.xml @@ -5,21 +5,17 @@ org.onap.ccsdk.parent single-feature-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound ccsdk-daexim-offsite-backup - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT feature ccsdk-sli-northbound :: daexim-offsite-backup :: ${project.artifactId} - - ${project.version} - - org.opendaylight.controller diff --git a/features/ccsdk-dataChange/pom.xml b/features/ccsdk-dataChange/pom.xml index 001dbd3e5..ada12eccc 100644 --- a/features/ccsdk-dataChange/pom.xml +++ b/features/ccsdk-dataChange/pom.xml @@ -5,19 +5,18 @@ org.onap.ccsdk.parent single-feature-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound ccsdk-dataChange - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT feature ccsdk-sli-northbound :: dataChange :: ${project.artifactId} - ${project.version} ${project.version} diff --git a/features/ccsdk-lcm/pom.xml b/features/ccsdk-lcm/pom.xml index 101d21eda..013786d24 100644 --- a/features/ccsdk-lcm/pom.xml +++ b/features/ccsdk-lcm/pom.xml @@ -5,19 +5,18 @@ org.onap.ccsdk.parent single-feature-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound ccsdk-lcm - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT feature ccsdk-sli-northbound :: lcm :: ${project.artifactId} - ${project.version} ${project.version} diff --git a/features/ccsdk-sli-northbound-all/pom.xml b/features/ccsdk-sli-northbound-all/pom.xml index 6ad30b881..fc7081fbc 100644 --- a/features/ccsdk-sli-northbound-all/pom.xml +++ b/features/ccsdk-sli-northbound-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound ccsdk-sli-northbound-all - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/features-sli-northbound/pom.xml b/features/features-sli-northbound/pom.xml index 548605e25..37f961b9e 100644 --- a/features/features-sli-northbound/pom.xml +++ b/features/features-sli-northbound/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound features-sli-northbound - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT feature ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index cc681d33a..b87f855b8 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound slinorthbound-features-installer - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index de7679586..88a4cbbec 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound slinorthbound-feature-aggregator - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: features diff --git a/lcm/installer/pom.xml b/lcm/installer/pom.xml index 62e0a122e..75bc22ac4 100755 --- a/lcm/installer/pom.xml +++ b/lcm/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound lcm-installer - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/model/pom.xml b/lcm/model/pom.xml index 67d455e05..916345f68 100755 --- a/lcm/model/pom.xml +++ b/lcm/model/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound lcm-model - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} diff --git a/lcm/pom.xml b/lcm/pom.xml index 2d9cb6f77..e210b2451 100755 --- a/lcm/pom.xml +++ b/lcm/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound lcm - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound :: lcm diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml index f08ca79c7..03f34e6ba 100755 --- a/lcm/provider/pom.xml +++ b/lcm/provider/pom.xml @@ -5,19 +5,18 @@ org.onap.ccsdk.parent binding-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound lcm-provider - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT bundle ccsdk-sli-northbound :: lcm :: ${project.artifactId} - ${project.version} ${project.version} diff --git a/pom.xml b/pom.xml index 6ddb50ebe..8943a216b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound ccsdk-sli-northbound - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom ccsdk-sli-northbound diff --git a/releases/1.1.0.yaml b/releases/1.1.0.yaml new file mode 100644 index 000000000..5ac19ffcf --- /dev/null +++ b/releases/1.1.0.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: 'maven' +version: '1.1.0' +project: 'ccsdk-sli-northbound' +log_dir: 'ccsdk-sli-northbound-maven-stage-master/305/' diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 63b2fdf79..9e04efb07 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent standalone-parent - 2.1.0-SNAPSHOT + 2.1.0 org.onap.ccsdk.sli.northbound ueb-listener - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT jar ccsdk-sli-northbound :: ueb-listener @@ -22,10 +22,10 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - ${project.version} + 1.1.0 ${project.version} 1.4.1 - 1.6.5 + 1.6.5 diff --git a/version.properties b/version.properties index 60b87d41c..8c043844d 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=1 sprint_number=1 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg