Refactor pom files to reflects right parents. 06/24406/3
authorAlexis de Talhouët <adetalhouet@inocybe.com>
Wed, 22 Jul 2015 18:07:41 +0000 (14:07 -0400)
committerAlexis de Talhouët <adetalhouet@inocybe.com>
Wed, 22 Jul 2015 20:41:13 +0000 (16:41 -0400)
Also rename the config file to default-config
Change the broker to be binding-osgi-borker

This patch doesn't fix the following issue: https://gist.github.com/adetalhouet/9ef2ae2f57533ded5cd5

Change-Id: I8364ec693344c1550225e4f44a77dfd6a68deecb
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
features-packetcable-policy/pom.xml
features-packetcable-policy/src/main/features/features.xml [new file with mode: 0644]
features-packetcable-policy/src/main/resources/features.xml [deleted file]
packetcable-policy-config/pom.xml
packetcable-policy-config/src/main/resources/default-config.xml [moved from packetcable-policy-config/src/main/resources/80-packetcable.xml with 84% similarity]
packetcable-policy-karaf/pom.xml
packetcable-policy-model/pom.xml
packetcable-policy-server/pom.xml
packetcable-policy-server/src/main/java/org/opendaylight/controller/packetcable/provider/PacketcableProvider.java
packetcable-policy-server/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/packetcable/packetcable/policy/server/impl/rev140131/PacketcableProviderModule.java
packetcable-policy-server/src/main/yang/packetcable-policy-server.yang

index 6ee75491acdd3b9032d2d00f99a0df769b6b7f63..7ba3dc371b00981d31b4551ea0f24dbc2760a033 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
+ Copyright (c) 2015 CableLabs, Inc. 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
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-   <modelVersion>4.0.0</modelVersion>
-   <parent>
-    <artifactId>packetcable</artifactId>
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>features-parent</artifactId>
+        <version>1.6.0-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+    <artifactId>features-packetcable-policy</artifactId>
     <groupId>org.opendaylight.packetcable</groupId>
+    <name>${project.artifactId}</name>
     <version>1.3.0-SNAPSHOT</version>
-  </parent>
-   <!--
-    Necessary TODO: Hookup your parent pom here, else you will not get necessary versions,
-    maven repos etc.  If you run this archetype in a subdirectory of your project, it
-    will pick the pom.xml from the parent directory as the parent pom, which may or may
-    not be correct.
-  -->
-   <artifactId>features-packetcable-policy</artifactId>
-   <groupId>org.opendaylight.packetcable</groupId>
-   <!-- Optional Uncomment version if you are not using a parent pom.xml
-   <version>1.3.0-SNAPSHOT</version>
-   -->
-   <packaging>jar</packaging>
-   <properties>
-      <features.file>features.xml</features.file>
-      <!-- Optional: Move these properties to your parent pom and possibly
-            DependencyManagement section of your parent pom -->
-      <branding.version>1.2.0-SNAPSHOT</branding.version>
-      <karaf.resources.version>1.6.0-SNAPSHOT</karaf.resources.version>
-      <karaf.empty.version>1.6.0-SNAPSHOT</karaf.empty.version>
-      <surefire.version>2.16</surefire.version>
-   </properties>
-   <dependencies>
-    <!--
-      Necessary: Put dependencies on any feature repos
-      you use in your features.xml file.
-
-      Note: they will need to be <type>xml</xml>
-      and <classifier>features</classifier>.
-      One other thing to watch for is to make sure they are
-      <scope>compile</compile>, which they should be by default,
-      but be cautious lest they be at a different scope in a parent pom.
-
-      Examples:
-    -->
+    <properties>
+        <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+        <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
+        <feature.test.version>1.6.0-SNAPSHOT</feature.test.version>
+    </properties>
+    <dependencies>
         <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>features-yangtools</artifactId>
