Add BP wiring for sfc-vpp-renderer 43/45443/3
authorRashmi Pujar <rpujar@inocybe.com>
Fri, 9 Sep 2016 19:13:39 +0000 (15:13 -0400)
committerRashmi Pujar <rpujar@inocybe.com>
Thu, 6 Oct 2016 17:52:37 +0000 (17:52 +0000)
Change-Id: I5cd39e31c4cadabe9eaf5b253b31ee97296df2a1
Signed-off-by: Rashmi Pujar <rpujar@inocybe.com>
features/pom.xml
features/src/main/features/features.xml
sfc-renderers/sfc-vpp-renderer/pom.xml
sfc-renderers/sfc-vpp-renderer/src/main/java/org/opendaylight/controller/config/yang/config/sfc_vpp_renderer/impl/SfcVppRendererModule.java [deleted file]
sfc-renderers/sfc-vpp-renderer/src/main/java/org/opendaylight/controller/config/yang/config/sfc_vpp_renderer/impl/SfcVppRendererModuleFactory.java [deleted file]
sfc-renderers/sfc-vpp-renderer/src/main/resources/configuration/initial/sfc-vpp-renderer-initial.xml [deleted file]
sfc-renderers/sfc-vpp-renderer/src/main/resources/org/opendaylight/blueprint/sfc-vpp-renderer.xml [new file with mode: 0644]
sfc-renderers/sfc-vpp-renderer/src/main/yang/sfc-vpp-renderer-impl.yang [deleted file]

index 5ddd3a2adb8a9bb0bca2943455404039d1e97c92..82a76cdb547256530cc26e75484e7caea838fa5c 100644 (file)
       Put dependencies for configfiles directly referenced in your features.xml file.
       For every <configfile> reference in your features.xml file, you need a corresponding dependency here.
     -->
-    <!-- odl-sfc-vpp-renderer config files -->
-    <dependency>
-       <groupId>${project.groupId}</groupId>
-       <artifactId>sfc-vpp-renderer</artifactId>
-       <version>${project.version}</version>
-       <type>xml</type>
-       <classifier>config</classifier>
-    </dependency>
     <!-- odl-sfclisp config files -->
     <dependency>
        <groupId>${project.groupId}</groupId>
index f028cf7f7342f390b2c03cf6eff2c032df3205f9..7603ce5f803b882e88f884353e5f9352715f80cc 100644 (file)
@@ -87,7 +87,6 @@
         <feature version="${netconf.parent.version}">odl-netconf-connector-all</feature>
         <feature version="${netconf.parent.version}">odl-netconf-topology</feature>
         <bundle>mvn:org.opendaylight.sfc/sfc-vpp-renderer/{{VERSION}}</bundle>
-        <configfile finalname="etc/opendaylight/karaf/sfc-vpp-renderer-initial.xml">mvn:org.opendaylight.sfc/sfc-vpp-renderer/{{VERSION}}/xml/config</configfile>
     </feature>
 
     <feature name="odl-sfclisp" version="${project.version}" description="OpenDaylight :: sfclisp :: all">
index deecaf517e5d8643f99df30d2dea7400cf25f72d..611a05e5fd2c58527d4dcf5950840eb81bc98ad0 100644 (file)
     <artifactId>sfc-vpp-renderer</artifactId>
     <packaging>bundle</packaging>
 
