aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2018-02-27 16:32:25 -0500
committerMarco Platania <platania@research.att.com>2018-02-27 16:32:25 -0500
commit0766a3ace2df01e523d65e726fc3f7c0c00b4dc8 (patch)
treea78a9305e01b4dd0390867fc5b7fadaa42e1faaa
parent33621cb3587792e4d29bcebf5ff02d42ed50c8e2 (diff)
Add NETCONF/RESTconf APIs to vLB
Create a new directory for the vLB Manual Scale out use case (vLBMS). Add NETCONF/RESTconf APIs for configuring the vLB via ONAP. Change-Id: I06c557143d3a6d12159fc3195991cd8d49432348 Issue-ID: INT-432 Signed-off-by: Marco Platania <platania@research.att.com>
-rw-r--r--.gitignore1
-rwxr-xr-xpom.xml1
-rw-r--r--scripts/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/VES/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/VES/code/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/VES/code/evel_training/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/VES/output/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vFW/.DS_Storebin8196 -> 0 bytes
-rw-r--r--vnfs/vFW/pg_streams/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vFW/scripts/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSClient/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSClient/src/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSClient/src/main/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSClient/src/main/java/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSManager/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSManager/src/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSManager/src/main/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/DNSManager/src/main/java/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLB/dns_streams/.DS_Storebin6148 -> 0 bytes
-rw-r--r--vnfs/vLBMS/apis/asciidoc/Readme.adoc3
-rwxr-xr-xvnfs/vLBMS/apis/pom.xml56
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/asciidoc/Readme.adoc3
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/pom.xml75
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/src/main/yang/vlb-business-vnf-onap-plugin.yang66
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/asciidoc/Readme.adoc3
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/pom.xml96
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/CrudService.java64
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ElementCrudService.java114
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/Module.java66
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ModuleConfiguration.java46
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/DnsInstanceManager.java142
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ElementCustomizer.java73
-rw-r--r--vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ModuleWriterFactory.java54
-rw-r--r--vnfs/vLBMS/apis/vlb-vnf-onap-distribution/asciidoc/Readme.adoc3
-rw-r--r--vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml103
47 files changed, 969 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 93fc263e..bd5fd821 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/.project
/.pydevproject
.*.sw?
+.DS_Store \ No newline at end of file
diff --git a/pom.xml b/pom.xml
index dc3d7d2a..1ce01a40 100755
--- a/pom.xml
+++ b/pom.xml
@@ -52,6 +52,7 @@
<module>vnfs/VESreporting_vLB5.0</module>
<module>vnfs/VESreporting_vFW5.0</module>
<module>vnfs/vCPE/kea-sdnc-notify-mod</module>
+ <module>vnfs/vLBMS/apis</module>
</modules>
<properties>
diff --git a/scripts/.DS_Store b/scripts/.DS_Store
deleted file mode 100644
index 5008ddfc..00000000
--- a/scripts/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/VES/.DS_Store b/vnfs/VES/.DS_Store
deleted file mode 100644
index 4b31f725..00000000
--- a/vnfs/VES/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/VES/code/.DS_Store b/vnfs/VES/code/.DS_Store
deleted file mode 100644
index a9cc98d2..00000000
--- a/vnfs/VES/code/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/VES/code/evel_training/.DS_Store b/vnfs/VES/code/evel_training/.DS_Store
deleted file mode 100644
index 5008ddfc..00000000
--- a/vnfs/VES/code/evel_training/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/VES/output/.DS_Store b/vnfs/VES/output/.DS_Store
deleted file mode 100644
index e34c8329..00000000
--- a/vnfs/VES/output/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/.DS_Store b/vnfs/honeycomb_plugin/.DS_Store
deleted file mode 100644
index 102e7ce1..00000000
--- a/vnfs/honeycomb_plugin/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Store
deleted file mode 100644
index 935eda93..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Store
deleted file mode 100644
index 6816049e..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/.DS_Store
deleted file mode 100644
index 7db2c2e3..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/.DS_Store
deleted file mode 100644
index 06450486..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/.DS_Store
deleted file mode 100644
index 47336c35..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/.DS_Store
deleted file mode 100644
index 0bb0440d..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/.DS_Store
deleted file mode 100644
index 70a47622..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Store
deleted file mode 100644
index 935eda93..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/.DS_Store
deleted file mode 100644
index 6816049e..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/.DS_Store
deleted file mode 100644
index 45c9ff18..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Store
deleted file mode 100644
index 935eda93..00000000
--- a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vFW/.DS_Store b/vnfs/vFW/.DS_Store
deleted file mode 100644
index d5659b63..00000000
--- a/vnfs/vFW/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vFW/pg_streams/.DS_Store b/vnfs/vFW/pg_streams/.DS_Store
deleted file mode 100644
index 5008ddfc..00000000
--- a/vnfs/vFW/pg_streams/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vFW/scripts/.DS_Store b/vnfs/vFW/scripts/.DS_Store
deleted file mode 100644
index e97f86f1..00000000
--- a/vnfs/vFW/scripts/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSClient/.DS_Store b/vnfs/vLB/DNSClient/.DS_Store
deleted file mode 100644
index 210fb02d..00000000
--- a/vnfs/vLB/DNSClient/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSClient/src/.DS_Store b/vnfs/vLB/DNSClient/src/.DS_Store
deleted file mode 100644
index dba6f684..00000000
--- a/vnfs/vLB/DNSClient/src/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSClient/src/main/.DS_Store b/vnfs/vLB/DNSClient/src/main/.DS_Store
deleted file mode 100644
index 9206bc71..00000000
--- a/vnfs/vLB/DNSClient/src/main/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSClient/src/main/java/.DS_Store b/vnfs/vLB/DNSClient/src/main/java/.DS_Store
deleted file mode 100644
index 05c35472..00000000
--- a/vnfs/vLB/DNSClient/src/main/java/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSManager/.DS_Store b/vnfs/vLB/DNSManager/.DS_Store
deleted file mode 100644
index cc896b07..00000000
--- a/vnfs/vLB/DNSManager/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSManager/src/.DS_Store b/vnfs/vLB/DNSManager/src/.DS_Store
deleted file mode 100644
index 201b6cf3..00000000
--- a/vnfs/vLB/DNSManager/src/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSManager/src/main/.DS_Store b/vnfs/vLB/DNSManager/src/main/.DS_Store
deleted file mode 100644
index d0f5e852..00000000
--- a/vnfs/vLB/DNSManager/src/main/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/DNSManager/src/main/java/.DS_Store b/vnfs/vLB/DNSManager/src/main/java/.DS_Store
deleted file mode 100644
index 097132be..00000000
--- a/vnfs/vLB/DNSManager/src/main/java/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLB/dns_streams/.DS_Store b/vnfs/vLB/dns_streams/.DS_Store
deleted file mode 100644
index 5008ddfc..00000000
--- a/vnfs/vLB/dns_streams/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/vnfs/vLBMS/apis/asciidoc/Readme.adoc b/vnfs/vLBMS/apis/asciidoc/Readme.adoc
new file mode 100644
index 00000000..292e5fd6
--- /dev/null
+++ b/vnfs/vLBMS/apis/asciidoc/Readme.adoc
@@ -0,0 +1,3 @@
+= vlb-business-vnf-onap-plugin-aggregator
+
+Overview of vlb-business-vnf-onap-plugin-aggregator \ No newline at end of file
diff --git a/vnfs/vLBMS/apis/pom.xml b/vnfs/vLBMS/apis/pom.xml
new file mode 100755
index 00000000..5ce6ed0f
--- /dev/null
+++ b/vnfs/vLBMS/apis/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ 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.
+--><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">
+
+ <parent>
+ <artifactId>demo-aggregator</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <groupId>org.onap.demo.vnf</groupId>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.onap.vnf.vlb</groupId>
+ <artifactId>vlb-business-vnf-onap-plugin-aggregator</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <name>vlb-business-vnf-onap-plugin-aggregator</name>
+ <packaging>pom</packaging>
+ <modelVersion>4.0.0</modelVersion>
+
+ <modules>
+ <module>vlb-business-vnf-onap-plugin-api</module>
+ <module>vlb-business-vnf-onap-plugin-impl</module>
+ <module>vlb-vnf-onap-distribution</module>
+ </modules>
+
+ <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/asciidoc/Readme.adoc b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/asciidoc/Readme.adoc
new file mode 100644
index 00000000..84ed862b
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/asciidoc/Readme.adoc
@@ -0,0 +1,3 @@
+= vlb-business-vnf-onap-plugin-api
+
+Overview of vlb-business-vnf-onap-plugin-api \ No newline at end of file
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/pom.xml b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/pom.xml
new file mode 100644
index 00000000..dd6c5972
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ 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.
+--><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">
+
+ <parent>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>api-parent</artifactId>
+ <version>1.17.07</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.onap.vnf.vlb</groupId>
+ <artifactId>vlb-business-vnf-onap-plugin-api</artifactId>
+ <name>vlb-business-vnf-onap-plugin-api</name>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>iana-if-type-2014-05-08</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-interfaces</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/src/main/yang/vlb-business-vnf-onap-plugin.yang b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/src/main/yang/vlb-business-vnf-onap-plugin.yang
new file mode 100644
index 00000000..229ad7a3
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-api/src/main/yang/vlb-business-vnf-onap-plugin.yang
@@ -0,0 +1,66 @@
+module vlb-business-vnf-onap-plugin {
+
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin";
+ prefix "vlb-business-vnf-onap-plugin";
+
+ description
+ "This YANG module defines the generic configuration and
+ operational data for vlb-business-vnf-onap-plugin in VPP";
+
+ revision "2016-09-18" {
+ description "Initial revision of vlb-business-vnf-onap-plugin model";
+ }
+
+ container vlb-business-vnf-onap-plugin {
+ uses vlb-business-vnf-onap-plugin-params;
+ description "Configuration data of vlb-business-vnf-onap-plugin in Honeycomb";
+
+ // READ
+ // curl -u admin:admin http://localhost:8181/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin
+
+ // WRITE
+ // curl http://localhost:8181/restconf/operational/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin
+
+ }
+
+ container vlb-business-vnf-onap-plugin-state {
+ config false;
+ uses vlb-business-vnf-onap-plugin-params;
+ description "Operational data of vlb-business-vnf-onap-plugin persisted in VPP";
+
+ // READ
+ // curl -u admin:admin http://localhost:8181/restconf/operational/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin-state
+ }
+
+// grouping vlb-business-vnf-onap-plugin-params {
+// list element {
+//
+// key id;
+// leaf id {
+// type uint32;
+// }
+//
+// leaf description {
+// type string;
+// }
+// }
+// }
+
+
+ grouping vlb-business-vnf-onap-plugin-params {
+ container vdns-instances {
+ list vdns-instance {
+
+ key ip-addr;
+ leaf ip-addr {
+ type string;
+ }
+
+ leaf is-enabled {
+ type boolean;
+ }
+ }
+ }
+ }
+}
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/asciidoc/Readme.adoc b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/asciidoc/Readme.adoc
new file mode 100644
index 00000000..ab759c7b
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/asciidoc/Readme.adoc
@@ -0,0 +1,3 @@
+= vlb-business-vnf-onap-plugin-impl
+
+Overview of vlb-business-vnf-onap-plugin-impl \ No newline at end of file
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/pom.xml b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/pom.xml
new file mode 100644
index 00000000..7f96b5c6
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/pom.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ 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.
+--><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">
+ <parent>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>impl-parent</artifactId>
+ <version>1.17.07</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.onap.vnf.vlb</groupId>
+ <artifactId>vlb-business-vnf-onap-plugin-impl</artifactId>
+ <name>vlb-business-vnf-onap-plugin-impl</name>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <honeycomb.infra.version>1.17.07</honeycomb.infra.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vlb-business-vnf-onap-plugin-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- Honeycomb infrastructure-->
+ <dependency>
+ <groupId>io.fd.honeycomb</groupId>
+ <artifactId>translate-api</artifactId>
+ <version>${honeycomb.infra.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.fd.honeycomb</groupId>
+ <artifactId>translate-spi</artifactId>
+ <version>${honeycomb.infra.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.fd.honeycomb</groupId>
+ <artifactId>cfg-init</artifactId>
+ <version>${honeycomb.infra.version}</version>
+ </dependency>
+
+ <!-- DI -->
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.jmob</groupId>
+ <artifactId>guice.conf</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/CrudService.java b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/CrudService.java
new file mode 100644
index 00000000..1e7be67b
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/CrudService.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * 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.
+ */
+
+package org.onap.vnf.vlb;
+
+import io.fd.honeycomb.translate.read.ReadFailedException;
+import io.fd.honeycomb.translate.write.WriteFailedException;
+import java.util.List;
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Example of an aggregated access interface.
+ * <p/>
+ * Shared by all the customizers hiding the ugly details of our data management.
+ *
+ * TODO update javadoc
+ */
+public interface CrudService<T extends DataObject> {
+
+ /**
+ * Perform write of provided data.
+ */
+ void writeData(@Nonnull final InstanceIdentifier<T> identifier, @Nonnull final T data)
+ throws WriteFailedException;
+
+
+ /**
+ * Perform delete of existing data.
+ */
+ void deleteData(@Nonnull final InstanceIdentifier<T> identifier, @Nonnull final T data)
+ throws WriteFailedException;
+
+ /**
+ * Perform update of existing data.
+ */
+ void updateData(@Nonnull final InstanceIdentifier<T> identifier, @Nonnull final T dataOld,
+ @Nonnull final T dataNew)
+ throws WriteFailedException;
+
+ /**
+ * Read data identified by provided identifier.
+ */
+ T readSpecific(@Nonnull final InstanceIdentifier<T> identifier) throws ReadFailedException;
+
+ /**
+ * Read all nodes of type {@link T}.
+ */
+ List<T> readAll() throws ReadFailedException;
+}
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ElementCrudService.java b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ElementCrudService.java
new file mode 100644
index 00000000..d17c6c18
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ElementCrudService.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * 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.
+ */
+
+package org.onap.vnf.vlb;
+
+import io.fd.honeycomb.translate.read.ReadFailedException;
+import io.fd.honeycomb.translate.write.WriteFailedException;
+import java.util.Collections;
+import java.util.List;
+import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.VlbBusinessVnfOnapPluginState;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.VdnsInstances;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.vdns.instances.VdnsInstance;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.vdns.instances.VdnsInstanceBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.vdns.instances.VdnsInstanceKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Simple example of class handling Crud operations for plugin.
+ * <p/>
+ * No real handling, serves just as an illustration.
+ *
+ * TODO update javadoc
+ */
+final class ElementCrudService implements CrudService<VdnsInstance> {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ElementCrudService.class);
+
+ @Override
+ public void writeData(@Nonnull final InstanceIdentifier<VdnsInstance> identifier, @Nonnull final VdnsInstance data)
+ throws WriteFailedException {
+ if (data != null) {
+
+ // identifier.firstKeyOf(SomeClassUpperInHierarchy.class) can be used to identify
+ // relationships such as to which parent these data are related to
+
+ // Performs any logic needed for persisting such data
+ LOG.info("Writing path[{}] / data [{}]", identifier, data);
+ } else {
+ throw new WriteFailedException.CreateFailedException(identifier, data,
+ new NullPointerException("Provided data are null"));
+ }
+ }
+
+ @Override
+ public void deleteData(@Nonnull final InstanceIdentifier<VdnsInstance> identifier, @Nonnull final VdnsInstance data)
+ throws WriteFailedException {
+ if (data != null) {
+
+ // identifier.firstKeyOf(SomeClassUpperInHierarchy.class) can be used to identify
+ // relationships such as to which parent these data are related to
+
+ // Performs any logic needed for persisting such data
+ LOG.info("Removing path[{}] / data [{}]", identifier, data);
+ } else {
+ throw new WriteFailedException.DeleteFailedException(identifier,
+ new NullPointerException("Provided data are null"));
+ }
+ }
+
+ @Override
+ public void updateData(@Nonnull final InstanceIdentifier<VdnsInstance> identifier, @Nonnull final VdnsInstance dataOld,
+ @Nonnull final VdnsInstance dataNew) throws WriteFailedException {
+ if (dataOld != null && dataNew != null) {
+
+ // identifier.firstKeyOf(SomeClassUpperInHierarchy.class) can be used to identify
+ // relationships such as to which parent these data are related to
+
+ // Performs any logic needed for persisting such data
+ LOG.info("Update path[{}] from [{}] to [{}]", identifier, dataOld, dataNew);
+ } else {
+ throw new WriteFailedException.DeleteFailedException(identifier,
+ new NullPointerException("Provided data are null"));
+ }
+ }
+
+ @Override
+ public VdnsInstance readSpecific(@Nonnull final InstanceIdentifier<VdnsInstance> identifier) throws ReadFailedException {
+
+ // read key specified in path identifier
+ final VdnsInstanceKey key = identifier.firstKeyOf(VdnsInstance.class);
+
+ // load data by this key
+ // *Key class will always contain key of entity, in this case long value
+
+ return new VdnsInstanceBuilder()
+ .setIpAddr(key.getIpAddr())
+ .setKey(key)
+ .setIsEnabled(true)
+ .build();
+ }
+
+ @Override
+ public List<VdnsInstance> readAll() throws ReadFailedException {
+ // read all data under parent node,in this case {@link ModuleState}
+ return Collections.singletonList(
+ readSpecific(InstanceIdentifier.create(VlbBusinessVnfOnapPluginState.class).child(VdnsInstances.class).child(VdnsInstance.class, new VdnsInstanceKey(""))));
+ }
+}
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/Module.java b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/Module.java
new file mode 100644
index 00000000..37506d1e
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/Module.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * 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.
+ */
+
+package org.onap.vnf.vlb;
+
+import static org.onap.vnf.vlb.ModuleConfiguration.ELEMENT_SERVICE_NAME;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.TypeLiteral;
+import com.google.inject.multibindings.Multibinder;
+import com.google.inject.name.Names;
+//import org.onap.vnf.vlb.read.ModuleStateReaderFactory;
+import org.onap.vnf.vlb.write.ModuleWriterFactory;
+import io.fd.honeycomb.data.init.DataTreeInitializer;
+import io.fd.honeycomb.translate.read.ReaderFactory;
+import io.fd.honeycomb.translate.write.WriterFactory;
+import net.jmob.guice.conf.core.ConfigurationModule;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.vdns.instances.VdnsInstance;
+
+/**
+ * Module class instantiating vlb-business-vnf-onap-plugin plugin components.
+ */
+public final class Module extends AbstractModule {
+
+ // TODO This initiates all the plugin components, but it still needs to be registered/wired into an integration
+ // module producing runnable distributions. There is one such distribution in honeycomb project:
+ // vpp-integration/minimal-distribution
+ // In order to integrate this plugin with the distribution:
+ // 1. Add a dependency on this maven module to the the distribution's pom.xml
+ // 2. Add an instance of this module into the distribution in its Main class
+
+ @Override
+ protected void configure() {
+ // requests injection of properties
+ install(ConfigurationModule.create());
+ requestInjection(ModuleConfiguration.class);
+
+ // creates binding for interface implementation by name
+ bind(new TypeLiteral<CrudService<VdnsInstance>>(){})
+ .annotatedWith(Names.named(ELEMENT_SERVICE_NAME))
+ .to(ElementCrudService.class);
+
+ // creates reader factory binding
+ // can hold multiple binding for separate yang modules
+ //final Multibinder<ReaderFactory> readerFactoryBinder = Multibinder.newSetBinder(binder(), ReaderFactory.class);
+ //readerFactoryBinder.addBinding().to(ModuleStateReaderFactory.class);
+
+ // create writer factory binding
+ // can hold multiple binding for separate yang modules
+ final Multibinder<WriterFactory> writerFactoryBinder = Multibinder.newSetBinder(binder(), WriterFactory.class);
+ writerFactoryBinder.addBinding().to(ModuleWriterFactory.class);
+ }
+}
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ModuleConfiguration.java b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ModuleConfiguration.java
new file mode 100644
index 00000000..c2a429ab
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/ModuleConfiguration.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * 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.
+ */
+
+package org.onap.vnf.vlb;
+
+import net.jmob.guice.conf.core.BindConfig;
+import net.jmob.guice.conf.core.InjectConfig;
+import net.jmob.guice.conf.core.Syntax;
+
+/**
+ * Class containing static configuration for vlb-business-vnf-onap-plugin module,<br>
+ * either loaded from property file vlb-business-vnf-onap-plugin.json from classpath.
+ * <p/>
+ * Further documentation for the configuration injection can be found at:
+ * https://github.com/yyvess/gconf
+ */
+@BindConfig(value = "vlb-business-vnf-onap-plugin", syntax = Syntax.JSON)
+public final class ModuleConfiguration {
+
+ // TODO change the sample property to real plugin configuration
+ // If there is no such configuration, remove this, vlb-business-vnf-onap-plugin.json resource and its wiring from Module class
+
+ /**
+ * Sample property that's injected from external json configuration file.
+ */
+ @InjectConfig("sample-prop")
+ public String sampleProp;
+
+ /**
+ * Constant name used to identify vlb-business-vnf-onap-plugin plugin specific components during dependency injection.
+ */
+ public static final String ELEMENT_SERVICE_NAME = "element-service";
+}
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/DnsInstanceManager.java b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/DnsInstanceManager.java
new file mode 100644
index 00000000..dc3e9248
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/DnsInstanceManager.java
@@ -0,0 +1,142 @@
+
+/*************************************************************************//**
+ *
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+package org.onap.vnf.vlb.write;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * Class that maintains a map of all the active vDNS instances.
+ * A vDNS instance is represented by its IP address and a flag
+ * that represents its status, i.e. enabled or disabled.
+ *
+ * Clients can update the vDNS map via NETCONF or RESTconf.
+ * Operations are translated by the Honeycomb agent into a JSON
+ * object that is persisted on disk (see Honeycomb distribution
+ * configuration for more information). The ElementCustomizer
+ * class then updates this map. Each operation results in a vLB
+ * setup change, e.g. GRE tunnels that connect the vLB to the
+ * vDNS instances are created or deleted, depending on the kind
+ * of operation that is invoked. Only vDNS instances for which
+ * the isEnabled flag is true are currently served by the vLB.
+ *
+ * The vLB setup and configuration is executed via shell scripts.
+ *
+ */
+
+public class DnsInstanceManager {
+
+ private static final Logger LOG = LoggerFactory.getLogger(DnsInstanceManager.class);
+ private Map<String, Boolean> dnsInstances = new HashMap<String, Boolean>();
+
+ /*
+ * Add a new DNS instance to the map and create a GRE tunnel
+ * towards that instance if isEnabled is set to true.
+ */
+ void addDnsInstance(String ipAddr, Boolean isEnabled) {
+ // Call updateDnsInstance in case the DNS instance already exists.
+ // This is somewhat redundant because Honeycomb already runs this check.
+ if(dnsInstances.containsKey(ipAddr)) {
+ updateDnsInstance(ipAddr, isEnabled);
+ return;
+ }
+
+ dnsInstances.put(ipAddr, isEnabled);
+ LOG.debug("DNS instance " + ipAddr + " with status isEnabled=" + isEnabled + " has been added.");
+
+ // Create a GRE tunnel towards the new DNS instance if isEnabled is true.
+ if(isEnabled) {
+ addGreTunnel(ipAddr);
+ }
+ }
+
+ /*
+ * Update an existing DNS instance and create or remove a GRE
+ * tunnel based on the current value of the isEnabled flag.
+ */
+ void updateDnsInstance(String ipAddr, Boolean isEnabled) {
+ // This is somewhat redundant because Honeycomb already runs this check.
+ if(dnsInstances.get(ipAddr) == isEnabled) {
+ LOG.debug("DNS instance " + ipAddr + " with status isEnabled=" + isEnabled + " already exists. No update is necessary.");
+ return;
+ }
+
+ dnsInstances.put(ipAddr, isEnabled);
+ LOG.debug("DNS instance " + ipAddr + " has been updated with status isEnabled=" + isEnabled + ".");
+
+ if(isEnabled) {
+ addGreTunnel(ipAddr);
+ }
+ else {
+ deleteGreTunnel(ipAddr);
+ }
+ }
+
+ /*
+ * Delete an existing DNS instance from the map and remove the
+ * GRE tunnel if isEnabled was set to true.
+ */
+ void deleteDnsInstance(String ipAddr) {
+ // This is somewhat redundant because Honeycomb already runs this check.
+ if(!dnsInstances.containsKey(ipAddr)) {
+ LOG.debug("DNS instance " + ipAddr + " doesn't exist.");
+ return;
+ }
+
+ // Remove a GRE tunnel towards this DNS instance if it exists.
+ if(dnsInstances.get(ipAddr)) {
+ deleteGreTunnel(ipAddr);
+ }
+
+ dnsInstances.remove(ipAddr);
+ }
+
+ /*
+ * Auxiliary function that calls a shell script to create a GRE tunnel towards a new vDNS instance.
+ */
+ private void addGreTunnel(String ipAddr) {
+ String script = new String("bash /opt/add_dns.sh " + ipAddr);
+ try {
+ Runtime.getRuntime().exec(script);
+ LOG.debug("New GRE tunnel towards DNS instance " + ipAddr + " created.");
+ } catch (IOException e) {
+ LOG.error("add_dns.sh returned an error.");
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * Auxiliary function that calls a shell script to delete a GRE tunnel towards a vDNS instance.
+ */
+ private void deleteGreTunnel(String ipAddr) {
+ String script = new String("bash /opt/remove_dns.sh " + ipAddr);
+ try {
+ Runtime.getRuntime().exec(script);
+ LOG.debug("GRE tunnel towards DNS instance " + ipAddr + " removed.");
+ } catch (IOException e) {
+ LOG.error("remove_dns.sh returned an error.");
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ElementCustomizer.java b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ElementCustomizer.java
new file mode 100644
index 00000000..d8da0b5b
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ElementCustomizer.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * 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.
+ */
+
+package org.onap.vnf.vlb.write;
+
+import org.onap.vnf.vlb.CrudService;
+import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
+import io.fd.honeycomb.translate.write.WriteContext;
+import io.fd.honeycomb.translate.write.WriteFailedException;
+import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.vdns.instances.VdnsInstance;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.vdns.instances.VdnsInstanceKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Writer for {@link Element} list node from our YANG model.
+ */
+public final class ElementCustomizer implements ListWriterCustomizer<VdnsInstance, VdnsInstanceKey> {
+
+ private final CrudService<VdnsInstance> crudService;
+ private DnsInstanceManager dnsInstanceManager;
+ private static final Logger LOG = LoggerFactory.getLogger(ElementCustomizer.class);
+
+ public ElementCustomizer(@Nonnull final CrudService<VdnsInstance> crudService) {
+ this.crudService = crudService;
+ dnsInstanceManager = new DnsInstanceManager();
+ }
+
+ @Override
+ public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<VdnsInstance> id, @Nonnull final VdnsInstance dataAfter,
+ @Nonnull final WriteContext writeContext) throws WriteFailedException {
+ //perform write of data,or throw exception
+ //invoked by PUT operation,if provided data doesn't exist in Config data
+ crudService.writeData(id, dataAfter);
+ dnsInstanceManager.addDnsInstance(dataAfter.getIpAddr(), dataAfter.isIsEnabled());
+ }
+
+ @Override
+ public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<VdnsInstance> id,
+ @Nonnull final VdnsInstance dataBefore,
+ @Nonnull final VdnsInstance dataAfter, @Nonnull final WriteContext writeContext)
+ throws WriteFailedException {
+ //perform update of data,or throw exception
+ //invoked by PUT operation,if provided data does exist in Config data
+ crudService.updateData(id, dataBefore, dataAfter);
+ dnsInstanceManager.updateDnsInstance(dataAfter.getIpAddr(), dataAfter.isIsEnabled());
+ }
+
+ @Override
+ public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<VdnsInstance> id,
+ @Nonnull final VdnsInstance dataBefore,
+ @Nonnull final WriteContext writeContext) throws WriteFailedException {
+ //perform delete of data,or throw exception
+ //invoked by DELETE operation
+ crudService.deleteData(id, dataBefore);
+ dnsInstanceManager.deleteDnsInstance(dataBefore.getIpAddr());
+ }
+}
diff --git a/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ModuleWriterFactory.java b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ModuleWriterFactory.java
new file mode 100644
index 00000000..8be4bb10
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/vlb/write/ModuleWriterFactory.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * 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.
+ */
+
+package org.onap.vnf.vlb.write;
+
+import static org.onap.vnf.vlb.ModuleConfiguration.ELEMENT_SERVICE_NAME;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import org.onap.vnf.vlb.CrudService;
+import io.fd.honeycomb.translate.impl.write.GenericWriter;
+import io.fd.honeycomb.translate.write.WriterFactory;
+import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
+import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.VlbBusinessVnfOnapPlugin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.VdnsInstances;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vlb.business.vnf.onap.plugin.rev160918.vlb.business.vnf.onap.plugin.params.vdns.instances.VdnsInstance;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Factory producing writers for vlb-business-vnf-onap-plugin plugin's data.
+ */
+public final class ModuleWriterFactory implements WriterFactory {
+
+ private static final InstanceIdentifier<VlbBusinessVnfOnapPlugin> ROOT_CONTAINER_ID = InstanceIdentifier.create(VlbBusinessVnfOnapPlugin.class);
+
+ /**
+ * Injected crud service to be passed to customizers instantiated in this factory.
+ */
+ @Inject
+ @Named(ELEMENT_SERVICE_NAME)
+ private CrudService<VdnsInstance> crudService;
+
+ @Override
+ public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) {
+
+ //adds writer for child node
+ //no need to add writers for empty nodes
+ registry.add(new GenericWriter<>(ROOT_CONTAINER_ID.child(VdnsInstances.class).child(VdnsInstance.class), new ElementCustomizer(crudService)));
+ }
+}
diff --git a/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/asciidoc/Readme.adoc b/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/asciidoc/Readme.adoc
new file mode 100644
index 00000000..0a6c66d4
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/asciidoc/Readme.adoc
@@ -0,0 +1,3 @@
+= vlb-vnf-onap-distribution
+
+Overview of vlb-vnf-onap-distribution \ No newline at end of file
diff --git a/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml b/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml
new file mode 100644
index 00000000..b70c2594
--- /dev/null
+++ b/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/pom.xml
@@ -0,0 +1,103 @@
+<?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">
+
+ <parent>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>minimal-distribution-parent</artifactId>
+ <version>1.17.07</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.onap.vnf.vlb</groupId>
+ <artifactId>vlb-vnf-onap-distribution</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+
+ <properties>
+ <exec.parameters>-Xms128m -Xmx128m</exec.parameters>
+ <main.class>io.fd.honeycomb.infra.distro.Main</main.class>
+ <interfaces.mapping.version>1.17.07</interfaces.mapping.version>
+ <honeycomb.min.distro.version>1.17.07</honeycomb.min.distro.version>
+ <!--
+ Defines list of specific modules provided by the distribution
+ (adds them to base modules like NetconfModule and RestconfModule).
+
+ Module configuration is placed in 'modules' subdir of the target distro folder.
+ Modules can be disabled by commenting them out in the pom.xml
+ or modules configuration file.
+ -->
+ <distribution.modules>
+ org.onap.vnf.vlb.Module
+ </distribution.modules>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- Dependency on sample plugin -->
+ <dependency>
+ <groupId>org.onap.vnf.vlb</groupId>
+ <artifactId>vlb-business-vnf-onap-plugin-impl</artifactId>
+ <version>${interfaces.mapping.version}</version>
+ </dependency>
+ <!-- Dependency on distribution base -->
+ <dependency>
+ <groupId>io.fd.honeycomb</groupId>
+ <artifactId>minimal-distribution</artifactId>
+ <version>${honeycomb.min.distro.version}</version>
+ </dependency>
+
+ </dependencies>
+</project>