-          <version>0.8.0-SNAPSHOT</version>
-          <classifier>features</classifier>
-          <type>xml</type>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>features-yangtools</artifactId>
+            <version>${yangtools.version}</version>
+            <classifier>features</classifier>
+            <type>xml</type>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>features-mdsal</artifactId>
-          <version>1.3.0-SNAPSHOT</version>
-          <classifier>features</classifier>
-          <type>xml</type>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>features-mdsal</artifactId>
+            <version>${mdsal.version}</version>
+            <classifier>features</classifier>
+            <type>xml</type>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
-          <groupId>org.opendaylight.packetcable</groupId>
-          <artifactId>packetcable-policy-config</artifactId>
-          <version>${project.version}</version>
-          <classifier>config</classifier>
-          <type>xml</type>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>features-restconf</artifactId>
+            <classifier>features</classifier>
+            <version>${mdsal.version}</version>
+            <type>xml</type>
+            <scope>runtime</scope>
         </dependency>
-
-
-
-
-    <!--
-      Necessary TODO: Put dependencies for bundles directly referenced
-      in your features.xml file.  For every <bundle> reference in your
-      features.xml file, you need a corresponding dependency here.
-
-      Examples:
-    -->
-      <dependency>
-        <groupId>org.opendaylight.packetcable</groupId>
-        <artifactId>packetcable-policy-server</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.packetcable</groupId>
-        <artifactId>packetcable-policy-model</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.packetcable</groupId>
-        <artifactId>packetcable-driver</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-    <!-- test to validate features.xml -->
-    <dependency>
-      <groupId>org.opendaylight.odlparent</groupId>
-      <artifactId>features-test</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <!-- dependency for opendaylight-karaf-empty for use by testing -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>opendaylight-karaf-empty</artifactId>
-      <version>${karaf.empty.version}</version>
-      <type>zip</type>
-    </dependency>
-    <!-- Uncomment this if you get an error : java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <version>1.7.2</version>
-    </dependency>
-    -->
-
-   </dependencies>
-   <build>
-      <resources>
-         <resource>
-            <directory>src/main/resources</directory>
-            <filtering>true</filtering>
-         </resource>
-      </resources>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-resources-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>filter</id>
-                  <phase>generate-resources</phase>
-                  <goals>
-                     <goal>resources</goal>
-                  </goals>
-               </execution>
-            </executions>
-         </plugin>
-         <plugin>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>build-helper-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>attach-artifacts</id>
-                  <phase>package</phase>
-                  <goals>
-                     <goal>attach-artifact</goal>
-                  </goals>
-                  <configuration>
-                     <artifacts>
-                        <artifact>
-                           <file>${project.build.directory}/classes/${features.file}</file>
-                           <type>xml</type>
-                           <classifier>features</classifier>
-                        </artifact>
-                     </artifacts>
-                  </configuration>
-               </execution>
-            </executions>
-         </plugin>
-         <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <version>${surefire.version}</version>
-            <configuration>
-              <systemPropertyVariables>
-                <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
-                <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
-                <karaf.distro.version>${karaf.empty.version}</karaf.distro.version>
-              </systemPropertyVariables>
-              <dependenciesToScan>
-               <dependency>org.opendaylight.odlparent:features-test</dependency>
-              </dependenciesToScan>
-            </configuration>
-          </plugin>
-      </plugins>
-   </build>
-   <scm>
-      <connection>scm:git:ssh://git.opendaylight.org:29418/packetcable.git</connection>
-      <developerConnection>scm:git:ssh://git.opendaylight.org:29418/packetcable.git</developerConnection>
-      <tag>HEAD</tag>
-      <url>https://git.opendaylight.org/gerrit/gitweb?p=packetcable.git;a=summary</url>
-   </scm>
-</project>
+        <dependency>
+            <groupId>org.opendaylight.packetcable</groupId>
+            <artifactId>packetcable-policy-config</artifactId>
+            <version>${project.version}</version>
+            <classifier>config</classifier>
+            <type>xml</type>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.packetcable</groupId>
+            <artifactId>packetcable-policy-server</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.packetcable</groupId>
+            <artifactId>packetcable-policy-model</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.packetcable</groupId>
+            <artifactId>packetcable-driver</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>features-test</artifactId>
+            <version>${feature.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/features-packetcable-policy/src/main/features/features.xml b/features-packetcable-policy/src/main/features/features.xml
new file mode 100644 (file)
index 0000000..aa96f1a
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 CableLabs, Inc. 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
+-->
+<features name="odl-packetcable-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+    <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
+    <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
+    <repository>mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features</repository>
+    <feature name='odl-packetcable-policy-server-all' version='${project.version}'
+        description='OpenDaylight :: packetcable :: policy :: All'>
+        <feature version='${project.version}'>odl-packetcable-policy-server</feature>
+    </feature>
+    <feature name='odl-packetcable-policy-model' version='${project.version}'
+        description='OpenDaylight :: packetcable :: policy :: Model'>
+        <feature version='${yangtools.version}'>odl-yangtools-binding</feature>
+        <feature version='${yangtools.version}'>odl-yangtools-models</feature>
+        <bundle>mvn:org.opendaylight.packetcable/packetcable-policy-model/${project.version}</bundle>
+    </feature>
+    <feature name='odl-packetcable-policy-server' version='${project.version}'
+        description='OpenDaylight :: packetcable :: policy :: Provider'>
+        <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+        <feature version="${mdsal.version}">odl-mdsal-apidocs</feature>
+        <feature version='${project.version}'>odl-packetcable-policy-model</feature>
+        <bundle>mvn:org.opendaylight.packetcable/packetcable-policy-server/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.packetcable/packetcable-driver/${project.version}</bundle>
+        <configfile finalname="etc/opendaylight/karaf/80-packetcable.xml">mvn:org.opendaylight.packetcable/packetcable-policy-config/${project.version}/xml/config</configfile>
+    </feature>
+</features>
\ No newline at end of file
diff --git a/features-packetcable-policy/src/main/resources/features.xml b/features-packetcable-policy/src/main/resources/features.xml
deleted file mode 100644 (file)
index 0715467..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
- 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
--->
-<features name="odl-packetcable-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-    <!--
-        Please read the features guidelines:
-        https://wiki.opendaylight.org/view/Runtime:Karaf_Features_Guidelines#Feature_Best_Practices
-    -->
-    <!--
-    Add repo entries for the repositories of features you refer to in this feature file but do not define here.
-    <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/0.2.0-SNAPSHOT/xml/features</repository>
-    <repository>mvn:org.opendaylight.controller/features-adsal/${feature.adsal.version}/xml/features</repository>      
-    <repository>mvn:org.opendaylight.controller/features-adsal-compatibility/1.6.0-SNAPSHOT/xml/features</repository>
-    -->
-    <repository>mvn:org.opendaylight.yangtools/features-yangtools/0.8.0-SNAPSHOT/xml/features</repository>
-    <repository>mvn:org.opendaylight.controller/features-mdsal/1.3.0-SNAPSHOT/xml/features</repository>
-    <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/${openflowplugin.version}/xml/features</repository>
-
-    <feature name='odl-packetcable-policy-server-all' version='${project.version}' description='OpenDaylight :: packetcable :: policy :: All'>
-            <feature version='${project.version}'>odl-packetcable-policy-server</feature>
-            <feature version='${project.version}'>odl-packetcable-policy-model</feature>
-            <feature version='${project.version}'>odl-packetcable-driver</feature>
-    </feature>
-
-    <!--
-        Define your features.  It is useful to list then in order of dependency.  So if A depends on B, list A first.
-        It's also nice to list inside a feature, first the features it needs, then the bundles it needs, then the configfiles.
-            <feature version='0.2.0-SNAPSHOT'>odl-openflowplugin-flow-services</feature>
-           <bundle>mvn:com.google.common.collect/collect/14.0</bundle>
-
-    -->
-        <!--- * Basic MD-SAL Consumer -->
-        <!--- * Basic MD-SAL Model feature -->
-        <feature name='odl-packetcable-policy-model' version='${project.version}' description='OpenDaylight :: packetcable :: policy :: Model'>
-            <feature version='0.8.0-SNAPSHOT'>odl-yangtools-binding</feature>
-            <feature version='0.8.0-SNAPSHOT'>odl-yangtools-models</feature>
-            <bundle>mvn:org.opendaylight.packetcable/packetcable-policy-model/${project.version}</bundle>
-        </feature>
-
-        <!--- * Basic MD-SAL Provider -->
-        <feature name='odl-packetcable-policy-server' version='${project.version}' description='OpenDaylight :: packetcable :: policy :: Provider'>
-            <feature version='1.3.0-SNAPSHOT'>odl-mdsal-broker</feature>
-            <bundle>mvn:org.opendaylight.packetcable/packetcable-policy-server/${project.version}</bundle>
-            <bundle>mvn:org.opendaylight.packetcable/packetcable-driver/${project.version}</bundle>
-            <feature version='${project.version}'>odl-packetcable-policy-model</feature>
-            <feature version='${project.version}'>odl-packetcable-driver</feature>
-            <configfile finalname="etc/opendaylight/karaf/80-packetcable.xml">mvn:org.opendaylight.packetcable/packetcable-policy-config/${project.version}/xml/config</configfile>
-        </feature>
-
-        <!--- * * -->
-        <feature name='odl-packetcable-driver' version='${project.version}' description='OpenDaylight :: packetcable :: Driver'>
-            <feature version='1.3.0-SNAPSHOT'>odl-mdsal-broker</feature>
-       </feature>
-
-</features>
index 789824216e023177592b87699b42a2aaf466a764..4af5f079f7d6737b40c39b67b6ae5a576195599f 100644 (file)
@@ -33,7 +33,7 @@
   <packaging>jar</packaging>
   <properties>
       <!-- Optional TODO: Rename your configfile to taste -->
-      <configfile>80-packetcable.xml</configfile>
+      <configfile>default-config.xml</configfile>
   </properties>
   <build>
     <plugins>
similarity index 84%
rename from packetcable-policy-config/src/main/resources/80-packetcable.xml
rename to packetcable-policy-config/src/main/resources/default-config.xml
index 2057f962e61bc23ce7d3c17162ef32c3310186ca..cea0b464719631c4c6cafb95c7c6eb038b9438f8 100644 (file)
@@ -9,6 +9,7 @@
 <snapshot>
     <required-capabilities>
         <capability>urn:opendaylight:params:xml:ns:yang:packetcable:packetcable-policy-server:impl?module=packetcable-policy-server-impl&amp;revision=2014-01-31</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
     </required-capabilities>
     <configuration>
 
@@ -20,8 +21,8 @@
                     </type>
                     <name>packetcable-policy-server-default-impl</name>
                     <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>
+                       <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+                       <name>binding-osgi-broker</name>
                     </data-broker>
                     <rpc-registry>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
index 34bc1b02d5966bd7d7246c1801425ebdf461d587..ba2c15ab8ab7111d3bcded97ba906d5f0818ad4a 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <artifactId>packetcable</artifactId>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>karaf-parent</artifactId>
+        <version>1.6.0-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+    <artifactId>packetcable-policy-karaf</artifactId>
     <groupId>org.opendaylight.packetcable</groupId>
+    <name>${project.artifactId}</name>
     <version>1.3.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>packetcable-policy-karaf</artifactId>
-  <packaging>pom</packaging>
-  <prerequisites>
-    <maven>3.0</maven>
-  </prerequisites>
-  <properties>
-    <!-- Optional TODO: Move these properties to your parent pom and possibly
-            DependencyManagement section of your parent pom -->
-    <branding.version>1.2.0-SNAPSHOT</branding.version>
-    <karaf.resources.version>1.6.0-SNAPSHOT</karaf.resources.version>
-  </properties>
-
-  <dependencies>
-    <!-- Basic Karaf dependencies -->
-    <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>framework</artifactId>
-      <version>${karaf.version}</version>
-      <type>kar</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>standard</artifactId>
-      <version>${karaf.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-      <scope>runtime</scope>
-    </dependency>
-
-    <!-- ODL Branding -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>karaf.branding</artifactId>
-      <version>${branding.version}</version>
-      <scope>compile</scope>
-    </dependency>
-
-    <!-- ODL Resources needed for karaf -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>opendaylight-karaf-resources</artifactId>
-      <version>${karaf.resources.version}</version>
-    </dependency>
-
-    <!-- Project local feautures -->
-    <!--
-      Necessary TODO put your features here.
-
-      Note: they will need to be <type>xml</xml>
-      and <classifier>features</classifier>.
-
-      Note: they must be <scope>runtime</scope>
-
-      Note: usually you would only need to depend
-      on your own feature file here for your local distro,
-      and possible the features-mdsal for odl-restconf
-      (although, strange situations do exist :) )
-
-      Example:
-      <dependency>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>features-mdsal</artifactId>
-        <classifier>features</classifier>
-        <type>xml</type>
-        <scope>runtime</scope>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.openflowplugin</groupId>
-        <artifactId>features-openflowplugin</artifactId>
-        <version>0.2.0-SNAPSHOT</version>
-        <classifier>features</classifier>
-        <type>xml</type>
-        <scope>runtime</scope>
-      </dependency>
-    -->
-      <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>features-mdsal</artifactId>
-          <classifier>features</classifier>
-          <version>${project.version}</version>
-          <type>xml</type>
-          <scope>runtime</scope>
-      </dependency>
-<!--
-      <dependency>
-        <groupId>org.opendaylight.l2switch</groupId>
-        <artifactId>features-l2switch</artifactId>
-        <classifier>features</classifier>
-        <version>0.3.0-SNAPSHOT</version>
-        <type>xml</type>
-        <scope>runtime</scope>
-      </dependency>
--->
-      <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>features-restconf</artifactId>
-          <classifier>features</classifier>
-          <version>1.3.0-SNAPSHOT</version>
-          <type>xml</type>
-          <scope>runtime</scope>
-      </dependency>
-      <dependency>
-          <groupId>org.opendaylight.dlux</groupId>
-          <artifactId>features-dlux</artifactId>
-          <classifier>features</classifier>
-          <version>0.3.0-SNAPSHOT</version>
-          <type>xml</type>
-          <scope>runtime</scope>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.packetcable</groupId>
-        <artifactId>features-packetcable-policy</artifactId>
-        <classifier>features</classifier>
-        <version>${project.version}</version>
-        <type>xml</type>
-        <scope>runtime</scope>
-      </dependency>
-  </dependencies>
-
-  <build>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.eclipse.m2e</groupId>
-          <artifactId>lifecycle-mapping</artifactId>
-          <version>1.0.0</version>
-          <configuration>
-            <lifecycleMappingMetadata>
-              <pluginExecutions>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.felix</groupId>
-                    <artifactId>maven-bundle-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>cleanVersions</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-dependency-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>copy</goal>
-                      <goal>unpack</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.karaf.tooling</groupId>
-                    <artifactId>karaf-maven-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>commands-generate-help</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.fusesource.scalate</groupId>
-                    <artifactId>maven-scalate-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>sitegen</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.servicemix.tooling</groupId>
-                    <artifactId>depends-maven-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>generate-depends-file</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-              </pluginExecutions>
-            </lifecycleMappingMetadata>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-        <version>${karaf.version}</version>
-        <extensions>true</extensions>
-        <configuration>
-          <bootFeatures>
-            <feature>standard</feature>
-            <!-- Uncomment the following lines to ensure restconf & dlux are automatically installed -->
-            <!--<feature>odl-restconf</feature>-->
-            <!--<feature>odl-dlux-core</feature>-->
-            <feature>odl-mdsal-apidocs</feature>
-            <feature>odl-packetcable-policy-server-all</feature>
-            <!--
-              Optional TODO: Add entries here for the features you want in your local distro
-              Note: odl-restconf is a separate feature from odl-mdsal-broker.  If you want
-              restconf, you need to list it here explicitely.
-              Examples:
-              <feature>odl-openflowplugin-flow-services</feature>
-              <feature>odl-restconf</feature>
-            -->
-            <!-- Final TODO: Remove TODO Comments ;) -->
-          </bootFeatures>
-        </configuration>
-        <executions>
-          <execution>
-            <id>process-resources</id>
-            <goals>
-              <goal>install-kars</goal>
-            </goals>
-            <phase>process-resources</phase>
-          </execution>
-          <execution>
-            <id>package</id>
-            <goals>
-              <goal>instance-create-archive</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <version>2.6</version>
-        <executions>
-          <execution>
-            <id>copy</id>
-            <goals>
-              <goal>copy</goal>
-            </goals>
-            <phase>generate-resources</phase>
-            <configuration>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>org.opendaylight.controller</groupId>
-                  <artifactId>karaf.branding</artifactId>
-                  <version>${karaf.branding.version}</version>
-                  <outputDirectory>target/assembly/lib</outputDirectory>
-                  <destFileName>karaf.branding-${branding.version}.jar</destFileName>
-                </artifactItem>
-              </artifactItems>
-            </configuration>
-          </execution>
-          <execution>
-            <id>unpack-karaf-resources</id>
-            <goals>
-              <goal>unpack-dependencies</goal>
-            </goals>
-            <phase>prepare-package</phase>
-            <configuration>
-             <outputDirectory>${project.build.directory}/assembly</outputDirectory>
-             <groupId>org.opendaylight.controller</groupId>
-             <includeArtifactIds>opendaylight-karaf-resources</includeArtifactIds>
-             <excludes>META-INF\/**</excludes>
-             <excludeTransitive>true</excludeTransitive>
-             <ignorePermissions>false</ignorePermissions>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <executions>
-            <execution>
-                <phase>prepare-package</phase>
-                <goals>
-                    <goal>run</goal>
-                </goals>
+    <prerequisites>
+        <maven>3.1.1</maven>
+    </prerequisites>
+    <properties>
+        <karaf.localFeature>odl-packetcable-policy-server-all</karaf.localFeature>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.karaf.features</groupId>
+            <artifactId>framework</artifactId>
+            <type>kar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.packetcable</groupId>
+            <artifactId>features-packetcable-policy</artifactId>
+            <classifier>features</classifier>
+            <version>${project.version}</version>
+            <type>xml</type>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
                 <configuration>
-                  <tasks>
-                    <chmod perm="755">
-                        <fileset dir="${project.build.directory}/assembly/bin">
-                          <include name="karaf" />
-                          <include name="instance" />
-                          <include name="start" />
-                          <include name="stop" />
-                          <include name="status" />
-                          <include name="client" />
-                          <include name="shell" />
-                        </fileset>
-                    </chmod>
-                  </tasks>
+                    <skip>true</skip>
                 </configuration>
-            </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/packetcable.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/packetcable.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://git.opendaylight.org/gerrit/gitweb?p=packetcable.git;a=summary</url>
-  </scm>
-</project>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
index c39f23ee4f74e5b23d9f0cfb4f6641d5fca96027..4ed190f6a7b257e3535fe970fce3f27446fc20d0 100644 (file)
@@ -3,11 +3,15 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.opendaylight.packetcable</groupId>
-        <artifactId>packetcable</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>binding-parent</artifactId>
+        <version>0.8.0-SNAPSHOT</version>
+        <relativePath />
     </parent>
     <artifactId>packetcable-policy-model</artifactId>
+    <groupId>org.opendaylight.packetcable</groupId>
+    <name>${project.artifactId}</name>
+    <version>1.3.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
     <dependencies>
         <dependency>
             <artifactId>yang-common</artifactId>
         </dependency>
     </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.opendaylight.yangtools</groupId>
-                <artifactId>yang-maven-plugin</artifactId>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.opendaylight.yangtools</groupId>
-                        <artifactId>maven-sal-api-gen-plugin</artifactId>
-                        <version>${yangtools.version}</version>
-                        <type>jar</type>
-                    </dependency>
-                </dependencies>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>generate-sources</goal>
-                        </goals>
-                        <configuration>
-                            <yangFilesRootDir>src/main/yang</yangFilesRootDir>
-                            <codeGenerators>
-                                <generator>
-                                    <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
-                                    <outputBaseDir>${salGeneratorPath}</outputBaseDir>
-                                </generator>
-                            </codeGenerators>
-                            <inspectDependencies>true</inspectDependencies>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-    <scm>
-        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-        <tag>HEAD</tag>
-        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
-    </scm>
-</project>
+</project>
\ No newline at end of file
index a301112d97df9881bef1bd6b529dece88a98e121..06ca6e6c513813c6cad49df0ebe9e3e42e2b87aa 100644 (file)
@@ -3,18 +3,20 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.opendaylight.packetcable</groupId>
-        <artifactId>packetcable</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>config-parent</artifactId>
+        <version>0.4.0-SNAPSHOT</version>
+        <relativePath />
     </parent>
     <artifactId>packetcable-policy-server</artifactId>
+    <groupId>org.opendaylight.packetcable</groupId>
+    <name>${project.artifactId}</name>
+    <version>1.3.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
-
     <properties>
         <sal-binding-api.version>1.3.0-SNAPSHOT</sal-binding-api.version>
         <powermock.version>1.5.1</powermock.version>
     </properties>
-
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>packetcable-policy-model</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.model</groupId>
-            <artifactId>ietf-inet-types</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.model</groupId>
-            <artifactId>ietf-yang-types</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>config-api</artifactId>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal-binding-config</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-common-util</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
@@ -81,7 +67,7 @@
             <artifactId>powermock-module-junit4</artifactId>
             <version>${powermock.version}</version>
             <scope>test</scope>
-           </dependency>
+        </dependency>
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-api-mockito</artifactId>
@@ -89,7 +75,6 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-
     <build>
         <plugins>
             <plugin>
                     <skip>true</skip>
                 </configuration>
             </plugin>
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Export-Package>org.opendaylight.controller.config.yang.toaster_provider,</Export-Package>
-                        <Import-Package>*</Import-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.opendaylight.yangtools</groupId>
-                <artifactId>yang-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>config</id>
-                        <goals>
-                            <goal>generate-sources</goal>
-                        </goals>
-                        <configuration>
-                            <codeGenerators>
-                                <generator>
-                                    <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
-                                    <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
-                                    <additionalConfiguration>
-                                        <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
-                                    </additionalConfiguration>
-                                </generator>
-                                <generator>
-                                    <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
-                                    <outputBaseDir>${salGeneratorPath}</outputBaseDir>
-                                </generator>
-                            </codeGenerators>
-                            <inspectDependencies>true</inspectDependencies>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
-    <scm>
-        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-        <tag>HEAD</tag>
-        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
-    </scm>
-</project>
+</project>
\ No newline at end of file
index 6f68360d5b2459e3af00a86d8a5845e1fd259956..87f54000ee597809a522f13eefea3b1a6ad0ad87 100644 (file)
@@ -1,10 +1,26 @@
 package org.opendaylight.controller.packetcable.provider;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.annotation.concurrent.ThreadSafe;
+
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.Ccap;
@@ -19,21 +35,16 @@ import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.app
 import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.SubsKey;
 import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.Gates;
 import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.GatesKey;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceRegistration;
 import org.pcmm.rcd.IPCMMClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.annotation.concurrent.ThreadSafe;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
 /**
  * Called by ODL framework to start this bundle.
  *
@@ -41,7 +52,7 @@ import java.util.concurrent.Executors;
  * TODO - Remove some of these state maps and move some of this into the PCMMService
  */
 @ThreadSafe
