Bug 1680 - default table-miss-entry feature should be pulled out into separate module 10/10910/4
authorMartin Bobak <mbobak@cisco.com>
Sun, 31 Aug 2014 17:44:35 +0000 (19:44 +0200)
committerMartin Bobak <mbobak@cisco.com>
Tue, 9 Sep 2014 08:36:51 +0000 (10:36 +0200)
Change-Id: I45e01c2edecfde58ceb13d0ae9a7c905faf9a018
Signed-off-by: Martin Bobak <mbobak@cisco.com>
applications/pom.xml [new file with mode: 0644]
applications/table-miss-enforcer/pom.xml [new file with mode: 0644]
applications/table-miss-enforcer/src/main/java/org/opendaylight/openflowplugin/applications/tableMissEnforcer/LLDPPacketPuntEnforcer.java [moved from openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/lldp/LLDPPAcketPuntEnforcer.java with 90% similarity]
applications/table-miss-enforcer/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/table/miss/enforcer/rev140326/LLDPPacketPuntEnforcerModule.java [new file with mode: 0644]
applications/table-miss-enforcer/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/table/miss/enforcer/rev140326/LLDPPacketPuntEnforcerModuleFactory.java [new file with mode: 0644]
applications/table-miss-enforcer/src/main/resources/initial/69-table-miss-enforcer.xml [new file with mode: 0644]
applications/table-miss-enforcer/src/main/yang/table-miss-enforcer.yang [new file with mode: 0644]
applications/table-miss-enforcer/src/test/java/org/opendaylight/openflowplugin/applications/tableMissEnforcer/LLDPDataChangeListenerTest.java [moved from openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/lldp/LLDPDataChangeListenerTest.java with 88% similarity]
distribution/base/pom.xml
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OpenflowPluginProvider.java
pom.xml