-    <properties>
-        <configfile>configuration/initial/sfc-vpp-renderer-initial.xml</configfile>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>attach-artifacts</id>
-                        <goals>
-                            <goal>attach-artifact</goal>
-                        </goals>
-                        <phase>package</phase>
-                        <configuration>
-                            <artifacts>
-                                <artifact>
-                                    <file>${project.build.directory}/classes/${configfile}</file>
-                                    <type>xml</type>
-                                    <classifier>config</classifier>
-                                </artifact>
-                            </artifacts>
-                        </configuration>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/sfc-renderers/sfc-vpp-renderer/src/main/java/org/opendaylight/controller/config/yang/config/sfc_vpp_renderer/impl/SfcVppRendererModule.java b/sfc-renderers/sfc-vpp-renderer/src/main/java/org/opendaylight/controller/config/yang/config/sfc_vpp_renderer/impl/SfcVppRendererModule.java
deleted file mode 100644 (file)
index 7b2abc5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Copyright (c) 2016 Intel Ltd. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.config.sfc_vpp_renderer.impl;
-
-import org.opendaylight.sfc.sfc_vpp_renderer.SfcVppRenderer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class SfcVppRendererModule extends org.opendaylight.controller.config.yang.config.sfc_vpp_renderer.impl.AbstractSfcVppRendererModule {
-    private static final Logger LOG = LoggerFactory.getLogger(SfcVppRendererModule.class);
-
-    public SfcVppRendererModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public SfcVppRendererModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.sfc_vpp_renderer.impl.SfcVppRendererModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        LOG.info("Initializing SFC VPP renderer module ... ");
-        SfcVppRenderer renderer = new SfcVppRenderer(getDataBrokerDependency(), getBindingRegistryDependency());
-
-        LOG.info("SFC VPP renderer module initialized");
-
-        java.lang.AutoCloseable autoClosable = new java.lang.AutoCloseable() {
-            @Override
-            public void close() {
-                renderer.unregisterListeners();
-                LOG.info("SFC VPP renderer listeners closed");
-            }
-        };
-
-        return autoClosable;
-    }
-
-}
diff --git a/sfc-renderers/sfc-vpp-renderer/src/main/java/org/opendaylight/controller/config/yang/config/sfc_vpp_renderer/impl/SfcVppRendererModuleFactory.java b/sfc-renderers/sfc-vpp-renderer/src/main/java/org/opendaylight/controller/config/yang/config/sfc_vpp_renderer/impl/SfcVppRendererModuleFactory.java
deleted file mode 100644 (file)
index 11cc1b4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Copyright (c) 2016 Intel Ltd. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: sfc-vpp-renderer-impl yang module local name: sfc-vpp-renderer-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Jul 20 16:16:13 CST 2016
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.sfc_vpp_renderer.impl;
-public class SfcVppRendererModuleFactory extends org.opendaylight.controller.config.yang.config.sfc_vpp_renderer.impl.AbstractSfcVppRendererModuleFactory {
-
-}
diff --git a/sfc-renderers/sfc-vpp-renderer/src/main/resources/configuration/initial/sfc-vpp-renderer-initial.xml b/sfc-renderers/sfc-vpp-renderer/src/main/resources/configuration/initial/sfc-vpp-renderer-initial.xml
deleted file mode 100644 (file)
index defb038..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<snapshot>
-    <configuration>
-        <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-            <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-                <module>
-                    <type xmlns:sfc="urn:opendaylight:params:xml:ns:yang:controller:config:sfc-vpp-renderer:impl">
-                        sfc:sfc-vpp-renderer-impl
-                    </type>
-                    <name>sfc-vpp-renderer-impl</name>
-
-                    <rpc-registry>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
-                        <name>binding-rpc-broker</name>
-                    </rpc-registry>
-
-                    <notification-service>
-                      <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
-                        binding:binding-notification-service
-                      </type>
-                      <name>binding-notification-broker</name>
-                    </notification-service>
-
-                    <data-broker>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
-                        <name>binding-data-broker</name>
-                    </data-broker>
-
-                    <binding-registry>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
-                        <name>binding-osgi-broker</name>
-                    </binding-registry>
-                </module>
-            </modules>
-        </data>
-
-    </configuration>
-
-    <required-capabilities>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:sfc-provider:impl?module=sfc-provider-impl&amp;revision=2014-06-30</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:sfc-vpp-renderer:impl?module=sfc-vpp-renderer-impl&amp;revision=2016-07-20</capability>
-    </required-capabilities>
-
-</snapshot>
diff --git a/sfc-renderers/sfc-vpp-renderer/src/main/resources/org/opendaylight/blueprint/sfc-vpp-renderer.xml b/sfc-renderers/sfc-vpp-renderer/src/main/resources/org/opendaylight/blueprint/sfc-vpp-renderer.xml
new file mode 100644 (file)
index 0000000..55324f9
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+  xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+  odl:use-default-for-reference-types="true">
+
+  <reference id="dataBroker"
+    interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+    odl:type="default" />
+  <reference id="bindingRegistry"
+    interface="org.opendaylight.controller.sal.binding.api.BindingAwareBroker" />
+
+  <bean id="renderer"
+    class="org.opendaylight.sfc.sfc_vpp_renderer.SfcVppRenderer"
+    destroy-method="unregisterListeners">
+    <argument ref="dataBroker"/>
+    <argument ref="bindingRegistry"/>
+  </bean>
+
+</blueprint>
diff --git a/sfc-renderers/sfc-vpp-renderer/src/main/yang/sfc-vpp-renderer-impl.yang b/sfc-renderers/sfc-vpp-renderer/src/main/yang/sfc-vpp-renderer-impl.yang
deleted file mode 100644 (file)
index 4914968..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// vi: set smarttab et sw=4 tabstop=4:
-module sfc-vpp-renderer-impl {
-
-  yang-version 1;
-  namespace "urn:opendaylight:params:xml:ns:yang:controller:config:sfc-vpp-renderer:impl";
-  prefix "sfc-vpp-renderer-impl";
-
-  import config { prefix config; revision-date 2013-04-05; }
-  import rpc-context { prefix rpcx; revision-date 2013-06-17; }
-  import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
-
-
-  description
-      "This module contains the base YANG definitions for
-      sfc-vpp-renderer impl implementation.";
-
-  revision "2016-07-20" {
-      description
-          "Initial revision";
-  }
-
-  // This is the definition of the service implementation as a module identity
-  identity sfc-vpp-renderer-impl {
-      base config:module-type;
-
-      // Specifies the prefix for generated java classes.
-      config:java-name-prefix SfcVppRenderer;
-  }
-
-
-  // Augments the 'configuration' choice node under modules/module.
-  augment "/config:modules/config:module/config:configuration" {
-    case sfc-vpp-renderer-impl {
-      when "/config:modules/config:module/config:type = 'sfc-vpp-renderer-impl'";
-
-      //wires in the data-broker service
-      container data-broker {
-        uses config:service-ref {
-          refine type {
-              mandatory false;
-              config:required-identity mdsal:binding-async-data-broker;
-          }
-        }
-      }
-
-      container notification-service {
-        uses config:service-ref {
-          refine type {
-            mandatory true;
-            config:required-identity mdsal:binding-notification-service;
-          }
-        }
-      }
-
-      container rpc-registry {
-        uses config:service-ref {
-          refine type {
-             mandatory true;
-             config:required-identity mdsal:binding-rpc-registry;
-          }
-        }
-      }
-
-      container binding-registry {
-        uses config:service-ref {
-          refine type {
-              mandatory true;
-              config:required-identity mdsal:binding-broker-osgi-registry;
-          }
-        }
-      }
-    }
-  }
-}