-public class PacketcableProvider implements DataChangeListener, AutoCloseable {
+public class PacketcableProvider implements BindingAwareProvider, DataChangeListener, AutoCloseable {
 
     private static final Logger logger = LoggerFactory.getLogger(PacketcableProvider.class);
 
@@ -52,7 +63,12 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
     /**
      * The ODL object used to broker messages throughout the framework
      */
-    private final DataBroker dataBroker;
+    private DataBroker dataBroker;
+
+    private ServiceRegistration<PacketcableProvider> packetcableProviderRegistration;
+
+    private ListenerRegistration<DataChangeListener> ccapDataChangeListenerRegistration;
+    private ListenerRegistration<DataChangeListener> qosDataChangeListenerRegistration;
 
     /**
      * The thread pool executor
@@ -75,18 +91,44 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
     /**
      * Constructor
      */
-    public PacketcableProvider(final DataBroker dataBroker) {
+    public PacketcableProvider() {
         logger.info("Starting provider");
-        this.dataBroker = dataBroker;
         executor = Executors.newCachedThreadPool();
     }
 
+    @Override
+    public void onSessionInitiated(ProviderContext session) {
+        logger.info("Packetcable Session Initiated");
+
+        dataBroker =  session.getSALService(DataBroker.class);
+
+        BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
+        packetcableProviderRegistration = context.registerService(PacketcableProvider.class, this, null);
+
+        ccapDataChangeListenerRegistration =
+                dataBroker.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
+                        PacketcableProvider.ccapIID, this, DataBroker.DataChangeScope.SUBTREE );
+
+        qosDataChangeListenerRegistration =
+                dataBroker.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
+                        PacketcableProvider.qosIID, this, DataBroker.DataChangeScope.SUBTREE );
+    }
     /**
      * Implemented from the AutoCloseable interface.
      */
     @Override
     public void close() throws ExecutionException, InterruptedException {
         executor.shutdown();
+        if (packetcableProviderRegistration != null) {
+            packetcableProviderRegistration.unregister();
+        }
+        if (ccapDataChangeListenerRegistration != null) {
+            ccapDataChangeListenerRegistration.close();
+        }
+
+        if (qosDataChangeListenerRegistration != null) {
+            qosDataChangeListenerRegistration.close();
+        }
     }
 
     public InetAddress getInetAddress(final String subId){
@@ -484,5 +526,4 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
             }
         }
     }