diff --git a/applications/pom.xml b/applications/pom.xml
new file mode 100644 (file)
index 0000000..d2e886e
--- /dev/null
@@ -0,0 +1,105 @@
+<?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>
+    <groupId>org.opendaylight.openflowplugin</groupId>
+    <artifactId>openflowplugin-parent</artifactId>
+    <version>0.0.3-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.opendaylight.openflowplugin</groupId>
+  <artifactId>applications</artifactId>
+  <version>0.0.3-SNAPSHOT</version>
+  <name>applications</name>
+  <url>http://maven.apache.org</url>
+  <packaging>pom</packaging>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.openflowplugin</groupId>
+                <artifactId>openflowplugin-api</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.opendaylight.yangtools</groupId>
+                    <artifactId>yang-maven-plugin</artifactId>
+                    <version>${yang.binding.version}</version>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>generate-sources</goal>
+                            </goals>
+                            <configuration>
+                                <codeGenerators>
+                                    <generator>
+                                        <codeGeneratorClass>
+                                            org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+                                        </codeGeneratorClass>
+                                        <outputBaseDir>${project.build.directory}/generated-sources/config</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>${project.build.directory}/generated-sources/sal</outputBaseDir>
+                                    </generator>
+                                </codeGenerators>
+                                <inspectDependencies>true</inspectDependencies>
+                            </configuration>
+                        </execution>
+                    </executions>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.opendaylight.controller</groupId>
+                            <artifactId>yang-jmx-generator-plugin</artifactId>
+                            <version>${config.parent.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.opendaylight.yangtools</groupId>
+                            <artifactId>maven-sal-api-gen-plugin</artifactId>
+                            <version>${yang.binding.version}</version>
+                            <type>jar</type>
+                        </dependency>
+                    </dependencies>
+
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>build-helper-maven-plugin</artifactId>
+                    <version>1.8</version>
+                    <executions>
+                        <execution>
+                            <id>add-source</id>
+                            <phase>generate-sources</phase>
+                            <goals>
+                                <goal>add-source</goal>
+                            </goals>
+                            <configuration>
+                                <sources>
+                                    <source>${project.build.directory}/generated-sources/config</source>;
+                                </sources>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
+    <modules>
+        <module>table-miss-enforcer</module>
+    </modules>
+
+</project>
\ No newline at end of file
diff --git a/applications/table-miss-enforcer/pom.xml b/applications/table-miss-enforcer/pom.xml
new file mode 100644 (file)
index 0000000..989f962
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.openflowplugin</groupId>
+    <artifactId>applications</artifactId>
+    <version>0.0.3-SNAPSHOT</version>
+  </parent>
+  <groupId>org.opendaylight.openflowplugin.applications</groupId>
+  <artifactId>table-miss-enforcer</artifactId>
+  <packaging>bundle</packaging>
+  <dependencies>
+      <dependency>
+          <groupId>org.opendaylight.openflowplugin</groupId>
+          <artifactId>openflowplugin-api</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-binding-api</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-binding-broker-impl</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.opendaylight.controller.model</groupId>
+          <artifactId>model-inventory</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.opendaylight.controller.model</groupId>
+          <artifactId>model-flow-service</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.mockito</groupId>
+          <artifactId>mockito-all</artifactId>
+          <scope>test</scope>
+      </dependency>
+      <dependency>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+          <scope>test</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-api</artifactId>
+      </dependency>
+  </dependencies>
+
+    <build>
+     <plugins>
+         <plugin>
+             <groupId>org.opendaylight.yangtools</groupId>
+             <artifactId>yang-maven-plugin</artifactId>
+         </plugin>
+         <plugin>
+             <groupId>org.codehaus.mojo</groupId>
+             <artifactId>build-helper-maven-plugin</artifactId>
+         </plugin>
+         <plugin>
+             <groupId>org.apache.felix</groupId>
+             <artifactId>maven-bundle-plugin</artifactId>
+         </plugin>
+     </plugins>
+    </build>
+</project>
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.openflowplugin.openflow.md.lldp;
+package org.opendaylight.openflowplugin.applications.tableMissEnforcer;
 
 import java.math.BigInteger;
 import java.util.ArrayList;
@@ -38,20 +38,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
  * Created by Martin Bobak mbobak@cisco.com on 8/27/14.
  */
-public class LLDPPAcketPuntEnforcer implements DataChangeListener {
+public class LLDPPacketPuntEnforcer implements DataChangeListener {
 
     private static final short TABLE_ID = (short) 0;
     private static final String LLDP_PUNT_WHOLE_PACKET_FLOW = "LLDP_PUNT_WHOLE_PACKET_FLOW";
     private static final String DEFAULT_FLOW_ID = "42";
     private final SalFlowService flowService;
 
-    public LLDPPAcketPuntEnforcer(SalFlowService flowService) {
+    public LLDPPacketPuntEnforcer(SalFlowService flowService) {
         this.flowService = flowService;
     }
 
@@ -59,10 +60,12 @@ public class LLDPPAcketPuntEnforcer implements DataChangeListener {
     public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
         final Set<InstanceIdentifier<?>> changedDataKeys = change.getCreatedData().keySet();
 
-        for (InstanceIdentifier<?> key : changedDataKeys) {
-            AddFlowInputBuilder addFlowInput = new AddFlowInputBuilder(createFlow());
-            addFlowInput.setNode(new NodeRef(key));
-            this.flowService.addFlow(addFlowInput.build());
+        if (changedDataKeys != null) {
+            for (InstanceIdentifier<?> key : changedDataKeys) {
+                AddFlowInputBuilder addFlowInput = new AddFlowInputBuilder(createFlow());
+                addFlowInput.setNode(new NodeRef(key.firstIdentifierOf(Node.class)));
+                this.flowService.addFlow(addFlowInput.build());
+            }
         }
     }
 
diff --git a/applications/table-miss-enforcer/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/table/miss/enforcer/rev140326/LLDPPacketPuntEnforcerModule.java b/applications/table-miss-enforcer/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/table/miss/enforcer/rev140326/LLDPPacketPuntEnforcerModule.java
new file mode 100644 (file)
index 0000000..fca8a63
--- /dev/null
@@ -0,0 +1,37 @@
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.table.miss.enforcer.rev140326;
+
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.openflowplugin.applications.tableMissEnforcer.LLDPPacketPuntEnforcer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+public class LLDPPacketPuntEnforcerModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.table.miss.enforcer.rev140326.AbstractLLDPPacketPuntEnforcerModule {
+    public LLDPPacketPuntEnforcerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public LLDPPacketPuntEnforcerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.table.miss.enforcer.rev140326.LLDPPacketPuntEnforcerModule 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() {
+        InstanceIdentifier<FlowCapableNode> path = InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class);
+        SalFlowService salFlowService = getRpcRegistryDependency().getRpcService(SalFlowService.class);
+        return getDataBrokerDependency().registerDataChangeListener(
+                LogicalDatastoreType.OPERATIONAL,
+                path,
+                new LLDPPacketPuntEnforcer(salFlowService),
+                AsyncDataBroker.DataChangeScope.BASE);
+    }
+
+}
diff --git a/applications/table-miss-enforcer/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/table/miss/enforcer/rev140326/LLDPPacketPuntEnforcerModuleFactory.java b/applications/table-miss-enforcer/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/table/miss/enforcer/rev140326/LLDPPacketPuntEnforcerModuleFactory.java
new file mode 100644 (file)
index 0000000..1ebc1f9
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: table-miss-enforcer yang module local name: table-miss-enforcer
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Mon Sep 08 15:26:18 CEST 2014
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.table.miss.enforcer.rev140326;
+public class LLDPPacketPuntEnforcerModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.table.miss.enforcer.rev140326.AbstractLLDPPacketPuntEnforcerModuleFactory {
+
+}
diff --git a/applications/table-miss-enforcer/src/main/resources/initial/69-table-miss-enforcer.xml b/applications/table-miss-enforcer/src/main/resources/initial/69-table-miss-enforcer.xml
new file mode 100644 (file)
index 0000000..003b563
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright (c) 2014 Cisco Systems, 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
+-->
+<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:prefix="urn:opendaylight:params:xml:ns:yang:openflow:applications:table-miss-enforcer">prefix:table-miss-enforcer</type>
+                    <name>table-miss-enforcer</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>
+                    </data-broker>
+                    <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>
+                </module>
+
+            </modules>
+        </data>
+    </configuration>
+</snapshot>
\ No newline at end of file
diff --git a/applications/table-miss-enforcer/src/main/yang/table-miss-enforcer.yang b/applications/table-miss-enforcer/src/main/yang/table-miss-enforcer.yang
new file mode 100644 (file)
index 0000000..139c5dc
--- /dev/null
@@ -0,0 +1,42 @@
+module table-miss-enforcer {
+       yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:openflow:applications:table-miss-enforcer";
+    prefix "table-miss-enforcer";
+    import config {prefix config; revision-date 2013-04-05;}
+    import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
+
+    description
+        "table-miss-enforcer-custom-config-impl";
+
+    revision "2014-03-26" {
+        description
+            "Initial revision";
+    }
+
+    identity table-miss-enforcer {
+        base "config:module-type";
+        config:java-name-prefix LLDPPacketPuntEnforcer;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case table-miss-enforcer {
+            when "/config:modules/config:module/config:type = 'table-miss-enforcer'";
+            container rpc-registry {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity mdsal:binding-rpc-registry;
+                    }
+                }
+            }
+            container data-broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory false;
+                        config:required-identity mdsal:binding-async-data-broker;
+                    }
+                }
+            }
+        }
+    }
+}
@@ -6,13 +6,14 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.openflowplugin.openflow.md.lldp;
+package org.opendaylight.openflowplugin.applications.tableMissEnforcer;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
 import org.mockito.Mock;
