aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xappc-outbound/.gitignore3
-rwxr-xr-xappc-outbound/appc-aai-client/.gitignore1
-rwxr-xr-xappc-outbound/appc-aai-client/features/.gitignore1
-rwxr-xr-xappc-outbound/appc-aai-client/features/pom.xml110
-rw-r--r--appc-outbound/appc-aai-client/features/src/main/resources/features.xml49
-rwxr-xr-xappc-outbound/appc-aai-client/installer/.gitignore1
-rwxr-xr-xappc-outbound/appc-aai-client/installer/pom.xml134
-rw-r--r--appc-outbound/appc-aai-client/installer/src/assembly/assemble_installer_zip.xml62
-rw-r--r--appc-outbound/appc-aai-client/installer/src/assembly/assemble_mvnrepo_zip.xml50
-rw-r--r--appc-outbound/appc-aai-client/installer/src/main/resources/scripts/install-feature.sh43
-rwxr-xr-xappc-outbound/appc-aai-client/pom.xml48
-rwxr-xr-xappc-outbound/appc-aai-client/provider/.gitignore1
-rwxr-xr-xappc-outbound/appc-aai-client/provider/pom.xml124
-rw-r--r--appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientActivator.java64
-rw-r--r--appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientConstant.java51
-rw-r--r--appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/aai/AaiService.java781
-rw-r--r--appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/node/AAIResourceNode.java514
-rw-r--r--appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/MockAaiService.java46
-rw-r--r--appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/TestAaiService.java63
-rw-r--r--appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/MockAaiService.java44
-rw-r--r--appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/TestAAIResourceNode.java57
-rwxr-xr-xappc-outbound/appc-network-inventory-client/.gitignore1
-rwxr-xr-xappc-outbound/appc-network-inventory-client/features/.gitignore1
-rwxr-xr-xappc-outbound/appc-network-inventory-client/features/pom.xml98
-rw-r--r--appc-outbound/appc-network-inventory-client/features/src/main/resources/features.xml48
-rwxr-xr-xappc-outbound/appc-network-inventory-client/installer/.gitignore1
-rwxr-xr-xappc-outbound/appc-network-inventory-client/installer/pom.xml131
-rw-r--r--appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_installer_zip.xml62
-rw-r--r--appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_mvnrepo_zip.xml50
-rw-r--r--appc-outbound/appc-network-inventory-client/installer/src/main/resources/scripts/install-feature.sh43
-rwxr-xr-xappc-outbound/appc-network-inventory-client/pom.xml51
-rwxr-xr-xappc-outbound/appc-network-inventory-client/provider/.gitignore1
-rwxr-xr-xappc-outbound/appc-network-inventory-client/provider/pom.xml93
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/InstarClientActivator.java64
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/Dme2Client.java184
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/SecureRestClientTrustManager.java58
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarResponseHandlerImpl.java86
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarRestClientImpl.java71
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java91
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/ResponseHandlerInterface.java31
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RestClientInterface.java32
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RuleHandlerInterface.java32
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/node/InstarClientNode.java135
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/utils/InstarClientConstant.java82
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/resources/adaptor.properties29
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/main/resources/outbound.properties39
-rwxr-xr-xappc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleInstarResponse24
-rwxr-xr-xappc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleKeyContents1
-rw-r--r--appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java53
-rwxr-xr-xappc-outbound/pom.xml78
-rw-r--r--pom.xml1
51 files changed, 3918 insertions, 0 deletions
diff --git a/appc-outbound/.gitignore b/appc-outbound/.gitignore
new file mode 100755
index 000000000..358cc65a6
--- /dev/null
+++ b/appc-outbound/.gitignore
@@ -0,0 +1,3 @@
+/target/
+/.project
+/.settings/
diff --git a/appc-outbound/appc-aai-client/.gitignore b/appc-outbound/appc-aai-client/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-aai-client/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-aai-client/features/.gitignore b/appc-outbound/appc-aai-client/features/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-aai-client/features/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-aai-client/features/pom.xml b/appc-outbound/appc-aai-client/features/pom.xml
new file mode 100755
index 000000000..413f3a7ae
--- /dev/null
+++ b/appc-outbound/appc-aai-client/features/pom.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-aai-client</artifactId>
+ <groupId>org.openecomp.appc</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>appc-aai-client-features</artifactId>
+ <name>APPC AAI Client Plugin - Features</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-aai-client-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+
+ <scope>runtime</scope>
+ </dependency>
+
+
+ <!-- dependency for opendaylight-karaf-empty for use by testing -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>opendaylight-karaf-empty</artifactId>
+ <type>zip</type>
+ </dependency>
+
+
+ <dependency>
+ <!-- Required for launching the feature tests -->
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-test</artifactId>
+ <version>${odl.commons.opendaylight.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>filter</id>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- launches the feature test, which validates that your karaf feature
+ can be installed inside of a karaf container. It doesn't validate that your
+ functionality works correctly, just that you have all of the dependent bundles
+ defined correctly. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version> <configuration> <systemPropertyVariables> <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
+ <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
+ <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
+ </systemPropertyVariables> <dependenciesToScan> <dependency>org.opendaylight.yangtools:features-test</dependency>
+ </dependenciesToScan> </configuration> </plugin> -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/classes/${features.file}</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/appc-outbound/appc-aai-client/features/src/main/resources/features.xml b/appc-outbound/appc-aai-client/features/src/main/resources/features.xml
new file mode 100644
index 000000000..84017dd7c
--- /dev/null
+++ b/appc-outbound/appc-aai-client/features/src/main/resources/features.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============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=========================================================
+ -->
+
+
+<features name="app-cntrl-aai-client-${project.version}"
+ xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+
+<!-- <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.version}/xml/features</repository> -->
+ <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features</repository>
+
+ <feature name='app-cntrl-aai-client' description="Application Controller AAI Client"
+ version='${project.version}'>
+ <!-- Most applications will have a dependency on the ODL MD-SAL Broker -->
+ <feature version="${broker-mdsal.version}">odl-mdsal-broker</feature>
+
+ <feature version="${sdnc.sli.version}">sdnc-sli</feature>
+ <feature version="${sdnc.aai.version}">sdnc-aai-service</feature>
+ <bundle>mvn:commons-lang/commons-lang/2.6</bundle>
+ <!-- <bundle>mvn:org.apache.velocity/velocity/${velocity.version}</bundle> -->
+ <bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
+ <bundle>wrap:mvn:com.att.eelf/eelf-core/${eelf.version}</bundle>
+ <bundle>mvn:ch.qos.logback/logback-core/${logback.version}</bundle>
+ <bundle>mvn:ch.qos.logback/logback-classic/${logback.version}</bundle>
+ <bundle>mvn:org.openecomp.appc/appc-aai-client-provider/${project.version}</bundle>
+ </feature>
+</features>
diff --git a/appc-outbound/appc-aai-client/installer/.gitignore b/appc-outbound/appc-aai-client/installer/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-aai-client/installer/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-aai-client/installer/pom.xml b/appc-outbound/appc-aai-client/installer/pom.xml
new file mode 100755
index 000000000..99e3fe067
--- /dev/null
+++ b/appc-outbound/appc-aai-client/installer/pom.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-aai-client</artifactId>
+ <groupId>org.openecomp.appc</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>appc-aai-client-installer</artifactId>
+ <name>APPC AAI Client -Installer</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <application.name>appc-aai-client</application.name>
+ <features.boot>appc-aai-client</features.boot>
+ <features.repositories>mvn:org.openecomp.appc/appc-aai-client-features/${project.version}/xml/features</features.repositories>
+ <include.transitive.dependencies>false</include.transitive.dependencies>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-aai-client-features</artifactId>
+ <version>${project.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-aai-client-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>maven-repo-zip</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>false</attach>
+ <finalName>stage/${application.name}-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/assemble_mvnrepo_zip.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>installer-zip</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>true</attach>
+ <finalName>${application.name}-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/assemble_installer_zip.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <transitive>false</transitive>
+ <outputDirectory>${project.build.directory}/assembly/system</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ <useRepositoryLayout>true</useRepositoryLayout>
+ <addParentPoms>false</addParentPoms>
+ <copyPom>false</copyPom>
+ <excludeGroupIds>org.opendaylight</excludeGroupIds>
+ <scope>provided</scope>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-version</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <!-- here the phase you need -->
+ <phase>validate</phase>
+ <configuration>
+ <outputDirectory>${basedir}/target/stage</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources/scripts</directory>
+ <includes>
+ <include>install-feature.sh</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/appc-outbound/appc-aai-client/installer/src/assembly/assemble_installer_zip.xml b/appc-outbound/appc-aai-client/installer/src/assembly/assemble_installer_zip.xml
new file mode 100644
index 000000000..e54eede04
--- /dev/null
+++ b/appc-outbound/appc-aai-client/installer/src/assembly/assemble_installer_zip.xml
@@ -0,0 +1,62 @@
+<!--
+ ============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=========================================================
+ -->
+
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+ 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">
+ <id>controller</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <!-- we want "system" and related files right at the root level
+ as this file is suppose to be unzip on top of a karaf
+ distro. -->
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>target/stage/</directory>
+ <outputDirectory>${application.name}</outputDirectory>
+ <fileMode>755</fileMode>
+ <includes>
+ <include>*.sh</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target/stage/</directory>
+ <outputDirectory>${application.name}</outputDirectory>
+ <fileMode>644</fileMode>
+ <excludes>
+ <exclude>*.sh</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+
+
+
+</assembly>
diff --git a/appc-outbound/appc-aai-client/installer/src/assembly/assemble_mvnrepo_zip.xml b/appc-outbound/appc-aai-client/installer/src/assembly/assemble_mvnrepo_zip.xml
new file mode 100644
index 000000000..fc99e918e
--- /dev/null
+++ b/appc-outbound/appc-aai-client/installer/src/assembly/assemble_mvnrepo_zip.xml
@@ -0,0 +1,50 @@
+<!--
+ ============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=========================================================
+ -->
+
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+ 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">
+ <id>controller</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <!-- we want "system" and related files right at the root level
+ as this file is suppose to be unzip on top of a karaf
+ distro. -->
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>target/assembly/</directory>
+ <outputDirectory>.</outputDirectory>
+ <excludes>
+ </excludes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
diff --git a/appc-outbound/appc-aai-client/installer/src/main/resources/scripts/install-feature.sh b/appc-outbound/appc-aai-client/installer/src/main/resources/scripts/install-feature.sh
new file mode 100644
index 000000000..05b4ae373
--- /dev/null
+++ b/appc-outbound/appc-aai-client/installer/src/main/resources/scripts/install-feature.sh
@@ -0,0 +1,43 @@
+###
+# ============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=========================================================
+###
+
+#!/bin/bash
+
+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 -n -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/appc-outbound/appc-aai-client/pom.xml b/appc-outbound/appc-aai-client/pom.xml
new file mode 100755
index 000000000..5c25bb3ba
--- /dev/null
+++ b/appc-outbound/appc-aai-client/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-outbound</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>pom</packaging>
+ <artifactId>appc-aai-client</artifactId>
+
+ <name>APPC AAI Client for Node</name>
+ <url>http://wiki.sdn.labs.att.com</url>
+ <description>Common Utilities for DG</description>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-aai-client.features</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-aai-client.provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-aai-client.installer</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+ </dependencyManagement>
+
+ <modules>
+ <module>provider</module>
+ <module>features</module>
+ <module>installer</module>
+ </modules>
+</project>
diff --git a/appc-outbound/appc-aai-client/provider/.gitignore b/appc-outbound/appc-aai-client/provider/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-aai-client/provider/pom.xml b/appc-outbound/appc-aai-client/provider/pom.xml
new file mode 100755
index 000000000..0604b1ad0
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/pom.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-aai-client</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>appc-aai-client-provider</artifactId>
+ <packaging>bundle</packaging>
+ <name>APPC AAI Client - Provider</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>${equinox.osgi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdnc.adaptors</groupId>
+ <artifactId>aai-service-provider</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy-xsl</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <outputDirectory>${basedir}/target/templates/xslt/sbg</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources/xsl</directory>
+ <includes>
+ <include>*</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-properties</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <outputDirectory>${basedir}/target/properties/</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>*.properties</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${bundle.plugin.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>org.openecomp.appc.aai.client</Bundle-SymbolicName>
+ <Bundle-Activator>org.openecomp.appc.aai.client.AppcAaiClientActivator</Bundle-Activator>
+ <Export-Package>org.openecomp.appc.aai.client</Export-Package>
+ <Import-Package>*</Import-Package>
+ <DynamicImport-Package>*</DynamicImport-Package>
+ </instructions>
+ <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
diff --git a/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientActivator.java b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientActivator.java
new file mode 100644
index 000000000..2f35805b7
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientActivator.java
@@ -0,0 +1,64 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+
+import org.openecomp.appc.aai.client.node.AAIResourceNode;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public class AppcAaiClientActivator implements BundleActivator {
+
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(AppcAaiClientActivator.class);
+ private List<ServiceRegistration> registrations = new LinkedList<ServiceRegistration>();
+
+ @Override
+ public void start(BundleContext ctx) throws Exception {
+
+
+
+ AAIResourceNode aaiResourceNode = new AAIResourceNode();
+ log.info("Registering service-- " + aaiResourceNode.getClass().getName());
+ registrations.add(ctx.registerService(aaiResourceNode.getClass().getName(), aaiResourceNode, null));
+
+
+ }
+
+ @Override
+ public void stop(BundleContext arg0) throws Exception {
+ for (ServiceRegistration registration : registrations) {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
diff --git a/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientConstant.java b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientConstant.java
new file mode 100644
index 000000000..7521d76da
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/AppcAaiClientConstant.java
@@ -0,0 +1,51 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client;
+
+public class AppcAaiClientConstant {
+
+
+
+
+ public static String INPUT_PARAM_RESPONSE_PREFIX = "responsePrefix";
+ public static String OUTPUT_STATUS_SUCCESS = "success";
+ public static String OUTPUT_STATUS_FAILURE = "failure";
+
+ public static String OUTPUT_PARAM_STATUS = "status";
+ public static String OUTPUT_PARAM_ERROR_MESSAGE = "error-message";
+
+
+ public static final String INPUT_PARAM_VM_INSTANCE = "vmInstance";
+
+
+ public static final Object INPUT_PARAM_VNF_ID = "vnfId";
+ public static final Object INPUT_PARAM_VM_NAME = "vmName";
+
+ public static final String INPUT_PARAM_FILE_ID = "fileId";
+
+
+
+
+}
diff --git a/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/aai/AaiService.java b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/aai/AaiService.java
new file mode 100644
index 000000000..388f5caa1
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/aai/AaiService.java
@@ -0,0 +1,781 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client.aai;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicException;
+import org.openecomp.sdnc.sli.SvcLogicResource;
+import org.openecomp.sdnc.sli.SvcLogicResource.QueryStatus;
+
+import org.openecomp.appc.aai.client.AppcAaiClientConstant;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.aai.AAIClient;
+import org.openecomp.sdnc.sli.aai.AAIService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+
+public class AaiService {
+
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(AaiService.class);
+ private AAIClient aaiClient;
+
+
+ public AaiService(AAIClient aaiClient) {
+ this.aaiClient = aaiClient;
+ }
+
+ public AaiService() {
+ BundleContext bctx = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
+ ServiceReference sref = bctx.getServiceReference(AAIService.class);
+ aaiClient = (AAIClient) bctx.getService(sref);
+ }
+
+ public void getGenericVnfInfo(Map<String, String> params, SvcLogicContext ctx) throws Exception {
+
+
+ String vnfId = params.get("vnfId");
+ if(StringUtils.isBlank(vnfId)){
+ throw new Exception("VnfId is missing");
+ }
+
+ String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+
+ prefix = StringUtils.isNotBlank(prefix) ? (prefix+".") : "";
+
+
+ //String resourceKey = "generic-vnf.vnf-id = '" + vnfId + "' AND relationship-key = 'vserver.vserver-id'";
+
+ String resourceKey = "generic-vnf.vnf-id = '" + vnfId + "'";
+
+ String resourceType = "generic-vnf";
+ String queryPrefix = "vnfInfo";
+ SvcLogicContext vnfCtx = readResource(resourceKey,queryPrefix,resourceType);
+
+
+
+
+ ctx.setAttribute(prefix + "vnf.vnf-name", vnfCtx.getAttribute("vnfInfo.vnf-name"));
+ ctx.setAttribute(prefix + "vnf.vnf-type", vnfCtx.getAttribute("vnfInfo.vnf-type"));
+ ctx.setAttribute(prefix + "vnf.prov-status", vnfCtx.getAttribute("vnfInfo.prov-status"));
+ ctx.setAttribute(prefix + "vnf.orchestration-status", vnfCtx.getAttribute("vnfInfo.orchestration-status"));
+
+
+
+ int vmCount = 0;
+
+
+ String relLen = vnfCtx.getAttribute("vnfInfo.relationship-list.relationship_length");
+ int relationshipLength = 0;
+ if ( relLen != null )
+ relationshipLength = Integer.parseInt(relLen);
+
+ log.info("RELLEN " + relationshipLength);
+ for ( int i=0; i < relationshipLength; i++ ) {
+
+ String vserverId = getRelationshipValue(i, vnfCtx, "vserver", "vserver.vserver-id", "vnfInfo");
+ String tenantId = getRelationshipValue(i, vnfCtx, "vserver", "tenant.tenant-id", "vnfInfo");
+ String cloudOwner = getRelationshipValue(i, vnfCtx, "vserver", "cloud-region.cloud-owner", "vnfInfo");
+ String cloudRegionId = getRelationshipValue(i, vnfCtx, "vserver", "cloud-region.cloud-region-id", "vnfInfo");
+
+ if ( vserverId != null ) {
+
+ log.info("VSERVER KEYS " + vserverId + " " + tenantId + " " + cloudOwner + " " + cloudRegionId);
+ String vnfPrefix = prefix + "vm[" + vmCount + "].";
+
+ ctx.setAttribute(vnfPrefix + "vserver-id", vserverId);
+ ctx.setAttribute(vnfPrefix + "tenant-id", tenantId);
+ ctx.setAttribute(vnfPrefix + "cloud-owner", cloudOwner);
+ ctx.setAttribute(vnfPrefix + "cloud-region-id", cloudRegionId);
+
+ vmCount++;
+ }
+ }
+
+
+
+ ctx.setAttribute(prefix + "vm-count", String.valueOf(vmCount));
+
+ log.info("VMCOUNT FROM VNF INFO " + ctx.getAttribute(prefix + "vm-count"));
+
+
+
+
+ }
+
+
+
+ public void getVMInfo(Map<String, String> params,SvcLogicContext ctx ) throws Exception {
+ log.info("Received getVmInfo call with params : " + params);
+
+ String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+
+ prefix = StringUtils.isNotBlank(prefix) ? (prefix+".") : "";
+
+ int vnfcCount = 0;
+ ctx.setAttribute(prefix + "vm.vnfc-count", String.valueOf(vnfcCount)); // Incase no vnfcs are found
+
+ String vserverId = params.get("vserverId");
+ if(StringUtils.isBlank(vserverId)){
+ throw new Exception("VServerId is missing");
+ }
+
+ String tenantId = params.get("tenantId");
+ if(StringUtils.isBlank(tenantId)){
+ throw new Exception("TenantId is missing");
+ }
+
+ String cloudOwner = params.get("cloudOwner");
+ if(StringUtils.isBlank(cloudOwner)){
+ throw new Exception("Cloud Owner is missing");
+ }
+
+ String cloudRegionId = params.get("cloudRegionId");
+ if(StringUtils.isBlank(cloudRegionId)){
+ throw new Exception("Cloud region Id is missing");
+ }
+
+
+
+ String resourceKey = "vserver.vserver-id = '" +vserverId + "' AND tenant.tenant-id = '" + tenantId +
+ "' AND cloud-region.cloud-owner = '" +cloudOwner +
+ "' AND cloud-region.cloud-region-id = '" +cloudRegionId + "'";
+
+
+ String queryPrefix = "vmInfo";
+
+ String resourceType = "vserver";
+ SvcLogicContext vmCtx = readResource(resourceKey,queryPrefix,resourceType);
+
+
+
+
+
+ ctx.setAttribute(prefix+ "vm.prov-status", vmCtx.getAttribute("vmInfo.prov-status"));
+
+ ctx.setAttribute(prefix+ "vm.vserver-name", vmCtx.getAttribute("vmInfo.vserver-name"));
+
+
+
+ String relLen = vmCtx.getAttribute("vmInfo.relationship-list.relationship_length");
+
+
+ int relationshipLength = 0;
+ if ( relLen != null )
+ relationshipLength = Integer.parseInt(relLen);
+
+ log.info("RELLEN" + relationshipLength);
+ for ( int i=0; i < relationshipLength; i++ ) {
+
+ String vfModuleId = getRelationshipValue(i, vmCtx, "vf-module", "vf-module.vf-module-id", "vmInfo");
+
+ if ( vfModuleId != null )
+ ctx.setAttribute(prefix + "vm.vf-module-id", vfModuleId);
+
+
+ String vnfcName = getRelationshipValue(i, vmCtx, "vnfc", "vnfc.vnfc-name", "vmInfo");
+
+ if ( vnfcName != null ) {
+
+ ctx.setAttribute(prefix + "vm.vnfc[" + vnfcCount + "].vnfc-name", vnfcName);
+ vnfcCount++;
+ }
+
+
+
+
+ } //relationshipLength
+ ctx.setAttribute(prefix + "vm.vnfc-count", String.valueOf(vnfcCount));
+
+ log.info("VSERVERNAME " + ctx.getAttribute(prefix+ "vm.vserver-name") + " HAS NUM VNFCS = " + ctx.getAttribute(prefix+ "vm.vnfc-count"));
+
+ }
+
+
+
+ private String getRelationshipValue(int i, SvcLogicContext ctx, String relatedTo, String relationshipKey, String prefix) throws Exception {
+
+
+ if ( relatedTo.equals(ctx.getAttribute(prefix + ".relationship-list.relationship[" + i + "].related-to")) ) {
+
+
+ log.info("RELATEDTO " + relatedTo);
+ int relationshipDataLength = 0;
+ String relDataLen = ctx.getAttribute(prefix + ".relationship-list.relationship[" + i + "].relationship-data_length");
+
+ if ( relDataLen != null )
+ relationshipDataLength = Integer.parseInt(relDataLen);
+
+
+
+ for ( int j =0 ; j < relationshipDataLength ; j++) {
+
+ String key = ctx.getAttribute(prefix + ".relationship-list.relationship[" + i + "].relationship-data[" + j + "].relationship-key");
+
+ String value = ctx.getAttribute(prefix + ".relationship-list.relationship[" + i + "].relationship-data[" + j + "].relationship-value");
+
+ log.info("GENERIC KEY " + key);
+ log.info("GENERIC VALUE " + value);
+
+ if (relationshipKey.equals(key)) {
+ return value;
+
+ }
+
+ } // relationshipDataLength
+
+
+ } // if related-To
+
+
+ return null;
+
+
+ }
+
+
+ public void getVnfcInfo(Map<String, String> params,SvcLogicContext ctx ) throws Exception {
+ log.info("Received getVnfc call with params : " + params);
+
+ String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+ prefix = StringUtils.isNotBlank(prefix) ? (prefix+".") : "";
+
+ String vnfcName = params.get("vnfcName");
+ if(StringUtils.isBlank(vnfcName)){
+ throw new Exception("Vnfc Name is missing");
+ }
+
+ String resourceKey = "vnfc.vnfc-name = '" + vnfcName + "'";
+
+ String queryPrefix = "vnfcInfo";
+ String resourceType = "vnfc";
+ SvcLogicContext vnfcCtx = readResource(resourceKey,queryPrefix,resourceType);
+
+ // Changes for US 315820 for 1710 vnfc-type renamed to nfc-function,vnfc-function-code renamed to nfc-naming-code
+
+ /*ctx.setAttribute(prefix+ "vnfc.vnfc-type", vnfcCtx.getAttribute("vnfcInfo.vnfc-type"));
+ ctx.setAttribute(prefix+ "vnfc.vnfc-function-code", vnfcCtx.getAttribute("vnfcInfo.vnfc-function-code"));
+ ctx.setAttribute(prefix+ "vnfc.group-notation", vnfcCtx.getAttribute("vnfcInfo.group-notation"));*/
+
+ ctx.setAttribute(prefix+ "vnfc.vnfc-type", vnfcCtx.getAttribute("vnfcInfo.nfc-function"));
+ ctx.setAttribute(prefix+ "vnfc.vnfc-function-code", vnfcCtx.getAttribute("vnfcInfo.nfc-naming-code"));
+ ctx.setAttribute(prefix+ "vnfc.group-notation", vnfcCtx.getAttribute("vnfcInfo.group-notation"));
+
+
+ }
+
+ public void insertVnfcs(Map<String, String> params,SvcLogicContext ctx, int vnfcRefLen, int vmCount) throws Exception {
+ log.info("Received insertVnfcs call with params : " + params);
+
+ String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ prefix = StringUtils.isNotBlank(prefix) ? (prefix+".") : "";
+
+
+
+ int vnfcRefIndx =-1;
+ for ( int i = 0; i < vmCount ; i++ ) {
+ String aaiRefKey = prefix + "vm[" + i + "].";
+
+ log.info("VNFCNAME IN INSERTVNFCS " + ctx.getAttribute(aaiRefKey + "vnfc-name"));
+ String numVnfcsStr = ctx.getAttribute(aaiRefKey + "vnfc-count");
+
+
+ //if ( numVnfcsStr != null || Integer.parseInt(numVnfcsStr) >= 1 )
+
+
+ if ( ctx.getAttribute(aaiRefKey + "vnfc-name") != null )
+ continue;
+ else
+ vnfcRefIndx++;
+
+
+ // Get Vnfc_reference data
+ String vnfcRefKey = "vnfcReference[" + vnfcRefIndx + "].";
+
+ log.info("VNFCREFKEY " + vnfcRefKey);
+ log.info("AAIREFKEY " + aaiRefKey);
+
+ String vmInstance = ctx.getAttribute(vnfcRefKey+ "VM-INSTANCE");
+ String vnfcInstance = ctx.getAttribute(vnfcRefKey+ "VNFC-INSTANCE");
+
+ String groupNotationType = ctx.getAttribute(vnfcRefKey+ "GROUP-NOTATION-TYPE");
+ String groupNotationValue = ctx.getAttribute(vnfcRefKey+ "GROUP-NOTATION-VALUE");
+
+ String vnfcType = ctx.getAttribute(vnfcRefKey+ "VNFC-TYPE");
+
+ String vnfcFuncCode = ctx.getAttribute(vnfcRefKey+ "VNFC-FUNCTION-CODE");
+
+ String populateIpAddressV4OamVip = ctx.getAttribute(vnfcRefKey+ "IPADDRESS-V4-OAM-VIP");
+
+
+ // Get vnfc Data to be added
+ String vserverName = ctx.getAttribute(aaiRefKey + "vserver-name");
+ String vnfcName = vserverName + vnfcFuncCode + "001";
+
+ String groupNotation = getGroupNotation(groupNotationType, groupNotationValue, vnfcName, vserverName,prefix, ctx, vnfcType);
+
+
+ String ipAddressV4OamVip = null;
+ if ( "Y".equals(populateIpAddressV4OamVip))
+ ipAddressV4OamVip = ctx.getAttribute("vnf-host-ip-address"); // from input
+
+
+ Map<String, String> vnfcParams = populateVnfcParams(ctx, aaiRefKey, ipAddressV4OamVip, groupNotation, vnfcType, vnfcFuncCode);
+
+
+ addVnfc( vnfcName, vnfcParams, prefix);
+
+ // Add VNFC Info to context for current added VNFC
+ ctx.setAttribute(aaiRefKey + "vnfc-name", vnfcName);
+ ctx.setAttribute(aaiRefKey + "vnfc-type", vnfcType);
+ ctx.setAttribute(aaiRefKey + "vnfc-function-code", vnfcFuncCode);
+ ctx.setAttribute(aaiRefKey + "group-notation", groupNotation);
+
+ }
+
+
+ }
+
+
+
+ public Map<String, String> populateVnfcParams(SvcLogicContext ctx, String aaiRefKey,
+ String ipAddressV4OamVip, String groupNotation, String vnfcType, String vnfcFuncCode) throws Exception {
+
+
+ Map<String, String> vnfcParams = new HashMap<String, String>();
+
+ // Changes for US 315820 for 1710 vnfc-type renamed to nfc-function,vnfc-function-code renamed to nfc-naming-code
+
+ /*
+ vnfcParams.put("vnfc-function-code", vnfcFuncCode);
+ vnfcParams.put("vnfc-type", vnfcType);
+ */
+ vnfcParams.put("nfc-naming-code", vnfcFuncCode);
+ vnfcParams.put("nfc-function", vnfcType);
+
+ //
+
+ vnfcParams.put("ipaddress-v4-oam-vip", ipAddressV4OamVip);
+
+ vnfcParams.put("prov-status", "NVTPROV");
+ vnfcParams.put("orchestration-status", "CONFIGURED");
+ vnfcParams.put("in-maint", "false");
+ vnfcParams.put("is-closed-loop", "false");
+ vnfcParams.put("group-notation",groupNotation);
+
+
+ vnfcParams.put("relationship-list.relationship[0].related-to","vserver");
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[0].relationship-key","vserver.vserver-id");
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[0].relationship-value",ctx.getAttribute(aaiRefKey + "vserver-id"));
+
+
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[1].relationship-key","tenant.tenant-id");
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[1].relationship-value",ctx.getAttribute(aaiRefKey + "tenant-id"));
+
+
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[2].relationship-key","cloud-region.cloud-owner");
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[2].relationship-value",ctx.getAttribute(aaiRefKey + "cloud-owner"));
+
+
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[3].relationship-key","cloud-region.cloud-region-id");
+ vnfcParams.put("relationship-list.relationship[0].relationship-data[3].relationship-value",ctx.getAttribute(aaiRefKey + "cloud-region-id"));
+
+
+
+ vnfcParams.put("relationship-list.relationship[1].related-to","generic-vnf");
+ vnfcParams.put("relationship-list.relationship[1].relationship-data[0].relationship-key","generic-vnf.vnf-id");
+ vnfcParams.put("relationship-list.relationship[1].relationship-data[0].relationship-value",ctx.getAttribute("vnf-id"));
+
+
+ vnfcParams.put("relationship-list.relationship[2].related-to","vf-module");
+ vnfcParams.put("relationship-list.relationship[2].relationship-data[0].relationship-key","generic-vnf.vnf-id");
+ vnfcParams.put("relationship-list.relationship[2].relationship-data[0].relationship-value",ctx.getAttribute("vnf-id"));
+
+
+ vnfcParams.put("relationship-list.relationship[2].relationship-data[1].relationship-key","vf-module.vf-module-id");
+ vnfcParams.put("relationship-list.relationship[2].relationship-data[1].relationship-value",ctx.getAttribute(aaiRefKey + "vf-module-id"));
+
+
+ return vnfcParams;
+ }
+
+ public void addVnfc(String vnfcName, Map<String, String> params, String prefix) throws Exception {
+
+ log.info("Received addVnfc call with vnfcName : " +vnfcName);
+ log.info("Received addVnfc call with params : " + params);
+ String resourceKey = "vnfc.vnfc-name = '" + vnfcName + "'";
+
+ log.info("Received addVnfc call with resourceKey : " + resourceKey);
+
+
+ SvcLogicContext vnfcCtx = new SvcLogicContext();
+ SvcLogicResource.QueryStatus response = aaiClient.save("vnfc", true, false, resourceKey, params, prefix, vnfcCtx) ;
+
+ if (SvcLogicResource.QueryStatus.SUCCESS.equals(response)) {
+ log.info("Added VNFC SUCCESSFULLY " + vnfcName);
+
+ }
+ else if (SvcLogicResource.QueryStatus.FAILURE.equals(response)) {
+ throw new Exception("VNFC Add failed for for vnfc_name " + vnfcName);
+
+ }
+
+
+ }
+
+ public String getGroupNotation(String groupNotationType, String groupNotationValue, String vnfcName,
+ String vserverName, String prefix, SvcLogicContext ctx, String vnfcRefVnfcType) throws Exception {
+
+ String grpNotation = null;
+
+ if ( "fixed-value".equals(groupNotationType)) {
+ grpNotation = groupNotationValue;
+
+ }
+ else if ( "first-vnfc-name".equals(groupNotationType) ) {
+
+ /*If the group-notation-type value = ?first-vnfc-name?,
+ * then populate the group-notation value with the concatenation of
+ * [vnfc name associated with the first vnfc for the vnfc-type (e.g., *******)]
+ * and [the value in group-notation-value (e.g., pair)].
+ * There may be several vnfc-types associated with the VM?s.
+ */
+ /* Vnfc-type should be from refrence data */
+
+ /* vDBE has 2 VNFCs with same VNFC type . The pair name should be same for both . */
+ /* When first VNFC is added details should be added to context so FirstVnfcName doesnt return null second time. */
+ String tmpVnfcName = getFirstVnfcNameForVnfcType(ctx, prefix, vnfcRefVnfcType);
+
+ log.info("RETURNED FIRSTVNFCNAME" + tmpVnfcName);
+ log.info("CURRENTVNFCNAME" + vnfcName);
+ if ( tmpVnfcName == null ) {
+ log.info("CURRENTVNFCNAME" + vnfcName);
+ // No Vnfcs currently exist. Use Current vnfcName
+ grpNotation = vnfcName + groupNotationValue;
+ }
+ else
+ grpNotation = tmpVnfcName + groupNotationValue;
+
+
+ }
+ else if ( "relative-value".equals(groupNotationType) ) {
+
+ /*If the group-notation-type = ?relative-value?, then find the group-notation value
+ * from the prior vnfc (where prior means the vnfc with where the last three digits of the
+ * vm-name is one lower than the current one; note that this vnfc may have been previously configured.)
+ 1. If the group-notation-value = next, then add 1 to the group-notation value from the prior vnfc and use this value
+ 2. If the group-notation-value = same, then use the group-notation-value from the prior vnfc record*/
+
+ // next and same cant be defined for first VM. if next will not generate grpNotation if Prior is not a number
+ String tmpVserverName = null;
+ if ( vserverName != null ) {
+
+ String vmNamePrefix = vserverName.substring(0,vserverName.length()-3);
+
+ String lastThreeChars = vserverName.substring(vserverName.length() - 3);
+
+ if ( NumberUtils.isDigits(lastThreeChars)) {
+ int vmNum = Integer.parseInt(lastThreeChars) - 1;
+ String formatted = String.format("%03d", vmNum);
+
+ log.info("FORMATTED " + formatted);
+
+ tmpVserverName = vmNamePrefix + formatted;
+
+
+ String priorGroupNotation = getGroupNotationForVServer(ctx, prefix, tmpVserverName);
+
+ if ( "same".equals(groupNotationValue))
+ grpNotation = priorGroupNotation;
+ else if ( "next".equals(groupNotationValue)) {
+ if ( priorGroupNotation != null && NumberUtils.isDigits(priorGroupNotation)) {
+ int nextGrpNotation = Integer.parseInt(priorGroupNotation) + 1;
+ grpNotation = String.valueOf(nextGrpNotation);
+ }
+ }
+ }
+
+ }
+
+
+
+ }
+
+
+ log.info("RETURNED GROUPNOTATION " + grpNotation);
+ return grpNotation;
+ }
+
+ public String getGroupNotationForVServer(SvcLogicContext ctx, String prefix, String vserverName) throws Exception {
+
+
+ String vmCountStr = ctx.getAttribute(prefix+"vnf.vm-count");
+
+ if ( vmCountStr == null )
+ return null;
+
+ int vmCount = Integer.valueOf(vmCountStr);
+ for ( int i = 0; i < vmCount ; i++ ) {
+
+ String tmpVserver = ctx.getAttribute(prefix+ "vm[" + i + "].vserver-name");
+
+ if (vserverName.equals(tmpVserver))
+ return ctx.getAttribute(prefix+ "vm[" + i + "].group-notation");
+
+ } // vmCount
+
+ return null;
+
+ }
+
+
+
+
+ public String getFirstVnfcNameForVnfcType(SvcLogicContext ctx, String prefix, String vnfcRefVnfcType) throws Exception {
+
+
+
+ /*if(StringUtils.isBlank(vnfcRefVnfcType)){
+ throw new Exception("Vnfc Reference : VNFC Type is missing");
+ }*/
+
+
+ String vmCountStr = ctx.getAttribute(prefix+"vnf.vm-count");
+
+ if ( vmCountStr == null )
+ return null;
+
+ int vmCount = Integer.valueOf(vmCountStr);
+ for ( int i = 0; i < vmCount ; i++ ) {
+
+ String tmpvnfcType = ctx.getAttribute(prefix+ "vm[" + i + "].vnfc-type");
+
+ if (vnfcRefVnfcType.equals(tmpvnfcType))
+ return ctx.getAttribute(prefix+ "vm[" + i + "].vnfc-name");
+
+ } // vmCount
+
+
+
+ return null;
+
+ }
+
+ public void updateVServerStatus(Map<String, String> params,SvcLogicContext ctx, int vmCount) throws Exception {
+ log.info("Received updateVServerStatus call with params : " + params);
+
+ String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ prefix = StringUtils.isNotBlank(prefix) ? (prefix+".") : "";
+
+
+ Map<String, String> vServerParams = new HashMap<String, String>();
+
+
+ // TODO - Should this just update prov-status or both? What about generic-vnf status? Will that be updated by Dispatcher?
+
+ vServerParams.put("prov-status", "NVTPROV");
+ //vServerParams.put("orchestration-status", "CONFIGURED");
+
+
+ for ( int i = 0; i < vmCount ; i++ ) {
+ String aaiRefKey = prefix + "vm[" + i + "].";
+
+ log.info("VNFCNAME IN UpdateVServer " + ctx.getAttribute(aaiRefKey + "vnfc-name"));
+
+ if ( ctx.getAttribute(aaiRefKey + "vnfc-name") != null )
+ continue;
+
+
+
+ String resourceKey = "vserver.vserver-id = '" + ctx.getAttribute(aaiRefKey + "vserver-id") + "'" +
+ " AND tenant.tenant-id = '" + ctx.getAttribute(aaiRefKey + "tenant-id") + "'" +
+ " AND cloud-region.cloud-owner = '" + ctx.getAttribute(aaiRefKey + "cloud-owner") + "'" +
+ " AND cloud-region.cloud-region-id = '" + ctx.getAttribute(aaiRefKey + "cloud-region-id") + "'";
+
+
+ updateResource( "vserver", resourceKey, vServerParams);
+
+ }
+
+
+ }
+
+
+
+ public void updateVnfStatus(Map<String, String> params,SvcLogicContext ctx) throws Exception {
+ log.info("Received updateVnfStatus call with params : " + params);
+
+ String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ prefix = StringUtils.isNotBlank(prefix) ? (prefix+".") : "";
+
+
+ Map<String, String> vnfParams = new HashMap<String, String>();
+
+
+ // TODO - Should this just update prov-status or both? What about generic-vnf status? Will that be updated by Dispatcher?
+
+ vnfParams.put("prov-status", "NVTPROV");
+ //vnfParams.put("orchestration-status", "CONFIGURED");
+
+
+ String resourceKey = "generic-vnf.vnf-id = '" + ctx.getAttribute("vnf-id") + "'";
+
+ updateResource( "generic-vnf" , resourceKey, vnfParams);
+
+
+
+
+ }
+
+ public void updateResource( String resource, String resourceKey, Map<String, String> params) throws Exception {
+
+ log.info("Received updateResource call with Key : " +resourceKey);
+
+
+ SvcLogicContext ctx = new SvcLogicContext();
+
+
+ SvcLogicResource.QueryStatus response = aaiClient.update(resource, resourceKey , params, "tmp.update", ctx);
+
+
+
+ if (SvcLogicResource.QueryStatus.SUCCESS.equals(response)) {
+ log.info("Updated " + resource + " SUCCESSFULLY for " + resourceKey);
+
+ }
+ else if (SvcLogicResource.QueryStatus.FAILURE.equals(response)) {
+ throw new Exception(resource + " Update failed for " + resourceKey);
+
+ }
+ }
+
+ public SvcLogicContext readResource(String query, String prefix, String resourceType) throws Exception {
+ SvcLogicContext resourceContext = new SvcLogicContext();
+
+ SvcLogicResource.QueryStatus response = aaiClient.query(resourceType,false,null,query,prefix,null,resourceContext);
+ log.info("AAIResponse: " + response.toString());
+ if(!SvcLogicResource.QueryStatus.SUCCESS.equals(response)){
+ throw new Exception("Error Retrieving " + resourceType + " from A&AI");
+ }
+
+ return resourceContext;
+
+
+
+ }
+
+ //Added 1710 & Backward Compatibility
+
+ public void checkAndUpdateVnfc(Map<String, String> params,SvcLogicContext ctx, int vnfcRefLen, int vmCount) throws Exception {
+ log.info("Received checkAndUpdateVnfcStatus call with params : " + params);
+
+ String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ prefix = StringUtils.isNotBlank(prefix) ? (prefix+".") : "";
+
+ for ( int i = 0; i < vmCount ; i++ ) {
+ String aaiRefKey = prefix + "vm[" + i + "].";
+
+ log.info("VNFCNAME IN INSERTVNFCS "+ aaiRefKey+"vnfc-name:" + ctx.getAttribute(aaiRefKey + "vnfc-name"));
+
+ String numVnfcsStr = ctx.getAttribute(aaiRefKey + "vnfc-count");
+ String vnfcNameAai = ctx.getAttribute(aaiRefKey + "vnfc-name");
+
+ if (StringUtils.isNotBlank(vnfcNameAai)) {
+ // Get Vnfc_reference data
+ for(int vnfcRefIndx=0;vnfcRefIndx < vnfcRefLen;vnfcRefIndx++ ) {
+
+ String vnfcRefKey = "vnfcReference[" + vnfcRefIndx + "].";
+
+ log.info("VNFCREFKEY " + vnfcRefKey);
+ log.info("AAIREFKEY " + aaiRefKey);
+
+ String vnfcFuncCode = ctx.getAttribute(vnfcRefKey+ "VNFC-FUNCTION-CODE");
+ String vserverName = ctx.getAttribute(aaiRefKey + "vserver-name");
+ String vnfcNameReference = vserverName + vnfcFuncCode + "001";
+
+ if(vnfcNameAai.equals(vnfcNameReference)) {
+
+ updateVnfcStatus( vnfcNameAai, params, prefix);
+ }
+
+
+ }
+ }
+
+
+
+
+
+
+ }
+
+
+ }
+
+ public void updateVnfcStatus(String vnfcName, Map<String, String> params, String prefix) throws Exception {
+
+ log.info("Received updateVnfcStatus call with vnfcName : " +vnfcName);
+ log.info("Received updateVnfcStatus call with params : " + params);
+
+ String resourceKey = "vnfc.vnfc-name = '" + vnfcName + "'";
+ log.info("Received updateVnfcStatus call with resourceKey : " + resourceKey);
+
+
+ Map<String, String> vnfcParams = new HashMap<String, String>();
+ vnfcParams.put("prov-status", "NVTPROV");
+ vnfcParams.put("orchestration-status", "CONFIGURED");
+
+ log.info("In updateVnfcStatus call with vnfcParams : " + vnfcParams);
+
+ updateResource( "vnfc" , resourceKey, vnfcParams);
+
+ log.info("End of updateVnfcStatus");
+
+
+ }
+
+
+
+ //Added for 1710
+
+
+}
diff --git a/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/node/AAIResourceNode.java b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/node/AAIResourceNode.java
new file mode 100644
index 000000000..d2797c8db
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/main/java/org/openecomp/appc/aai/client/node/AAIResourceNode.java
@@ -0,0 +1,514 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client.node;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+import org.openecomp.appc.aai.client.AppcAaiClientConstant;
+import org.openecomp.appc.aai.client.aai.AaiService;
+
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicException;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+//import com.fasterxml.jackson.databind.ObjectMapper;
+
+
+public class AAIResourceNode implements SvcLogicJavaPlugin {
+
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(AAIResourceNode.class);
+
+
+ public AaiService getAaiService() {
+ return new AaiService();
+ }
+ /* Gets VNF Info and All VServers associated with Vnf */
+ public void getVnfInfo(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+
+ log.info("Received getVnfInfo call with params : " + inParams);
+
+ String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ try {
+
+
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
+ AaiService aai = getAaiService();
+
+
+
+ aai.getGenericVnfInfo(inParams,ctx);
+
+
+
+
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_SUCCESS);
+ log.info("getVnfInfo Successful ");
+ } catch (Exception e) {
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed in getVnfInfo " + e.getMessage());
+
+ throw new SvcLogicException(e.getMessage());
+ }
+ }
+
+
+
+ public void getAllVServersVnfcsInfo(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+
+ log.info("Received getAllVServersVnfcsInfo call with params : " + inParams);
+
+ String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ try {
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
+ AaiService aai = getAaiService();
+
+
+
+ ArrayList<Map<String, String>> vservers = new ArrayList<Map<String, String>>();
+
+ int vmWithNoVnfcsCount = 0;
+ String vmCountStr = ctx.getAttribute(responsePrefix + "vm-count");
+
+ if ( vmCountStr == null )
+ throw new Exception("Unable to get VServers for the VNF");
+
+ int vmCount = Integer.parseInt(vmCountStr);
+ for ( int i = 0; i < vmCount; i++ ) {
+
+ SvcLogicContext vmServerCtx = new SvcLogicContext();
+
+ Map<String, String> paramsVm = new HashMap<String, String>();
+ paramsVm.put("vserverId", ctx.getAttribute(responsePrefix + "vm[" + i + "].vserver-id"));
+ paramsVm.put("tenantId", ctx.getAttribute(responsePrefix +"vm[" + i + "].tenant-id"));
+ paramsVm.put("cloudOwner", ctx.getAttribute(responsePrefix +"vm[" + i + "].cloud-owner"));
+ paramsVm.put("cloudRegionId", ctx.getAttribute(responsePrefix +"vm[" + i + "].cloud-region-id"));
+ paramsVm.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX, inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
+
+
+
+ aai.getVMInfo(paramsVm, vmServerCtx);
+
+ HashMap<String, String> vserverMap = new HashMap<String, String>();
+ vserverMap.put("vserver-id", ctx.getAttribute(responsePrefix + "vm[" + i + "].vserver-id"));
+ vserverMap.put("tenant-id", ctx.getAttribute(responsePrefix +"vm[" + i + "].tenant-id"));
+ vserverMap.put("cloud-owner", ctx.getAttribute(responsePrefix +"vm[" + i + "].cloud-owner"));
+ vserverMap.put("cloud-region-id", ctx.getAttribute(responsePrefix +"vm[" + i + "].cloud-region-id"));
+
+ // Parameters returned by getVMInfo
+ vserverMap.put("vserver-name", vmServerCtx.getAttribute(responsePrefix + "vm.vserver-name"));
+ vserverMap.put("vf-module-id", vmServerCtx.getAttribute(responsePrefix + "vm.vf-module-id"));
+
+
+ // as Per 17.07 requirements we are supporting only one VNFC per VM.
+
+ String vnfcName = vmServerCtx.getAttribute(responsePrefix + "vm.vnfc[0].vnfc-name");
+ vserverMap.put("vnfc-name", vnfcName);
+
+
+ String vnfcCount = vmServerCtx.getAttribute(responsePrefix + "vm.vnfc-count");
+ if ( vnfcCount == null )
+ vnfcCount = "0";
+
+ vserverMap.put("vnfc-count", vnfcCount);
+
+ if ( vnfcName != null ) {
+ Map<String, String> paramsVnfc = new HashMap<String, String>();
+ paramsVnfc.put("vnfcName", vnfcName);
+
+ paramsVnfc.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX, inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
+
+ SvcLogicContext vnfcCtx = new SvcLogicContext();
+
+ aai.getVnfcInfo(paramsVnfc, vnfcCtx);
+
+ vserverMap.put("vnfc-type", vnfcCtx.getAttribute(responsePrefix + "vnfc.vnfc-type"));
+ vserverMap.put("vnfc-function-code", vnfcCtx.getAttribute(responsePrefix + "vnfc.vnfc-function-code"));
+ vserverMap.put("group-notation", vnfcCtx.getAttribute(responsePrefix + "vnfc.group-notation"));
+
+
+ }
+ else
+ vmWithNoVnfcsCount++;
+
+
+
+ vservers.add(vserverMap);
+
+ } // vmCount
+
+
+
+
+ Collections.sort(vservers, new Comparator<Map<String, String>>() {
+ @Override
+ public int compare(Map<String, String> o1, Map<String, String> o2) {
+ return o1.get("vserver-name").compareTo(o2.get("vserver-name"));
+ }
+ });
+
+ log.info("SORTED VSERVERS " + vservers.toString());
+
+ populateContext(vservers, ctx, responsePrefix);
+
+ log.info("VMCOUNT IN GETALLVSERVERS " + vmCount);
+ log.info("VMSWITHNOVNFCSCOUNT IN GETALLVSERVERS " + vmWithNoVnfcsCount);
+ ctx.setAttribute(responsePrefix+"vnf.vm-count", String.valueOf(vmCount));
+ ctx.setAttribute(responsePrefix+"vnf.vm-with-no-vnfcs-count", String.valueOf(vmWithNoVnfcsCount));
+
+
+ } catch (Exception e) {
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed in getAllVServersVnfcsInfo " + e.getMessage());
+
+ throw new SvcLogicException(e.getMessage());
+ }
+ }
+
+
+
+
+ public void populateContext(ArrayList<Map<String, String>> vservers, SvcLogicContext ctx, String prefix) {
+
+
+ log.info("Populating Final Context");
+ int ctr = 0;
+
+ for (Map<String, String> entry : vservers) {
+ for (String key : entry.keySet()) {
+ String value = entry.get(key);
+
+ ctx.setAttribute(prefix+ "vm[" + ctr + "]."+ key, value);
+ log.info("Populating Context Key = " + prefix+ "vm[" + ctr + "]."+ key + " Value = " + value);
+
+ }
+
+
+ ctr++;
+ }
+
+ String firstVServerName = null;
+ for ( int i =0; i < ctr; i++ ) {
+ String vnfcName = ctx.getAttribute(prefix + "vm[" + i + "].vnfc-name");
+ log.info("VNFCNAME " + i + vnfcName);
+ if ( vnfcName == null && firstVServerName == null ) {
+ firstVServerName = ctx.getAttribute(prefix + "vm[" + i + "].vserver-name");
+ ctx.setAttribute("vm-name" , firstVServerName);
+ log.info("Populating Context Key = " + "vm-name" + " Value = " + firstVServerName);
+ }
+ }
+ }
+
+
+
+ public void addVnfcs(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+
+ log.info("Received addVnfcs call with params : " + inParams);
+
+ String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ int vnfcRefLen =0 ;
+ int vmCount = 0;
+ int vmWithNoVnfcCount = 0;
+
+ try {
+
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
+ AaiService aai = getAaiService();
+
+
+
+ String vnfcRefLenStr = ctx.getAttribute("vnfcReference_length");
+
+ if ( vnfcRefLenStr == null) {
+ log.info("Vnfc Reference data is missing");
+ throw new Exception("Vnfc Reference data is missing");
+
+ }
+ else
+ vnfcRefLen = Integer.parseInt(vnfcRefLenStr);
+
+ String vmWithNoVnfcCountStr = ctx.getAttribute(responsePrefix+"vnf.vm-with-no-vnfcs-count");
+
+ //Commented for backward compatibility
+
+ /*if ( vmWithNoVnfcCountStr == null) {
+ throw new Exception("VNFCs to be added data from A&AI is missing");
+ //log.info("VNFCs to be added data from A&AI is missing");
+ }
+ else
+ vmWithNoVnfcCount = Integer.parseInt(vmWithNoVnfcCountStr);
+
+ if ( vmWithNoVnfcCount!= vnfcRefLen )
+ throw new Exception("Unable to Add Vnfcs to A&AI. Reference data mismatch.");
+
+ String vmCountStr = ctx.getAttribute(responsePrefix+"vnf.vm-count");
+
+ if ( vmCountStr == null)
+ throw new Exception("VM data from A&AI is missing");
+ else
+ vmCount = Integer.parseInt(vmCountStr);
+
+
+ log.info("VMCOUNT " + vmCount);
+ log.info("VNFCREFLEN " + vnfcRefLen);
+ aai.insertVnfcs(inParams,ctx, vnfcRefLen, vmCount);
+
+ */
+
+
+ // Modified for 1710
+
+ if ( vmWithNoVnfcCountStr == null) {
+ log.info("Parameter VM without VNFCs(vmWithNoVnfcCountStr) from A&AI is Null");
+ }
+ else
+ vmWithNoVnfcCount = Integer.parseInt(vmWithNoVnfcCountStr);
+
+ log.info("No of VM without VNFCs(vmWithNoVnfcCount) from A&AI is " +vmWithNoVnfcCount);
+
+ String vmCountStr = ctx.getAttribute(responsePrefix+"vnf.vm-count");
+
+ if ( vmCountStr == null)
+ throw new Exception("VM data from A&AI is missing");
+ else
+ vmCount = Integer.parseInt(vmCountStr);
+
+ log.info("VMCOUNT " + vmCount);
+ log.info("VNFCREFLEN " + vnfcRefLen);
+
+ if ( vmWithNoVnfcCount!= vnfcRefLen ) {
+ //throw new Exception("Unable to Add Vnfcs to A&AI. Reference data mismatch.");
+ log.info("vmWithNoVnfcCount and vnfcRefLen data from table are not same ");
+ aai.checkAndUpdateVnfc(inParams,ctx, vnfcRefLen, vmCount);
+ }
+
+ else {
+
+ aai.insertVnfcs(inParams,ctx, vnfcRefLen, vmCount);
+ }
+
+ //// Modified 1710
+
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_SUCCESS);
+
+ log.info("addVnfcs Successful ");
+ } catch (Exception e) {
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed in addVnfcs " + e.getMessage());
+
+ throw new SvcLogicException(e.getMessage());
+ }
+ }
+
+
+ public void updateVnfAndVServerStatus(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+
+ log.info("Received updateVnfAndVServerStatus call with params : " + inParams);
+
+ String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+
+ int vmCount = 0;
+
+
+ try {
+
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
+ AaiService aai = getAaiService();
+
+
+
+ String vmCountStr = ctx.getAttribute(responsePrefix+"vnf.vm-count");
+
+ if ( vmCountStr == null)
+ throw new Exception("VM data from A&AI is missing");
+ else
+ vmCount = Integer.parseInt(vmCountStr);
+
+
+ log.info("VMCOUNT " + vmCount);
+
+
+ aai.updateVnfStatus(inParams, ctx);
+ aai.updateVServerStatus(inParams,ctx, vmCount);
+
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_SUCCESS);
+
+ log.info("updateVnfAndVServerStatus Successful ");
+ } catch (Exception e) {
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed in updateVnfAndVServerStatus " + e.getMessage());
+
+ throw new SvcLogicException(e.getMessage());
+ }
+ }
+
+ /*public void getDummyValues(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+
+ log.info("Received getDummyValues call with params : " + inParams);
+
+ String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ try {
+
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
+ String instarKeys = inParams.get("instarKeys");
+ ObjectMapper mapper = new ObjectMapper();
+ if ( instarKeys != null ) {
+
+ List<String> keyList = mapper.readValue(instarKeys, ArrayList.class);
+
+ Map<String, String> instarParams =new HashMap<String, String>();
+ if(keyList != null){
+ //System.out.println(keyList.toString());
+
+
+ for(int i=0;i<keyList.size();i++)
+ {
+ log.info(" -->"+keyList.get(i));
+
+ //ctx.setAttribute(keyList.get(i), "test" + i);
+
+ instarParams.put( keyList.get(i), "test" + i);
+ }
+
+ }
+ log.info("INSTARPARAMMAP " + instarParams);
+ String jsonString = mapper.writeValueAsString(instarParams);
+ log.info(jsonString);
+ ctx.setAttribute(responsePrefix + "configuration-parameters", jsonString);
+
+ }
+
+ log.info("getDummyValues Successful ");
+ } catch (Exception e) {
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed in getDummyValues " + e.getMessage());
+
+ throw new SvcLogicException(e.getMessage());
+ }
+
+ }
+
+ */
+ /*public void getRequestKeys(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+
+ log.info("Received getRequestKeys call with params : " + inParams);
+
+ String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
+
+ try {
+
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
+ String instarKeys = inParams.get("instarKeys");
+
+ ObjectMapper mapper = new ObjectMapper();
+ if ( instarKeys != null ) {
+
+ List<String> keyList = mapper.readValue(instarKeys, ArrayList.class);
+
+ //Map<String, String> instarParams =new HashMap<String, String>();
+ if(keyList != null){
+
+
+ for(int i=0;i<keyList.size();i++)
+ {
+ log.info("INSTARKEY -->"+keyList.get(i));
+
+
+ String instarParameter = ctx.getAttribute("INSTAR." + keyList.get(i));
+ log.info("INSTARPARAMETER " + instarParameter);
+ Parameter param = parseParameterContent(instarParameter);
+
+ log.info("PARAMETER KEY SIZE " + param.getRequestKeys().size());
+ log.info("RULE TYPE " + param.getClassType());
+
+ for ( int j =0 ; j < param.getRequestKeys().size() ; j++ ) {
+
+ log.info(" PARAM KEY NAME " + param.getRequestKeys().get(j).getKeyName());
+ log.info(" PARAM KEY VALUE " + param.getRequestKeys().get(j).getKeyValue());
+ }
+
+ // instarParams.put( keyList.get(i), "test" + i);
+ }
+
+ }
+ //log.info("INSTARPARAMMAP " + instarParams);
+ //String jsonString = mapper.writeValueAsString(instarParams);
+ //log.info(jsonString);
+ //ctx.setAttribute(responsePrefix + "configuration-parameters", jsonString);
+
+ }
+
+ log.info("getRequestKeys Successful ");
+ } catch (Exception e) {
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
+ AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed in getRequestKeys " + e.getMessage());
+
+ throw new SvcLogicException(e.getMessage());
+ }
+
+ }
+
+
+ public Parameter parseParameterContent(String parameter) throws JsonParseException, JsonMappingException, IOException{
+ Parameter parameterDefinition = null;
+ if(StringUtils.isNotBlank(parameter)){
+ ObjectMapper mapper = new ObjectMapper();
+ parameterDefinition = mapper.readValue(parameter, Parameter.class);
+ }
+ return parameterDefinition;
+ }*/
+}
diff --git a/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/MockAaiService.java b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/MockAaiService.java
new file mode 100644
index 000000000..92f57ff94
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/MockAaiService.java
@@ -0,0 +1,46 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client.aai;
+import static org.junit.Assert.assertEquals;
+
+import static org.junit.Assert.fail;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicResource;
+import org.openecomp.sdnc.sli.aai.AAIClient;
+
+public class MockAaiService extends AaiService {
+
+ //ONAP migration
+
+}
diff --git a/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/TestAaiService.java b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/TestAaiService.java
new file mode 100644
index 000000000..4cf6acf1f
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/aai/TestAaiService.java
@@ -0,0 +1,63 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client.aai;
+
+import java.awt.List;
+import java.io.File;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openecomp.appc.aai.client.AppcAaiClientConstant;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.aai.AAIClient;
+import org.openecomp.sdnc.sli.aai.AAIService;
+import org.openecomp.sdnc.sli.SvcLogicResource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
+
+
+public class TestAaiService {
+ // ONAP merging
+}
diff --git a/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/MockAaiService.java b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/MockAaiService.java
new file mode 100644
index 000000000..41fa6da06
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/MockAaiService.java
@@ -0,0 +1,44 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client.node;
+import static junit.framework.Assert.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.appc.aai.client.AppcAaiClientConstant;
+//import org.openecomp.appc.aai.client.aai.AAIClientMock;
+import org.openecomp.appc.aai.client.aai.AaiService;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.aai.AAIClient;
+
+public class MockAaiService extends AaiService {
+
+ // ONAP merging
+}
diff --git a/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/TestAAIResourceNode.java b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/TestAAIResourceNode.java
new file mode 100644
index 000000000..5f88a9af8
--- /dev/null
+++ b/appc-outbound/appc-aai-client/provider/src/test/java/org/openecomp/appc/aai/client/node/TestAAIResourceNode.java
@@ -0,0 +1,57 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.aai.client.node;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.appc.aai.client.AppcAaiClientConstant;
+import org.openecomp.appc.aai.client.aai.AaiService;
+import org.openecomp.appc.aai.client.aai.TestAaiService;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.aai.AAIClient;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+
+public class TestAAIResourceNode {
+
+ //Removed for ONAP integration
+}
diff --git a/appc-outbound/appc-network-inventory-client/.gitignore b/appc-outbound/appc-network-inventory-client/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-network-inventory-client/features/.gitignore b/appc-outbound/appc-network-inventory-client/features/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/features/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-network-inventory-client/features/pom.xml b/appc-outbound/appc-network-inventory-client/features/pom.xml
new file mode 100755
index 000000000..23a2b2975
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/features/pom.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-network-inventory-client</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>appc-network-inventory-client-features</artifactId>
+ <name>APPC Network Inventory - Features</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-network-inventory-client-provider</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>filter</id>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/classes/${features.file}</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/appc-outbound/appc-network-inventory-client/features/src/main/resources/features.xml b/appc-outbound/appc-network-inventory-client/features/src/main/resources/features.xml
new file mode 100644
index 000000000..6eff11add
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/features/src/main/resources/features.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============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=========================================================
+ -->
+
+
+<features name="app-cntrl-instar-client-${project.version}"
+ xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+
+ <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features</repository>
+
+ <feature name='app-cntrl-instar-client' description="Application Controller Instar Client"
+ version='${project.version}'>
+ <!-- Most applications will have a dependency on the ODL MD-SAL Broker -->
+ <feature version="${broker-mdsal.version}">odl-mdsal-broker</feature>
+ <feature version= "${sdnctl.sli.version}">sdnc-sli</feature>
+
+ <bundle>mvn:commons-lang/commons-lang/2.6</bundle>
+ <bundle>mvn:commons-collections/commons-collections/${common.collections.version}</bundle>
+ <bundle>wrap:mvn:com.att.eelf/eelf-core/${eelf.version}</bundle>
+ <bundle>mvn:com.sun.jersey/jersey-client/1.17</bundle>
+ <bundle>mvn:ch.qos.logback/logback-core/${logback.version}</bundle>
+ <bundle>mvn:ch.qos.logback/logback-classic/${logback.version}</bundle>
+ <bundle>mvn:org.openecomp.appc/appc-config-params-provider/${project.version}</bundle>
+ <bundle>mvn:org.openecomp.appc/appc-network-inventory-client-provider/${project.version}</bundle>
+ </feature>
+</features>
diff --git a/appc-outbound/appc-network-inventory-client/installer/.gitignore b/appc-outbound/appc-network-inventory-client/installer/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/installer/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-network-inventory-client/installer/pom.xml b/appc-outbound/appc-network-inventory-client/installer/pom.xml
new file mode 100755
index 000000000..446721393
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/installer/pom.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-network-inventory-client</artifactId>
+ <groupId>org.openecomp.appc</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <name>APPC Network Inventory - Installer</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <application.name>appc-network-inventory-client</application.name>
+ <features.boot>appc-network-inventory-client</features.boot>
+ <features.repositories>mvn:org.openecomp.appc/appc-network-inventory-features/${project.version}/xml/features</features.repositories>
+ <include.transitive.dependencies>false</include.transitive.dependencies>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-network-inventory-client-features</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-network-inventory-client-provider</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>maven-repo-zip</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>false</attach>
+ <finalName>stage/${application.name}-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/assemble_mvnrepo_zip.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>installer-zip</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>true</attach>
+ <finalName>${application.name}-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/assemble_installer_zip.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <transitive>false</transitive>
+ <outputDirectory>${project.build.directory}/assembly/system</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ <useRepositoryLayout>true</useRepositoryLayout>
+ <addParentPoms>false</addParentPoms>
+ <copyPom>false</copyPom>
+ <excludeGroupIds>org.opendaylight</excludeGroupIds>
+ <scope>provided</scope>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-version</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <!-- here the phase you need -->
+ <phase>validate</phase>
+ <configuration>
+ <outputDirectory>${basedir}/target/stage</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources/scripts</directory>
+ <includes>
+ <include>install-feature.sh</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <artifactId>appc-network-inventory-client-installer</artifactId>
+</project>
diff --git a/appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_installer_zip.xml b/appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_installer_zip.xml
new file mode 100644
index 000000000..e54eede04
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_installer_zip.xml
@@ -0,0 +1,62 @@
+<!--
+ ============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=========================================================
+ -->
+
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+ 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">
+ <id>controller</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <!-- we want "system" and related files right at the root level
+ as this file is suppose to be unzip on top of a karaf
+ distro. -->
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>target/stage/</directory>
+ <outputDirectory>${application.name}</outputDirectory>
+ <fileMode>755</fileMode>
+ <includes>
+ <include>*.sh</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target/stage/</directory>
+ <outputDirectory>${application.name}</outputDirectory>
+ <fileMode>644</fileMode>
+ <excludes>
+ <exclude>*.sh</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+
+
+
+</assembly>
diff --git a/appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_mvnrepo_zip.xml b/appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_mvnrepo_zip.xml
new file mode 100644
index 000000000..fc99e918e
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/installer/src/assembly/assemble_mvnrepo_zip.xml
@@ -0,0 +1,50 @@
+<!--
+ ============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=========================================================
+ -->
+
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+ 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">
+ <id>controller</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <!-- we want "system" and related files right at the root level
+ as this file is suppose to be unzip on top of a karaf
+ distro. -->
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>target/assembly/</directory>
+ <outputDirectory>.</outputDirectory>
+ <excludes>
+ </excludes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
diff --git a/appc-outbound/appc-network-inventory-client/installer/src/main/resources/scripts/install-feature.sh b/appc-outbound/appc-network-inventory-client/installer/src/main/resources/scripts/install-feature.sh
new file mode 100644
index 000000000..05b4ae373
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/installer/src/main/resources/scripts/install-feature.sh
@@ -0,0 +1,43 @@
+###
+# ============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=========================================================
+###
+
+#!/bin/bash
+
+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 -n -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/appc-outbound/appc-network-inventory-client/pom.xml b/appc-outbound/appc-network-inventory-client/pom.xml
new file mode 100755
index 000000000..2167d9ccc
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-outbound</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>pom</packaging>
+ <artifactId>appc-network-inventory-client</artifactId>
+ <name>APPC Network Inventory Client</name>
+
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <logback.version>1.1.1</logback.version>
+ <common.collections.version>3.2.1</common.collections.version>
+ <common.io.version>2.5</common.io.version>
+ <jettison.version>1.3.7</jettison.version>
+ <velocity.version>1.7</velocity.version>
+ <jackson.version>2.3.2</jackson.version>
+ <snakeyaml.version>1.12</snakeyaml.version>
+ </properties>
+
+
+ <dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-network-inventory-client-features</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-network-inventory-client-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <modules>
+ <module>provider</module>
+ <module>features</module>
+ <module>installer</module>
+ </modules>
+</project>
diff --git a/appc-outbound/appc-network-inventory-client/provider/.gitignore b/appc-outbound/appc-network-inventory-client/provider/.gitignore
new file mode 100755
index 000000000..b83d22266
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-outbound/appc-network-inventory-client/provider/pom.xml b/appc-outbound/appc-network-inventory-client/provider/pom.xml
new file mode 100755
index 000000000..7c91ffc74
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/pom.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-network-inventory-client</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>appc-network-inventory-client-provider</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+ <name>APPC Network Client - Provider</name>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-config-params-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>sli-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>dblib-provider</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>org.openecomp.appc.instar</Bundle-SymbolicName>
+ <Bundle-Activator>org.openecomp.appc.instar.InstarClientActivator</Bundle-Activator>
+ <Export-Package>org.openecomp.appc.instar</Export-Package>
+ <Import-Package>*</Import-Package>
+ <DynamicImport-Package>*</DynamicImport-Package>
+ </instructions>
+ <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/InstarClientActivator.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/InstarClientActivator.java
new file mode 100644
index 000000000..1f8f037b0
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/InstarClientActivator.java
@@ -0,0 +1,64 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.openecomp.appc.instar.node.InstarClientNode;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public class InstarClientActivator implements BundleActivator{
+
+ private List<ServiceRegistration> registrations = new LinkedList<ServiceRegistration>();
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(InstarClientActivator.class);
+
+ @Override
+ public void start(BundleContext ctx) throws Exception
+ {
+
+ InstarClientNode instarClientNode = new InstarClientNode();
+ log.info("Registering service "+ instarClientNode.getClass().getName());
+ registrations.add(ctx.registerService(instarClientNode.getClass().getName(), instarClientNode, null));
+ log.info("Registering service sccessful for "+ instarClientNode.getClass().getName());
+
+ }
+ @Override
+ public void stop(BundleContext arg0) throws Exception
+ {
+ for (ServiceRegistration registration: registrations)
+ {
+ registration.unregister();
+ registration = null;
+ }
+
+ }
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/Dme2Client.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/Dme2Client.java
new file mode 100644
index 000000000..a0a57db54
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/Dme2Client.java
@@ -0,0 +1,184 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.dme2client;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.net.URI;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Properties;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.commons.io.IOUtils;
+import org.openecomp.appc.instar.utils.InstarClientConstant;
+
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.DefaultClientConfig;
+import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
+
+
+public class Dme2Client {
+
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(Dme2Client.class);
+ private static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR";
+ //DME2Client client = null;
+ Properties props = new Properties();
+ String operationName ;
+ String appendContext;
+
+ public Dme2Client(String optName, String subCtxt, HashMap<String, String> data) throws Exception{
+ log.info("Setting Properties for DME2 Client for INSTAR connection");
+ this.operationName=optName;
+ this.appendContext = data.get(subCtxt);
+ String propDir = System.getenv(SDNC_CONFIG_DIR_VAR);
+ if (propDir == null)
+ throw new Exception(" Cannot find Property file -" + SDNC_CONFIG_DIR_VAR);
+ String propFile = propDir + InstarClientConstant.OUTBOUND_PROPERTIES;
+ InputStream propStream = new FileInputStream(propFile);
+ try
+ {
+ props.load(propStream);
+ }
+ catch (Exception e)
+ {
+ throw new Exception("Could not load properties file " + propFile, e);
+ }
+ finally
+ {
+ try
+ {
+ propStream.close();
+ }
+ catch (Exception e)
+ {
+ log.warn("Could not close FileInputStream", e);
+ }
+ }
+ }
+
+ public ClientResponse sendtoInstar() throws Exception {
+
+ log.info("Called Send with operation Name=" + this.operationName + "and = " + props.getProperty(operationName+InstarClientConstant.BASE_URL));
+ String resourceUri = props.getProperty(operationName+InstarClientConstant.BASE_URL)+
+ props.getProperty(operationName + InstarClientConstant.URL_SUFFIX) +
+ props.getProperty(operationName + InstarClientConstant.SUB_CONTEXT)+ appendContext ;
+
+ log.info("DME Endpoint URI:" + resourceUri);
+ Client client = null;
+ WebResource webResource = null;
+ ClientResponse clientResponse = null;
+ String authorization = props.getProperty("authorization");
+ String requestDataType = "application/json";
+ String responseDataType= MediaType.APPLICATION_JSON;
+ String methodType = props.getProperty("getIpAddressByVnf_method");
+ String request = "";
+ String userId=props.getProperty("MechID");
+ String password=props.getProperty("MechPass");
+
+ log.info("authorization = " + authorization + "methodType= " + methodType);
+ try{
+ DefaultClientConfig defaultClientConfig = new DefaultClientConfig();
+ System.setProperty("jsse.enableSNIExtension", "false");
+ SSLContext sslContext = null;
+ SecureRestClientTrustManager secureRestClientTrustManager = new SecureRestClientTrustManager();
+ sslContext = SSLContext.getInstance("SSL");
+ sslContext.init(null, new javax.net.ssl.TrustManager[] { secureRestClientTrustManager }, null);
+ defaultClientConfig.getProperties().put(
+ com.sun.jersey.client.urlconnection.HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
+ new com.sun.jersey.client.urlconnection.HTTPSProperties(getHostnameVerifier(), sslContext));
+ client = Client.create(defaultClientConfig);
+ client.addFilter(new HTTPBasicAuthFilter(userId, password));
+
+ webResource = client.resource(new URI(resourceUri));
+ webResource.setProperty("Content-Type", "application/json;charset=UTF-8");
+
+ if(HttpMethod.GET.equalsIgnoreCase(methodType)){
+ clientResponse = webResource.accept(responseDataType).get(ClientResponse.class);
+ }else if(HttpMethod.POST.equalsIgnoreCase(methodType)){
+ clientResponse = webResource.type(requestDataType).post(ClientResponse.class, request);
+ }else if(HttpMethod.PUT.equalsIgnoreCase(methodType)){
+ clientResponse = webResource.type(requestDataType).put(ClientResponse.class,request);
+ }else if(HttpMethod.DELETE.equalsIgnoreCase(methodType)){
+ clientResponse = webResource.delete(ClientResponse.class);
+ }
+
+ return clientResponse;
+
+ }catch (Exception e) {
+ log.info("failed in RESTCONT Action ("+methodType+") for the resource " + resourceUri + ", falut message :"+e.getMessage());
+ throw new Exception("Error While gettting Data from INSTAR" + e.getMessage());
+ }
+ finally {
+ // clean up.
+ webResource = null;
+ if(client != null){
+ client.destroy();
+ client = null;
+ }
+ }
+
+
+ }
+
+ public String send() {
+ String response = null;
+ try{
+
+ if(props !=null &&
+ props.getProperty(InstarClientConstant.MOCK_INSTAR) != null &&
+ props.getProperty(InstarClientConstant.MOCK_INSTAR).equalsIgnoreCase("true"))
+ return IOUtils.toString(Dme2Client.class.getClassLoader().getResourceAsStream("/tmp/sampleResponse"), Charset.defaultCharset());
+
+ ClientResponse clientResponse = sendtoInstar();
+ if(clientResponse != null){
+ response = clientResponse.getEntity(String.class);
+ log.info(clientResponse.getStatus() + " Status, Response :" + response);
+
+ }
+ } catch (Exception t) {
+ t.printStackTrace();
+ }
+ return response;
+ }
+
+ private HostnameVerifier getHostnameVerifier() {
+ return new HostnameVerifier() {
+ @Override
+ public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
+ return true;
+ }
+ };
+ }
+
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/SecureRestClientTrustManager.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/SecureRestClientTrustManager.java
new file mode 100644
index 000000000..21e313eaf
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/dme2client/SecureRestClientTrustManager.java
@@ -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=========================================================
+ */
+
+package org.openecomp.appc.instar.dme2client;
+
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.X509TrustManager;
+
+
+public class SecureRestClientTrustManager implements X509TrustManager {
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] arg0, String arg1)
+ throws CertificateException {
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] arg0, String arg1)
+ throws CertificateException {
+ }
+
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+
+ public boolean isClientTrusted(X509Certificate[] arg0) {
+ return true;
+ }
+
+ public boolean isServerTrusted(X509Certificate[] arg0) {
+ return true;
+ }
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarResponseHandlerImpl.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarResponseHandlerImpl.java
new file mode 100644
index 000000000..3292253da
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarResponseHandlerImpl.java
@@ -0,0 +1,86 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.interfaceImpl;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.openecomp.appc.instar.interfaces.ResponseHandlerInterface;
+import org.openecomp.appc.instar.utils.InstarClientConstant;
+import org.openecomp.sdnc.config.params.data.ResponseKey;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public class InstarResponseHandlerImpl implements ResponseHandlerInterface {
+
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(InstarResponseHandlerImpl.class);
+
+ ResponseKey resKey = null;
+ SvcLogicContext ctxt = null;
+
+ public InstarResponseHandlerImpl(ResponseKey filterKeys, SvcLogicContext context) {
+ this.resKey = filterKeys;
+ this.ctxt = context;
+
+ }
+
+ @Override
+ public Object processResponse(String instarResponse, String instarKey) {
+ String fn = " InstarResponseHandlerImpl.processResponse ";
+ log.info(fn + " Instar Response :" + instarResponse);
+
+ JSONObject instarKeyValues;
+
+ log.info("Instar Data in Context : "+ ctxt.getAttribute(InstarClientConstant.INSTAR_KEY_VALUES));
+ if(ctxt.getAttribute(InstarClientConstant.INSTAR_KEY_VALUES) != null){
+ instarKeyValues = new JSONObject(ctxt.getAttribute(InstarClientConstant.INSTAR_KEY_VALUES));
+ log.info("Instar data already exsits : " + instarKeyValues.toString());
+ }
+ else
+ instarKeyValues = new JSONObject();
+ JSONArray instarResponses = new JSONObject(instarResponse).getJSONArray(InstarClientConstant.INSTAR_RESPONSE_BLOCK_NAME);
+ for (int i = 0; i < instarResponses.length(); i++){
+ JSONObject res = instarResponses.getJSONObject(i);
+ log.info(fn + "Instar Block :" + i + " Values :" + res.toString());
+ log.info(fn + "Appc Filter Key :" + ctxt.getAttribute(InstarClientConstant.VNF_NAME) + resKey.getUniqueKeyValue());
+
+ if(res.getString(InstarClientConstant.FDQN) != null &&
+ res.getString(InstarClientConstant.FDQN).equalsIgnoreCase(ctxt.getAttribute(InstarClientConstant.VNF_NAME) + resKey.getUniqueKeyValue())){
+ if(resKey.getFieldKeyName().equals(InstarClientConstant.V4_ADDRESS))
+ instarKeyValues.put(instarKey, res.getString(InstarClientConstant.INSTAR_V4_ADDRESS));
+ else if(resKey.getFieldKeyName().equals(InstarClientConstant.V6_ADDRESS))
+ instarKeyValues.put(instarKey, res.getString(InstarClientConstant.INSTAR_V6_ADDRESS));
+ break;
+ }
+ }
+ log.info(fn + "Instar KeyValues :" + instarKeyValues);
+ ctxt.setAttribute(InstarClientConstant.INSTAR_KEY_VALUES, instarKeyValues.toString());
+
+
+ return instarKeyValues;
+ }
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarRestClientImpl.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarRestClientImpl.java
new file mode 100644
index 000000000..e727ce10d
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InstarRestClientImpl.java
@@ -0,0 +1,71 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.interfaceImpl;
+
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+
+import org.apache.commons.io.IOUtils;
+import org.openecomp.appc.instar.dme2client.Dme2Client;
+import org.openecomp.appc.instar.interfaces.RestClientInterface;
+import org.openecomp.appc.instar.utils.InstarClientConstant;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public class InstarRestClientImpl implements RestClientInterface {
+
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(InstarRestClientImpl.class);
+ HashMap<String, String> requestData = null;
+ Dme2Client dme2Client;
+
+ public InstarRestClientImpl(HashMap<String, String> instarRequestData) {
+
+ this.requestData = instarRequestData;
+ }
+
+ @Override
+ public String sendRequest(String operation) throws Exception {
+
+ String instarResponse = null;
+ try {
+ if(operation !=null && operation.equalsIgnoreCase(InstarClientConstant.OPERATION_GET_IPADDRESS_BY_VNF_NAME)){
+ dme2Client = new Dme2Client(operation, InstarClientConstant.VNF_NAME, requestData);
+ }
+ instarResponse = dme2Client.send();
+ log.info("Resposne in InstarRestClientImpl = " + instarResponse);
+ if(instarResponse == null || instarResponse.length() < 0)
+ throw new Exception ("No Data received from Instar for this call " + operation);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ return instarResponse;
+ }
+
+
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java
new file mode 100644
index 000000000..2d94331aa
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java
@@ -0,0 +1,91 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.interfaceImpl;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.openecomp.appc.instar.interfaces.ResponseHandlerInterface;
+import org.openecomp.appc.instar.interfaces.RestClientInterface;
+import org.openecomp.appc.instar.interfaces.RuleHandlerInterface;
+import org.openecomp.appc.instar.node.InstarClientNode;
+import org.openecomp.appc.instar.utils.InstarClientConstant;
+import org.openecomp.sdnc.config.params.data.Parameter;
+import org.openecomp.sdnc.config.params.data.ResponseKey;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public class InterfaceIpAddressImpl implements RuleHandlerInterface {
+
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(InterfaceIpAddressImpl.class);
+ private Parameter parameters;
+ private SvcLogicContext context;
+
+ public InterfaceIpAddressImpl(Parameter params, SvcLogicContext ctx) {
+ this.parameters = params;
+ this.context = ctx;
+ }
+
+ @Override
+ public void processRule() throws Exception {
+
+ String fn = "InterfaceIpAddressHandler.processRule";
+ log.info(fn + "Processing rule :" + parameters.getRuleType());
+ String operationName ;
+
+ RestClientInterface restClient = null;
+ ResponseHandlerInterface responseHandler = null;
+
+ List<ResponseKey> responseKeyList = parameters.getResponseKeys();
+ if(responseKeyList != null && responseKeyList.size() > 0){
+ for(ResponseKey filterKeys : responseKeyList){
+ //response.setUniqueKeyValue(response.getUniqueKeyValue()+ context.getAttribute(InstarClientConstant.VNF_NAME));
+ switch(parameters.getSource()){
+ case InstarClientConstant.SOURCE_SYSTEM_INSTAR:
+ restClient = new InstarRestClientImpl(createInstarRequestData(context));
+ responseHandler = new InstarResponseHandlerImpl(filterKeys, context );
+ operationName = "getIpAddressByVnf";
+ break;
+ default:
+ throw new Exception("No Client registered for : " + parameters.getSource());
+
+ }
+ responseHandler.processResponse(restClient.sendRequest(operationName),parameters.getName() );
+ }
+ }
+ else
+ {
+ throw new Exception("NO response Keys set for : " + parameters.getRuleType());
+ }
+ }
+
+ private HashMap<String, String> createInstarRequestData(SvcLogicContext ctxt) {
+ HashMap<String, String> requestParams = new HashMap<String, String>();
+ requestParams.put(InstarClientConstant.VNF_NAME, ctxt.getAttribute(InstarClientConstant.VNF_NAME));
+ return requestParams;
+ }
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/ResponseHandlerInterface.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/ResponseHandlerInterface.java
new file mode 100644
index 000000000..816bbdb5d
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/ResponseHandlerInterface.java
@@ -0,0 +1,31 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.interfaces;
+
+public interface ResponseHandlerInterface {
+
+ public Object processResponse(String response, String instarKey);
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RestClientInterface.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RestClientInterface.java
new file mode 100644
index 000000000..448429163
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RestClientInterface.java
@@ -0,0 +1,32 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.interfaces;
+
+public interface RestClientInterface {
+
+
+ public String sendRequest(String operation) throws Exception;
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RuleHandlerInterface.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RuleHandlerInterface.java
new file mode 100644
index 000000000..ad13c96e0
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/interfaces/RuleHandlerInterface.java
@@ -0,0 +1,32 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.interfaces;
+
+
+public interface RuleHandlerInterface {
+
+ public void processRule() throws Exception;
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/node/InstarClientNode.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/node/InstarClientNode.java
new file mode 100644
index 000000000..17ce64422
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/node/InstarClientNode.java
@@ -0,0 +1,135 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.node;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.appc.instar.interfaceImpl.InstarRestClientImpl;
+import org.openecomp.appc.instar.interfaceImpl.InterfaceIpAddressImpl;
+import org.openecomp.appc.instar.interfaces.RestClientInterface;
+import org.openecomp.appc.instar.interfaces.RuleHandlerInterface;
+import org.openecomp.appc.instar.utils.InstarClientConstant;
+import org.openecomp.sdnc.config.params.data.Parameter;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicException;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+public class InstarClientNode implements SvcLogicJavaPlugin
+{
+ private static final EELFLogger log = EELFManager.getInstance().getLogger(InstarClientNode.class);
+
+ public void getInstarInfo(Map<String, String> inParams, SvcLogicContext ctx)
+ throws SvcLogicException{
+ log.info("Received getInstarInfo call with params : " + inParams);
+ String responsePrefix = (String)inParams.get(InstarClientConstant.INPUT_PARAM_RESPONSE_PRIFIX);
+ try
+ {
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? responsePrefix + "." : "";
+ String [] instarKeys = getInstarKeys(inParams.get(InstarClientConstant.INSTAR_KEYS));
+ for (String instarKey : instarKeys){
+ log.info("Processing Key : " + instarKey);
+ log.info("Searching key for : " + "INSTAR." + instarKey);
+ ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
+ RuleHandlerInterface handler = null;
+ log.info("Received Context : " + ctx.getAttribute("INSTAR." + instarKey));
+ Parameter params = mapper.readValue(ctx.getAttribute(InstarClientConstant.SOURCE_SYSTEM_INSTAR + "." + instarKey), Parameter.class);
+
+ log.info("Processing rule Type : " + params.getRuleType());
+ switch(params.getRuleType()){
+ case InstarClientConstant.INTERFACE_IP_ADDRESS:
+ handler = new InterfaceIpAddressImpl(params, ctx);
+ break;
+ default:
+ throw new Exception("No Rule Defined to process :" + params.getRuleType());
+ }
+ handler.processRule();
+
+ }
+ log.info("responsePrefix =" + responsePrefix);
+ ctx.setAttribute(responsePrefix + InstarClientConstant.INSTAR_KEY_VALUES, ctx.getAttribute(InstarClientConstant.INSTAR_KEY_VALUES));
+ ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_STATUS, InstarClientConstant.OUTPUT_STATUS_SUCCESS);
+ ctx.setAttribute(InstarClientConstant.INSTAR_KEY_VALUES, null);
+ }
+ catch (Exception e)
+ {
+ ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_STATUS, InstarClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed processing Instar request" + e.getMessage());
+ e.printStackTrace();
+ throw new SvcLogicException(e.getMessage());
+ }
+ }
+ private static String[] getInstarKeys(String keyString) {
+ String fn = "InstarClientNode.getInstarKeys";
+ System.out.println("Received instar Key String as :" + keyString);
+
+ keyString = keyString.replace("[","");
+ keyString = keyString.replace("]", "");
+ keyString = keyString.replace("\"", "");
+ if(keyString.contains(","))
+ {
+ String[] keys = keyString.split(",");
+ return keys;
+ }
+ else{
+ String[] keys = {keyString};
+ return keys;
+ }
+ }
+ public void getInstarData(Map<String, String> inParams, SvcLogicContext ctx)
+ throws SvcLogicException{
+ log.info("Received getInstarData call with params : " + inParams);
+ String responsePrefix = (String)inParams.get(InstarClientConstant.INPUT_PARAM_RESPONSE_PRIFIX);
+ try
+ {
+ HashMap<String, String> input = new HashMap<String, String>();
+ input.putAll(inParams);
+ RestClientInterface rcINterface = new InstarRestClientImpl(input);
+ String response = rcINterface.sendRequest(inParams.get("operationName"));
+
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? responsePrefix + "." : "";
+ ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_STATUS, InstarClientConstant.OUTPUT_STATUS_SUCCESS);
+ ctx.setAttribute(responsePrefix + InstarClientConstant.INSTAR_KEY_VALUES, response);
+
+ }
+ catch (Exception e)
+ {
+ ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_STATUS, InstarClientConstant.OUTPUT_STATUS_FAILURE);
+ ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+ log.error("Failed processing Instar request" + e.getMessage());
+ e.printStackTrace();
+ throw new SvcLogicException(e.getMessage());
+ }
+ }
+
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/utils/InstarClientConstant.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/utils/InstarClientConstant.java
new file mode 100644
index 000000000..790651f12
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/openecomp/appc/instar/utils/InstarClientConstant.java
@@ -0,0 +1,82 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.utils;
+
+public class InstarClientConstant
+{
+ public static String INPUT_PARAM_RESPONSE_PRIFIX = "responsePrefix";
+ public static String OUTPUT_PARAM_STATUS = "status";
+ public static String OUTPUT_PARAM_ERROR_MESSAGE = "error-message";
+ public static String OUTPUT_STATUS_SUCCESS = "success";
+ public static String OUTPUT_STATUS_FAILURE = "failure";
+
+
+
+ public static final String INSTAR_KEYS = "instarKeys";
+
+ public static final String INTERFACE_IP_ADDRESS = "interface-ip-address";
+ public static final String SOURCE_SYSTEM_INSTAR = "INSTAR";
+ public static final String VNF_TYPE = "vnf-type";
+ public static final String ADDRESSFDQN = "addressfqdn";
+ public static final String VNF_NAME = "vnf-name";
+ public static final String INSTAR_KEY_VALUES = "INSTAR-KEY-VALUES";
+ public static final String INSTAR_RESPONSE_BLOCK_NAME = "vnfConfigurationParameterDetails";
+ public static final String FDQN = "fqdn";
+
+
+ public static final String MOCK_INSTAR="mock_instar";
+ public static final String AFT_LATITUDE="aft_latitude";
+ public static final String AFT_LONGITUDE="aft_latitude";
+ public static final String AFT_ENVIRONMENT="aft_environment";
+ public static final String SCLD_PLATFORM="scld_platform";
+ public static final String AUTHORIZATION="authorization";
+ public static final String DME2_CLIENT_TIMEOUTMS="dme2_client_timeoutms";
+ public static final String DME2_CLIENT_SENDANDWAIT="dme2_client_sendandwait";
+ public static final String BASE_URL="_base_url";
+ public static final String HTTP_HEADERS="_http_headers";
+
+ public static final String V6_ADDRESS="ipaddress-v6";
+ public static final String INSTAR_V6_ADDRESS="v6IPAddress";
+
+
+ public static final String V4_ADDRESS="ipaddress-v4";
+ public static final String INSTAR_V4_ADDRESS="v4IPAddress";
+
+ public static final String SUB_CONTEXT="_sub_context";
+ public static final String URL_SUFFIX="_suffix";
+ public static final String VERSION="_version";
+ public static final String ENV_CONTEXT="_env_context";
+ public static final String ROUTEOFFER="_routeoffer";
+ public static final String APPC_PROPERTIES = "appc.properties";
+ public static final String METHOD="_method";
+ public static final String OPERATION_GET_IPADDRESS_BY_VNF_NAME = "getIpAddressByVnf";
+
+ public static final String OUTBOUND_PROPERTIES= "/outbound.properties";
+
+ public static String CONTENT_TYPE = "application/json";
+ public static String RETURNED_RESPONSE_TYPE = "application/json";
+
+}
+
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/resources/adaptor.properties b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/adaptor.properties
new file mode 100644
index 000000000..205a8f884
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/adaptor.properties
@@ -0,0 +1,29 @@
+###
+# ============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=========================================================
+###
+
+adaptorName=
+vSphere.url=
+vSphere.user=
+vSphere.passwd=
+org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/resources/outbound.properties b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/outbound.properties
new file mode 100644
index 000000000..ede337681
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/outbound.properties
@@ -0,0 +1,39 @@
+###
+# ============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=========================================================
+###
+
+MechID=
+MechPass=
+SCLD_PLATFORM=NON-PROD
+dme2_client_timeoutms=100000
+dme2_client_sendandwait=1000000
+DME2.DEBUG=true
+
+#appc-instar service base context
+getIpAddressByVnf_base_url=
+getIpAddressByVnf_sub_context=vnfs/
+getIpAddressByVnf_suffix=vnfconfigparameters/
+getIpAddressByVnf_method=GET
+getIpAddressByVnf_http_headers=X-CSI-MessageId=123
+
+
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleInstarResponse b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleInstarResponse
new file mode 100755
index 000000000..7433aea62
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleInstarResponse
@@ -0,0 +1,24 @@
+{
+"vnfConfigurationParameterDetails": [
+ {
+ "addressfqdn": "XXXXXX",
+ "ipaddress-purpose": "vNIC1/Data NIC",
+ "ipaddress-v4": "00.00.00.00",
+ "v4-subnet": "00.00.00.00/25",
+ "v4-default-gateway": "00.00.00.00",
+ "ipaddress-v6": "2001:1890:FC:28::1:2",
+ "v6-subnet": "2001:1890:FC:28::/64",
+ "v6-default-gateway": "2001:1890:FC:28::3"
+ },
+ {
+ "addressfqdn": "XXXXXX",
+ "ipaddress-purpose": "vNIC1/Data NIC",
+ "ipaddress-v4": "00.00.00.00",
+ "v4-subnet": "00.00.00.00/25",
+ "v4-default-gateway": "00.00.00.00",
+ "ipaddress-v6": "2001:1890:FC:28::1:4",
+ "v6-subnet": "2001:1890:FC:28::/64",
+ "v6-default-gateway": "2001:1890:FC:28::3"
+ }
+ ]
+}
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleKeyContents b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleKeyContents
new file mode 100755
index 000000000..90e3ec789
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/main/resources/templates/sampleKeyContents
@@ -0,0 +1 @@
+{"name":"LOCAL_ACCESS_IP_ADDR","description":"this is the node0 tacplus server IP address","type":"ipv4_address","required":true,"source":"INSTAR","rule-type":"interface-ip-address","default":null,"request-keys":null,"response-keys":[{"unique-key-name":"addressfqdn","unique-key-value":"00000000000000","field-key-name":"ipaddress-v4"}]} \ No newline at end of file
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java b/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java
new file mode 100644
index 000000000..ca88d54db
--- /dev/null
+++ b/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java
@@ -0,0 +1,53 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.appc.instar.node;
+
+import java.net.URI;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.HttpMethod;
+
+import org.apache.commons.io.IOUtils;
+import org.json.JSONObject;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.appc.instar.dme2client.SecureRestClientTrustManager;
+import org.openecomp.appc.instar.utils.InstarClientConstant;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.DefaultClientConfig;
+import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
+
+
+public class TestInstarClientNode {
+
+ //ONAP Migration
+}
diff --git a/appc-outbound/pom.xml b/appc-outbound/pom.xml
new file mode 100755
index 000000000..a7d073646
--- /dev/null
+++ b/appc-outbound/pom.xml
@@ -0,0 +1,78 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>appc-outbound</artifactId>
+ <packaging>pom</packaging>
+ <name>Application Controller Outbound</name>
+ <description>Application Controller Outbound</description>
+
+ <properties>
+ <sdnc.aai.version>1.1.2</sdnc.aai.version>
+ </properties>
+
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdnc.adaptors</groupId>
+ <artifactId>sql-resource-provider</artifactId>
+ <version>${openecomp.sdnc.sql-resource.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdnc.adaptors</groupId>
+ <artifactId>aai-service-provider</artifactId>
+ <version>${sdnc.aai.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <modules>
+ <module>appc-aai-client</module>
+ <module>appc-network-inventory-client</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+ maven-checkstyle-plugin
+ </artifactId>
+ <versionRange>
+ [2.17,)
+ </versionRange>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
diff --git a/pom.xml b/pom.xml
index 6f5dbc4e8..7c1257378 100644
--- a/pom.xml
+++ b/pom.xml
@@ -644,6 +644,7 @@
<module>appc-lifecycle-management</module>
<module>appc-oam</module>
<module>appc-config</module>
+ <module>appc-outbound</module>
</modules>
</profile>
<profile>