-
 }
index 1d6275ba72cc5d4649fabd405f8c96bd17e25c11..9351656ccd0c4177decac0965a95f770872d56e1 100644 (file)
@@ -1,10 +1,6 @@
 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.packetcable.packetcable.policy.server.impl.rev140131;
 
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.packetcable.provider.PacketcableProvider;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -27,37 +23,9 @@ public class PacketcableProviderModule extends org.opendaylight.yang.gen.v1.urn.
     @Override
     public java.lang.AutoCloseable createInstance() {
         logger.info("Creating PacketcableProvider instance");
-
-        final DataBroker dataBrokerService = getDataBrokerDependency();
-        final PacketcableProvider provider = new PacketcableProvider(dataBrokerService);
-
-        final ListenerRegistration<DataChangeListener> ccapDataChangeListenerRegistration =
-                dataBrokerService.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
-                        PacketcableProvider.ccapIID, provider, DataBroker.DataChangeScope.SUBTREE );
-
-        final ListenerRegistration<DataChangeListener> qosDataChangeListenerRegistration =
-                dataBrokerService.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
-                        PacketcableProvider.qosIID, provider, DataBroker.DataChangeScope.SUBTREE );
-
-        logger.info("PacketCableProvider Registered with DataBroker");
-
-        AutoCloseable close = new AutoCloseable() {
-
-            @Override
-            public void close() throws Exception {
-                if (ccapDataChangeListenerRegistration != null) {
-                    ccapDataChangeListenerRegistration.close();
-                }
-                if (qosDataChangeListenerRegistration != null) {
-                    qosDataChangeListenerRegistration.close();
-                }
-                if (provider != null) {
-                    provider.close();
-                }
-            }
-        };
-
-        return close;
+        final PacketcableProvider provider = new PacketcableProvider();
+        getDataBrokerDependency().registerProvider(provider);
+        return provider;
     }
 
 }
index d05911aa2505196d43f0dcfac4950e9b7d7c2711..64b72533eb6a9258783ca99e543bd36822a7cc5a 100644 (file)
@@ -34,7 +34,7 @@ module packetcable-policy-server-impl {
                        uses config:service-ref {
                          refine type {
                              mandatory true;
-                             config:required-identity mdsal:binding-async-data-broker;
+                             config:required-identity mdsal:binding-broker-osgi-registry;
                          }
                        }
                      }