+import org.opendaylight.openflowplugin.applications.tableMissEnforcer.LLDPPacketPuntEnforcer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
@@ -30,12 +31,12 @@ public class LLDPDataChangeListenerTest {
     private static SalFlowService flowService;
 
     /**
-     * Test method for {@link LLDPPAcketPuntEnforcer#createFlow()}
+     * Test method for {@link org.opendaylight.openflowplugin.applications.tableMissEnforcer.LLDPPacketPuntEnforcer#createFlow()}
      * which ensures that LLDPDataChangeListener creates proper flow for
      */
     @Test
     public void testCreateFlow() {
-        LLDPPAcketPuntEnforcer lldpDataChangeListener = new LLDPPAcketPuntEnforcer(flowService);
+        LLDPPacketPuntEnforcer lldpDataChangeListener = new LLDPPacketPuntEnforcer(flowService);
         evaluateFlow(lldpDataChangeListener.createFlow());
     }
 
index 875b3cdfaa3d0b1b7ced17f19e14806cf32cc42b..4725c99f66b22b2443a7df1ef58f9e65614f72a9 100644 (file)
@@ -120,6 +120,12 @@ see https://git.opendaylight.org/gerrit/#/c/390/
       <groupId>org.opendaylight.openflowjava</groupId>
       <artifactId>util</artifactId>
     </dependency>
+
+      <dependency>
+          <groupId>org.opendaylight.openflowplugin.applications</groupId>
+          <artifactId>table-miss-enforcer</artifactId>
+          <version>${project.version}</version>
+      </dependency>
   </dependencies>
 
   <build>
@@ -161,7 +167,8 @@ see https://git.opendaylight.org/gerrit/#/c/390/
             <configuration>
              <outputDirectory>${project.build.directory}/generated-resources/opendaylight/configuration</outputDirectory>
              <includeArtifactIds>openflowplugin-controller-config, 
-             test-extension, openflowjava-extension-nicira, openflowjava-extension-nicira-api, openflowplugin-extension-nicira
+             test-extension, openflowjava-extension-nicira, openflowjava-extension-nicira-api, openflowplugin-extension-nicira,
+             table-miss-enforcer,
              </includeArtifactIds>
              <includes>**\/*.xml</includes>
              <excludes>META-INF</excludes>
index 4dac6c9191cf979a4e4b05b1afe6c111fcb5b9a9..bddc84feac34a39c4a566d40cb336861e4d5d9cd 100644 (file)
@@ -9,9 +9,6 @@ package org.opendaylight.openflowplugin.openflow.md.core.sal;
 
 import java.util.Collection;
 import java.util.Collections;
-
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
@@ -19,17 +16,12 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
 import org.opendaylight.openflowplugin.extension.api.ExtensionConverterRegistrator;
 import org.opendaylight.openflowplugin.openflow.md.core.MDController;
-import org.opendaylight.openflowplugin.openflow.md.core.extension.ExtensionConverterManagerImpl;
 import org.opendaylight.openflowplugin.openflow.md.core.extension.ExtensionConverterManager;
-import org.opendaylight.openflowplugin.openflow.md.lldp.LLDPPAcketPuntEnforcer;
+import org.opendaylight.openflowplugin.openflow.md.core.extension.ExtensionConverterManagerImpl;
 import org.opendaylight.openflowplugin.api.statistics.MessageCountDumper;
 import org.opendaylight.openflowplugin.api.statistics.MessageObservatory;
 import org.opendaylight.openflowplugin.statistics.MessageSpyCounterImpl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
@@ -53,8 +45,8 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
     private MessageObservatory<DataContainer> messageCountProvider;
 
     private SalRegistrationManager registrationManager;
-    
-    private ExtensionConverterManager extensionConverterManager;  
+
+    private ExtensionConverterManager extensionConverterManager;
 
     /**
      * Initialization of services and msgSpy counter
@@ -84,14 +76,6 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
         LOG.debug("onSessionInitiated");
         registrationManager = new SalRegistrationManager();
         registrationManager.onSessionInitiated(session);
-        //TODO : LLDPPAcketPuntEnforcer should be instantiated and registered in separate module driven by config subsystem
-        InstanceIdentifier<Node> path = InstanceIdentifier.create(Nodes.class).child(Node.class);
-        registrationManager.getSessionManager().getDataBroker().registerDataChangeListener(
-                LogicalDatastoreType.OPERATIONAL,
-                path,
-                new LLDPPAcketPuntEnforcer(
-                        session.<SalFlowService>getRpcService(SalFlowService.class)),
-                AsyncDataBroker.DataChangeScope.BASE);
         mdController = new MDController();
         mdController.setSwitchConnectionProviders(switchConnectionProviders);
         mdController.setMessageSpyCounter(messageCountProvider);
@@ -133,6 +117,7 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
 
     /**
      * dependencymanager requirement
+     *
      * @param broker
      */
     public void setBroker(BindingAwareBroker broker) {
@@ -141,14 +126,15 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
 
     /**
      * dependencymanager requirement
+     *
      * @param brokerArg
      */
     public void unsetBroker(BindingAwareBroker brokerArg) {
         this.broker = null;
     }
 
-    private boolean hasAllDependencies(){
-        if(this.broker != null && this.switchConnectionProviders != null) {
+    private boolean hasAllDependencies() {
+        if (this.broker != null && this.switchConnectionProviders != null) {
             return true;
         }
         return false;
@@ -158,19 +144,19 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
      * register providers for md-sal
      */
     private void registerProvider() {
-        if(hasAllDependencies()) {
-            this.broker.registerProvider(this,context);
+        if (hasAllDependencies()) {
+            this.broker.registerProvider(this, context);
         }
     }
 
     public MessageCountDumper getMessageCountDumper() {
         return messageCountProvider;
     }
-    
+
     /**
      * @return the extensionConverterRegistry
      */
     public ExtensionConverterRegistrator getExtensionConverterRegistrator() {
         return extensionConverterManager;
     }
- }
+}
diff --git a/pom.xml b/pom.xml
index 6092930ff9da863ff784099c37ff040b93c921e1..7b3e34105de7510406b089b0bb45032f3096843d 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent</artifactId>
         <version>1.4.2-SNAPSHOT</version>
-        <relativePath></relativePath>
+        <relativePath/>
     </parent>
     <prerequisites>
         <maven>3.0</maven>
             <artifactId>yang-binding</artifactId>
             <version>${yang.binding.version}</version>
         </dependency>
+          <dependency>
+              <groupId>org.opendaylight.openflowplugin</groupId>
+              <artifactId>openflowplugin-api</artifactId>
+              <version>${project.version}</version>
+          </dependency>
         <dependency>
           <groupId>org.opendaylight.openflowjava</groupId>
           <artifactId>openflow-protocol-impl</artifactId>
             <artifactId>sal-common-util</artifactId>
             <version>${controller.model.version}</version>
         </dependency>
-
         <!-- IT -->
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
                         </goals>
                       </pluginExecutionFilter>
                       <action>
-                        <ignore></ignore>
+                        <ignore/>
                       </action>
                     </pluginExecution>
                     <pluginExecution>
                         </goals>
                       </pluginExecutionFilter>
                       <action>
-                        <ignore></ignore>
+                        <ignore/>
                       </action>
                     </pluginExecution>
                     <pluginExecution>
                         </goals>
                       </pluginExecutionFilter>
                       <action>
-                        <ignore></ignore>
+                        <ignore/>
                       </action>
                     </pluginExecution>
                     <pluginExecution>
                         </goals>
                       </pluginExecutionFilter>
                       <action>
-                        <ignore></ignore>
+                        <ignore/>
                       </action>
                     </pluginExecution>
                     <pluginExecution>
                         </goals>
                       </pluginExecutionFilter>
                       <action>
-                        <execute></execute>
+                        <execute/>
                       </action>
                     </pluginExecution>
                     <pluginExecution>
                         </goals>
                       </pluginExecutionFilter>
                       <action>
-                        <ignore></ignore>
+                        <ignore/>
                       </action>
                     </pluginExecution>
                     <pluginExecution>
                         </goals>
                       </pluginExecutionFilter>
                       <action>
-                        <ignore></ignore>
+                        <ignore/>
                       </action>
                     </pluginExecution>
                   </pluginExecutions>
       <module>features</module>
       <module>samples/sample-consumer</module>
       <module>samples/learning-switch</module>
-    </modules>
+    <module>applications</module>
+  </modules>
 </project>