aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/honeycomb_plugin/sample_plugin
diff options
context:
space:
mode:
authorplatania <platania@research.att.com>2017-02-16 11:20:22 -0500
committerplatania <platania@research.att.com>2017-02-16 11:20:47 -0500
commit3426556541256f93d2cba65df3b9c8d1d1772861 (patch)
tree56e5b26481400d35e3e2e36be20df953793e348d /vnfs/honeycomb_plugin/sample_plugin
parentf525cb9014ae27ddd795f933dee54a78b214a589 (diff)
Initial OpenECOMP Demo commit
Change-Id: Ibf8696196a7ac2c84ac8aa7cde1982c9c89fb64d Signed-off-by: platania <platania@research.att.com>
Diffstat (limited to 'vnfs/honeycomb_plugin/sample_plugin')
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/.DS_Storebin0 -> 10244 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/LICENSE.TXT22
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/README.md16
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/parent-pom/pom.xml244
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/pom.xml58
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-distribution/pom.xml106
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Storebin0 -> 6148 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/.DS_Storebin0 -> 6148 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/.DS_Storebin0 -> 6148 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/.DS_Storebin0 -> 6148 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/.DS_Storebin0 -> 6148 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/tutorial/Main.java41
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/pom.xml76
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/.DS_Storebin0 -> 6148 bytes
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/yang/sample-plugin.yang77
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/Readme.adoc3
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/pom.xml107
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/Module.java71
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/ModuleConfiguration.java46
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/init/ConfigDataInitializer.java50
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/notif/SampleNotificationProducer.java86
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/ModuleWriterFactory.java63
-rwxr-xr-xvnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/PgWriteCustomizer.java155
-rw-r--r--vnfs/honeycomb_plugin/sample_plugin/settings.xml105
29 files changed, 1326 insertions, 0 deletions
diff --git a/vnfs/honeycomb_plugin/sample_plugin/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/.DS_Store
new file mode 100644
index 00000000..c7a6a7ae
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/.DS_Store
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/LICENSE.TXT b/vnfs/honeycomb_plugin/sample_plugin/LICENSE.TXT
new file mode 100644
index 00000000..56404742
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/LICENSE.TXT
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START==========================================
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ *
+ * ECOMP and OpenECOMP are trademarks
+ * and service marks of AT&T Intellectual Property.
+ *
+ */ \ No newline at end of file
diff --git a/vnfs/honeycomb_plugin/sample_plugin/README.md b/vnfs/honeycomb_plugin/sample_plugin/README.md
new file mode 100755
index 00000000..2719e64f
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/README.md
@@ -0,0 +1,16 @@
+# Honeycomb plugin for VPP's packet generator plugin
+
+This plugin provides REST API to enable/disable streams on the VPP's packet generator.
+
+
+Buid instructions:
+
+From the sample_pluging folder execute: mvn -s settings.xml clean install.
+
+
+Run instruction:
+
+From the sample_pluging folder execute: ./sample-distribution/target/sample-distribution-1.0.0-hc/sample-distribution-1.0.0/honeycomb
+
+
+In order to allow access to REST API from an external machine, modify the "restconf-binding-address" parameter in sample-distribution/target/sample-distribution-1.0.0-hc/sample-distribution-1.0.0/config/honeycomb.json
diff --git a/vnfs/honeycomb_plugin/sample_plugin/parent-pom/pom.xml b/vnfs/honeycomb_plugin/sample_plugin/parent-pom/pom.xml
new file mode 100644
index 00000000..16cd604e
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/parent-pom/pom.xml
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<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>org.openecomp.demo.vnf</groupId>
+ <artifactId>demo-aggregator</artifactId>
+ <version>1.0.0</version>
+ <relativePath>../../../pom.xml</relativePath>
+</parent>
+
+ <properties>
+ <nexusproxy>http://nexus.fd.io/content</nexusproxy>
+ <start.script.template>
+#!/bin/sh -
+STATUS=100
+
+while [ $STATUS -eq 100 ]
+do
+ %s
+ STATUS=$?
+ echo "Honeycomb exited with status: $STATUS"
+ if [ $STATUS -eq 100 ]
+ then
+ echo "Restarting..."
+ fi
+done
+ </start.script.template>
+ <exec.parameters>-Xms32m -Xmx128m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m</exec.parameters>
+ <exec.parameters.minimal>-client -Xms20m -Xmx32m -XX:MetaspaceSize=5m -XX:MaxMetaspaceSize=32m -XX:MaxMetaspaceExpansion=1m -Xss512k -XX:+UseSerialGC -Djava.compiler=NONE -Xverify:none -noverify</exec.parameters.minimal>
+ <debug.parameters>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</debug.parameters>
+ <guice.version>4.1.0</guice.version>
+ <guice.config.version>1.2.0</guice.config.version>
+ <restconf.version>1.3.2-Beryllium-SR2</restconf.version>
+ <netconf.version>1.0.2-Beryllium-SR2</netconf.version>
+ <jersey.version>1.19.1</jersey.version>
+ <jetty.version>9.3.11.v20160721</jetty.version>
+ <servlet.version>3.1.0</servlet.version>
+ <yangtools.version>0.8.2-Beryllium-SR2</yangtools.version>
+ <mdsal.version>1.3.2-Beryllium-SR2</mdsal.version>
+ <!-- Used by mdsal as provided/runtime dependency-->
+ <osgi.core.version>5.0.0</osgi.core.version>
+ </properties>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>minimal-distribution-parent</artifactId>
+ <version>1.16.9</version>
+ <packaging>pom</packaging>
+
+ <!-- Generate executable shell script -->
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <!-- Use google's error-prone static analysis-->
+ <compilerId>javac-with-errorprone</compilerId>
+ <forceJavacCompilerUse>true</forceJavacCompilerUse>
+ <showWarnings>true</showWarnings>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-compiler-javac-errorprone</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <!-- override plexus-compiler-javac-errorprone's dependency on
+ Error Prone with the latest version -->
+ <dependency>
+ <groupId>com.google.errorprone</groupId>
+ <artifactId>error_prone_core</artifactId>
+ <version>2.0.9</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>${main.class}</mainClass>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>lib/</classpathPrefix>
+ <useUniqueVersions>false</useUniqueVersions>
+ <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
+ </manifest>
+ <manifestEntries>
+ <Class-Path>config/ cert/</Class-Path>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <!-- Copy all dependencies -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.10</version>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ <useBaseVersion>true</useBaseVersion>
+ <useRepositoryLayout>true</useRepositoryLayout>
+ <excludeArtifactIds>yang-jmx-generator</excludeArtifactIds>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack-configuration</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <includes>**/honeycomb-minimal-resources/</includes>
+ <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Generate shell script -->
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <!-- TODO add remote debug option -->
+ <!-- TODO add clean option -->
+ <!-- TODO add shutdown script -->
+ <!-- TODO add restart script -->
+ <!-- TODO pass options to JVM? -->
+ <source>
+ import java.nio.file.Paths
+
+ log.info "Generating shell exec script"
+ def scriptTemplate = properties.getOrDefault("start.script.template", "")
+ def args = properties.getOrDefault("exec.parameters", "")
+ log.debug "Additional shell exec script properties: ${args}"
+ def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar"
+ def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources")
+ scriptParent.toFile().mkdirs()
+ def scriptContent = "java " + javaArgs
+ log.info "Generating shell exec script as ${scriptContent}"
+ def scriptPath = Paths.get(scriptParent.toString(), "honeycomb")
+ log.info "Writing shell exec script to ${scriptPath}"
+ scriptPath.toFile().text = String.format(scriptTemplate, scriptContent)
+ scriptPath.toFile().setExecutable(true)
+
+ scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start")
+ log.info "Writing shell exec script to ${scriptPath}"
+ scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &amp;"
+ scriptPath.toFile().setExecutable(true)
+
+ def debug_args = properties.getOrDefault("debug.parameters", "")
+ def debugScriptContent = "java" + " ${debug_args} " + javaArgs
+ log.info "Generating shell debug script as ${debugScriptContent}"
+ scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug")
+ log.info "Writing shell debug script to ${scriptPath}"
+ scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent)
+ scriptPath.toFile().setExecutable(true)
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Build archives -->
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.5.3</version>
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>minimal-assembly-descriptor</artifactId>
+ <version>1.16.9</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>create-archive</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>honeycomb-minimal</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+<!-- <distributionManagement>
+ <repository>
+ <id>fdio-release</id>
+ <url>${nexusproxy}/repositories/fd.io.release/</url>
+ </repository>
+ <snapshotRepository>
+ <id>fdio-snapshot</id>
+ <url>${nexusproxy}/repositories/fd.io.snapshot/</url>
+ </snapshotRepository>
+ </distributionManagement>
+-->
+</project>
diff --git a/vnfs/honeycomb_plugin/sample_plugin/pom.xml b/vnfs/honeycomb_plugin/sample_plugin/pom.xml
new file mode 100755
index 00000000..2da40d38
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/pom.xml
@@ -0,0 +1,58 @@
+<?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>org.opendaylight.odlparent</groupId>
+ <artifactId>odlparent</artifactId>
+ <version>1.6.2-Beryllium-SR2</version>
+ </parent>
+
+ <groupId>org.openecomp.demo.vnf</groupId>
+ <artifactId>sample-plugin-aggregator</artifactId>
+ <version>1.0.0</version>
+ <name>sample-plugin-aggregator</name>
+ <packaging>pom</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+
+ <modules>
+ <module>sample-plugin-api</module>
+ <module>sample-plugin-impl</module>
+ <module>sample-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/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Store
new file mode 100644
index 00000000..935eda93
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/.DS_Store
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/pom.xml b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/pom.xml
new file mode 100755
index 00000000..0d8ddd77
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/pom.xml
@@ -0,0 +1,106 @@
+<?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.16.9</version>
+ </parent>
+-->
+<parent>
+<groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>minimal-distribution-parent</artifactId>
+ <version>1.16.9</version>
+<relativePath>../parent-pom/pom.xml</relativePath>
+</parent>
+<!--
+<parent>
+ <groupId>org.openecomp.demo.vnf</groupId>
+ <artifactId>demo-aggregator</artifactId>
+ <version>1.0.0</version>
+<relativePath>../../../pom.xml</relativePath>
+ </parent>
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.openecomp.demo.vnf</groupId>
+ <artifactId>sample-distribution</artifactId>
+ <version>1.0.0</version>
+
+ <properties>
+ <main.class>io.fd.honeycomb.vpp.integration.distro.Main</main.class>
+ <v3po.version>1.16.9</v3po.version>
+ <lisp.version>1.16.9</lisp.version>
+ <vpp.common.min.distro.version>1.16.9</vpp.common.min.distro.version>
+ <vppnsh.version>1.16.9</vppnsh.version>
+ </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>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.vpp</groupId>
+ <artifactId>minimal-distribution</artifactId>
+ <version>${vpp.common.min.distro.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>v3po2vpp</artifactId>
+ <version>${v3po.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.honeycomb.lisp</groupId>
+ <artifactId>lisp2vpp</artifactId>
+ <version>${lisp.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.honeycomb.vppnsh</groupId>
+ <artifactId>vppnsh-impl</artifactId>
+ <version>${vppnsh.version}</version>
+ </dependency>
+<dependency>
+ <groupId>org.openecomp.demo.vnf</groupId>
+ <artifactId>sample-plugin-impl</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Store
new file mode 100644
index 00000000..6816049e
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/.DS_Store
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
new file mode 100644
index 00000000..7db2c2e3
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/.DS_Store
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
new file mode 100644
index 00000000..06450486
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/.DS_Store
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
new file mode 100644
index 00000000..47336c35
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/.DS_Store
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
new file mode 100644
index 00000000..0bb0440d
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/.DS_Store
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
new file mode 100644
index 00000000..70a47622
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/.DS_Store
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/tutorial/Main.java b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/tutorial/Main.java
new file mode 100755
index 00000000..d16c4221
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-distribution/src/main/java/io/fd/honeycomb/tutorial/Main.java
@@ -0,0 +1,41 @@
+/*
+ * 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 io.fd.honeycomb.vpp.integration.distro;
+
+import com.google.common.collect.Lists;
+import com.google.inject.Module;
+import io.fd.honeycomb.lisp.LispModule;
+import io.fd.honeycomb.translate.v3po.V3poModule;
+import io.fd.honeycomb.vpp.distro.VppCommonModule;
+import io.fd.honeycomb.vppnsh.impl.VppNshModule;
+import java.util.List;
+
+public class Main {
+
+ public static void main(String[] args) {
+ final List<Module> sampleModules = Lists.newArrayList(io.fd.honeycomb.infra.distro.Main.BASE_MODULES);
+
+ // All the plugins should be listed here
+ sampleModules.add(new VppCommonModule());
+ sampleModules.add(new V3poModule());
+ sampleModules.add(new LispModule());
+ sampleModules.add(new VppNshModule());
+ sampleModules.add(new io.fd.honeycomb.tutorial.Module());
+
+ io.fd.honeycomb.infra.distro.Main.init(sampleModules);
+ }
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Store
new file mode 100644
index 00000000..935eda93
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/.DS_Store
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/pom.xml b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/pom.xml
new file mode 100755
index 00000000..74506eb9
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/pom.xml
@@ -0,0 +1,76 @@
+<?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.16.9</version>
+ <relativePath>../../common/api-parent</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.openecomp.demo.vnf</groupId>
+ <artifactId>sample-plugin-api</artifactId>
+ <version>1.0.0</version>
+ <packaging>bundle</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.8.2-Beryllium-SR2</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <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.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+</plugin>
+</plugins>
+</build>
+
+</project>
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
new file mode 100644
index 00000000..6816049e
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/.DS_Store
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
new file mode 100644
index 00000000..45c9ff18
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/.DS_Store
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/yang/sample-plugin.yang b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/yang/sample-plugin.yang
new file mode 100755
index 00000000..df929782
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-api/src/main/yang/sample-plugin.yang
@@ -0,0 +1,77 @@
+//*************************************************************//
+//
+// Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//******************************************************************
+
+
+module sample-plugin {
+
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:sample-plugin";
+ prefix "sample-plugin";
+
+ import ietf-inet-types { prefix "inet"; }
+
+ description
+ "This YANG module defines the generic configuration and
+ operational data for sample-plugin in VPP";
+
+ revision "2016-09-18" {
+ description "Initial revision of sample-plugin model";
+ }
+
+ container sample-plugin {
+ uses sample-plugin-params;
+ description "Configuration data of sample-plugin in Honeycomb";
+
+ // READ
+ // curl -u admin:admin http://localhost:8181/restconf/config/sample-plugin:sample-plugin
+
+ // WRITE
+ // curl http://localhost:8181/restconf/operational/sample-plugin:sample-plugin
+
+ }
+
+ container sample-plugin-state {
+ config false;
+ uses sample-plugin-params;
+ description "Operational data of sample-plugin persisted in VPP";
+
+ // READ
+ // curl -u admin:admin http://localhost:8181/restconf/operational/sample-plugin:sample-plugin-state
+ }
+
+ grouping sample-plugin-params {
+ container pg-streams {
+ list pg-stream {
+
+ key id;
+ leaf id {
+ type string;
+ }
+
+ leaf is-enabled {
+ type boolean;
+ }
+ }
+ }
+ }
+
+ notification sample-notification {
+ leaf content {
+ type string;
+ }
+ }
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Store b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Store
new file mode 100644
index 00000000..935eda93
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/.DS_Store
Binary files differ
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/Readme.adoc b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/Readme.adoc
new file mode 100755
index 00000000..c3ca7940
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/Readme.adoc
@@ -0,0 +1,3 @@
+--Documentation for sample-plugin --
+
+TODO Replace with general description whats the purpose of sample-plugin and how it works
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/pom.xml b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/pom.xml
new file mode 100755
index 00000000..59f3c1f0
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/pom.xml
@@ -0,0 +1,107 @@
+<?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.16.9</version>
+ <relativePath>../../common/impl-parent</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.openecomp.demo.vnf</groupId>
+ <artifactId>sample-plugin-impl</artifactId>
+ <version>1.0.0</version>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <honeycomb.infra.version>1.16.9</honeycomb.infra.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.demo.vnf</groupId>
+ <artifactId>sample-plugin-api</artifactId>
+ <version>1.0.0</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.vpp</groupId>
+ <artifactId>vpp-translate-utils</artifactId>
+ <version>1.16.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.fd.honeycomb</groupId>
+ <artifactId>notification-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>
+ <version>${guice.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.jmob</groupId>
+ <artifactId>guice.conf</artifactId>
+ <version>${guice.config.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ <version>${guice.version}</version>
+ </dependency>
+
+ <!-- VPP's core Java APIs -->
+ <dependency>
+ <groupId>io.fd.vpp</groupId>
+ <artifactId>jvpp-core</artifactId>
+ <version>16.09</version>
+ </dependency>
+ </dependencies>
+
+<build>
+<plugins>
+<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+</plugin>
+</plugins>
+</build>
+
+</project>
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/Module.java b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/Module.java
new file mode 100755
index 00000000..8cd46006
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/Module.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+/*
+ * Modifications copyright (c) 2017 AT&T Intellectual Property
+ */
+
+package io.fd.honeycomb.tutorial;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.multibindings.Multibinder;
+import io.fd.honeycomb.data.init.DataTreeInitializer;
+import io.fd.honeycomb.translate.read.ReaderFactory;
+import io.fd.honeycomb.translate.v3po.util.NamingContext;
+import io.fd.honeycomb.translate.write.WriterFactory;
+import io.fd.honeycomb.tutorial.init.ConfigDataInitializer;
+//import io.fd.honeycomb.tutorial.read.ModuleStateReaderFactory;
+import io.fd.honeycomb.tutorial.write.ModuleWriterFactory;
+import net.jmob.guice.conf.core.ConfigurationModule;
+
+/**
+ * Module class instantiating sample-plugin plugin components.
+ */
+public final class Module extends AbstractModule {
+
+ @Override
+ protected void configure() {
+ // requests injection of properties
+ install(ConfigurationModule.create());
+ requestInjection(ModuleConfiguration.class);
+
+ // bind naming context instance for reader and writer factories
+ // the first parameter is artificial name prefix in cases a name needs to be reconstructed for a vxlan tunnel
+ // that is present in VPP but not in Honeycomb (could be extracted into configuration)
+ // the second parameter is just the naming context ID (could be extracted into configuration)
+ binder().bind(NamingContext.class).toInstance(new NamingContext("pgstream", "pgstream-context"));
+
+ // 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);
+
+ // create initializer binding
+ // can hold multiple binding for separate yang modules
+ final Multibinder<DataTreeInitializer> initializerBinder =
+ Multibinder.newSetBinder(binder(), DataTreeInitializer.class);
+ initializerBinder.addBinding().to(ConfigDataInitializer.class);
+
+ // Disable notification producer for now
+// Multibinder.newSetBinder(binder(), ManagedNotificationProducer.class).addBinding()
+// .to(SampleNotificationProducer.class);
+ }
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/ModuleConfiguration.java b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/ModuleConfiguration.java
new file mode 100755
index 00000000..ef6be6e2
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/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 io.fd.honeycomb.tutorial;
+
+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 sample-plugin module,<br>
+ * either loaded from property file sample-plugin.json from classpath.
+ * <p/>
+ * Further documentation for the configuration injection can be found at:
+ * https://github.com/yyvess/gconf
+ */
+@BindConfig(value = "sample-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, sample-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 sample-plugin plugin specific components during dependency injection.
+ */
+ public static final String ELEMENT_SERVICE_NAME = "element-service";
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/init/ConfigDataInitializer.java b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/init/ConfigDataInitializer.java
new file mode 100755
index 00000000..8a7f4d10
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/init/ConfigDataInitializer.java
@@ -0,0 +1,50 @@
+/*
+ * 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 io.fd.honeycomb.tutorial.init;
+
+import io.fd.honeycomb.data.init.AbstractDataTreeConverter;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import javax.annotation.Nonnull;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.SamplePlugin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.SamplePluginBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.SamplePluginState;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Initialize configuration data based on operational data.
+ * <p/>
+ * Very useful when a plugin is initiated but the underlying layer already contains some operation state.
+ * Deriving the configuration from existing operational state enables reconciliation in case when Honeycomb's persistence
+ * is not available to do the work for us.
+ */
+public final class ConfigDataInitializer extends AbstractDataTreeConverter<SamplePluginState, SamplePlugin> {
+
+ @Inject
+ public ConfigDataInitializer(@Named("honeycomb-initializer") @Nonnull final DataBroker bindingDataBroker) {
+ super(bindingDataBroker, InstanceIdentifier.create(SamplePluginState.class), InstanceIdentifier.create(SamplePlugin.class));
+ }
+
+ @Override
+ public SamplePlugin convert(final SamplePluginState operationalData) {
+ // Transfer all the operational data into configuration
+ return new SamplePluginBuilder()
+ .setPgStreams(operationalData.getPgStreams())
+ .build();
+ }
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/notif/SampleNotificationProducer.java b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/notif/SampleNotificationProducer.java
new file mode 100755
index 00000000..6ae1394a
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/notif/SampleNotificationProducer.java
@@ -0,0 +1,86 @@
+/*
+ * 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 io.fd.honeycomb.tutorial.notif;
+
+import io.fd.honeycomb.notification.ManagedNotificationProducer;
+import io.fd.honeycomb.notification.NotificationCollector;
+import java.util.Collection;
+import java.util.Collections;
+import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.SampleNotification;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.SampleNotificationBuilder;
+import org.opendaylight.yangtools.yang.binding.Notification;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Notification producer for sample plugin
+ */
+public class SampleNotificationProducer implements ManagedNotificationProducer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(SampleNotificationProducer.class);
+
+ private Thread thread;
+
+ @Override
+ public void start(@Nonnull final NotificationCollector collector) {
+ LOG.info("Starting notification stream for interfaces");
+
+ // Simulating notification producer
+ thread = new Thread(() -> {
+ while(true) {
+ if (Thread.currentThread().isInterrupted()) {
+ return;
+ }
+
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ break;
+ }
+
+ final SampleNotification notification = new SampleNotificationBuilder()
+ .setContent("Hello world " + System.currentTimeMillis())
+ .build();
+ LOG.info("Emitting notification: {}", notification);
+ collector.onNotification(notification);
+ }
+ }, "NotificationProducer");
+ thread.setDaemon(true);
+ thread.start();
+ }
+
+ @Override
+ public void stop() {
+ if(thread != null) {
+ thread.interrupt();
+ }
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Class<? extends Notification>> getNotificationTypes() {
+ // Producing only this single type of notification
+ return Collections.singleton(SampleNotification.class);
+ }
+
+ @Override
+ public void close() throws Exception {
+ stop();
+ }
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/ModuleWriterFactory.java b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/ModuleWriterFactory.java
new file mode 100755
index 00000000..ad7669b5
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/ModuleWriterFactory.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+/*
+ * Modifications copyright (c) 2017 AT&T Intellectual Property
+ */
+package io.fd.honeycomb.tutorial.write;
+
+import com.google.inject.Inject;
+import io.fd.honeycomb.translate.impl.write.GenericWriter;
+import io.fd.honeycomb.translate.v3po.util.NamingContext;
+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.sample.plugin.rev160918.SamplePlugin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.sample.plugin.params.PgStreams;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.sample.plugin.params.pg.streams.PgStream;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.openvpp.jvpp.core.future.FutureJVppCore;
+
+/**
+ * Factory producing writers for sample-plugin plugin's data.
+ */
+public final class ModuleWriterFactory implements WriterFactory {
+
+ private static final InstanceIdentifier<SamplePlugin> ROOT_CONTAINER_ID = InstanceIdentifier.create(SamplePlugin.class);
+
+ /**
+ * Injected vxlan naming context shared with writer, provided by this plugin
+ */
+ @Inject
+ private NamingContext pgNamingContext;
+ /**
+ * Injected jvpp core APIs, provided by Honeycomb's infrastructure
+ */
+ @Inject
+ private FutureJVppCore jvppCore;
+
+ @Override
+ public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) {
+ // Unlike ReaderFactory, there's no need to add structural writers, just the writers that actually do something
+
+ // register writer for vxlan tunnel
+ registry.add(new GenericWriter<>(
+ // What part of subtree this writer handles is identified by an InstanceIdentifier
+ ROOT_CONTAINER_ID.child(PgStreams.class).child(PgStream.class),
+ // Customizer (the actual translation code to do the heavy lifting)
+ new PgWriteCustomizer(jvppCore, pgNamingContext)));
+ }
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/PgWriteCustomizer.java b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/PgWriteCustomizer.java
new file mode 100755
index 00000000..7a146f6c
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/sample-plugin-impl/src/main/java/io/fd/honeycomb/tutorial/write/PgWriteCustomizer.java
@@ -0,0 +1,155 @@
+/*
+ * 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.
+ */
+
+ /*
+ * Modifications copyright (c) 2017 AT&T Intellectual Property
+ */
+
+package io.fd.honeycomb.tutorial.write;
+
+import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
+import io.fd.honeycomb.translate.v3po.util.NamingContext;
+import io.fd.honeycomb.translate.v3po.util.TranslateUtils;
+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.sample.plugin.rev160918.sample.plugin.params.pg.streams.PgStream;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.sample.plugin.rev160918.sample.plugin.params.pg.streams.PgStreamKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.openvpp.jvpp.VppBaseCallException;
+import org.openvpp.jvpp.core.dto.PgEnableDisable;
+import org.openvpp.jvpp.core.dto.PgEnableDisableReply;
+import org.openvpp.jvpp.core.future.FutureJVppCore;
+
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Writer for {@link VxlanTunnel} list node from our YANG model.
+ */
+public final class PgWriteCustomizer implements ListWriterCustomizer<PgStream, PgStreamKey> {
+
+
+ private static final Logger LOG = LoggerFactory.getLogger(PgWriteCustomizer.class);
+
+ /**
+ * JVpp APIs
+ */
+ private final FutureJVppCore jvppCore;
+ /**
+ * Shared vxlan tunnel naming context
+ */
+ private final NamingContext pgStreamNamingContext;
+
+ public PgWriteCustomizer(final FutureJVppCore jvppCore, final NamingContext pgStreamNamingContext) {
+ this.jvppCore = jvppCore;
+ this.pgStreamNamingContext = pgStreamNamingContext;
+ }
+
+ @Override
+ public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<PgStream> id,
+ @Nonnull final PgStream dataAfter,
+ @Nonnull final WriteContext writeContext) throws WriteFailedException {
+ // Create and set vxlan tunnel add request
+ final PgEnableDisable pgEnableDisable = new PgEnableDisable();
+ // 1 for add, 0 for delete
+ //look into this file: ~/vpp/build-root/build-vpp-native/vpp-api/java/jvpp-core/org/openvpp/jvpp/core/dto/PgEnableDisable.java
+ pgEnableDisable.isEnabled = 1;//public byte
+ String sName = dataAfter.getId();
+ //pgEnableDisable.streamName = sName.getBytes();//public byte[]
+ byte[] tempArray = sName.getBytes();
+ LOG.info("Going to copy array!!!");
+ String tempMsg = "";
+ pgEnableDisable.streamName = new byte[tempArray.length+1];
+ for(int i = 0; i < tempArray.length; i++){
+ tempMsg = "copying: i= "+i+" value: "+tempArray[i];
+ LOG.info(tempMsg);
+ pgEnableDisable.streamName[i] = tempArray[i];
+ }
+
+ //System.arraycopy( sName.getBytes(), 0, pgEnableDisable.streamName, 0, sName.length());
+ pgEnableDisable.streamNameLength = sName.length() + 1;//public int
+ String logMsg = "######***** Enabling: "+sName+" len: "+sName.length()+" getBytes:" + Arrays.toString(pgEnableDisable.streamName);
+ LOG.info(logMsg);
+ // dataAfter is the new vxlanTunnel configuration
+ //final boolean isIpv6 = dataAfter.getSrc().getIpv6Address() != null;
+ //vxlanAddDelTunnel.isIpv6 = TranslateUtils.booleanToByte(isIpv6);
+ //vxlanAddDelTunnel.srcAddress = TranslateUtils.ipAddressToArray(isIpv6, dataAfter.getSrc());
+ //vxlanAddDelTunnel.dstAddress = TranslateUtils.ipAddressToArray(isIpv6, dataAfter.getDst());
+ // There are other input parameters that are not exposed by our YANG model, default values will be used
+
+ try {
+ final PgEnableDisableReply replyForWrite = TranslateUtils
+ .getReplyForWrite(jvppCore.pgEnableDisable(pgEnableDisable).toCompletableFuture(), id);
+
+ // VPP returns the index of new vxlan tunnel
+ //final int newVxlanTunnelIndex = replyForWrite.swIfIndex;
+ // It's important to store it in context so that reader knows to which name a vxlan tunnel is mapped
+ pgStreamNamingContext.addName(1, dataAfter.getId(), writeContext.getMappingContext());
+ } catch (VppBaseCallException e) {
+ throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
+ }
+ }
+
+ @Override
+ public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<PgStream> id,
+ @Nonnull final PgStream dataBefore,
+ @Nonnull final PgStream dataAfter, @Nonnull final WriteContext writeContext)
+ throws WriteFailedException {
+ // Not supported at VPP API level, throw exception
+ throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
+ new UnsupportedOperationException("Vxlan tunnel update is not supported by VPP"));
+ }
+
+ @Override
+ public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<PgStream> id,
+ @Nonnull final PgStream dataBefore,
+ @Nonnull final WriteContext writeContext) throws WriteFailedException {
+ // Create and set vxlan tunnel add request
+ //final VxlanAddDelTunnel vxlanAddDelTunnel = new VxlanAddDelTunnel();
+ final PgEnableDisable pgEnableDisable = new PgEnableDisable();
+ // 1 for add, 0 for delete
+ //vxlanAddDelTunnel.isAdd = 0;
+ pgEnableDisable.isEnabled = 0;//public byte
+
+ String sName = dataBefore.getId();
+ pgEnableDisable.streamName = sName.getBytes();//public byte[]
+ pgEnableDisable.streamNameLength = sName.length()+1;//public int
+
+ String logMsg1 = "***** Disabling: "+sName+" len: "+sName.length()+" getBytes:" + Arrays.toString(pgEnableDisable.streamName);
+ LOG.info(logMsg1);
+ // Vxlan tunnel is identified by its attributes when deleting, not index, so set all attributes
+ // dataBefore is the vxlan tunnel that's being deleted
+ //final boolean isIpv6 = dataBefore.getSrc().getIpv6Address() != null;
+ //vxlanAddDelTunnel.isIpv6 = TranslateUtils.booleanToByte(isIpv6);
+ //vxlanAddDelTunnel.srcAddress = TranslateUtils.ipAddressToArray(isIpv6, dataBefore.getSrc());
+ //vxlanAddDelTunnel.dstAddress = TranslateUtils.ipAddressToArray(isIpv6, dataBefore.getDst());
+ // There are other input parameters that are not exposed by our YANG model, default values will be used
+
+ try {
+ // final VxlanAddDelTunnelReply replyForWrite = TranslateUtils
+ // .getReplyForWrite(jvppCore.vxlanAddDelTunnel(vxlanAddDelTunnel).toCompletableFuture(), id);
+ final PgEnableDisableReply replyForWrite = TranslateUtils
+ .getReplyForWrite(jvppCore.pgEnableDisable(pgEnableDisable).toCompletableFuture(), id);
+ // It's important to remove the mapping from context
+ pgStreamNamingContext.removeName(dataBefore.getId(), writeContext.getMappingContext());
+ } catch (VppBaseCallException e) {
+ throw new WriteFailedException.DeleteFailedException(id, e);
+ }
+ }
+}
diff --git a/vnfs/honeycomb_plugin/sample_plugin/settings.xml b/vnfs/honeycomb_plugin/sample_plugin/settings.xml
new file mode 100644
index 00000000..28acd41a
--- /dev/null
+++ b/vnfs/honeycomb_plugin/sample_plugin/settings.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=2 tabstop=2: -->
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+
+ <profiles>
+ <profile>
+ <id>fd.io-release</id>
+ <repositories>
+ <repository>
+ <id>fd.io-mirror</id>
+ <name>fd.io-mirror</name>
+ <url>https://nexus.fd.io/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>fd.io-mirror</id>
+ <name>fd.io-mirror</name>
+ <url>https://nexus.fd.io/content/repositories/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+
+ <profile>
+ <id>fd.io-snapshots</id>
+ <repositories>
+ <repository>
+ <id>fd.io-snapshot</id>
+ <name>fd.io-snapshot</name>
+ <url>https://nexus.fd.io/content/repositories/fd.io.snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>fd.io-snapshot</id>
+ <name>fd.io-snapshot</name>
+ <url>https://nexus.fd.io/content/repositories/fd.io.snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ <profile>
+ <id>opendaylight-snapshots</id>
+ <repositories>
+ <repository>
+ <id>opendaylight-snapshot</id>
+ <name>opendaylight-snapshot</name>
+ <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>opendaylight-shapshot</id>
+ <name>opendaylight-snapshot</name>
+ <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+
+ <activeProfiles>
+ <activeProfile>fd.io-release</activeProfile>
+ <activeProfile>fd.io-snapshots</activeProfile>
+ <activeProfile>opendaylight-snapshots</activeProfile>
+ </activeProfiles>
+</settings> \ No newline at end of file