From d022ca8d078e1731435bf3e69a9a1ff85e7e0c63 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Thu, 11 Aug 2016 15:37:28 +0200 Subject: HONEYCOMB-21 Vpp-integration minimal distribution Change-Id: I1a44028ae38c3ab70aa3a7b173cd0c81c820378a Signed-off-by: Maros Marsalek --- common/impl-parent/pom.xml | 2 + .../resources/assemblies/honeycomb-minimal.xml | 4 +- common/minimal-distribution-parent/pom.xml | 200 +++++++++++++++++++++ common/minimal-distro-parent/pom.xml | 195 -------------------- common/pom.xml | 2 +- infra/minimal-distribution/Readme.adoc | 16 -- infra/minimal-distribution/logs/honeycomb.log | 115 ++++++++++++ infra/minimal-distribution/pom.xml | 2 +- .../java/io/fd/honeycomb/infra/distro/Main.java | 12 +- .../data/ConfigAndOperationalPipelineModule.groovy | 37 ++-- .../infra/distro/data/DataTreeProvider.groovy | 14 +- .../distro/data/HoneycombDOMBrokerProvider.groovy | 8 +- .../data/HoneycombDOMDataBrokerProvider.groovy | 2 - .../HoneycombNotificationManagerProvider.groovy | 3 - .../infra/distro/data/NotificationModule.groovy | 45 ----- .../distro/data/PersistingDataTreeProvider.groovy | 70 ++++++++ .../data/context/ContextPipelineModule.groovy | 27 ++- .../context/RealtimeMappingContextProvider.groovy | 40 +++++ .../initializer/InitializerPipelineModule.groovy | 13 +- .../ModifiableDTDelegInitProvider.groovy | 49 +++++ .../PersistedFileInitializerProvider.groovy | 2 +- .../HoneycombNotification2NetconfProvider.groovy | 4 +- .../netconf/NetconfBindingBrokerProvider.groovy | 2 +- .../netconf/NetconfMdsalMapperProvider.groovy | 2 - .../infra/distro/netconf/NetconfModule.groovy | 26 ++- .../netconf/NetconfMonitoringMapperProvider.groovy | 2 +- .../NetconfMonitoringReaderFactoryProvider.groovy | 2 +- .../NetconfMonitoringServiceProvider.groovy | 2 +- .../NetconfNotificationMapperProvider.groovy | 4 +- ...etconfNotificationsReaderFactoryProvider.groovy | 2 +- .../netconf/NetconfServerDispatcherProvider.groovy | 2 +- .../infra/distro/restconf/RestconfProvider.groovy | 4 +- .../distro/schema/YangBindingProviderModule.groovy | 3 +- .../honeycomb-minimal-resources/WEB-INF/web.xml | 94 ---------- .../config/WEB-INF/web.xml | 110 ++++++++++++ infra/pom.xml | 5 +- .../translate/util/RealtimeMappingContext.java | 87 +++++++++ .../rev160406/RealtimeMappingContextModule.java | 63 +------ samples/minimal-distribution/pom.xml | 2 +- v3po/pom.xml | 3 +- v3po/v3po2vpp/pom.xml | 17 ++ .../v3po/InterfacesStateReaderFactory.java | 153 ++++++++++++++++ .../translate/v3po/InterfacesWriterFactory.java | 178 ++++++++++++++++++ .../SubinterfaceAugmentationWriterFactory.java | 119 ++++++++++++ ...SubinterfaceStateAugmentationReaderFactory.java | 106 +++++++++++ .../io/fd/honeycomb/translate/v3po/V3poModule.java | 94 ++++++++++ .../v3po/VppClassifierHoneycombWriterFactory.java | 66 +++++++ .../translate/v3po/VppClassifierReaderFactory.java | 59 ++++++ .../translate/v3po/VppHoneycombWriterFactory.java | 81 +++++++++ .../v3po/VppStateHoneycombReaderFactory.java | 94 ++++++++++ .../translate/v3po/cfgattrs/V3poConfiguration.java | 28 +++ .../v3po/initializers/InterfacesInitializer.java | 5 +- .../v3po/initializers/VppClasifierInitializer.java | 7 +- .../v3po/initializers/VppInitializer.java | 5 +- .../InterfaceChangeNotificationProducer.java | 7 +- .../rev160406/InterfacesHoneycombWriterModule.java | 157 +--------------- .../InterfacesStateHoneycombReaderModule.java | 135 +------------- .../SubinterfaceAugmentationWriterFactory.java | 119 ------------ ...SubinterfaceStateAugmentationReaderFactory.java | 106 ----------- .../VppClassifierHoneycombWriterModule.java | 45 +---- .../VppClassifierStateHoneycombReaderModule.java | 37 +--- .../rev160406/VppHoneycombWriterModule.java | 64 +------ .../rev160406/VppStateHoneycombReaderModule.java | 68 +------ .../honeycomb-minimal-resources/config/v3po.json | 3 + vpp-common/minimal-distribution/pom.xml | 107 +++++++++++ .../distro/ContextsReaderFactoryProvider.groovy | 40 +++++ .../io/fd/honeycomb/vpp/distro/JVppProvider.groovy | 55 ++++++ .../main/java/io/fd/honeycomb/vpp/distro/Main.java | 32 ++++ .../fd/honeycomb/vpp/distro/VppCommonModule.groovy | 42 +++++ .../vpp/distro/VppConfigAttributes.groovy | 31 ++++ .../honeycomb-minimal-resources/config/jvpp.json | 3 + .../impl/rev141210/ContextReaderModule.java | 6 +- vpp-common/pom.xml | 3 +- vpp-integration/minimal-distribution/pom.xml | 71 ++++++++ .../fd/honeycomb/vpp/integration/distro/Main.java | 36 ++++ vpp-integration/pom.xml | 5 +- 76 files changed, 2222 insertions(+), 1239 deletions(-) create mode 100644 common/minimal-distribution-parent/pom.xml delete mode 100644 common/minimal-distro-parent/pom.xml delete mode 100644 infra/minimal-distribution/Readme.adoc create mode 100644 infra/minimal-distribution/logs/honeycomb.log delete mode 100644 infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/NotificationModule.groovy create mode 100644 infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/PersistingDataTreeProvider.groovy create mode 100644 infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.groovy create mode 100644 infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.groovy delete mode 100644 infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/WEB-INF/web.xml create mode 100644 infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml create mode 100644 infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesStateReaderFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesWriterFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceAugmentationWriterFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceStateAugmentationReaderFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierHoneycombWriterFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierReaderFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppHoneycombWriterFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/cfgattrs/V3poConfiguration.java delete mode 100644 v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceAugmentationWriterFactory.java delete mode 100644 v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceStateAugmentationReaderFactory.java create mode 100644 v3po/v3po2vpp/src/main/resources/honeycomb-minimal-resources/config/v3po.json create mode 100644 vpp-common/minimal-distribution/pom.xml create mode 100644 vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy create mode 100644 vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy create mode 100644 vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/Main.java create mode 100644 vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy create mode 100644 vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppConfigAttributes.groovy create mode 100644 vpp-common/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/jvpp.json create mode 100644 vpp-integration/minimal-distribution/pom.xml create mode 100644 vpp-integration/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/integration/distro/Main.java diff --git a/common/impl-parent/pom.xml b/common/impl-parent/pom.xml index f09996564..4cce01f8b 100644 --- a/common/impl-parent/pom.xml +++ b/common/impl-parent/pom.xml @@ -32,6 +32,8 @@ APACHE_HEADER.txt http://nexus.fd.io/content + 4.1.0 + 1.2.0 diff --git a/common/minimal-assembly-descriptor/src/main/resources/assemblies/honeycomb-minimal.xml b/common/minimal-assembly-descriptor/src/main/resources/assemblies/honeycomb-minimal.xml index 03f403b21..7f9111706 100644 --- a/common/minimal-assembly-descriptor/src/main/resources/assemblies/honeycomb-minimal.xml +++ b/common/minimal-assembly-descriptor/src/main/resources/assemblies/honeycomb-minimal.xml @@ -21,6 +21,7 @@ tar.gz zip + dir @@ -33,9 +34,6 @@ ${project.build.directory}/lib lib - - *.jar - ${project.build.outputDirectory}/honeycomb-minimal-resources diff --git a/common/minimal-distribution-parent/pom.xml b/common/minimal-distribution-parent/pom.xml new file mode 100644 index 000000000..ac67b7921 --- /dev/null +++ b/common/minimal-distribution-parent/pom.xml @@ -0,0 +1,200 @@ + + + + + + http://nexus.fd.io/content + + -Xms128m -Xmx256m + + 4.1.0 + 1.2.0 + 1.3.2-Beryllium-SR2 + 1.0.2-Beryllium-SR2 + 1.19.1 + 9.3.11.v20160721 + 3.1.0 + 2.4.7 + 0.8.2-Beryllium-SR2 + 1.3.2-Beryllium-SR2 + + 5.0.0 + + + 4.0.0 + io.fd.honeycomb.common + minimal-distribution-parent + 1.0.0-SNAPSHOT + pom + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + + javac-with-errorprone + true + true + 1.8 + 1.8 + + + + org.codehaus.plexus + plexus-compiler-javac-errorprone + 2.5 + + + + com.google.errorprone + error_prone_core + 2.0.9 + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + ${main.class} + true + lib/ + false + true + + + config/ + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/lib + true + true + + + + unpack-configuration + prepare-package + + unpack-dependencies + + + **/honeycomb-minimal-resources/ + ${project.build.outputDirectory}/ + + + + + + + + org.codehaus.gmaven + groovy-maven-plugin + 2.0 + + + package + + execute + + + + + import java.nio.file.Paths + + log.info "Generating shell exec script" + def args = properties.getOrDefault("exec.parameters", "") + log.debug "Additional shell exec script properties: ${args}" + def scriptContent = "java ${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar" + log.info "Generating shell exec script as ${scriptContent}" + def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources") + scriptParent.toFile().mkdirs() + def scriptPath = Paths.get(scriptParent.toString(), "honeycomb.sh") + log.info "Writing shell exec script to ${scriptPath}" + scriptPath.toFile().text = scriptContent + + + + + + + + + maven-assembly-plugin + 2.5.3 + + + io.fd.honeycomb.common + minimal-assembly-descriptor + 1.0.0-SNAPSHOT + + + + + create-archive + package + + single + + + + honeycomb-minimal + + + + + + + + + + + + fdio-release + ${nexusproxy}/repositories/fd.io.release/ + + + fdio-snapshot + ${nexusproxy}/repositories/fd.io.snapshot/ + + + diff --git a/common/minimal-distro-parent/pom.xml b/common/minimal-distro-parent/pom.xml deleted file mode 100644 index 0994b667a..000000000 --- a/common/minimal-distro-parent/pom.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - http://nexus.fd.io/content - - -Xms128m -Xmx256m - - 4.1.0 - 1.2.0 - 1.3.2-Beryllium-SR2 - 1.0.2-Beryllium-SR2 - 1.19.1 - 9.3.11.v20160721 - 3.1.0 - 2.4.7 - 0.8.2-Beryllium-SR2 - 1.3.2-Beryllium-SR2 - - 5.0.0 - - - 4.0.0 - io.fd.honeycomb.common - minimal-distribution-parent - 1.0.0-SNAPSHOT - pom - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.3 - - - javac-with-errorprone - true - true - 1.8 - 1.8 - - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - 2.5 - - - - com.google.errorprone - error_prone_core - 2.0.9 - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - ${main.class} - true - lib/ - - - config/ - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.10 - - - copy-dependencies - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - unpack-configuration - prepare-package - - unpack-dependencies - - - **/honeycomb-minimal-resources/ - ${project.build.outputDirectory}/ - - - - - - - - org.codehaus.gmaven - groovy-maven-plugin - 2.0 - - - package - - execute - - - - import java.nio.file.Paths - - log.info "Generating shell exec script" - def args = properties.getOrDefault("exec.parameters", "") - log.debug "Additional shell exec script properties: ${args}" - def scriptContent = "java ${args} -jar ${project.artifactId}-${project.version}.jar" - log.info "Generating shell exec script as ${scriptContent}" - def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources") - scriptParent.toFile().mkdirs() - def scriptPath = Paths.get(scriptParent.toString(), "honeycomb.sh") - log.info "Writing shell exec script to ${scriptPath}" - scriptPath.toFile().text = scriptContent - - - - - - - - - maven-assembly-plugin - 2.5.3 - - - io.fd.honeycomb.common - minimal-assembly-descriptor - 1.0.0-SNAPSHOT - - - - - create-archive - package - - single - - - - honeycomb-minimal - - - - - - - - - - - - fdio-release - ${nexusproxy}/repositories/fd.io.release/ - - - fdio-snapshot - ${nexusproxy}/repositories/fd.io.snapshot/ - - - diff --git a/common/pom.xml b/common/pom.xml index 64f85af11..12f87b9ce 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -31,7 +31,7 @@ impl-parent karaf-parent minimal-assembly-descriptor - minimal-distro-parent + minimal-distribution-parent diff --git a/infra/minimal-distribution/Readme.adoc b/infra/minimal-distribution/Readme.adoc deleted file mode 100644 index 5606b2d2f..000000000 --- a/infra/minimal-distribution/Readme.adoc +++ /dev/null @@ -1,16 +0,0 @@ -= Honeycomb minimal distribution -This is a minimal, statically wired distribution of Honeycomb. It wires all the dependencies from Opendaylight with -Honeycomb infrastructure code in order to provide a lightweight runnable distribution utilizing Google's guice for DI. - -It is lightweight because: - -1. Not using ODL's config subsystem -2. Not using ODL's global (clustered) MD-SAL -3. Wiring only minimal necessary subset of ODL components together - -== How to build&use -Regular maven build (install) creates an ${project.artifactId}-${project.version}-infra.zip (or tar.gz) that can be -unpacked and HC can be started using honeycomb.sh script - -== How to run from IntelliJ -Just mark the src/config folder as resources root and you should be able to run Main from Intellij \ No newline at end of file diff --git a/infra/minimal-distribution/logs/honeycomb.log b/infra/minimal-distribution/logs/honeycomb.log new file mode 100644 index 000000000..942161f55 --- /dev/null +++ b/infra/minimal-distribution/logs/honeycomb.log @@ -0,0 +1,115 @@ +2016-08-12 13:17:37.976 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting honeycomb +2016-08-12 13:19:29.097 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting honeycomb +2016-08-12 13:21:01.988 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting honeycomb +2016-08-12 13:21:02.748 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: ModuleInfoBackedCtxProvider{writerFactories=[org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.general.entity.rev150820.$YangModelBindingProvider@4f2613d1, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.spi.entity.ownership.service.rev150810.$YangModelBindingProvider@773f7880, org.opendaylight.yang.gen.v1.instance.identifier.patch.module.rev151121.$YangModelBindingProvider@4c51bb7, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.rest.connector.rev140724.$YangModelBindingProvider@5b080f3a, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.sal.restconf.service.rev150708.$YangModelBindingProvider@665e9289, org.opendaylight.yang.gen.v1.urn.sal.restconf.event.subscription.rev140708.$YangModelBindingProvider@2756c0a7, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.impl.rev131028.$YangModelBindingProvider@71984c3, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.rev131028.$YangModelBindingProvider@277f7dd3, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.$YangModelBindingProvider@470a696f, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.$YangModelBindingProvider@2b491fee, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.$YangModelBindingProvider@5ddabb18, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.inmemory.datastore.provider.rev140617.$YangModelBindingProvider@50eca7c6, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.$YangModelBindingProvider@376a312c, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev131019.$YangModelBindingProvider@5ef0d29e, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.$YangModelBindingProvider@3ce3db41, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.$YangModelBindingProvider@e260766, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.netconf.northbound.impl.rev150112.$YangModelBindingProvider@4275c20c, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.$YangModelBindingProvider@40258c2f, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210.$YangModelBindingProvider@16f7b4af, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.netconf.northbound.rev150114.$YangModelBindingProvider@58bf8650, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.north.mapper.rev150114.$YangModelBindingProvider@4ba534b0, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.notification.rev150806.$YangModelBindingProvider@2cb3d0f7, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.$YangModelBindingProvider@6a66a204, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.$YangModelBindingProvider@42f3156d, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.$YangModelBindingProvider@24bdb479, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.notification.impl.rev150807.$YangModelBindingProvider@2c7d121c, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.protocol.framework.rev140313.$YangModelBindingProvider@419a20a6, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.ssh.rev150114.$YangModelBindingProvider@10fde30a, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.netconf.auth.rev150715.$YangModelBindingProvider@346939bf, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.rev130409.$YangModelBindingProvider@74e47444, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.rev131119.$YangModelBindingProvider@39dcf4b0, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.mdsal.notification.rev150803.$YangModelBindingProvider@46f699d5, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.mdsal.monitoring.rev150218.$YangModelBindingProvider@768ccdc5, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.mdsal.mapper.rev150114.$YangModelBindingProvider@659eef7, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.tcp.rev150423.$YangModelBindingProvider@1c9f0a20, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.spi.config.dom.store.rev140617.$YangModelBindingProvider@7db82169, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.common.rev131028.$YangModelBindingProvider@3276732, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.spi.operational.dom.store.rev140617.$YangModelBindingProvider@19fe4644, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.rev131028.$YangModelBindingProvider@7383eae2, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.$YangModelBindingProvider@24fb6a80, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.$YangModelBindingProvider@6722db6e, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.api.rev160411.$YangModelBindingProvider@7a48e6e2, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.translate.api.rev160406.$YangModelBindingProvider@5049d8b2, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.core.general.entity.rev150930.$YangModelBindingProvider@2a3591c5, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.translate.utils.rev160406.$YangModelBindingProvider@107ed6fc, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.$YangModelBindingProvider@2e029d61, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.notification.api.rev160601.$YangModelBindingProvider@132ddbab, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.init.rev160407.$YangModelBindingProvider@5bf22f18, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.$YangModelBindingProvider@28276e50, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.$YangModelBindingProvider@675d8c96, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.notification.impl.rev160601.$YangModelBindingProvider@63648ee9]} +2016-08-12 13:21:03.276 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.schema.SerializerProvider(org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext@1a78dacd) +2016-08-12 13:21:04.048 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider(org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext@1a78dacd) +2016-08-12 13:21:04.058 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataTreeProvider$ConfigDataTreeProvider() +2016-08-12 13:21:04.088 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.PersistingDataTreeProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:21:04.116 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.config.WriterRegistryProvider([]) +2016-08-12 13:21:04.147 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataTreeProvider$ContextDataTreeProvider() +2016-08-12 13:21:04.147 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.PersistingDataTreeProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:21:04.148 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.context.ModifiableDTMgrProvider(io.fd.honeycomb.data.impl.PersistingDataTreeAdapter@574b7f4a) +2016-08-12 13:21:04.151 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.context.HoneycombContextDOMDataBrokerProvider(io.fd.honeycomb.data.impl.ModifiableDataTreeManager@57cb70be) +2016-08-12 13:21:04.158 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider(io.fd.honeycomb.data.impl.DataBroker@5981f4a6, org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@63dfada0) +2016-08-12 13:21:04.164 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.ModifiableDTDelegProvider(org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@63dfada0, io.fd.honeycomb.data.impl.PersistingDataTreeAdapter@427ae189, io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder@16a9eb2e, org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@76332405) +2016-08-12 13:21:04.183 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataStoreProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, config, CONFIGURATION) +2016-08-12 13:21:04.204 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataStoreProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, operational, OPERATIONAL) +2016-08-12 13:21:04.204 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.InmemoryDOMDataBrokerProvider(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore@4fa822ad, org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore@597f0937) +2016-08-12 13:21:04.238 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider(org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker@4fd05028, org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@63dfada0) +2016-08-12 13:21:04.240 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMonitoringReaderFactoryProvider(org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@7b81616b) +2016-08-12 13:21:04.245 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfNotificationsReaderFactoryProvider(org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@7b81616b) +2016-08-12 13:21:04.248 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.oper.ReaderRegistryProvider([org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.NetconfMonitoringReaderModule$NetconfMonitoringReaderFactory@4b5a078a, io.fd.honeycomb.infra.distro.netconf.NetconfNotificationsReaderFactoryProvider$1@39909d1a]) +2016-08-12 13:21:04.295 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.oper.ReadableDTDelegProvider(org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@63dfada0, io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder@4a8e6e89, org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@76332405) +2016-08-12 13:21:04.323 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Honeycomb configuration: io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin) +2016-08-12 13:21:04.324 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting RESTCONF +2016-08-12 13:21:04.336 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.HoneycombDOMDataBrokerProvider(io.fd.honeycomb.data.impl.ModifiableDataTreeDelegator@69f0b0f4, io.fd.honeycomb.data.impl.ReadableDataTreeDelegator@66933239) +2016-08-12 13:21:04.341 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DOMNotificationServiceProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:21:04.365 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.HoneycombDOMBrokerProvider(io.fd.honeycomb.data.impl.DataBroker@60a19573, io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter@44a085e5) +2016-08-12 13:21:04.373 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.restconf.RestconfProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.impl.NorthboundFacadeHoneycombDOMBroker@64f981e2) +2016-08-12 13:21:04.585 CEST [Web socket server on port PortNumber [_value=7779]] INFO o.o.n.s.s.w.WebSocketServer - Web socket server started at port 7779. +2016-08-12 13:21:05.332 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting NETCONF +2016-08-12 13:21:05.334 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMdsalMapperProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66, org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext@1a78dacd, io.fd.honeycomb.impl.NorthboundFacadeHoneycombDOMBroker@64f981e2) +2016-08-12 13:21:05.370 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfBindingBrokerProvider(org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@7b81616b) +2016-08-12 13:21:05.375 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfNotificationMapperProvider(org.opendaylight.netconf.notifications.impl.NetconfNotificationManager@614df0a4, org.opendaylight.netconf.notifications.impl.NetconfNotificationManager@614df0a4, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.NetconfBindingBrokerModule$FakeBindingAwareBroker@3830f918, org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@7b81616b, org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66) +2016-08-12 13:21:05.515 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMonitoringServiceProvider(org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66) +2016-08-12 13:21:05.529 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMonitoringMapperProvider(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.NetconfBindingBrokerModule$FakeBindingAwareBroker@3830f918, org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66, org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl@496cc217) +2016-08-12 13:21:05.666 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NettyTimerProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:21:05.683 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NettyThreadGroupProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:21:05.702 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfServerDispatcherProvider(org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66, org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl@496cc217, io.netty.util.HashedWheelTimer@36d582cb, io.netty.channel.nio.NioEventLoopGroup@6c2a95d5) +2016-08-12 13:21:05.728 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfTcpServerProvider(org.opendaylight.netconf.impl.NetconfServerDispatcherImpl@14e750c5, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:21:05.785 CEST [nioEventLoopGroup-4-1] INFO i.f.h.i.d.n.NetconfTcpServerProvider - Netconf TCP endpoint started successfully at /127.0.0.1:7777 +2016-08-12 13:21:05.804 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfSshServerProvider(org.opendaylight.netconf.impl.NetconfServerDispatcherImpl@14e750c5, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.netty.channel.nio.NioEventLoopGroup@6c2a95d5) +2016-08-12 13:21:06.447 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.HoneycombNotificationManagerProvider(org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter@44a085e5, [], org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@63dfada0) +2016-08-12 13:21:06.466 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.HoneycombNotification2NetconfProvider(org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter@44a085e5, io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.notification.impl.HoneycombNotificationCollector@1c9975a8, org.opendaylight.netconf.notifications.impl.NetconfNotificationManager@614df0a4) +2016-08-12 13:21:06.489 CEST [nioEventLoopGroup-4-2] INFO i.f.h.i.d.n.NetconfSshServerProvider - Netconf SSH endpoint started successfully at /0.0.0.0:2831 +2016-08-12 13:21:06.497 CEST [main] INFO i.f.h.i.d.n.HoneycombNotification2NetconfProvider - Exposing NETCONF notification stream: honeycomb +2016-08-12 13:21:06.499 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Honeycomb started successfully! +2016-08-12 13:21:06.499 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Initializing configuration +2016-08-12 13:21:06.505 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.initializer.PersistedFileInitializerProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.data.impl.DataBroker@5981f4a6) +2016-08-12 13:21:06.514 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.initializer.PersistedFileInitializerProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.data.impl.DataBroker@60a19573) +2016-08-12 13:21:06.515 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.initializer.InitializerRegistryProvider(io.fd.honeycomb.data.init.RestoringInitializer@49665f92, io.fd.honeycomb.data.init.RestoringInitializer@b68932b, []) +2016-08-12 13:21:06.519 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Config initialization started +2016-08-12 13:21:06.543 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Persisted context restored successfully +2016-08-12 13:21:06.544 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Configuration initialized successfully +2016-08-12 13:21:06.555 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Persisted configuration restored successfully +2016-08-12 13:21:06.556 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Honeycomb initialized +2016-08-12 13:21:06.556 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Configuration initialized successfully +2016-08-12 13:21:06.556 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Honeycomb started successfully! +2016-08-12 13:27:32.452 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting honeycomb +2016-08-12 13:29:00.304 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting honeycomb +2016-08-12 13:29:01.098 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: ModuleInfoBackedCtxProvider{writerFactories=[org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.general.entity.rev150820.$YangModelBindingProvider@4f2613d1, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.spi.entity.ownership.service.rev150810.$YangModelBindingProvider@773f7880, org.opendaylight.yang.gen.v1.instance.identifier.patch.module.rev151121.$YangModelBindingProvider@4c51bb7, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.rest.connector.rev140724.$YangModelBindingProvider@5b080f3a, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.sal.restconf.service.rev150708.$YangModelBindingProvider@665e9289, org.opendaylight.yang.gen.v1.urn.sal.restconf.event.subscription.rev140708.$YangModelBindingProvider@2756c0a7, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.impl.rev131028.$YangModelBindingProvider@71984c3, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.rev131028.$YangModelBindingProvider@277f7dd3, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.$YangModelBindingProvider@470a696f, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.$YangModelBindingProvider@2b491fee, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.$YangModelBindingProvider@5ddabb18, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.inmemory.datastore.provider.rev140617.$YangModelBindingProvider@50eca7c6, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.$YangModelBindingProvider@376a312c, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev131019.$YangModelBindingProvider@5ef0d29e, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.$YangModelBindingProvider@3ce3db41, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.$YangModelBindingProvider@e260766, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.netconf.northbound.impl.rev150112.$YangModelBindingProvider@4275c20c, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.$YangModelBindingProvider@40258c2f, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210.$YangModelBindingProvider@16f7b4af, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.netconf.northbound.rev150114.$YangModelBindingProvider@58bf8650, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.north.mapper.rev150114.$YangModelBindingProvider@4ba534b0, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.notification.rev150806.$YangModelBindingProvider@2cb3d0f7, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.$YangModelBindingProvider@6a66a204, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.$YangModelBindingProvider@42f3156d, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.$YangModelBindingProvider@24bdb479, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.notification.impl.rev150807.$YangModelBindingProvider@2c7d121c, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.protocol.framework.rev140313.$YangModelBindingProvider@419a20a6, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.ssh.rev150114.$YangModelBindingProvider@10fde30a, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.netconf.auth.rev150715.$YangModelBindingProvider@346939bf, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.rev130409.$YangModelBindingProvider@74e47444, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.rev131119.$YangModelBindingProvider@39dcf4b0, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.mdsal.notification.rev150803.$YangModelBindingProvider@46f699d5, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.mdsal.monitoring.rev150218.$YangModelBindingProvider@768ccdc5, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.mdsal.mapper.rev150114.$YangModelBindingProvider@659eef7, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netconf.northbound.tcp.rev150423.$YangModelBindingProvider@1c9f0a20, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.spi.config.dom.store.rev140617.$YangModelBindingProvider@7db82169, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.common.rev131028.$YangModelBindingProvider@3276732, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.spi.operational.dom.store.rev140617.$YangModelBindingProvider@19fe4644, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.rev131028.$YangModelBindingProvider@7383eae2, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.$YangModelBindingProvider@24fb6a80, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.$YangModelBindingProvider@6722db6e, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.api.rev160411.$YangModelBindingProvider@7a48e6e2, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.translate.api.rev160406.$YangModelBindingProvider@5049d8b2, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.core.general.entity.rev150930.$YangModelBindingProvider@2a3591c5, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.translate.utils.rev160406.$YangModelBindingProvider@107ed6fc, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.$YangModelBindingProvider@2e029d61, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.notification.api.rev160601.$YangModelBindingProvider@132ddbab, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.init.rev160407.$YangModelBindingProvider@5bf22f18, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.$YangModelBindingProvider@28276e50, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.$YangModelBindingProvider@675d8c96, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.notification.impl.rev160601.$YangModelBindingProvider@63648ee9]} +2016-08-12 13:29:01.680 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.schema.SerializerProvider(org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext@1a78dacd) +2016-08-12 13:29:02.472 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider(org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext@1a78dacd) +2016-08-12 13:29:02.479 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataTreeProvider$ConfigDataTreeProvider() +2016-08-12 13:29:02.513 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.PersistingDataTreeProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:29:02.539 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.config.WriterRegistryProvider([]) +2016-08-12 13:29:02.567 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataTreeProvider$ContextDataTreeProvider() +2016-08-12 13:29:02.567 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.PersistingDataTreeProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:29:02.568 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.context.ModifiableDTMgrProvider(io.fd.honeycomb.data.impl.PersistingDataTreeAdapter@44065156) +2016-08-12 13:29:02.571 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.context.HoneycombContextDOMDataBrokerProvider(io.fd.honeycomb.data.impl.ModifiableDataTreeManager@43f9dd56) +2016-08-12 13:29:02.577 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider(io.fd.honeycomb.data.impl.DataBroker@54db056b, org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@d5af0a5) +2016-08-12 13:29:02.583 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.ModifiableDTDelegProvider(org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@d5af0a5, io.fd.honeycomb.data.impl.PersistingDataTreeAdapter@4784efd9, io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder@3fba233d, org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@427ae189) +2016-08-12 13:29:02.605 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataStoreProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, config, CONFIGURATION) +2016-08-12 13:29:02.626 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DataStoreProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, operational, OPERATIONAL) +2016-08-12 13:29:02.627 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.InmemoryDOMDataBrokerProvider(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore@3662bdff, org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore@1bb15351) +2016-08-12 13:29:02.665 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider(org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker@7c112f5f, org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@d5af0a5) +2016-08-12 13:29:02.667 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMonitoringReaderFactoryProvider(org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@439e3cb4) +2016-08-12 13:29:02.671 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfNotificationsReaderFactoryProvider(org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@439e3cb4) +2016-08-12 13:29:02.674 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.oper.ReaderRegistryProvider([org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.NetconfMonitoringReaderModule$NetconfMonitoringReaderFactory@36c281ed, io.fd.honeycomb.infra.distro.netconf.NetconfNotificationsReaderFactoryProvider$1@4bd5849e]) +2016-08-12 13:29:02.725 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.oper.ReadableDTDelegProvider(org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@d5af0a5, io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder@1e1b061, org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@427ae189) +2016-08-12 13:29:02.741 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Honeycomb configuration: io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin) +2016-08-12 13:29:02.742 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting RESTCONF +2016-08-12 13:29:02.750 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.HoneycombDOMDataBrokerProvider(io.fd.honeycomb.data.impl.ModifiableDataTreeDelegator@2b5c4f17, io.fd.honeycomb.data.impl.ReadableDataTreeDelegator@6ca8fcf3) +2016-08-12 13:29:02.757 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.DOMNotificationServiceProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:29:02.777 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.HoneycombDOMBrokerProvider(io.fd.honeycomb.data.impl.DataBroker@60d6fdd4, io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter@66f28a1f) +2016-08-12 13:29:02.784 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.restconf.RestconfProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.impl.NorthboundFacadeHoneycombDOMBroker@59c70ceb) +2016-08-12 13:29:03.036 CEST [Web socket server on port PortNumber [_value=7779]] INFO o.o.n.s.s.w.WebSocketServer - Web socket server started at port 7779. +2016-08-12 13:29:03.767 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Starting NETCONF +2016-08-12 13:29:03.770 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMdsalMapperProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66, org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext@1a78dacd, io.fd.honeycomb.impl.NorthboundFacadeHoneycombDOMBroker@59c70ceb) +2016-08-12 13:29:03.803 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfBindingBrokerProvider(org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@439e3cb4) +2016-08-12 13:29:03.806 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfNotificationMapperProvider(org.opendaylight.netconf.notifications.impl.NetconfNotificationManager@614df0a4, org.opendaylight.netconf.notifications.impl.NetconfNotificationManager@614df0a4, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.NetconfBindingBrokerModule$FakeBindingAwareBroker@58feb6b0, org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter@439e3cb4, org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66) +2016-08-12 13:29:03.957 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMonitoringServiceProvider(org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66) +2016-08-12 13:29:03.972 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfMonitoringMapperProvider(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210.NetconfBindingBrokerModule$FakeBindingAwareBroker@58feb6b0, org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66, org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl@2ca54da9) +2016-08-12 13:29:04.105 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NettyTimerProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:29:04.118 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NettyThreadGroupProvider(io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:29:04.151 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfServerDispatcherProvider(org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory@1199fe66, org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl@2ca54da9, io.netty.util.HashedWheelTimer@226d5af0, io.netty.channel.nio.NioEventLoopGroup@527937d0) +2016-08-12 13:29:04.193 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfTcpServerProvider(org.opendaylight.netconf.impl.NetconfServerDispatcherImpl@7911cc15, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin)) +2016-08-12 13:29:04.255 CEST [nioEventLoopGroup-4-1] INFO i.f.h.i.d.n.NetconfTcpServerProvider - Netconf TCP endpoint started successfully at /127.0.0.1:7777 +2016-08-12 13:29:04.255 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.NetconfSshServerProvider(org.opendaylight.netconf.impl.NetconfServerDispatcherImpl@7911cc15, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.netty.channel.nio.NioEventLoopGroup@527937d0) +2016-08-12 13:29:04.922 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.data.HoneycombNotificationManagerProvider(org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter@66f28a1f, [], org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec@d5af0a5) +2016-08-12 13:29:04.944 CEST [nioEventLoopGroup-4-2] INFO i.f.h.i.d.n.NetconfSshServerProvider - Netconf SSH endpoint started successfully at /0.0.0.0:2831 +2016-08-12 13:29:04.945 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.netconf.HoneycombNotification2NetconfProvider(org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter@66f28a1f, io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.notification.impl.HoneycombNotificationCollector@58a7a58d, org.opendaylight.netconf.notifications.impl.NetconfNotificationManager@614df0a4) +2016-08-12 13:29:04.968 CEST [main] INFO i.f.h.i.d.n.HoneycombNotification2NetconfProvider - Exposing NETCONF notification stream: honeycomb +2016-08-12 13:29:04.972 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Honeycomb started successfully! +2016-08-12 13:29:04.973 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Initializing configuration +2016-08-12 13:29:04.981 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.initializer.PersistedFileInitializerProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.data.impl.DataBroker@54db056b) +2016-08-12 13:29:04.991 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.initializer.PersistedFileInitializerProvider(io.fd.honeycomb.infra.distro.schema.SchemaServiceProvider$StaticSchemaService@23f86d8a, io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration(peristContextPath:persist/context/data.json, persistedContextRestorationType:Merge, peristConfigPath:persist/config/data.json, persistedConfigRestorationType:Merge, notificationServiceQueueDepth:1, restconfWebsocketPort:7779, restconfPort:8181, restconfRootPath:/restconf, netconfNettyThreads:Optional[2], netconfTcpBindingAddress:Optional[127.0.0.1], netconfTcpBindingPort:Optional[7777], netconfSshBindingAddress:0.0.0.0, netconfSshBindingPort:2831, netconfNotificationStreamName:honeycomb, username:admin, password:admin), io.fd.honeycomb.data.impl.DataBroker@60d6fdd4) +2016-08-12 13:29:04.993 CEST [main] INFO i.f.h.infra.distro.ProviderTrait - Providing: io.fd.honeycomb.infra.distro.initializer.InitializerRegistryProvider(io.fd.honeycomb.data.init.RestoringInitializer@195cbf5e, io.fd.honeycomb.data.init.RestoringInitializer@4cb82b09, []) +2016-08-12 13:29:04.998 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Config initialization started +2016-08-12 13:29:05.025 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Persisted context restored successfully +2016-08-12 13:29:05.026 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Configuration initialized successfully +2016-08-12 13:29:05.043 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Persisted configuration restored successfully +2016-08-12 13:29:05.044 CEST [main] INFO i.f.h.i.d.i.InitializerRegistryProvider - Honeycomb initialized +2016-08-12 13:29:05.044 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Configuration initialized successfully +2016-08-12 13:29:05.045 CEST [main] INFO io.fd.honeycomb.infra.distro.Main - Honeycomb started successfully! diff --git a/infra/minimal-distribution/pom.xml b/infra/minimal-distribution/pom.xml index 8d284b340..43f7a1100 100644 --- a/infra/minimal-distribution/pom.xml +++ b/infra/minimal-distribution/pom.xml @@ -19,7 +19,7 @@ io.fd.honeycomb.common minimal-distribution-parent 1.0.0-SNAPSHOT - ../../common/minimal-distro-parent + ../../common/minimal-distribution-parent 4.0.0 diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java index d715c592d..ff85cd2a7 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java @@ -38,7 +38,6 @@ import io.fd.honeycomb.infra.distro.netconf.NetconfTcpServerProvider; import io.fd.honeycomb.infra.distro.restconf.RestconfModule; import io.fd.honeycomb.infra.distro.schema.SchemaModule; import io.fd.honeycomb.infra.distro.schema.YangBindingProviderModule; -import io.fd.honeycomb.infra.distro.data.NotificationModule; import java.util.List; import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory; import org.opendaylight.netconf.sal.rest.api.RestConnector; @@ -54,7 +53,6 @@ public final class Main { // Infra new YangBindingProviderModule(), new SchemaModule(), - new NotificationModule(), new ConfigAndOperationalPipelineModule(), new ContextPipelineModule(), new InitializerPipelineModule(), @@ -69,7 +67,7 @@ public final class Main { init(BASE_MODULES); } - public static void init(final List modules) { + public static Injector init(final List modules) { LOG.info("Starting honeycomb"); Injector injector = Guice.createInjector(modules); @@ -88,11 +86,11 @@ public final class Main { LOG.info("Starting NETCONF"); injector.getInstance( - Key.get(NetconfOperationServiceFactory.class, Names.named(NetconfModule.NETCONF_MAPPER_HONEYCOMB))); + Key.get(NetconfOperationServiceFactory.class, Names.named("netconf-mapper-honeycomb"))); injector.getInstance( - Key.get(NetconfOperationServiceFactory.class, Names.named(NetconfModule.NETCONF_MAPPER_NOTIFICATION))); + Key.get(NetconfOperationServiceFactory.class, Names.named("netconf-mapper-notification"))); injector.getInstance( - Key.get(NetconfOperationServiceFactory.class, Names.named(NetconfModule.NETCONF_MAPPER_MONITORING))); + Key.get(NetconfOperationServiceFactory.class, Names.named("netconf-mapper-monitoring"))); if (cfgAttributes.isNetconfTcpServerEnabled()) { injector.getInstance(NetconfTcpServerProvider.NetconfTcpServer.class); @@ -112,5 +110,7 @@ public final class Main { } LOG.info("Honeycomb started successfully!"); + + return injector; } } diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.groovy index 01ec8c16a..ede905d06 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.groovy @@ -31,34 +31,42 @@ import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder import org.opendaylight.controller.md.sal.binding.api.DataBroker import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker +import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter +import org.opendaylight.controller.sal.core.api.Broker import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree @Slf4j class ConfigAndOperationalPipelineModule extends PrivateModule { protected void configure() { - // Expose registries + // Expose registries for plugin reader/writer factories bind(ModifiableWriterRegistryBuilder).toProvider(WriterRegistryProvider).in(Singleton) expose(ModifiableWriterRegistryBuilder) bind(ModifiableReaderRegistryBuilder).toProvider(ReaderRegistryProvider).in(Singleton) expose(ModifiableReaderRegistryBuilder) - def dataTreeProvider = new DataTreeProvider.ConfigDataTreeProvider() - bind(DataTree).annotatedWith(Names.named("honeycomb-config")).toProvider(dataTreeProvider).in(Singleton) + // Non persisting data tree + bind(DataTree) + .annotatedWith(Names.named("honeycomb-config-nopersist")) + .toProvider(DataTreeProvider.ConfigDataTreeProvider) + .in(Singleton) + expose(DataTree).annotatedWith(Names.named("honeycomb-config-nopersist")) + // Persisting data tree wrapper + bind(DataTree) + .annotatedWith(Names.named("honeycomb-config")) + .toProvider(PersistingDataTreeProvider.ConfigPersistingDataTreeProvider) + .in(Singleton) expose(DataTree).annotatedWith(Names.named("honeycomb-config")) bind(ModifiableDataManager).toProvider(ModifiableDTDelegProvider).in(Singleton) - bind(ReadableDataManager) - .annotatedWith(Names.named("honeycomb-operational")) - .toProvider(ReadableDTDelegProvider).in(Singleton) - // Expose reader for initializer - expose(ReadableDataManager).annotatedWith(Names.named("honeycomb-operational")) + bind(ReadableDataManager).toProvider(ReadableDTDelegProvider).in(Singleton) + expose(ReadableDataManager) def domBrokerProvider = new HoneycombDOMDataBrokerProvider() - bind(DOMDataBroker).annotatedWith(Names.named("honeycomb-config")).toProvider(domBrokerProvider).in(Singleton) +// bind(DOMDataBroker).annotatedWith(Names.named("honeycomb-config")).toProvider(domBrokerProvider).in(Singleton) // Bind also without annotation for easy private injection bind(DOMDataBroker).toProvider(domBrokerProvider).in(Singleton) - expose(DOMDataBroker).annotatedWith(Names.named("honeycomb-config")) + bind(DataBroker).annotatedWith(Names.named("honeycomb-config")).toProvider(BindingDataBrokerProvider).in(Singleton) expose(DataBroker).annotatedWith(Names.named("honeycomb-config")) @@ -67,5 +75,14 @@ class ConfigAndOperationalPipelineModule extends PrivateModule { .toProvider(PersistedFileInitializerProvider.PersistedConfigInitializerProvider) .in(Singleton) expose(DataTreeInitializer).annotatedWith(Names.named("honeycomb-config")) + + configureNotifications() + } + + protected void configureNotifications() { + bind(DOMNotificationRouter).toProvider(DOMNotificationServiceProvider).in(Singleton) + expose(DOMNotificationRouter) + bind(Broker).toProvider(HoneycombDOMBrokerProvider).in(Singleton) + expose(Broker) } } diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/DataTreeProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/DataTreeProvider.groovy index 6915a3cec..bf1f562ec 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/DataTreeProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/DataTreeProvider.groovy @@ -19,16 +19,13 @@ package io.fd.honeycomb.infra.distro.data import com.google.inject.Inject import groovy.transform.ToString import groovy.util.logging.Slf4j -import io.fd.honeycomb.data.impl.PersistingDataTreeAdapter -import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration import org.opendaylight.controller.sal.core.api.model.SchemaService import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory -import java.nio.file.Paths - @Slf4j @ToString abstract class DataTreeProvider extends ProviderTrait { @@ -41,19 +38,20 @@ abstract class DataTreeProvider extends ProviderTrait { def create() { def delegate = InMemoryDataTreeFactory.getInstance().create(getType()) delegate.setSchemaContext(schemaService.getGlobalContext()) - new PersistingDataTreeAdapter(delegate, schemaService, Paths.get(getPath())) + delegate } - abstract String getPath() abstract TreeType getType() + @Slf4j + @ToString static class ConfigDataTreeProvider extends DataTreeProvider { - String getPath() { config.peristConfigPath } TreeType getType() { TreeType.CONFIGURATION } } + @Slf4j + @ToString static class ContextDataTreeProvider extends DataTreeProvider { - String getPath() { config.peristContextPath } TreeType getType() { TreeType.OPERATIONAL } } } diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMBrokerProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMBrokerProvider.groovy index 2b275f7ff..5dc98cded 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMBrokerProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMBrokerProvider.groovy @@ -17,13 +17,12 @@ package io.fd.honeycomb.infra.distro.data import com.google.inject.Inject -import com.google.inject.name.Named import groovy.transform.ToString import groovy.util.logging.Slf4j import io.fd.honeycomb.impl.NorthboundFacadeHoneycombDOMBroker import io.fd.honeycomb.infra.distro.ProviderTrait import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker -import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService +import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter import org.opendaylight.controller.sal.core.api.Broker import org.opendaylight.controller.sal.core.api.model.SchemaService @@ -32,13 +31,12 @@ import org.opendaylight.controller.sal.core.api.model.SchemaService class HoneycombDOMBrokerProvider extends ProviderTrait { @Inject - @Named("honeycomb-config") +// @Named("honeycomb-config") DOMDataBroker domDataBroker @Inject SchemaService schemaService @Inject - @Named("honeycomb") - DOMNotificationService domNotificationService + DOMNotificationRouter domNotificationService def create() { new NorthboundFacadeHoneycombDOMBroker(domDataBroker, schemaService, domNotificationService) } } diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.groovy index e91054b3b..a2fec2a60 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.groovy @@ -17,7 +17,6 @@ package io.fd.honeycomb.infra.distro.data import com.google.inject.Inject -import com.google.inject.name.Named import groovy.transform.ToString import groovy.util.logging.Slf4j import io.fd.honeycomb.data.ModifiableDataManager @@ -34,7 +33,6 @@ class HoneycombDOMDataBrokerProvider extends ProviderTrait { ModifiableDataManager modDataManager @Inject - @Named("honeycomb-operational") ReadableDataManager readDataManager def create() { diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.groovy index f150691a8..473112341 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.groovy @@ -17,7 +17,6 @@ package io.fd.honeycomb.infra.distro.data import com.google.inject.Inject -import com.google.inject.name.Named import groovy.transform.ToString import groovy.util.logging.Slf4j import io.fd.honeycomb.infra.distro.ProviderTrait @@ -29,7 +28,6 @@ import io.fd.honeycomb.notification.impl.NotificationProducerTracker import org.opendaylight.controller.md.sal.binding.impl.BindingDOMNotificationPublishServiceAdapter import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter - /** * Mirror of org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.notification.impl.rev160601.HoneycombNotificationManagerModule */ @@ -38,7 +36,6 @@ import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter class HoneycombNotificationManagerProvider extends ProviderTrait { @Inject - @Named("honeycomb") DOMNotificationRouter notificationRouter @Inject(optional = true) Set notificationProducers = [] diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/NotificationModule.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/NotificationModule.groovy deleted file mode 100644 index 4836a0fbe..000000000 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/NotificationModule.groovy +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.infra.distro.data - -import com.google.inject.AbstractModule -import com.google.inject.Singleton -import com.google.inject.name.Names -import groovy.util.logging.Slf4j -import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService -import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter -import org.opendaylight.controller.sal.core.api.Broker - -@Slf4j -class NotificationModule extends AbstractModule { - - protected void configure() { - def provider = new DOMNotificationServiceProvider() - bind(DOMNotificationService) - .annotatedWith(Names.named("honeycomb")) - .toProvider(provider) - .in(Singleton) - bind(DOMNotificationRouter) - .annotatedWith(Names.named("honeycomb")) - .toProvider(provider) - .in(Singleton) - bind(Broker) - .annotatedWith(Names.named("honeycomb")) - .toProvider(HoneycombDOMBrokerProvider) - .in(Singleton) - } -} diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/PersistingDataTreeProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/PersistingDataTreeProvider.groovy new file mode 100644 index 000000000..753963309 --- /dev/null +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/PersistingDataTreeProvider.groovy @@ -0,0 +1,70 @@ +/* + * 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.infra.distro.data + +import com.google.inject.Inject +import com.google.inject.name.Named +import groovy.transform.ToString +import groovy.util.logging.Slf4j +import io.fd.honeycomb.data.impl.PersistingDataTreeAdapter +import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration +import org.opendaylight.controller.sal.core.api.model.SchemaService +import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree +import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType + +import java.nio.file.Paths + +@Slf4j +@ToString +abstract class PersistingDataTreeProvider extends ProviderTrait { + + @Inject + SchemaService schemaService + @Inject + HoneycombConfiguration config + + def create() { + new PersistingDataTreeAdapter(delegate, schemaService, Paths.get(path)) + } + + abstract String getPath() + abstract TreeType getType() + abstract DataTree getDelegate() + + static class ConfigPersistingDataTreeProvider extends PersistingDataTreeProvider { + + @Inject + @Named("honeycomb-config-nopersist") + DataTree delegate + + String getPath() { config.peristConfigPath } + TreeType getType() { TreeType.CONFIGURATION } + DataTree getDelegate() { return delegate } + } + + static class ContextPersistingDataTreeProvider extends PersistingDataTreeProvider { + + @Inject + @Named("honeycomb-context-nopersist") + DataTree delegate + + String getPath() { config.peristContextPath } + TreeType getType() { TreeType.OPERATIONAL } + DataTree getDelegate() { return delegate } + } +} diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.groovy index 01124131f..25244cb2f 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.groovy @@ -23,7 +23,9 @@ import io.fd.honeycomb.data.ModifiableDataManager import io.fd.honeycomb.data.init.DataTreeInitializer import io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider import io.fd.honeycomb.infra.distro.data.DataTreeProvider +import io.fd.honeycomb.infra.distro.data.PersistingDataTreeProvider import io.fd.honeycomb.infra.distro.initializer.PersistedFileInitializerProvider +import io.fd.honeycomb.translate.MappingContext import org.opendaylight.controller.md.sal.binding.api.DataBroker import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree @@ -32,18 +34,27 @@ class ContextPipelineModule extends PrivateModule { protected void configure() { // Bind also without annotation for easy private injection - def dataTreeProvider = new DataTreeProvider.ContextDataTreeProvider() + + // Non persisting data tree + def noPersistDataTreeProvider = new DataTreeProvider.ContextDataTreeProvider() + bind(DataTree) + .annotatedWith(Names.named("honeycomb-context-nopersist")) + .toProvider(noPersistDataTreeProvider) + .in(Singleton) + expose(DataTree).annotatedWith(Names.named("honeycomb-context-nopersist")) + // Persisting data tree wrapper + def dataTreeProvider = new PersistingDataTreeProvider.ContextPersistingDataTreeProvider() bind(DataTree).toProvider(dataTreeProvider).in(Singleton) - bind(DataTree).annotatedWith(Names.named("honeycomb-context")).toProvider(dataTreeProvider).in(Singleton) - expose(DataTree).annotatedWith(Names.named("honeycomb-context")) +// bind(DataTree).annotatedWith(Names.named("honeycomb-context")).toProvider(dataTreeProvider).in(Singleton) +// expose(DataTree).annotatedWith(Names.named("honeycomb-context")) bind(ModifiableDataManager).toProvider(ModifiableDTMgrProvider).in(Singleton) def domBrokerProvider = new HoneycombContextDOMDataBrokerProvider() - bind(DOMDataBroker).annotatedWith(Names.named("honeycomb-context")).toProvider(domBrokerProvider).in(Singleton) +// bind(DOMDataBroker).annotatedWith(Names.named("honeycomb-context")).toProvider(domBrokerProvider).in(Singleton) // Bind also without annotation for easy private injection bind(DOMDataBroker).toProvider(domBrokerProvider).in(Singleton) - expose(DOMDataBroker).annotatedWith(Names.named("honeycomb-context")) +// expose(DOMDataBroker).annotatedWith(Names.named("honeycomb-context")) bind(DataBroker).annotatedWith(Names.named("honeycomb-context")).toProvider(BindingDataBrokerProvider).in(Singleton) expose(DataBroker).annotatedWith(Names.named("honeycomb-context")) @@ -53,6 +64,12 @@ class ContextPipelineModule extends PrivateModule { .toProvider(PersistedFileInitializerProvider.PersistedContextInitializerProvider) .in(Singleton) expose(DataTreeInitializer).annotatedWith(Names.named("honeycomb-context")) + + bind(MappingContext) + .annotatedWith(Names.named("honeycomb-context")) + .toProvider(RealtimeMappingContextProvider) + .in(Singleton.class) + expose(MappingContext).annotatedWith(Names.named("honeycomb-context")) } } diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.groovy new file mode 100644 index 000000000..3c7eebb3d --- /dev/null +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.groovy @@ -0,0 +1,40 @@ +/* + * 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.infra.distro.data.context + +import com.google.inject.Inject +import com.google.inject.name.Named +import groovy.transform.ToString +import groovy.util.logging.Slf4j +import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.translate.MappingContext +import io.fd.honeycomb.translate.util.RealtimeMappingContext +import org.opendaylight.controller.md.sal.binding.api.DataBroker + +@Slf4j +@ToString +class RealtimeMappingContextProvider extends ProviderTrait { + + @Inject + @Named("honeycomb-context") + DataBroker contextDataBroker + + @Override + def create() { + new RealtimeMappingContext(contextDataBroker) + } +} diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.groovy index 80b52f2b8..10757c1a5 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.groovy @@ -24,9 +24,6 @@ import io.fd.honeycomb.data.ModifiableDataManager import io.fd.honeycomb.data.init.InitializerRegistry import io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider import io.fd.honeycomb.infra.distro.data.HoneycombDOMDataBrokerProvider -import io.fd.honeycomb.infra.distro.data.ModifiableDTDelegProvider -import io.fd.honeycomb.translate.util.write.NoopWriterRegistry -import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder import org.opendaylight.controller.md.sal.binding.api.DataBroker import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker @@ -34,19 +31,11 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker class InitializerPipelineModule extends PrivateModule { protected void configure() { - // Initializer hierarchy uses fake writer registry to not send restored configuration from plugins back to plugins - def registry = new NoopWriterRegistry() - bind(ModifiableWriterRegistryBuilder) - .annotatedWith(Names.named("honeycomb-initializer")) - .toInstance([build: { registry }]) - - // Then just build data tree delegator and DataBrokers on top of it - bind(ModifiableDataManager).toProvider(ModifiableDTDelegProvider).in(Singleton) + bind(ModifiableDataManager).toProvider(ModifiableDTDelegInitProvider).in(Singleton) bind(DOMDataBroker).toProvider(HoneycombDOMDataBrokerProvider).in(Singleton) bind(DataBroker).annotatedWith(Names.named("honeycomb-initializer")).toProvider(BindingDataBrokerProvider).in(Singleton) expose(DataBroker).annotatedWith(Names.named("honeycomb-initializer")) - // NOW do initializer registry bind(InitializerRegistry) .annotatedWith(Names.named("honeycomb-initializer")) .toProvider(InitializerRegistryProvider) diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.groovy new file mode 100644 index 000000000..2a1422dae --- /dev/null +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.groovy @@ -0,0 +1,49 @@ +/* + * 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.infra.distro.initializer + +import com.google.inject.Inject +import com.google.inject.name.Named +import groovy.transform.ToString +import groovy.util.logging.Slf4j +import io.fd.honeycomb.data.ModifiableDataManager +import io.fd.honeycomb.data.impl.ModifiableDataTreeDelegator +import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.translate.util.write.NoopWriterRegistry +import org.opendaylight.controller.md.sal.binding.api.DataBroker +import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec +import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree + +/** + * Similar to ModifiableDTDelegProvider, but uses noop writer registry + */ +@Slf4j +@ToString +class ModifiableDTDelegInitProvider extends ProviderTrait { + + @Inject + BindingToNormalizedNodeCodec serializer + @Inject + @Named("honeycomb-config-nopersist") + DataTree dataTree + @Inject + @Named("honeycomb-context") + DataBroker contextBroker + + @Override + def create() { new ModifiableDataTreeDelegator(serializer, dataTree, new NoopWriterRegistry(), contextBroker) } +} diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/PersistedFileInitializerProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/PersistedFileInitializerProvider.groovy index c2448d234..9b7cfb4ae 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/PersistedFileInitializerProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/initializer/PersistedFileInitializerProvider.groovy @@ -20,8 +20,8 @@ import com.google.inject.Inject import groovy.transform.ToString import groovy.util.logging.Slf4j import io.fd.honeycomb.data.init.RestoringInitializer -import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker import org.opendaylight.controller.sal.core.api.model.SchemaService diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.groovy index a18d2c4f0..726dfb5af 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.groovy @@ -17,11 +17,10 @@ package io.fd.honeycomb.infra.distro.netconf import com.google.inject.Inject -import com.google.inject.name.Named import groovy.transform.ToString import groovy.util.logging.Slf4j -import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration import io.fd.honeycomb.notification.NotificationCollector import io.fd.honeycomb.notification.impl.NotificationProducerRegistry import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter @@ -39,7 +38,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath class HoneycombNotification2NetconfProvider extends ProviderTrait { @Inject - @Named("honeycomb") DOMNotificationRouter notificationRouter @Inject SchemaService schemaService diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfBindingBrokerProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfBindingBrokerProvider.groovy index 8226c8d9e..8c5dcab01 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfBindingBrokerProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfBindingBrokerProvider.groovy @@ -33,7 +33,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycom class NetconfBindingBrokerProvider extends ProviderTrait { @Inject - @Named(NetconfModule.NETCONF) + @Named("netconf") DataBroker dataBroker @Override diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMdsalMapperProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMdsalMapperProvider.groovy index d84af61a8..491eedcef 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMdsalMapperProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMdsalMapperProvider.groovy @@ -17,7 +17,6 @@ package io.fd.honeycomb.infra.distro.netconf import com.google.inject.Inject -import com.google.inject.name.Named import groovy.transform.ToString import groovy.util.logging.Slf4j import io.fd.honeycomb.infra.distro.ProviderTrait @@ -42,7 +41,6 @@ class NetconfMdsalMapperProvider extends ProviderTrait { @Inject - @Named(NetconfModule.NETCONF) + @Named("netconf") BindingAwareBroker bindingAwareBroker @Inject NetconfOperationServiceFactoryListener aggregator diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.groovy index 2945ae6d8..fee1944f4 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.groovy @@ -30,7 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycom class NetconfMonitoringReaderFactoryProvider extends ProviderTrait { @Inject - @Named(NetconfModule.NETCONF) + @Named("netconf") DataBroker netconfDataBroker def create() { new NetconfMonitoringReaderModule.NetconfMonitoringReaderFactory(netconfDataBroker) } diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringServiceProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringServiceProvider.groovy index 5762a0a7f..4592cf4bd 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringServiceProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringServiceProvider.groovy @@ -32,7 +32,7 @@ import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory class NetconfMonitoringServiceProvider extends ProviderTrait { @Inject - @Named(NetconfModule.NETCONF_MAPPER_AGGREGATOR) + @Named("netconf-mapper-aggregator") NetconfOperationServiceFactory aggregator @Override diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfNotificationMapperProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfNotificationMapperProvider.groovy index 57f7038ab..02739290f 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfNotificationMapperProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfNotificationMapperProvider.groovy @@ -50,10 +50,10 @@ class NetconfNotificationMapperProvider extends ProviderTrait { @Inject - @Named(NetconfModule.NETCONF) + @Named("netconf") DataBroker netconfDataBroker def create() { diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfServerDispatcherProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfServerDispatcherProvider.groovy index 072a7f6ae..18019db57 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfServerDispatcherProvider.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfServerDispatcherProvider.groovy @@ -43,7 +43,7 @@ class NetconfServerDispatcherProvider extends ProviderTrait { HoneycombConfiguration cfg @Inject - @Named("honeycomb") Broker domBroker def create() { diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/schema/YangBindingProviderModule.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/schema/YangBindingProviderModule.groovy index ebf473a3b..3ea4bcaa6 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/schema/YangBindingProviderModule.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/schema/YangBindingProviderModule.groovy @@ -18,6 +18,7 @@ package io.fd.honeycomb.infra.distro.schema import com.google.common.base.Charsets import com.google.inject.AbstractModule +import com.google.inject.Singleton import com.google.inject.multibindings.Multibinder import groovy.util.logging.Slf4j import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider @@ -41,7 +42,7 @@ class YangBindingProviderModule extends AbstractModule { .collect { this.getClass().forName(it) } .forEach { log.debug "ModuleProvider found for {}", it - addBinding().to(it) + addBinding().to(it).in(Singleton) } } } diff --git a/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/WEB-INF/web.xml b/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/WEB-INF/web.xml deleted file mode 100644 index b75bdeaec..000000000 --- a/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/WEB-INF/web.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - JAXRSRestconf - com.sun.jersey.spi.container.servlet.ServletContainer - - javax.ws.rs.Application - org.opendaylight.netconf.sal.rest.impl.RestconfApplication - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - JAXRSRestconf - /* - - - - GzipFilter - org.eclipse.jetty.servlets.GzipFilter - - mimeTypes - application/xml,application/yang.data+xml,xml,application/json,application/yang.data+json - - - - - GzipFilter - /* - - - - cross-origin-restconf - org.eclipse.jetty.servlets.CrossOriginFilter - - allowedOrigins - * - - - allowedMethods - GET,POST,OPTIONS,DELETE,PUT,HEAD - - - allowedHeaders - origin, content-type, accept, authorization - - - exposedHeaders - location - - - - cross-origin-restconf - /* - - - - - NB api - /* - POST - GET - PUT - PATCH - DELETE - HEAD - - - - diff --git a/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml b/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml new file mode 100644 index 000000000..4a4adfbd8 --- /dev/null +++ b/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml @@ -0,0 +1,110 @@ + + + + + + + JAXRSRestconf + com.sun.jersey.spi.container.servlet.ServletContainer + + javax.ws.rs.Application + org.opendaylight.netconf.sal.rest.impl.RestconfApplication + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + JAXRSRestconf + /* + + + + GzipFilter + org.eclipse.jetty.servlets.GzipFilter + + mimeTypes + application/xml,application/yang.data+xml,xml,application/json,application/yang.data+json + + + + + GzipFilter + /* + + + + cross-origin-restconf + org.eclipse.jetty.servlets.CrossOriginFilter + + allowedOrigins + * + + + allowedMethods + GET,POST,OPTIONS,DELETE,PUT,HEAD + + + allowedHeaders + origin, content-type, accept, authorization + + + exposedHeaders + location + + + + cross-origin-restconf + /* + + + + + NB api + /* + POST + GET + PUT + PATCH + DELETE + HEAD + + + + diff --git a/infra/pom.xml b/infra/pom.xml index 152f668d5..9f9ea549f 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -42,8 +42,9 @@ cfg-init impl minimal-distribution - karaf - features + + + artifacts it diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java new file mode 100644 index 000000000..3d1b5222f --- /dev/null +++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java @@ -0,0 +1,87 @@ +/* + * 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.translate.util; + +import com.google.common.base.Optional; +import io.fd.honeycomb.translate.MappingContext; +import javax.annotation.Nonnull; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; +import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; +import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public final class RealtimeMappingContext implements MappingContext { + + private DataBroker contextBindingBrokerDependency; + + public RealtimeMappingContext(final DataBroker contextBindingBrokerDependency) { + this.contextBindingBrokerDependency = contextBindingBrokerDependency; + } + + @Override + public Optional read(@Nonnull final InstanceIdentifier currentId) { + try(ReadOnlyTransaction tx = contextBindingBrokerDependency.newReadOnlyTransaction()) { + try { + return tx.read(LogicalDatastoreType.OPERATIONAL, currentId).checkedGet(); + } catch (ReadFailedException e) { + throw new IllegalStateException("Unable to perform read of " + currentId, e); + } + } + } + + @Override + public void delete(final InstanceIdentifier path) { + final WriteTransaction writeTx = contextBindingBrokerDependency.newWriteOnlyTransaction(); + writeTx.delete(LogicalDatastoreType.OPERATIONAL, path); + try { + writeTx.submit().checkedGet(); + } catch (TransactionCommitFailedException e) { + throw new IllegalStateException("Unable to perform delete of " + path, e); + } + } + + @Override + public void merge(final InstanceIdentifier path, final T data) { + final WriteTransaction writeTx = contextBindingBrokerDependency.newWriteOnlyTransaction(); + writeTx.merge(LogicalDatastoreType.OPERATIONAL, path, data); + try { + writeTx.submit().checkedGet(); + } catch (TransactionCommitFailedException e) { + throw new IllegalStateException("Unable to perform merge of " + path, e); + } + } + + @Override + public void put(final InstanceIdentifier path, final T data) { + final WriteTransaction writeTx = contextBindingBrokerDependency.newWriteOnlyTransaction(); + writeTx.put(LogicalDatastoreType.OPERATIONAL, path, data); + try { + writeTx.submit().checkedGet(); + } catch (TransactionCommitFailedException e) { + throw new IllegalStateException("Unable to perform put of " + path, e); + } + } + + @Override + public void close() { + // Noop + } +} diff --git a/infra/translate-utils/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/translate/utils/rev160406/RealtimeMappingContextModule.java b/infra/translate-utils/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/translate/utils/rev160406/RealtimeMappingContextModule.java index d245682d0..f882b9ba4 100644 --- a/infra/translate-utils/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/translate/utils/rev160406/RealtimeMappingContextModule.java +++ b/infra/translate-utils/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/translate/utils/rev160406/RealtimeMappingContextModule.java @@ -1,16 +1,5 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.translate.utils.rev160406; -import com.google.common.base.Optional; -import io.fd.honeycomb.translate.MappingContext; -import javax.annotation.Nonnull; -import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; -import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; - public class RealtimeMappingContextModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.translate.utils.rev160406.AbstractRealtimeMappingContextModule { public RealtimeMappingContextModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -28,57 +17,7 @@ public class RealtimeMappingContextModule extends org.opendaylight.yang.gen.v1.u @Override public java.lang.AutoCloseable createInstance() { // Provides real time CRUD on top of Context data broker - return new MappingContext() { - - @Override - public Optional read(@Nonnull final InstanceIdentifier currentId) { - try(ReadOnlyTransaction tx = getContextBindingBrokerDependency().newReadOnlyTransaction()) { - try { - return tx.read(LogicalDatastoreType.OPERATIONAL, currentId).checkedGet(); - } catch (ReadFailedException e) { - throw new IllegalStateException("Unable to perform read of " + currentId, e); - } - } - } - - @Override - public void delete(final InstanceIdentifier path) { - final WriteTransaction writeTx = getContextBindingBrokerDependency().newWriteOnlyTransaction(); - writeTx.delete(LogicalDatastoreType.OPERATIONAL, path); - try { - writeTx.submit().checkedGet(); - } catch (TransactionCommitFailedException e) { - throw new IllegalStateException("Unable to perform delete of " + path, e); - } - } - - @Override - public void merge(final InstanceIdentifier path, final T data) { - final WriteTransaction writeTx = getContextBindingBrokerDependency().newWriteOnlyTransaction(); - writeTx.merge(LogicalDatastoreType.OPERATIONAL, path, data); - try { - writeTx.submit().checkedGet(); - } catch (TransactionCommitFailedException e) { - throw new IllegalStateException("Unable to perform merge of " + path, e); - } - } - - @Override - public void put(final InstanceIdentifier path, final T data) { - final WriteTransaction writeTx = getContextBindingBrokerDependency().newWriteOnlyTransaction(); - writeTx.put(LogicalDatastoreType.OPERATIONAL, path, data); - try { - writeTx.submit().checkedGet(); - } catch (TransactionCommitFailedException e) { - throw new IllegalStateException("Unable to perform put of " + path, e); - } - } - - @Override - public void close() { - // Noop - } - }; + return new io.fd.honeycomb.translate.util.RealtimeMappingContext(getContextBindingBrokerDependency()); } } diff --git a/samples/minimal-distribution/pom.xml b/samples/minimal-distribution/pom.xml index c8311aead..900d66ae9 100644 --- a/samples/minimal-distribution/pom.xml +++ b/samples/minimal-distribution/pom.xml @@ -19,7 +19,7 @@ io.fd.honeycomb.common minimal-distribution-parent 1.0.0-SNAPSHOT - ../../common/minimal-distro-parent + ../../common/minimal-distribution-parent 4.0.0 diff --git a/v3po/pom.xml b/v3po/pom.xml index f7cb1c2ba..16bc3902a 100644 --- a/v3po/pom.xml +++ b/v3po/pom.xml @@ -34,7 +34,8 @@ api v3po2vpp - features + + diff --git a/v3po/v3po2vpp/pom.xml b/v3po/v3po2vpp/pom.xml index 7bd412681..4848ae949 100644 --- a/v3po/v3po2vpp/pom.xml +++ b/v3po/v3po2vpp/pom.xml @@ -89,6 +89,23 @@ 16.09-SNAPSHOT + + + com.google.inject + guice + ${guice.version} + + + net.jmob + guice.conf + ${guice.config.version} + + + com.google.inject.extensions + guice-multibindings + ${guice.version} + + junit diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesStateReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesStateReaderFactory.java new file mode 100644 index 000000000..3aa68f6a9 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesStateReaderFactory.java @@ -0,0 +1,153 @@ +/* + * 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.translate.v3po; + +import com.google.common.collect.Sets; +import com.google.inject.Inject; +import com.google.inject.name.Named; +import io.fd.honeycomb.translate.impl.read.GenericListReader; +import io.fd.honeycomb.translate.impl.read.GenericReader; +import io.fd.honeycomb.translate.read.ReaderFactory; +import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; +import io.fd.honeycomb.translate.v3po.interfacesstate.AclCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.EthernetCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.GreCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.InterfaceCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.L2Customizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.ProxyArpCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.TapCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.VhostUserCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.VxlanCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.VxlanGpeCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4AddressCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4Customizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4NeighbourCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv6Customizer; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface2; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface2Builder; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.Ipv4; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.Ipv6; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.Neighbor; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Gre; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.L2; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.ProxyArp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Tap; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Vxlan; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VxlanGpe; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; + +public final class InterfacesStateReaderFactory implements ReaderFactory, AutoCloseable { + + private NamingContext ifcCtx; + private NamingContext bdCtx; + private NamingContext classifyCtx; + private FutureJVpp jvpp; + + static final InstanceIdentifier IFC_STATE_ID = + InstanceIdentifier.create(InterfacesState.class); + static final InstanceIdentifier IFC_ID = IFC_STATE_ID.child(Interface.class); + + @Inject + public InterfacesStateReaderFactory(final FutureJVpp jvpp, + @Named("interface-context") final NamingContext ifcCtx, + @Named("bridge-domain-context") final NamingContext bdCtx, + @Named("classify-table-context") final NamingContext classifyCtx) { + this.jvpp = jvpp; + this.ifcCtx = ifcCtx; + this.bdCtx = bdCtx; + this.classifyCtx = classifyCtx; + } + + @Override + public void init(final ModifiableReaderRegistryBuilder registry) { + // InterfacesState(Structural) + registry.addStructuralReader(IFC_STATE_ID, InterfacesStateBuilder.class); + // Interface + registry.add(new GenericListReader<>(IFC_ID, new InterfaceCustomizer(jvpp, ifcCtx))); + + // v3po.yang + initVppIfcAugmentationReaders(registry, IFC_ID); + // ietf-ip.yang + initInterface2AugmentationReaders(registry, IFC_ID); + // vpp-vlan.yang + new SubinterfaceStateAugmentationReaderFactory(jvpp, ifcCtx, bdCtx, classifyCtx).init(registry); + } + + private void initInterface2AugmentationReaders(final ModifiableReaderRegistryBuilder registry, + final InstanceIdentifier ifcId) { + // Interface2Augmentation(Structural) + final InstanceIdentifier ifc2AugId = ifcId.augmentation(Interface2.class); + registry.addStructuralReader(ifc2AugId, Interface2Builder.class); + // Ipv4 + // TODO unfinished customizer + final InstanceIdentifier ipv4Id = ifc2AugId.child(Ipv4.class); + registry.add(new GenericReader<>(ipv4Id, new Ipv4Customizer(jvpp))); + // Address + final InstanceIdentifier
ipv4AddrId = ipv4Id.child(Address.class); + registry.add(new GenericListReader<>(ipv4AddrId, new Ipv4AddressCustomizer(jvpp, ifcCtx))); + // Neighbor + final InstanceIdentifier neighborId = ipv4Id.child(Neighbor.class); + registry.add(new GenericListReader<>(neighborId, new Ipv4NeighbourCustomizer(jvpp))); + // Ipv6 + // TODO unfinished customizer + final InstanceIdentifier ipv6Id = ifc2AugId.child(Ipv6.class); + registry.add(new GenericReader<>(ipv6Id, new Ipv6Customizer(jvpp, ifcCtx))); + } + + private void initVppIfcAugmentationReaders(final ModifiableReaderRegistryBuilder registry, + final InstanceIdentifier ifcId) { + // VppInterfaceStateAugmentation + final InstanceIdentifier vppIfcAugId = ifcId.augmentation(VppInterfaceStateAugmentation.class); + registry.addStructuralReader(vppIfcAugId, VppInterfaceStateAugmentationBuilder.class); + // Ethernet + registry.add(new GenericReader<>(vppIfcAugId.child(Ethernet.class), new EthernetCustomizer(jvpp, ifcCtx))); + // Tap + registry.add(new GenericReader<>(vppIfcAugId.child(Tap.class), new TapCustomizer(jvpp, ifcCtx))); + // VhostUser + registry.add(new GenericReader<>(vppIfcAugId.child(VhostUser.class), new VhostUserCustomizer(jvpp, ifcCtx))); + // Vxlan + registry.add(new GenericReader<>(vppIfcAugId.child(Vxlan.class), new VxlanCustomizer(jvpp, ifcCtx))); + // VxlanGpe + registry.add(new GenericReader<>(vppIfcAugId.child(VxlanGpe.class), new VxlanGpeCustomizer(jvpp, ifcCtx))); + // Gre + registry.add(new GenericReader<>(vppIfcAugId.child(Gre.class), new GreCustomizer(jvpp, ifcCtx))); + // L2 + registry.add(new GenericReader<>(vppIfcAugId.child(L2.class), new L2Customizer(jvpp, ifcCtx, bdCtx))); + // Acl(Subtree) + final InstanceIdentifier aclIdRelative = InstanceIdentifier.create(Acl.class); + registry.subtreeAdd( + Sets.newHashSet(aclIdRelative.child(L2Acl.class), aclIdRelative.child(Ip4Acl.class), aclIdRelative.child(Ip6Acl.class)), + new GenericReader<>(vppIfcAugId.child(Acl.class), new AclCustomizer(jvpp, ifcCtx, classifyCtx))); + // Proxy ARP + registry.add(new GenericReader<>(vppIfcAugId.child(ProxyArp.class), new ProxyArpCustomizer(jvpp, + ifcCtx))); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesWriterFactory.java new file mode 100644 index 000000000..ce2f621a4 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/InterfacesWriterFactory.java @@ -0,0 +1,178 @@ +/* + * 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.translate.v3po; + +import static io.fd.honeycomb.translate.v3po.VppClassifierHoneycombWriterFactory.CLASSIFY_SESSION_ID; +import static io.fd.honeycomb.translate.v3po.VppClassifierHoneycombWriterFactory.CLASSIFY_TABLE_ID; + +import com.google.common.collect.Sets; +import com.google.inject.Inject; +import com.google.inject.name.Named; +import io.fd.honeycomb.translate.impl.write.GenericListWriter; +import io.fd.honeycomb.translate.impl.write.GenericWriter; +import io.fd.honeycomb.translate.v3po.interfaces.AclCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.EthernetCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.GreCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.InterfaceCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.L2Customizer; +import io.fd.honeycomb.translate.v3po.interfaces.ProxyArpCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.RoutingCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.TapCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.VhostUserCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.VxlanCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.VxlanGpeCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4AddressCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4Customizer; +import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4NeighbourCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv6Customizer; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; +import java.util.Set; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface1; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.Ipv4; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.Ipv6; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Neighbor; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Ethernet; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Gre; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.L2; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ProxyArp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Routing; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Tap; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VhostUser; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Vxlan; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VxlanGpe; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; + +public final class InterfacesWriterFactory implements WriterFactory, AutoCloseable { + + public static final InstanceIdentifier IFC_ID = + InstanceIdentifier.create(Interfaces.class).child(Interface.class); + public static final InstanceIdentifier VPP_IFC_AUG_ID = + IFC_ID.augmentation(VppInterfaceAugmentation.class); + public static final InstanceIdentifier ACL_ID = VPP_IFC_AUG_ID.child(Acl.class); + public static final InstanceIdentifier L2_ID = VPP_IFC_AUG_ID.child(L2.class); + + private final FutureJVpp jvpp; + private final NamingContext bdContext; + private final NamingContext ifcContext; + private final NamingContext classifyTableContext; + + @Inject + public InterfacesWriterFactory(final FutureJVpp vppJvppIfcDependency, + @Named("bridge-domain-context") final NamingContext bridgeDomainContextDependency, + @Named("interface-context") final NamingContext interfaceContextDependency, + @Named("classify-table-context") final NamingContext classifyTableContextDependency) { + this.jvpp = vppJvppIfcDependency; + this.bdContext = bridgeDomainContextDependency; + this.ifcContext = interfaceContextDependency; + this.classifyTableContext = classifyTableContextDependency; + } + + @Override + public void init(final ModifiableWriterRegistryBuilder registry) { + // Interfaces + // Interface = + registry.add(new GenericListWriter<>(IFC_ID, new InterfaceCustomizer(jvpp, ifcContext))); + // VppInterfaceAugmentation + addVppInterfaceAgmentationWriters(IFC_ID, registry); + // Interface1 (ietf-ip augmentation) + addInterface1AugmentationWriters(IFC_ID, registry); + // SubinterfaceAugmentation TODO make dedicated module for subIfc writer factory + new SubinterfaceAugmentationWriterFactory(jvpp, ifcContext, bdContext, classifyTableContext).init(registry); + } + + private void addInterface1AugmentationWriters(final InstanceIdentifier ifcId, + final ModifiableWriterRegistryBuilder registry) { + final InstanceIdentifier ifc1AugId = ifcId.augmentation(Interface1.class); + // Ipv6(after interface) TODO unfinished customizer = + registry.addAfter(new GenericWriter<>(ifc1AugId.child(Ipv6.class), new Ipv6Customizer(jvpp)), + ifcId); + // Ipv4(after interface) + final InstanceIdentifier ipv4Id = ifc1AugId.child(Ipv4.class); + registry.addAfter(new GenericWriter<>(ipv4Id, new Ipv4Customizer(jvpp, ifcContext)), + ifcId); + // Address(after Ipv4) = + final InstanceIdentifier
ipv4AddressId = ipv4Id.child(Address.class); + registry.addAfter(new GenericListWriter<>(ipv4AddressId, new Ipv4AddressCustomizer(jvpp, ifcContext)), + ipv4Id); + // Neighbor(after ipv4Address) + registry.addAfter(new GenericListWriter<>(ipv4Id.child(Neighbor.class), new Ipv4NeighbourCustomizer(jvpp, ifcContext)), + ipv4AddressId); + } + + private void addVppInterfaceAgmentationWriters(final InstanceIdentifier ifcId, + final ModifiableWriterRegistryBuilder registry) { + // VhostUser(Needs to be executed before Interface customizer) = + final InstanceIdentifier vhostId = VPP_IFC_AUG_ID.child(VhostUser.class); + registry.addBefore(new GenericWriter<>(vhostId, new VhostUserCustomizer(jvpp, ifcContext)), + ifcId); + // Vxlan(Needs to be executed before Interface customizer) = + final InstanceIdentifier vxlanId = VPP_IFC_AUG_ID.child(Vxlan.class); + registry.addBefore(new GenericWriter<>(vxlanId, new VxlanCustomizer(jvpp, ifcContext)), + ifcId); + // VxlanGpe(Needs to be executed before Interface customizer) = + final InstanceIdentifier vxlanGpeId = VPP_IFC_AUG_ID.child(VxlanGpe.class); + registry.addBefore(new GenericWriter<>(vxlanGpeId, new VxlanGpeCustomizer(jvpp, ifcContext)), + ifcId); + // Tap(Needs to be executed before Interface customizer) = + final InstanceIdentifier tapId = VPP_IFC_AUG_ID.child(Tap.class); + registry.addBefore(new GenericWriter<>(tapId, new TapCustomizer(jvpp, ifcContext)), + ifcId); + + // Gre(Needs to be executed before Interface customizer) = + final InstanceIdentifier greId = VPP_IFC_AUG_ID.child(Gre.class); + registry.addBefore(new GenericWriter<>(greId, new GreCustomizer(jvpp, ifcContext)), + ifcId); + + + final Set> specificIfcTypes = Sets.newHashSet(vhostId, vxlanGpeId, vxlanGpeId, tapId); + + // Ethernet(No dependency, customizer not finished TODO) = + registry.add(new GenericWriter<>(VPP_IFC_AUG_ID.child(Ethernet.class), new EthernetCustomizer(jvpp))); + // Routing(Execute only after specific interface customizers) = + registry.addAfter( + new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), new RoutingCustomizer(jvpp, ifcContext)), + specificIfcTypes); + // Routing(Execute only after specific interface customizers) = + registry.addAfter(new GenericWriter<>(L2_ID, new L2Customizer(jvpp, ifcContext, bdContext)), + specificIfcTypes); + // Proxy Arp (execute after specific interface customizers) + registry.addAfter( + new GenericWriter<>(VPP_IFC_AUG_ID.child(ProxyArp.class), new ProxyArpCustomizer(jvpp, ifcContext)), + specificIfcTypes); + // ACL (execute after classify table and session writers) + // also handles L2Acl, Ip4Acl and Ip6Acl: + final InstanceIdentifier aclId = InstanceIdentifier.create(Acl.class); + registry + .subtreeAddAfter( + Sets.newHashSet(aclId.child(L2Acl.class), aclId.child(Ip4Acl.class), aclId.child(Ip6Acl.class)), + new GenericWriter<>(ACL_ID, new AclCustomizer(jvpp, ifcContext, classifyTableContext)), + Sets.newHashSet(CLASSIFY_TABLE_ID, CLASSIFY_SESSION_ID)); + } + + +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceAugmentationWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceAugmentationWriterFactory.java new file mode 100644 index 000000000..d5bf4f678 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceAugmentationWriterFactory.java @@ -0,0 +1,119 @@ +/* + * 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.translate.v3po; + +import static io.fd.honeycomb.translate.v3po.VppClassifierHoneycombWriterFactory.CLASSIFY_SESSION_ID; +import static io.fd.honeycomb.translate.v3po.VppClassifierHoneycombWriterFactory.CLASSIFY_TABLE_ID; + +import com.google.common.collect.Sets; +import io.fd.honeycomb.translate.impl.write.GenericListWriter; +import io.fd.honeycomb.translate.impl.write.GenericWriter; +import io.fd.honeycomb.translate.v3po.interfaces.RewriteCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceAclCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceCustomizer; +import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceL2Customizer; +import io.fd.honeycomb.translate.v3po.interfaces.ip.SubInterfaceIpv4AddressCustomizer; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; +import org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.or.any.Dot1qTag; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.SubinterfaceAugmentation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.SubInterfaces; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterface; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.match.type.vlan.tagged.VlanTagged; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.L2; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Match; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.l2.Rewrite; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.tags.Tag; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.ipv4.Address; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.tag.rewrite.PushTags; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; + +public final class SubinterfaceAugmentationWriterFactory implements WriterFactory { + + private final FutureJVpp jvpp; + private final NamingContext ifcContext; + private final NamingContext bdContext; + private final NamingContext classifyTableContext; + + public static final InstanceIdentifier SUB_IFC_AUG_ID = + InterfacesWriterFactory.IFC_ID.augmentation(SubinterfaceAugmentation.class); + public static final InstanceIdentifier SUB_IFC_ID = + SUB_IFC_AUG_ID.child(SubInterfaces.class).child(SubInterface.class); + public static final InstanceIdentifier L2_ID = SUB_IFC_ID.child( + L2.class); + public static final InstanceIdentifier SUBIF_ACL_ID = SUB_IFC_ID.child(Acl.class); + + public SubinterfaceAugmentationWriterFactory(final FutureJVpp jvpp, + final NamingContext ifcContext, final NamingContext bdContext, final NamingContext classifyTableContext) { + this.jvpp = jvpp; + this.ifcContext = ifcContext; + this.bdContext = bdContext; + this.classifyTableContext = classifyTableContext; + } + + @Override + public void init(final ModifiableWriterRegistryBuilder registry) { + // Subinterfaces + // Subinterface(Handle only after all interface related stuff gets processed) = + registry.subtreeAddAfter( + // TODO this customizer covers quite a lot of complex child nodes (maybe refactor ?) + Sets.newHashSet( + InstanceIdentifier.create(SubInterface.class).child(Tags.class), + InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class), + InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child( + Dot1qTag.class), + InstanceIdentifier.create(SubInterface.class).child(Match.class), + InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)), + new GenericListWriter<>(SUB_IFC_ID, new SubInterfaceCustomizer(jvpp, ifcContext)), + InterfacesWriterFactory.IFC_ID); + // L2 = + registry.addAfter(new GenericWriter<>(L2_ID, new SubInterfaceL2Customizer(jvpp, ifcContext, bdContext)), + SUB_IFC_ID); + // Rewrite(also handles pushTags + pushTags/dot1qtag) = + final InstanceIdentifier rewriteId = L2_ID.child(Rewrite.class); + registry.subtreeAddAfter( + Sets.newHashSet( + InstanceIdentifier.create(Rewrite.class).child(PushTags.class), + InstanceIdentifier.create(Rewrite.class).child(PushTags.class) + .child(org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)), + new GenericWriter<>(rewriteId, new RewriteCustomizer(jvpp, ifcContext)), + L2_ID); + // Ipv4(handled after L2 and L2/rewrite is done) = + final InstanceIdentifier
ipv4SubifcAddressId = SUB_IFC_ID.child(Ipv4.class).child(Address.class); + registry.addAfter(new GenericListWriter<>(ipv4SubifcAddressId, + new SubInterfaceIpv4AddressCustomizer(jvpp, ifcContext)), + rewriteId); + + // ACL (execute after classify table and session writers) + // also handles L2Acl, Ip4Acl and Ip6Acl: + final InstanceIdentifier aclId = InstanceIdentifier.create(Acl.class); + registry + .subtreeAddAfter( + Sets.newHashSet(aclId.child(L2Acl.class), aclId.child(Ip4Acl.class), aclId.child(Ip6Acl.class)), + new GenericWriter<>(SUBIF_ACL_ID, new SubInterfaceAclCustomizer(jvpp, ifcContext, classifyTableContext)), + Sets.newHashSet(CLASSIFY_TABLE_ID, CLASSIFY_SESSION_ID)); + + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceStateAugmentationReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceStateAugmentationReaderFactory.java new file mode 100644 index 000000000..eab61d627 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/SubinterfaceStateAugmentationReaderFactory.java @@ -0,0 +1,106 @@ +/* + * 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.translate.v3po; + +import com.google.common.collect.Sets; +import io.fd.honeycomb.translate.impl.read.GenericListReader; +import io.fd.honeycomb.translate.impl.read.GenericReader; +import io.fd.honeycomb.translate.read.ReaderFactory; +import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; +import io.fd.honeycomb.translate.v3po.interfacesstate.RewriteCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceAclCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceCustomizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceL2Customizer; +import io.fd.honeycomb.translate.v3po.interfacesstate.ip.SubInterfaceIpv4AddressCustomizer; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.or.any.Dot1qTag; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.SubinterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.SubinterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.SubInterfaces; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.SubInterfacesBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterface; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.match.type.vlan.tagged.VlanTagged; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.L2; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Match; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.l2.Rewrite; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.tags.Tag; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4Builder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.ipv4.Address; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.tag.rewrite.PushTags; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; + +final class SubinterfaceStateAugmentationReaderFactory implements ReaderFactory { + + private final FutureJVpp jvpp; + private final NamingContext ifcCtx; + private final NamingContext bdCtx; + private final NamingContext classifyCtx; + + SubinterfaceStateAugmentationReaderFactory(final FutureJVpp jvpp, final NamingContext ifcCtx, + final NamingContext bdCtx, final NamingContext classifyCtx) { + this.jvpp = jvpp; + this.ifcCtx = ifcCtx; + this.bdCtx = bdCtx; + this.classifyCtx = classifyCtx; + } + + @Override + public void init(final ModifiableReaderRegistryBuilder registry) { + // SubinterfaceStateAugmentation(Structural) + final InstanceIdentifier subIfcAugId = + InterfacesStateReaderFactory.IFC_ID.augmentation(SubinterfaceStateAugmentation.class); + registry.addStructuralReader(subIfcAugId, SubinterfaceStateAugmentationBuilder.class); + // SubInterfaces(Structural) + final InstanceIdentifier subIfcsId = subIfcAugId.child(SubInterfaces.class); + registry.addStructuralReader(subIfcsId, SubInterfacesBuilder.class); + // SubInterface(Subtree) + final InstanceIdentifier subIfcId = subIfcsId.child(SubInterface.class); + registry.subtreeAdd(Sets.newHashSet( + InstanceIdentifier.create(SubInterface.class).child(Tags.class), + InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class), + InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child(Dot1qTag.class), + InstanceIdentifier.create(SubInterface.class).child(Match.class), + InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)), + new GenericListReader<>(subIfcId, new SubInterfaceCustomizer(jvpp, ifcCtx))); + // L2 + final InstanceIdentifier l2Id = subIfcId.child(L2.class); + registry.add(new GenericReader<>(l2Id, new SubInterfaceL2Customizer(jvpp, ifcCtx, bdCtx))); + // Rewrite(Subtree) + registry.subtreeAdd(Sets.newHashSet( + InstanceIdentifier.create(Rewrite.class).child(PushTags.class), + InstanceIdentifier.create(Rewrite.class).child(PushTags.class) + .child(org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)), + new GenericReader<>(l2Id.child(Rewrite.class), new RewriteCustomizer(jvpp, ifcCtx))); + // Ipv4(Structural) + final InstanceIdentifier ipv4Id = subIfcId.child(Ipv4.class); + registry.addStructuralReader(ipv4Id, Ipv4Builder.class); + // Address + registry.add(new GenericListReader<>(ipv4Id.child(Address.class), new SubInterfaceIpv4AddressCustomizer(jvpp, ifcCtx))); + // Acl(Subtree) + final InstanceIdentifier aclIdRelative = InstanceIdentifier.create(Acl.class); + registry.subtreeAdd( + Sets.newHashSet(aclIdRelative.child(L2Acl.class), aclIdRelative.child(Ip4Acl.class), aclIdRelative.child(Ip6Acl.class)), + new GenericReader<>(subIfcId.child(Acl.class), new SubInterfaceAclCustomizer(jvpp, ifcCtx, classifyCtx))); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java new file mode 100644 index 000000000..aafd0154a --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java @@ -0,0 +1,94 @@ +/* + * 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.translate.v3po; + +import com.google.inject.AbstractModule; +import com.google.inject.multibindings.Multibinder; +import com.google.inject.name.Names; +import io.fd.honeycomb.data.init.DataTreeInitializer; +import io.fd.honeycomb.notification.ManagedNotificationProducer; +import io.fd.honeycomb.translate.read.ReaderFactory; +import io.fd.honeycomb.translate.v3po.cfgattrs.V3poConfiguration; +import io.fd.honeycomb.translate.v3po.initializers.InterfacesInitializer; +import io.fd.honeycomb.translate.v3po.initializers.VppClasifierInitializer; +import io.fd.honeycomb.translate.v3po.initializers.VppInitializer; +import io.fd.honeycomb.translate.v3po.notification.InterfaceChangeNotificationProducer; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriterFactory; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import net.jmob.guice.conf.core.ConfigurationModule; +import org.opendaylight.controller.config.threadpool.ScheduledThreadPool; + +public class V3poModule extends AbstractModule { + + @Override + protected void configure() { + install(ConfigurationModule.create()); + requestInjection(V3poConfiguration.class); + + // Naming contexts + bind(NamingContext.class) + .annotatedWith(Names.named("interface-context")) + .toInstance(new NamingContext("interface-", "interface-context")); + bind(NamingContext.class) + .annotatedWith(Names.named("bridge-domain-context")) + .toInstance(new NamingContext("bridge-domain-", "bridge-domain-context")); + bind(NamingContext.class) + .annotatedWith(Names.named("classify-table-context")) + .toInstance(new NamingContext("classify-table-", "classify-table-context")); + + // Executor needed for keepalives + // TODO-minimal remove the funny wrapper. it is only here because of config subsystem + final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); + bind(ScheduledThreadPool.class).toInstance(new ScheduledThreadPool() { + @Override + public ScheduledExecutorService getExecutor() { + return executor; + } + + @Override + public int getMaxThreadCount() { + return 1; + } + }); + + // Readers + final Multibinder readerFactoryBinder = Multibinder.newSetBinder(binder(), ReaderFactory.class); + readerFactoryBinder.addBinding().to(InterfacesStateReaderFactory.class); + readerFactoryBinder.addBinding().to(VppStateHoneycombReaderFactory.class); + readerFactoryBinder.addBinding().to(VppClassifierReaderFactory.class); + + // Writers + final Multibinder writerFactoryBinder = Multibinder.newSetBinder(binder(), WriterFactory.class); + writerFactoryBinder.addBinding().to(InterfacesWriterFactory.class); + writerFactoryBinder.addBinding().to(VppHoneycombWriterFactory.class); + writerFactoryBinder.addBinding().to(VppClassifierHoneycombWriterFactory.class); + + // Initializers + final Multibinder initializerBinder = + Multibinder.newSetBinder(binder(), DataTreeInitializer.class); + initializerBinder.addBinding().to(InterfacesInitializer.class); + initializerBinder.addBinding().to(VppClasifierInitializer.class); + initializerBinder.addBinding().to(VppInitializer.class); + + // Notifications + final Multibinder notifiersBinder = + Multibinder.newSetBinder(binder(), ManagedNotificationProducer.class); + notifiersBinder.addBinding().to(InterfaceChangeNotificationProducer.class); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierHoneycombWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierHoneycombWriterFactory.java new file mode 100644 index 000000000..7c63076d5 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierHoneycombWriterFactory.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 io.fd.honeycomb.translate.v3po; + +import static io.fd.honeycomb.translate.v3po.InterfacesWriterFactory.ACL_ID; + +import com.google.inject.Inject; +import com.google.inject.name.Named; +import io.fd.honeycomb.translate.impl.write.GenericListWriter; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifySessionWriter; +import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifyTableWriter; +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.vpp.classifier.rev150603.VppClassifier; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.classify.table.base.attributes.ClassifySession; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.vpp.classifier.ClassifyTable; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; + +public final class VppClassifierHoneycombWriterFactory implements WriterFactory, AutoCloseable { + + public static final InstanceIdentifier CLASSIFY_TABLE_ID = + InstanceIdentifier.create(VppClassifier.class).child(ClassifyTable.class); + public static final InstanceIdentifier CLASSIFY_SESSION_ID = + CLASSIFY_TABLE_ID.child(ClassifySession.class); + + private final FutureJVpp jvpp; + private final NamingContext classifyTableContext; + + @Inject + public VppClassifierHoneycombWriterFactory(@Nonnull final FutureJVpp jvpp, + @Named("classify-table-context") @Nonnull final NamingContext classifyTableContext) { + this.jvpp = jvpp; + this.classifyTableContext = classifyTableContext; + } + + @Override + public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { + // Ordering here is: First create table, then create sessions and then assign as ACL + // ClassifyTable + registry.addBefore( + new GenericListWriter<>(CLASSIFY_TABLE_ID, new ClassifyTableWriter(jvpp, classifyTableContext)), + CLASSIFY_SESSION_ID); + // ClassifyTableSession + registry.addBefore( + new GenericListWriter<>( + CLASSIFY_SESSION_ID, new ClassifySessionWriter(jvpp, classifyTableContext)), + ACL_ID); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierReaderFactory.java new file mode 100644 index 000000000..4cb99c538 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppClassifierReaderFactory.java @@ -0,0 +1,59 @@ +/* + * 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.translate.v3po; + +import com.google.inject.Inject; +import com.google.inject.name.Named; +import io.fd.honeycomb.translate.impl.read.GenericListReader; +import io.fd.honeycomb.translate.read.ReaderFactory; +import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifySessionReader; +import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifyTableReader; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierState; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierStateBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.classify.table.base.attributes.ClassifySession; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.vpp.classifier.state.ClassifyTable; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; + +public final class VppClassifierReaderFactory implements ReaderFactory, AutoCloseable { + + private final FutureJVpp jvpp; + private final NamingContext classifyCtx; + + @Inject + public VppClassifierReaderFactory(final FutureJVpp jvpp, + @Named("classify-table-context") final NamingContext classifyCtx) { + this.jvpp = jvpp; + this.classifyCtx = classifyCtx; + } + + @Override + public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) { + // VppClassifierState + final InstanceIdentifier vppStateId = InstanceIdentifier.create(VppClassifierState.class); + registry.addStructuralReader(vppStateId, VppClassifierStateBuilder.class); + // ClassifyTable + final InstanceIdentifier classTblId = vppStateId.child(ClassifyTable.class); + registry.add(new GenericListReader<>(classTblId, new ClassifyTableReader(jvpp, classifyCtx))); + // ClassifySession + final InstanceIdentifier classSesId = classTblId.child(ClassifySession.class); + registry.add(new GenericListReader<>(classSesId, new ClassifySessionReader(jvpp, classifyCtx))); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppHoneycombWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppHoneycombWriterFactory.java new file mode 100644 index 000000000..204f9f8d8 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppHoneycombWriterFactory.java @@ -0,0 +1,81 @@ +/* + * 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.translate.v3po; + +import static io.fd.honeycomb.translate.v3po.InterfacesWriterFactory.L2_ID; + +import com.google.common.collect.Sets; +import com.google.inject.Inject; +import com.google.inject.name.Named; +import io.fd.honeycomb.translate.impl.write.GenericListWriter; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.vpp.ArpTerminationTableEntryCustomizer; +import io.fd.honeycomb.translate.v3po.vpp.BridgeDomainCustomizer; +import io.fd.honeycomb.translate.v3po.vpp.L2FibEntryCustomizer; +import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.Vpp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.bridge.domain.attributes.ArpTerminationTable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.BridgeDomains; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomain; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; + +public final class VppHoneycombWriterFactory implements WriterFactory, AutoCloseable { + + private final FutureJVpp jvpp; + private final NamingContext bdContext; + private final NamingContext ifcContext; + + @Inject + public VppHoneycombWriterFactory(final FutureJVpp vppJvppWriterDependency, + @Named("bridge-domain-context") final NamingContext bridgeDomainContextVppDependency, + @Named("interface-context") final NamingContext interfaceContextVppDependency) { + this.jvpp = vppJvppWriterDependency; + this.bdContext = bridgeDomainContextVppDependency; + this.ifcContext = interfaceContextVppDependency; + } + + @Override + public void init(final ModifiableWriterRegistryBuilder registry) { + // Vpp has no handlers + // BridgeDomains has no handlers + // BridgeDomain = + final InstanceIdentifier bdId = + InstanceIdentifier.create(Vpp.class).child(BridgeDomains.class).child(BridgeDomain.class); + registry.add(new GenericListWriter<>(bdId, new BridgeDomainCustomizer(jvpp, bdContext))); + // L2FibTable has no handlers + // L2FibEntry(handled after BridgeDomain and L2 of ifc and subifc) = + final InstanceIdentifier l2FibEntryId = bdId.child(L2FibTable.class).child(L2FibEntry.class); + registry.addAfter( + new GenericListWriter<>(l2FibEntryId, new L2FibEntryCustomizer(jvpp, bdContext, ifcContext)), + Sets.newHashSet( + bdId, + L2_ID, + SubinterfaceAugmentationWriterFactory.L2_ID)); + // ArpTerminationTable has no handlers + // ArpTerminationTableEntry(handled after BridgeDomain) = + final InstanceIdentifier arpEntryId = + bdId.child(ArpTerminationTable.class).child(ArpTerminationTableEntry.class); + registry.addAfter( + new GenericListWriter<>(arpEntryId, new ArpTerminationTableEntryCustomizer(jvpp, bdContext)), + bdId); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java new file mode 100644 index 000000000..f39502c09 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java @@ -0,0 +1,94 @@ +/* + * 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.translate.v3po; + +import com.google.inject.Inject; +import com.google.inject.name.Named; +import io.fd.honeycomb.translate.impl.read.GenericListReader; +import io.fd.honeycomb.translate.impl.read.GenericReader; +import io.fd.honeycomb.translate.read.ReaderFactory; +import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; +import io.fd.honeycomb.translate.util.read.KeepaliveReaderWrapper; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.util.ReadTimeoutException; +import io.fd.honeycomb.translate.v3po.vppstate.BridgeDomainCustomizer; +import io.fd.honeycomb.translate.v3po.vppstate.L2FibEntryCustomizer; +import io.fd.honeycomb.translate.v3po.vppstate.VersionCustomizer; +import org.opendaylight.controller.config.threadpool.ScheduledThreadPool; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppStateBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTableBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.BridgeDomains; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.BridgeDomainsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.Version; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.future.FutureJVpp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class VppStateHoneycombReaderFactory implements ReaderFactory, AutoCloseable { + + private static final Logger LOG = LoggerFactory.getLogger(VppStateHoneycombReaderFactory.class); + + private final FutureJVpp jVpp; + private final NamingContext ifcCtx; + private final NamingContext bdCtx; + private final ScheduledThreadPool keepaliveExecutor; + + @Inject + public VppStateHoneycombReaderFactory(final FutureJVpp jVpp, + @Named("interface-context") final NamingContext ifcCtx, + @Named("bridge-domain-context") final NamingContext bdCtx, + final ScheduledThreadPool keepaliveExecutorDependency) { + this.jVpp = jVpp; + this.ifcCtx = ifcCtx; + this.bdCtx = bdCtx; + this.keepaliveExecutor = keepaliveExecutorDependency; + } + + @Override + public void init(final ModifiableReaderRegistryBuilder registry) { + // VppState(Structural) + final InstanceIdentifier vppStateId = InstanceIdentifier.create(VppState.class); + registry.addStructuralReader(vppStateId, VppStateBuilder.class); + // Version + // Wrap with keepalive reader to detect connection issues + // TODO keepalive reader wrapper relies on VersionReaderCustomizer (to perform timeout on reads) + // Once readers+customizers are asynchronous, pull the timeout to keepalive executor so that keepalive wrapper + // is truly generic + registry.add(new KeepaliveReaderWrapper<>( + new GenericReader<>(vppStateId.child(Version.class), new VersionCustomizer(jVpp)), + keepaliveExecutor.getExecutor(), ReadTimeoutException.class, 30, + // FIXME-minimal trigger jvpp reinitialization here + () -> LOG.error("Keepalive failed. VPP is probably DOWN!"))); + // BridgeDomains(Structural) + final InstanceIdentifier bridgeDomainsId = vppStateId.child(BridgeDomains.class); + registry.addStructuralReader(bridgeDomainsId, BridgeDomainsBuilder.class); + // BridgeDomain + final InstanceIdentifier bridgeDomainId = bridgeDomainsId.child(BridgeDomain.class); + registry.add(new GenericListReader<>(bridgeDomainId, new BridgeDomainCustomizer(jVpp, bdCtx))); + // L2FibTable(Structural) + final InstanceIdentifier l2FibTableId = bridgeDomainId.child(L2FibTable.class); + registry.addStructuralReader(l2FibTableId, L2FibTableBuilder.class); + // L2FibEntry + registry.add(new GenericListReader<>(l2FibTableId.child(L2FibEntry.class), + new L2FibEntryCustomizer(jVpp, bdCtx, ifcCtx))); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/cfgattrs/V3poConfiguration.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/cfgattrs/V3poConfiguration.java new file mode 100644 index 000000000..afe486c46 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/cfgattrs/V3poConfiguration.java @@ -0,0 +1,28 @@ +/* + * 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.translate.v3po.cfgattrs; + +import net.jmob.guice.conf.core.BindConfig; +import net.jmob.guice.conf.core.InjectConfig; +import net.jmob.guice.conf.core.Syntax; + +@BindConfig(value = "v3po", syntax = Syntax.JSON) +public class V3poConfiguration { + + @InjectConfig("some") + String some; +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/InterfacesInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/InterfacesInitializer.java index c218e5456..e9beccfb7 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/InterfacesInitializer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/InterfacesInitializer.java @@ -18,6 +18,8 @@ package io.fd.honeycomb.translate.v3po.initializers; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; +import com.google.inject.Inject; +import com.google.inject.name.Named; import io.fd.honeycomb.data.init.AbstractDataTreeConverter; import java.util.List; import java.util.stream.Collectors; @@ -76,7 +78,8 @@ import org.slf4j.LoggerFactory; public class InterfacesInitializer extends AbstractDataTreeConverter { private static final Logger LOG = LoggerFactory.getLogger(InterfacesInitializer.class); - public InterfacesInitializer(@Nonnull final DataBroker bindingDataBroker) { + @Inject + public InterfacesInitializer(@Named("honeycomb-initializer") @Nonnull final DataBroker bindingDataBroker) { super(bindingDataBroker, InstanceIdentifier.create(InterfacesState.class), InstanceIdentifier.create(Interfaces.class)); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClasifierInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClasifierInitializer.java index 42d1c59dc..b97586830 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClasifierInitializer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClasifierInitializer.java @@ -16,6 +16,8 @@ package io.fd.honeycomb.translate.v3po.initializers; +import com.google.inject.Inject; +import com.google.inject.name.Named; import io.fd.honeycomb.data.init.AbstractDataTreeConverter; import java.util.stream.Collectors; import javax.annotation.Nonnull; @@ -29,12 +31,13 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; /** * Initializes vpp-classfier node in config data tree based on operational state. */ -public class VppClasifierInitializer extends AbstractDataTreeConverter { +public final class VppClasifierInitializer extends AbstractDataTreeConverter { private static final InstanceIdentifier OPER_ID = InstanceIdentifier.create(VppClassifierState.class); private static final InstanceIdentifier CFG_ID = InstanceIdentifier.create(VppClassifier.class); - public VppClasifierInitializer(@Nonnull final DataBroker bindingDataBroker) { + @Inject + public VppClasifierInitializer(@Named("honeycomb-initializer") @Nonnull final DataBroker bindingDataBroker) { super(bindingDataBroker, OPER_ID, CFG_ID); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppInitializer.java index 370de347b..b2c2f7b1e 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppInitializer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppInitializer.java @@ -18,6 +18,8 @@ package io.fd.honeycomb.translate.v3po.initializers; import com.google.common.base.Function; import com.google.common.collect.Lists; +import com.google.inject.Inject; +import com.google.inject.name.Named; import io.fd.honeycomb.data.init.AbstractDataTreeConverter; import java.util.stream.Collectors; import javax.annotation.Nonnull; @@ -43,7 +45,8 @@ import org.slf4j.LoggerFactory; public class VppInitializer extends AbstractDataTreeConverter { private static final Logger LOG = LoggerFactory.getLogger(VppInitializer.class); - public VppInitializer(@Nonnull final DataBroker bindingDataBroker) { + @Inject + public VppInitializer(@Named("honeycomb-initializer") @Nonnull final DataBroker bindingDataBroker) { super(bindingDataBroker, InstanceIdentifier.create(VppState.class), InstanceIdentifier.create(Vpp.class)); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducer.java index 1c60ef609..39226c0fc 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducer.java @@ -17,6 +17,8 @@ package io.fd.honeycomb.translate.v3po.notification; import com.google.common.base.Optional; import com.google.common.collect.Lists; +import com.google.inject.Inject; +import com.google.inject.name.Named; import io.fd.honeycomb.notification.ManagedNotificationProducer; import io.fd.honeycomb.notification.NotificationCollector; import io.fd.honeycomb.translate.MappingContext; @@ -59,9 +61,10 @@ public final class InterfaceChangeNotificationProducer implements ManagedNotific @Nullable private AutoCloseable notificationListenerReg; + @Inject public InterfaceChangeNotificationProducer(@Nonnull final FutureJVpp jvpp, - @Nonnull final NamingContext interfaceContext, - @Nonnull final MappingContext mappingContext) { + @Named("interface-context") @Nonnull final NamingContext interfaceContext, + @Named("honeycomb-context") @Nonnull final MappingContext mappingContext) { this.jvpp = jvpp; this.interfaceContext = interfaceContext; this.mappingContext = mappingContext; diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java index d99fd2edb..e63392018 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java @@ -1,66 +1,12 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; -import static org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.VppClassifierHoneycombWriterModule.CLASSIFY_SESSION_ID; -import static org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.VppClassifierHoneycombWriterModule.CLASSIFY_TABLE_ID; - -import com.google.common.collect.Sets; -import io.fd.honeycomb.translate.impl.write.GenericListWriter; -import io.fd.honeycomb.translate.impl.write.GenericWriter; -import io.fd.honeycomb.translate.v3po.interfaces.AclCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.EthernetCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.GreCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.InterfaceCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.L2Customizer; -import io.fd.honeycomb.translate.v3po.interfaces.ProxyArpCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.RoutingCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.TapCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.VhostUserCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.VxlanCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.VxlanGpeCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4AddressCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4Customizer; -import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4NeighbourCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv6Customizer; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; -import io.fd.honeycomb.translate.write.WriterFactory; -import java.util.Set; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface1; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.Ipv4; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.Ipv6; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Neighbor; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Ethernet; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.L2; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ProxyArp; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Routing; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Tap; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VhostUser; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Vxlan; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VxlanGpe; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Gre; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; +import io.fd.honeycomb.translate.v3po.InterfacesWriterFactory; public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesHoneycombWriterModule { // TODO split configuration and translation code into 2 or more bundles - public static final InstanceIdentifier IFC_ID = - InstanceIdentifier.create(Interfaces.class).child(Interface.class); - public static final InstanceIdentifier VPP_IFC_AUG_ID = - IFC_ID.augmentation(VppInterfaceAugmentation.class); - public static final InstanceIdentifier L2_ID = VPP_IFC_AUG_ID.child(L2.class); - public static final InstanceIdentifier ACL_ID = VPP_IFC_AUG_ID.child(Acl.class); - public InterfacesHoneycombWriterModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -87,105 +33,4 @@ public class InterfacesHoneycombWriterModule extends } - private static class InterfacesWriterFactory implements WriterFactory, AutoCloseable { - - private final FutureJVpp jvpp; - private final NamingContext bdContext; - private final NamingContext ifcContext; - private final NamingContext classifyTableContext; - - InterfacesWriterFactory(final FutureJVpp vppJvppIfcDependency, - final NamingContext bridgeDomainContextDependency, - final NamingContext interfaceContextDependency, - final NamingContext classifyTableContextDependency) { - this.jvpp = vppJvppIfcDependency; - this.bdContext = bridgeDomainContextDependency; - this.ifcContext = interfaceContextDependency; - this.classifyTableContext = classifyTableContextDependency; - } - - @Override - public void init(final ModifiableWriterRegistryBuilder registry) { - // Interfaces - // Interface = - registry.add(new GenericListWriter<>(IFC_ID, new InterfaceCustomizer(jvpp, ifcContext))); - // VppInterfaceAugmentation - addVppInterfaceAgmentationWriters(IFC_ID, registry); - // Interface1 (ietf-ip augmentation) - addInterface1AugmentationWriters(IFC_ID, registry); - // SubinterfaceAugmentation TODO make dedicated module for subIfc writer factory - new SubinterfaceAugmentationWriterFactory(jvpp, ifcContext, bdContext, classifyTableContext).init(registry); - } - - private void addInterface1AugmentationWriters(final InstanceIdentifier ifcId, - final ModifiableWriterRegistryBuilder registry) { - final InstanceIdentifier ifc1AugId = ifcId.augmentation(Interface1.class); - // Ipv6(after interface) TODO unfinished customizer = - registry.addAfter(new GenericWriter<>(ifc1AugId.child(Ipv6.class), new Ipv6Customizer(jvpp)), - ifcId); - // Ipv4(after interface) - final InstanceIdentifier ipv4Id = ifc1AugId.child(Ipv4.class); - registry.addAfter(new GenericWriter<>(ipv4Id, new Ipv4Customizer(jvpp, ifcContext)), - ifcId); - // Address(after Ipv4) = - final InstanceIdentifier
ipv4AddressId = ipv4Id.child(Address.class); - registry.addAfter(new GenericListWriter<>(ipv4AddressId, new Ipv4AddressCustomizer(jvpp, ifcContext)), - ipv4Id); - // Neighbor(after ipv4Address) - registry.addAfter(new GenericListWriter<>(ipv4Id.child(Neighbor.class), new Ipv4NeighbourCustomizer(jvpp, ifcContext)), - ipv4AddressId); - } - - private void addVppInterfaceAgmentationWriters(final InstanceIdentifier ifcId, - final ModifiableWriterRegistryBuilder registry) { - // VhostUser(Needs to be executed before Interface customizer) = - final InstanceIdentifier vhostId = VPP_IFC_AUG_ID.child(VhostUser.class); - registry.addBefore(new GenericWriter<>(vhostId, new VhostUserCustomizer(jvpp, ifcContext)), - ifcId); - // Vxlan(Needs to be executed before Interface customizer) = - final InstanceIdentifier vxlanId = VPP_IFC_AUG_ID.child(Vxlan.class); - registry.addBefore(new GenericWriter<>(vxlanId, new VxlanCustomizer(jvpp, ifcContext)), - ifcId); - // VxlanGpe(Needs to be executed before Interface customizer) = - final InstanceIdentifier vxlanGpeId = VPP_IFC_AUG_ID.child(VxlanGpe.class); - registry.addBefore(new GenericWriter<>(vxlanGpeId, new VxlanGpeCustomizer(jvpp, ifcContext)), - ifcId); - // Tap(Needs to be executed before Interface customizer) = - final InstanceIdentifier tapId = VPP_IFC_AUG_ID.child(Tap.class); - registry.addBefore(new GenericWriter<>(tapId, new TapCustomizer(jvpp, ifcContext)), - ifcId); - - // Gre(Needs to be executed before Interface customizer) = - final InstanceIdentifier greId = VPP_IFC_AUG_ID.child(Gre.class); - registry.addBefore(new GenericWriter<>(greId, new GreCustomizer(jvpp, ifcContext)), - ifcId); - - - final Set> specificIfcTypes = Sets.newHashSet(vhostId, vxlanGpeId, vxlanGpeId, tapId); - - // Ethernet(No dependency, customizer not finished TODO) = - registry.add(new GenericWriter<>(VPP_IFC_AUG_ID.child(Ethernet.class), new EthernetCustomizer(jvpp))); - // Routing(Execute only after specific interface customizers) = - registry.addAfter( - new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), new RoutingCustomizer(jvpp, ifcContext)), - specificIfcTypes); - // Routing(Execute only after specific interface customizers) = - registry.addAfter(new GenericWriter<>(L2_ID, new L2Customizer(jvpp, ifcContext, bdContext)), - specificIfcTypes); - // Proxy Arp (execute after specific interface customizers) - registry.addAfter( - new GenericWriter<>(VPP_IFC_AUG_ID.child(ProxyArp.class), new ProxyArpCustomizer(jvpp, ifcContext)), - specificIfcTypes); - // ACL (execute after classify table and session writers) - // also handles L2Acl, Ip4Acl and Ip6Acl: - final InstanceIdentifier aclId = InstanceIdentifier.create(Acl.class); - registry - .subtreeAddAfter( - Sets.newHashSet(aclId.child(L2Acl.class), aclId.child(Ip4Acl.class), aclId.child(Ip6Acl.class)), - new GenericWriter<>(ACL_ID, new AclCustomizer(jvpp, ifcContext, classifyTableContext)), - Sets.newHashSet(CLASSIFY_TABLE_ID, CLASSIFY_SESSION_ID)); - } - - } - } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java index d914facbf..300f44159 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java @@ -1,59 +1,10 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; -import com.google.common.collect.Sets; -import io.fd.honeycomb.translate.impl.read.GenericListReader; -import io.fd.honeycomb.translate.impl.read.GenericReader; -import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; -import io.fd.honeycomb.translate.v3po.interfacesstate.AclCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.EthernetCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.GreCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.InterfaceCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.L2Customizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.ProxyArpCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.TapCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.VhostUserCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.VxlanCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.VxlanGpeCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4AddressCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4Customizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4NeighbourCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv6Customizer; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface2; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface2Builder; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.Ipv4; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.Ipv6; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.Address; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.Neighbor; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.L2; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.ProxyArp; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Tap; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Vxlan; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VxlanGpe; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Gre; -import org.opendaylight.yangtools.yang.binding.Augmentation; -import org.opendaylight.yangtools.yang.binding.ChildOf; +import io.fd.honeycomb.translate.v3po.InterfacesStateReaderFactory; public class InterfacesStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule { - public static final InstanceIdentifier IFC_STATE_ID = InstanceIdentifier.create(InterfacesState.class); - static final InstanceIdentifier IFC_ID = IFC_STATE_ID.child(Interface.class); - public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -73,92 +24,10 @@ public class InterfacesStateHoneycombReaderModule extends @Override public java.lang.AutoCloseable createInstance() { - return new VppStateReaderFactory(getVppJvppDependency(), + return new InterfacesStateReaderFactory(getVppJvppDependency(), getInterfaceContextIfcStateDependency(), getBridgeDomainContextIfcStateDependency(), getClassifyTableContextDependency()); } - private static final class VppStateReaderFactory implements ReaderFactory, AutoCloseable { - - private NamingContext ifcCtx; - private NamingContext bdCtx; - private NamingContext classifyCtx; - private FutureJVpp jvpp; - - VppStateReaderFactory(final FutureJVpp jvpp, - final NamingContext ifcCtx, - final NamingContext bdCtx, - final NamingContext classifyCtx) { - this.jvpp = jvpp; - this.ifcCtx = ifcCtx; - this.bdCtx = bdCtx; - this.classifyCtx = classifyCtx; - } - - @Override - public void init(final ModifiableReaderRegistryBuilder registry) { - // InterfacesState(Structural) - registry.addStructuralReader(IFC_STATE_ID, InterfacesStateBuilder.class); - // Interface - registry.add(new GenericListReader<>(IFC_ID, new InterfaceCustomizer(jvpp, ifcCtx))); - - // v3po.yang - initVppIfcAugmentationReaders(registry, IFC_ID); - // ietf-ip.yang - initInterface2AugmentationReaders(registry, IFC_ID); - // vpp-vlan.yang - new SubinterfaceStateAugmentationReaderFactory(jvpp, ifcCtx, bdCtx, classifyCtx).init(registry); - } - - private void initInterface2AugmentationReaders(final ModifiableReaderRegistryBuilder registry, - final InstanceIdentifier ifcId) { - // Interface2Augmentation(Structural) - final InstanceIdentifier ifc2AugId = ifcId.augmentation(Interface2.class); - registry.addStructuralReader(ifc2AugId, Interface2Builder.class); - // Ipv4 - // TODO unfinished customizer - final InstanceIdentifier ipv4Id = ifc2AugId.child(Ipv4.class); - registry.add(new GenericReader<>(ipv4Id, new Ipv4Customizer(jvpp))); - // Address - final InstanceIdentifier
ipv4AddrId = ipv4Id.child(Address.class); - registry.add(new GenericListReader<>(ipv4AddrId, new Ipv4AddressCustomizer(jvpp, ifcCtx))); - // Neighbor - final InstanceIdentifier neighborId = ipv4Id.child(Neighbor.class); - registry.add(new GenericListReader<>(neighborId, new Ipv4NeighbourCustomizer(jvpp))); - // Ipv6 - // TODO unfinished customizer - final InstanceIdentifier ipv6Id = ifc2AugId.child(Ipv6.class); - registry.add(new GenericReader<>(ipv6Id, new Ipv6Customizer(jvpp, ifcCtx))); - } - - private void initVppIfcAugmentationReaders(final ModifiableReaderRegistryBuilder registry, - final InstanceIdentifier ifcId) { - // VppInterfaceStateAugmentation - final InstanceIdentifier vppIfcAugId = ifcId.augmentation(VppInterfaceStateAugmentation.class); - registry.addStructuralReader(vppIfcAugId, VppInterfaceStateAugmentationBuilder.class); - // Ethernet - registry.add(new GenericReader<>(vppIfcAugId.child(Ethernet.class), new EthernetCustomizer(jvpp, ifcCtx))); - // Tap - registry.add(new GenericReader<>(vppIfcAugId.child(Tap.class), new TapCustomizer(jvpp, ifcCtx))); - // VhostUser - registry.add(new GenericReader<>(vppIfcAugId.child(VhostUser.class), new VhostUserCustomizer(jvpp, ifcCtx))); - // Vxlan - registry.add(new GenericReader<>(vppIfcAugId.child(Vxlan.class), new VxlanCustomizer(jvpp, ifcCtx))); - // VxlanGpe - registry.add(new GenericReader<>(vppIfcAugId.child(VxlanGpe.class), new VxlanGpeCustomizer(jvpp, ifcCtx))); - // Gre - registry.add(new GenericReader<>(vppIfcAugId.child(Gre.class), new GreCustomizer(jvpp, ifcCtx))); - // L2 - registry.add(new GenericReader<>(vppIfcAugId.child(L2.class), new L2Customizer(jvpp, ifcCtx, bdCtx))); - // Acl(Subtree) - final InstanceIdentifier aclIdRelative = InstanceIdentifier.create(Acl.class); - registry.subtreeAdd( - Sets.newHashSet(aclIdRelative.child(L2Acl.class), aclIdRelative.child(Ip4Acl.class), aclIdRelative.child(Ip6Acl.class)), - new GenericReader<>(vppIfcAugId.child(Acl.class), new AclCustomizer(jvpp, ifcCtx, classifyCtx))); - // Proxy ARP - registry.add(new GenericReader<>(vppIfcAugId.child(ProxyArp.class), new ProxyArpCustomizer(jvpp, - ifcCtx))); - } - } } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceAugmentationWriterFactory.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceAugmentationWriterFactory.java deleted file mode 100644 index d0d8f1bdc..000000000 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceAugmentationWriterFactory.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; - -import static org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.VppClassifierHoneycombWriterModule.CLASSIFY_SESSION_ID; -import static org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.VppClassifierHoneycombWriterModule.CLASSIFY_TABLE_ID; - -import com.google.common.collect.Sets; -import io.fd.honeycomb.translate.impl.write.GenericListWriter; -import io.fd.honeycomb.translate.impl.write.GenericWriter; -import io.fd.honeycomb.translate.v3po.interfaces.RewriteCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceAclCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceCustomizer; -import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceL2Customizer; -import io.fd.honeycomb.translate.v3po.interfaces.ip.SubInterfaceIpv4AddressCustomizer; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; -import io.fd.honeycomb.translate.write.WriterFactory; -import org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.or.any.Dot1qTag; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.SubinterfaceAugmentation; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.SubInterfaces; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterface; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.match.type.vlan.tagged.VlanTagged; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.L2; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Match; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.l2.Rewrite; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.tags.Tag; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.ipv4.Address; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.tag.rewrite.PushTags; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; - -final class SubinterfaceAugmentationWriterFactory implements WriterFactory { - - private final FutureJVpp jvpp; - private final NamingContext ifcContext; - private final NamingContext bdContext; - private final NamingContext classifyTableContext; - - public static final InstanceIdentifier SUB_IFC_AUG_ID = - InterfacesHoneycombWriterModule.IFC_ID.augmentation(SubinterfaceAugmentation.class); - public static final InstanceIdentifier SUB_IFC_ID = - SUB_IFC_AUG_ID.child(SubInterfaces.class).child(SubInterface.class); - public static final InstanceIdentifier L2_ID = SUB_IFC_ID.child( - L2.class); - public static final InstanceIdentifier SUBIF_ACL_ID = SUB_IFC_ID.child(Acl.class); - - public SubinterfaceAugmentationWriterFactory(final FutureJVpp jvpp, - final NamingContext ifcContext, final NamingContext bdContext, final NamingContext classifyTableContext) { - this.jvpp = jvpp; - this.ifcContext = ifcContext; - this.bdContext = bdContext; - this.classifyTableContext = classifyTableContext; - } - - @Override - public void init(final ModifiableWriterRegistryBuilder registry) { - // Subinterfaces - // Subinterface(Handle only after all interface related stuff gets processed) = - registry.subtreeAddAfter( - // TODO this customizer covers quite a lot of complex child nodes (maybe refactor ?) - Sets.newHashSet( - InstanceIdentifier.create(SubInterface.class).child(Tags.class), - InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class), - InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child( - Dot1qTag.class), - InstanceIdentifier.create(SubInterface.class).child(Match.class), - InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)), - new GenericListWriter<>(SUB_IFC_ID, new SubInterfaceCustomizer(jvpp, ifcContext)), - InterfacesHoneycombWriterModule.IFC_ID); - // L2 = - registry.addAfter(new GenericWriter<>(L2_ID, new SubInterfaceL2Customizer(jvpp, ifcContext, bdContext)), - SUB_IFC_ID); - // Rewrite(also handles pushTags + pushTags/dot1qtag) = - final InstanceIdentifier rewriteId = L2_ID.child(Rewrite.class); - registry.subtreeAddAfter( - Sets.newHashSet( - InstanceIdentifier.create(Rewrite.class).child(PushTags.class), - InstanceIdentifier.create(Rewrite.class).child(PushTags.class) - .child(org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)), - new GenericWriter<>(rewriteId, new RewriteCustomizer(jvpp, ifcContext)), - L2_ID); - // Ipv4(handled after L2 and L2/rewrite is done) = - final InstanceIdentifier
ipv4SubifcAddressId = SUB_IFC_ID.child(Ipv4.class).child(Address.class); - registry.addAfter(new GenericListWriter<>(ipv4SubifcAddressId, - new SubInterfaceIpv4AddressCustomizer(jvpp, ifcContext)), - rewriteId); - - // ACL (execute after classify table and session writers) - // also handles L2Acl, Ip4Acl and Ip6Acl: - final InstanceIdentifier aclId = InstanceIdentifier.create(Acl.class); - registry - .subtreeAddAfter( - Sets.newHashSet(aclId.child(L2Acl.class), aclId.child(Ip4Acl.class), aclId.child(Ip6Acl.class)), - new GenericWriter<>(SUBIF_ACL_ID, new SubInterfaceAclCustomizer(jvpp, ifcContext, classifyTableContext)), - Sets.newHashSet(CLASSIFY_TABLE_ID, CLASSIFY_SESSION_ID)); - - } -} diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceStateAugmentationReaderFactory.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceStateAugmentationReaderFactory.java deleted file mode 100644 index 0718d69d9..000000000 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/SubinterfaceStateAugmentationReaderFactory.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; - -import com.google.common.collect.Sets; -import io.fd.honeycomb.translate.impl.read.GenericListReader; -import io.fd.honeycomb.translate.impl.read.GenericReader; -import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; -import io.fd.honeycomb.translate.v3po.interfacesstate.RewriteCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceAclCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceCustomizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceL2Customizer; -import io.fd.honeycomb.translate.v3po.interfacesstate.ip.SubInterfaceIpv4AddressCustomizer; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.or.any.Dot1qTag; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.SubinterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.SubinterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.SubInterfaces; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.SubInterfacesBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterface; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.match.type.vlan.tagged.VlanTagged; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.L2; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Match; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.l2.Rewrite; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.tags.Tag; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4Builder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.ipv4.Address; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.tag.rewrite.PushTags; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; - -final class SubinterfaceStateAugmentationReaderFactory implements ReaderFactory { - - private final FutureJVpp jvpp; - private final NamingContext ifcCtx; - private final NamingContext bdCtx; - private final NamingContext classifyCtx; - - SubinterfaceStateAugmentationReaderFactory(final FutureJVpp jvpp, final NamingContext ifcCtx, - final NamingContext bdCtx, final NamingContext classifyCtx) { - this.jvpp = jvpp; - this.ifcCtx = ifcCtx; - this.bdCtx = bdCtx; - this.classifyCtx = classifyCtx; - } - - @Override - public void init(final ModifiableReaderRegistryBuilder registry) { - // SubinterfaceStateAugmentation(Structural) - final InstanceIdentifier subIfcAugId = - InterfacesStateHoneycombReaderModule.IFC_ID.augmentation(SubinterfaceStateAugmentation.class); - registry.addStructuralReader(subIfcAugId, SubinterfaceStateAugmentationBuilder.class); - // SubInterfaces(Structural) - final InstanceIdentifier subIfcsId = subIfcAugId.child(SubInterfaces.class); - registry.addStructuralReader(subIfcsId, SubInterfacesBuilder.class); - // SubInterface(Subtree) - final InstanceIdentifier subIfcId = subIfcsId.child(SubInterface.class); - registry.subtreeAdd(Sets.newHashSet( - InstanceIdentifier.create(SubInterface.class).child(Tags.class), - InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class), - InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child(Dot1qTag.class), - InstanceIdentifier.create(SubInterface.class).child(Match.class), - InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)), - new GenericListReader<>(subIfcId, new SubInterfaceCustomizer(jvpp, ifcCtx))); - // L2 - final InstanceIdentifier l2Id = subIfcId.child(L2.class); - registry.add(new GenericReader<>(l2Id, new SubInterfaceL2Customizer(jvpp, ifcCtx, bdCtx))); - // Rewrite(Subtree) - registry.subtreeAdd(Sets.newHashSet( - InstanceIdentifier.create(Rewrite.class).child(PushTags.class), - InstanceIdentifier.create(Rewrite.class).child(PushTags.class) - .child(org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)), - new GenericReader<>(l2Id.child(Rewrite.class), new RewriteCustomizer(jvpp, ifcCtx))); - // Ipv4(Structural) - final InstanceIdentifier ipv4Id = subIfcId.child(Ipv4.class); - registry.addStructuralReader(ipv4Id, Ipv4Builder.class); - // Address - registry.add(new GenericListReader<>(ipv4Id.child(Address.class), new SubInterfaceIpv4AddressCustomizer(jvpp, ifcCtx))); - // Acl(Subtree) - final InstanceIdentifier aclIdRelative = InstanceIdentifier.create(Acl.class); - registry.subtreeAdd( - Sets.newHashSet(aclIdRelative.child(L2Acl.class), aclIdRelative.child(Ip4Acl.class), aclIdRelative.child(Ip6Acl.class)), - new GenericReader<>(subIfcId.child(Acl.class), new SubInterfaceAclCustomizer(jvpp, ifcCtx, classifyCtx))); - } -} diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierHoneycombWriterModule.java index c321c2724..172646c06 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierHoneycombWriterModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierHoneycombWriterModule.java @@ -1,31 +1,11 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; -import static org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.InterfacesHoneycombWriterModule.ACL_ID; - -import io.fd.honeycomb.translate.impl.write.GenericListWriter; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifySessionWriter; -import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifyTableWriter; -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.vpp.classifier.rev150603.VppClassifier; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.classify.table.base.attributes.ClassifySession; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.vpp.classifier.ClassifyTable; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; +import io.fd.honeycomb.translate.v3po.VppClassifierHoneycombWriterFactory; public class VppClassifierHoneycombWriterModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractVppClassifierHoneycombWriterModule { - public static final InstanceIdentifier CLASSIFY_TABLE_ID = - InstanceIdentifier.create(VppClassifier.class).child(ClassifyTable.class); - - public static final InstanceIdentifier CLASSIFY_SESSION_ID = - CLASSIFY_TABLE_ID.child(ClassifySession.class); - - public VppClassifierHoneycombWriterModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -50,27 +30,4 @@ public class VppClassifierHoneycombWriterModule extends getClassifyTableContextDependency()); } - private static final class VppClassifierHoneycombWriterFactory implements WriterFactory, AutoCloseable { - private final FutureJVpp jvpp; - private final NamingContext classifyTableContext; - - public VppClassifierHoneycombWriterFactory(@Nonnull final FutureJVpp jvpp, - @Nonnull final NamingContext classifyTableContext) { - this.jvpp = jvpp; - this.classifyTableContext = classifyTableContext; - } - - @Override - public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { - // Ordering here is: First create table, then create sessions and then assign as ACL - // ClassifyTable - registry.addBefore( - new GenericListWriter<>(CLASSIFY_TABLE_ID, new ClassifyTableWriter(jvpp, classifyTableContext)), - CLASSIFY_SESSION_ID); - // ClassifyTableSession - registry.addBefore( - new GenericListWriter<>(CLASSIFY_SESSION_ID, new ClassifySessionWriter(jvpp, classifyTableContext)), - ACL_ID); - } - } } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierStateHoneycombReaderModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierStateHoneycombReaderModule.java index de12bbeea..4169b784a 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierStateHoneycombReaderModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppClassifierStateHoneycombReaderModule.java @@ -1,17 +1,6 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; -import io.fd.honeycomb.translate.impl.read.GenericListReader; -import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifySessionReader; -import io.fd.honeycomb.translate.v3po.vppclassifier.ClassifyTableReader; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierState; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierStateBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.classify.table.base.attributes.ClassifySession; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.vpp.classifier.state.ClassifyTable; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; +import io.fd.honeycomb.translate.v3po.VppClassifierReaderFactory; public class VppClassifierStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractVppClassifierStateHoneycombReaderModule { public VppClassifierStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { @@ -32,28 +21,4 @@ public class VppClassifierStateHoneycombReaderModule extends org.opendaylight.ya return new VppClassifierReaderFactory(getVppJvppDependency(), getClassifyTableContextDependency()); } - private static final class VppClassifierReaderFactory implements ReaderFactory, AutoCloseable { - - private final FutureJVpp jvpp; - private final NamingContext classifyCtx; - - VppClassifierReaderFactory(final FutureJVpp jvpp, - final NamingContext classifyCtx) { - this.jvpp = jvpp; - this.classifyCtx = classifyCtx; - } - - @Override - public void init(final ModifiableReaderRegistryBuilder registry) { - // VppClassifierState - final InstanceIdentifier vppStateId = InstanceIdentifier.create(VppClassifierState.class); - registry.addStructuralReader(vppStateId, VppClassifierStateBuilder.class); - // ClassifyTable - final InstanceIdentifier classTblId = vppStateId.child(ClassifyTable.class); - registry.add(new GenericListReader<>(classTblId, new ClassifyTableReader(jvpp, classifyCtx))); - // ClassifySession - final InstanceIdentifier classSesId = classTblId.child(ClassifySession.class); - registry.add(new GenericListReader<>(classSesId, new ClassifySessionReader(jvpp, classifyCtx))); - } - } } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java index 2cdf24ce6..63a8a1b67 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java @@ -1,22 +1,6 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; -import com.google.common.collect.Sets; -import io.fd.honeycomb.translate.impl.write.GenericListWriter; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import io.fd.honeycomb.translate.v3po.vpp.ArpTerminationTableEntryCustomizer; -import io.fd.honeycomb.translate.v3po.vpp.BridgeDomainCustomizer; -import io.fd.honeycomb.translate.v3po.vpp.L2FibEntryCustomizer; -import io.fd.honeycomb.translate.write.WriterFactory; -import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.Vpp; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.bridge.domain.attributes.ArpTerminationTable; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTable; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.l2.fib.table.L2FibEntry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.BridgeDomains; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomain; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; +import io.fd.honeycomb.translate.v3po.VppHoneycombWriterFactory; public class VppHoneycombWriterModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractVppHoneycombWriterModule { @@ -40,49 +24,9 @@ public class VppHoneycombWriterModule extends @Override public java.lang.AutoCloseable createInstance() { return new VppHoneycombWriterFactory( - getVppJvppWriterDependency(), - getBridgeDomainContextVppDependency(), - getInterfaceContextVppDependency()); + getVppJvppWriterDependency(), + getBridgeDomainContextVppDependency(), + getInterfaceContextVppDependency()); } - private static final class VppHoneycombWriterFactory implements WriterFactory, AutoCloseable { - - private final FutureJVpp jvpp; - private final NamingContext bdContext; - private final NamingContext ifcContext; - - VppHoneycombWriterFactory(final FutureJVpp vppJvppWriterDependency, - final NamingContext bridgeDomainContextVppDependency, - final NamingContext interfaceContextVppDependency) { - this.jvpp = vppJvppWriterDependency; - this.bdContext = bridgeDomainContextVppDependency; - this.ifcContext = interfaceContextVppDependency; - } - - @Override - public void init(final ModifiableWriterRegistryBuilder registry) { - // Vpp has no handlers - // BridgeDomains has no handlers - // BridgeDomain = - final InstanceIdentifier bdId = - InstanceIdentifier.create(Vpp.class).child(BridgeDomains.class).child(BridgeDomain.class); - registry.add(new GenericListWriter<>(bdId, new BridgeDomainCustomizer(jvpp, bdContext))); - // L2FibTable has no handlers - // L2FibEntry(handled after BridgeDomain and L2 of ifc and subifc) = - final InstanceIdentifier l2FibEntryId = bdId.child(L2FibTable.class).child(L2FibEntry.class); - registry.addAfter( - new GenericListWriter<>(l2FibEntryId, new L2FibEntryCustomizer(jvpp, bdContext, ifcContext)), - Sets.newHashSet( - bdId, - InterfacesHoneycombWriterModule.L2_ID, - SubinterfaceAugmentationWriterFactory.L2_ID)); - // ArpTerminationTable has no handlers - // ArpTerminationTableEntry(handled after BridgeDomain) = - final InstanceIdentifier arpEntryId = - bdId.child(ArpTerminationTable.class).child(ArpTerminationTableEntry.class); - registry.addAfter( - new GenericListWriter<>(arpEntryId, new ArpTerminationTableEntryCustomizer(jvpp, bdContext)), - bdId); - } - } } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java index 5be949b13..df216c05a 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java @@ -1,37 +1,16 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; -import io.fd.honeycomb.translate.impl.read.GenericListReader; -import io.fd.honeycomb.translate.impl.read.GenericReader; -import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; -import io.fd.honeycomb.translate.util.read.KeepaliveReaderWrapper; -import io.fd.honeycomb.translate.v3po.util.NamingContext; -import io.fd.honeycomb.translate.v3po.util.ReadTimeoutException; -import io.fd.honeycomb.translate.v3po.vppstate.BridgeDomainCustomizer; -import io.fd.honeycomb.translate.v3po.vppstate.L2FibEntryCustomizer; -import io.fd.honeycomb.translate.v3po.vppstate.VersionCustomizer; +import io.fd.honeycomb.translate.v3po.VppStateHoneycombReaderFactory; import java.lang.management.ManagementFactory; import javax.management.Attribute; import javax.management.InstanceNotFoundException; import javax.management.ObjectName; import org.opendaylight.controller.config.api.ConflictingVersionException; import org.opendaylight.controller.config.api.ValidationException; -import org.opendaylight.controller.config.threadpool.ScheduledThreadPool; import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.jvpp.cfg.rev160406.VppJvppImplModule; import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.jvpp.cfg.rev160406.VppJvppImplModuleFactory; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppStateBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTable; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTableBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.l2.fib.table.L2FibEntry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.BridgeDomains; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.BridgeDomainsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.Version; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.openvpp.jvpp.future.FutureJVpp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -117,49 +96,4 @@ public class VppStateHoneycombReaderModule extends } - private static final class VppStateHoneycombReaderFactory implements ReaderFactory, AutoCloseable { - - private final FutureJVpp jVpp; - private final NamingContext ifcCtx; - private final NamingContext bdCtx; - private final ScheduledThreadPool keepaliveExecutor; - - public VppStateHoneycombReaderFactory(final FutureJVpp jVpp, - final NamingContext ifcCtx, - final NamingContext bdCtx, - final ScheduledThreadPool keepaliveExecutorDependency) { - this.jVpp = jVpp; - this.ifcCtx = ifcCtx; - this.bdCtx = bdCtx; - this.keepaliveExecutor = keepaliveExecutorDependency; - } - - @Override - public void init(final ModifiableReaderRegistryBuilder registry) { - // VppState(Structural) - final InstanceIdentifier vppStateId = InstanceIdentifier.create(VppState.class); - registry.addStructuralReader(vppStateId, VppStateBuilder.class); - // Version - // Wrap with keepalive reader to detect connection issues - // TODO keepalive reader wrapper relies on VersionReaderCustomizer (to perform timeout on reads) - // Once readers+customizers are asynchronous, pull the timeout to keepalive executor so that keepalive wrapper - // is truly generic - registry.add(new KeepaliveReaderWrapper<>( - new GenericReader<>(vppStateId.child(Version.class), new VersionCustomizer(jVpp)), - keepaliveExecutor.getExecutor(), ReadTimeoutException.class, 30, - () -> reinitializeJVpp(reinitializationCounter))); - // BridgeDomains(Structural) - final InstanceIdentifier bridgeDomainsId = vppStateId.child(BridgeDomains.class); - registry.addStructuralReader(bridgeDomainsId, BridgeDomainsBuilder.class); - // BridgeDomain - final InstanceIdentifier bridgeDomainId = bridgeDomainsId.child(BridgeDomain.class); - registry.add(new GenericListReader<>(bridgeDomainId, new BridgeDomainCustomizer(jVpp, bdCtx))); - // L2FibTable(Structural) - final InstanceIdentifier l2FibTableId = bridgeDomainId.child(L2FibTable.class); - registry.addStructuralReader(l2FibTableId, L2FibTableBuilder.class); - // L2FibEntry - registry.add(new GenericListReader<>(l2FibTableId.child(L2FibEntry.class), - new L2FibEntryCustomizer(jVpp, bdCtx, ifcCtx))); - } - } } diff --git a/v3po/v3po2vpp/src/main/resources/honeycomb-minimal-resources/config/v3po.json b/v3po/v3po2vpp/src/main/resources/honeycomb-minimal-resources/config/v3po.json new file mode 100644 index 000000000..290d631f0 --- /dev/null +++ b/v3po/v3po2vpp/src/main/resources/honeycomb-minimal-resources/config/v3po.json @@ -0,0 +1,3 @@ +{ + "some": "value" +} \ No newline at end of file diff --git a/vpp-common/minimal-distribution/pom.xml b/vpp-common/minimal-distribution/pom.xml new file mode 100644 index 000000000..4500a633d --- /dev/null +++ b/vpp-common/minimal-distribution/pom.xml @@ -0,0 +1,107 @@ + + + + + + io.fd.honeycomb.common + minimal-distribution-parent + 1.0.0-SNAPSHOT + ../../common/minimal-distribution-parent + + + 4.0.0 + io.fd.honeycomb.vpp + minimal-distribution + 1.0.0-SNAPSHOT + + + io.fd.honeycomb.vpp.distro.Main + + + + + + maven-compiler-plugin + + + groovy-eclipse-compiler + + + + org.codehaus.groovy + groovy-eclipse-compiler + 2.9.2-01 + + + + org.codehaus.groovy + groovy-eclipse-batch + 2.4.3-01 + + + + + org.codehaus.gmaven + groovy-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-dependency-plugin + + + maven-assembly-plugin + + + + + + + io.fd.honeycomb + minimal-distribution + 1.0.0-SNAPSHOT + + + ${project.groupId} + naming-context-api + ${project.version} + + + ${project.groupId} + naming-context-impl + ${project.version} + + + ${project.groupId} + vpp-jvpp-cfg + ${project.version} + + + io.fd.vpp + jvpp + 16.09-SNAPSHOT + + + ${project.groupId} + vpp-translate-utils + ${project.version} + + + + diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy new file mode 100644 index 000000000..fe71caddb --- /dev/null +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy @@ -0,0 +1,40 @@ +/* + * 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.distro + +import com.google.inject.Inject +import com.google.inject.name.Named +import groovy.transform.ToString +import groovy.util.logging.Slf4j +import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.translate.read.ReaderFactory +import org.opendaylight.controller.md.sal.binding.api.DataBroker +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.context.impl.rev141210.ContextReaderModule + +/** + * Mirror of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.context.impl.rev141210.ContextReaderModule + */ +@Slf4j +@ToString +class ContextsReaderFactoryProvider extends ProviderTrait { + + @Inject + @Named("honeycomb-context") + DataBroker contextDataBroker + + def create() { new ContextReaderModule.ContextsReaderFactory(contextDataBroker) } +} diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy new file mode 100644 index 000000000..dfd0c44ae --- /dev/null +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy @@ -0,0 +1,55 @@ +/* + * 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.distro + +import com.google.inject.Inject +import groovy.transform.ToString +import groovy.util.logging.Slf4j +import io.fd.honeycomb.infra.distro.ProviderTrait +import org.openvpp.jvpp.JVppImpl +import org.openvpp.jvpp.VppJNIConnection +import org.openvpp.jvpp.future.FutureJVpp +import org.openvpp.jvpp.future.FutureJVppFacade + +@Slf4j +@ToString +class JVppProvider extends ProviderTrait { + + @Inject + VppConfigAttributes config + + def create() { + try { + def connection = new VppJNIConnection(config.jvppConnectionName) + def jVpp = new JVppImpl(connection) + + // Closing JVpp connection with shutdown hook to erase the connection from VPP so HC will be able + // to connect next time + // TODO is there a safer way than a shutdown hook ? + Runtime.addShutdownHook { + log.info("Disconnecting from VPP") + jVpp.close() + connection.close() + log.info("Successfully disconnected from VPP as {}", config.jvppConnectionName) + } + log.info("JVpp connection opened successfully as: {}", config.jvppConnectionName) + new FutureJVppFacade(jVpp) + } catch (IOException e) { + throw new IllegalStateException("Unable to open VPP management connection", e) + } + } +} diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/Main.java b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/Main.java new file mode 100644 index 000000000..821bd1ef9 --- /dev/null +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/Main.java @@ -0,0 +1,32 @@ +/* + * 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.distro; + +import com.google.common.collect.Lists; +import com.google.inject.Module; +import java.util.List; + +public class Main { + + public static void main(String[] args) { + final List sampleModules = Lists.newArrayList(io.fd.honeycomb.infra.distro.Main.BASE_MODULES); + + sampleModules.add(new VppCommonModule()); + + io.fd.honeycomb.infra.distro.Main.init(sampleModules); + } +} diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy new file mode 100644 index 000000000..4c2573ca1 --- /dev/null +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy @@ -0,0 +1,42 @@ +/* + * 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.distro + +import com.google.inject.AbstractModule +import com.google.inject.Singleton +import com.google.inject.multibindings.Multibinder +import groovy.util.logging.Slf4j +import io.fd.honeycomb.translate.read.ReaderFactory +import net.jmob.guice.conf.core.ConfigurationModule +import org.openvpp.jvpp.future.FutureJVpp + +@Slf4j +public final class VppCommonModule extends AbstractModule { + + protected void configure() { + install(ConfigurationModule.create()) + // Inject non-dependency configuration + requestInjection(VppConfigAttributes) + + bind(FutureJVpp).toProvider(JVppProvider).in(Singleton) + + // Naming contexts reader exposing context storage over REST/NETCONF + Multibinder.newSetBinder(binder(), ReaderFactory.class).with { + addBinding().toProvider(ContextsReaderFactoryProvider).in(Singleton) + } + } +} diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppConfigAttributes.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppConfigAttributes.groovy new file mode 100644 index 000000000..23ee95da3 --- /dev/null +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppConfigAttributes.groovy @@ -0,0 +1,31 @@ +/* + * 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.distro + +import groovy.transform.ToString +import net.jmob.guice.conf.core.BindConfig +import net.jmob.guice.conf.core.InjectConfig +import net.jmob.guice.conf.core.Syntax + +@ToString(includeNames = true) +@BindConfig(value = "jvpp", syntax = Syntax.JSON) +class VppConfigAttributes { + + @InjectConfig("jvpp-connection-name") + String jvppConnectionName + +} diff --git a/vpp-common/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/jvpp.json b/vpp-common/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/jvpp.json new file mode 100644 index 000000000..1d411872e --- /dev/null +++ b/vpp-common/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/jvpp.json @@ -0,0 +1,3 @@ +{ + "jvpp-connection-name": "honeycomb" +} \ No newline at end of file diff --git a/vpp-common/naming-context-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/context/impl/rev141210/ContextReaderModule.java b/vpp-common/naming-context-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/context/impl/rev141210/ContextReaderModule.java index da7ab832d..ccc01e0ad 100644 --- a/vpp-common/naming-context-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/context/impl/rev141210/ContextReaderModule.java +++ b/vpp-common/naming-context-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/context/impl/rev141210/ContextReaderModule.java @@ -27,14 +27,14 @@ public class ContextReaderModule extends org.opendaylight.yang.gen.v1.urn.openda @Override public java.lang.AutoCloseable createInstance() { - return new ReaderFactory(getContextBindingBrokerDependency()); + return new ContextsReaderFactory(getContextBindingBrokerDependency()); } - private static final class ReaderFactory implements AutoCloseable, io.fd.honeycomb.translate.read.ReaderFactory { + public static final class ContextsReaderFactory implements AutoCloseable, io.fd.honeycomb.translate.read.ReaderFactory { private final DataBroker contextBindingBrokerDependency; - public ReaderFactory(final DataBroker contextBindingBrokerDependency) { + public ContextsReaderFactory(final DataBroker contextBindingBrokerDependency) { this.contextBindingBrokerDependency = contextBindingBrokerDependency; } diff --git a/vpp-common/pom.xml b/vpp-common/pom.xml index ca4029b81..42a5221e3 100644 --- a/vpp-common/pom.xml +++ b/vpp-common/pom.xml @@ -36,7 +36,8 @@ vpp-jvpp-cfg naming-context-api naming-context-impl - features + minimal-distribution + diff --git a/vpp-integration/minimal-distribution/pom.xml b/vpp-integration/minimal-distribution/pom.xml new file mode 100644 index 000000000..034c3ee75 --- /dev/null +++ b/vpp-integration/minimal-distribution/pom.xml @@ -0,0 +1,71 @@ + + + + + + io.fd.honeycomb.common + minimal-distribution-parent + 1.0.0-SNAPSHOT + ../../common/minimal-distribution-parent + + + 4.0.0 + io.fd.honeycomb.vpp.integration + vpp-integration-distribution + 1.0.0-SNAPSHOT + + + -Xms128m -Xmx128m + io.fd.honeycomb.vpp.integration.distro.Main + + + + + + maven-compiler-plugin + + + org.codehaus.gmaven + groovy-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-dependency-plugin + + + maven-assembly-plugin + + + + + + + io.fd.honeycomb.vpp + minimal-distribution + 1.0.0-SNAPSHOT + + + io.fd.honeycomb.v3po + v3po2vpp + 1.0.0-SNAPSHOT + + + + diff --git a/vpp-integration/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/integration/distro/Main.java b/vpp-integration/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/integration/distro/Main.java new file mode 100644 index 000000000..6485aedb1 --- /dev/null +++ b/vpp-integration/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/integration/distro/Main.java @@ -0,0 +1,36 @@ +/* + * 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.translate.v3po.V3poModule; +import io.fd.honeycomb.vpp.distro.VppCommonModule; +import java.util.List; + +public class Main { + + public static void main(String[] args) { + final List 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()); + + io.fd.honeycomb.infra.distro.Main.init(sampleModules); + } +} diff --git a/vpp-integration/pom.xml b/vpp-integration/pom.xml index 7b900e7ea..e087abd86 100644 --- a/vpp-integration/pom.xml +++ b/vpp-integration/pom.xml @@ -31,8 +31,9 @@ 3.1.1 - features - karaf + + + minimal-distribution -- cgit 1.2.3-korg