Removed legacy AD-SAL compatibility 42/26642/2
authorTony Tkacik <ttkacik@cisco.com>
Tue, 8 Sep 2015 08:58:07 +0000 (10:58 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 8 Sep 2015 09:00:35 +0000 (11:00 +0200)
AD-SAL is not part of beryllium, so dependencies
used by AD-SAL adapter are not available in
controller, autorelease and offline mode.

Since this code is not supported, lets remove it
to decrease technical debt.

Change-Id: Ifb4b9e7ec04b00566d421d0089e1dd629ee755d8
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
37 files changed:
legacy/features-legacy/pom.xml [deleted file]
legacy/features-legacy/src/main/resources/features.xml [deleted file]
legacy/pom.xml [deleted file]
legacy/sal-compatibility/pom.xml [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/AbstractDataChangeListener.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ComponentActivator.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/DataPacketAdapter.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/FlowProgrammerAdapter.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/FromSalConversionsUtils.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryAndReadAdapter.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryMapping.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryNotificationProvider.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDFlowMapping.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDSalNodeConnectorFactory.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDSalNodeFactory.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NCDataChangeListener.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeConnectorDataChangeListener.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeDataChangeListener.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeMapping.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ProtocolConstants.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/SalCompatibilityProvider.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ToSalConversionsUtils.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/DataPacketServiceAdapter.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/FlowServiceAdapter.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/FlowStatisticsAdapter.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyAdapter.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyCommitHandler.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyMapping.java [deleted file]
legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyProvider.java [deleted file]
legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/FromSalConversionsUtilsTest.java [deleted file]
legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/MDFlowMappingTest.java [deleted file]
legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/NodeMappingTest.java [deleted file]
legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/TestFromSalConversionsUtils.java [deleted file]
legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/TestToSalConversionsUtils.java [deleted file]
legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/ToSalConversionsUtilsTest.java [deleted file]
legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/test/TopologyMappingTest.java [deleted file]
pom.xml

diff --git a/legacy/features-legacy/pom.xml b/legacy/features-legacy/pom.xml
deleted file mode 100644 (file)
index 24f7fec..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-   <modelVersion>4.0.0</modelVersion>\r
-   <parent>\r
-     <groupId>org.opendaylight.openflowplugin.legacy</groupId>\r
-     <artifactId>legacy-parent</artifactId>\r
-     <version>0.2.0-SNAPSHOT</version>\r
-     <relativePath>../</relativePath>\r
-   </parent>\r
-\r
-   <artifactId>features-legacy</artifactId>\r
-   <packaging>jar</packaging>\r
-   <properties>\r
-      <features.file>features.xml</features.file>\r
-      <feature.test.version>0.8.0-SNAPSHOT</feature.test.version>\r
-      <sal.version>0.10.0-SNAPSHOT</sal.version>\r
-   </properties>\r
-   <dependencies>\r
-    <!--\r
-      Necessary TODO: Put dependencies on any feature repos\r
-      you use in your features.xml file.\r
-\r
-      Note: they will need to be <type>xml</xml>\r
-      and <classifier>features</classifier>.\r
-      One other thing to watch for is to make sure they are\r
-      <scope>compile</compile>, which they should be by default,\r
-      but be cautious lest they be at a different scope in a parent pom.\r
-\r
-      Examples:\r
-        <dependency>\r
-          <groupId>org.opendaylight.yangtools</groupId>\r
-          <artifactId>features-yangtools</artifactId>\r
-          <version>0.8.0-SNAPSHOT</version>\r
-          <classifier>features</classifier>\r
-          <type>xml</type>\r
-        </dependency>\r
-        <dependency>\r
-          <groupId>org.opendaylight.controller</groupId>\r
-          <artifactId>features-mdsal</artifactId>\r
-          <version>1.3.0-SNAPSHOT</version>\r
-          <classifier>features</classifier>\r
-          <type>xml</type>\r
-        </dependency>\r
-        <dependency>\r
-          <groupId>org.opendaylight.openflowplugin</groupId>\r
-          <artifactId>features-openflowplugin</artifactId>\r
-          <version>0.2.0-SNAPSHOT</version>\r
-          <classifier>features</classifier>\r
-          <type>xml</type>\r
-        </dependency>\r
-    -->\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>features-mdsal</artifactId>\r
-        <version>${mdsal.version}</version>\r
-        <classifier>features</classifier>\r
-        <type>xml</type>\r
-      </dependency>\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>features-adsal</artifactId>\r
-        <version>${sal.version}</version>\r
-        <classifier>features</classifier>\r
-        <type>xml</type>\r
-      </dependency>\r
-      <dependency>\r
-        <groupId>org.opendaylight.openflowplugin</groupId>\r
-        <artifactId>features-openflowplugin</artifactId>\r
-        <classifier>features</classifier>\r
-        <type>xml</type>\r
-      </dependency>\r
-\r
-    <!--\r
-      Necessary TODO: Put dependencies for bundles directly referenced\r
-      in your features.xml file.  For every <bundle> reference in your\r
-      features.xml file, you need a corresponding dependency here.\r
-\r
-      Examples:\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>controller-provider</artifactId>\r
-        <version>${project.version}</version>\r
-      </dependency>\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>controller-model</artifactId>\r
-        <version>${project.version}</version>\r
-      </dependency>\r
-    -->\r
-      <dependency>\r
-        <groupId>org.opendaylight.openflowplugin.legacy</groupId>\r
-        <artifactId>sal-compatibility</artifactId>\r
-      </dependency>\r
-\r
-    <!--\r
-      Necessary TODO: Put dependencies for configfiles directly referenced\r
-      in your features.xml file.  For every <configfile> reference in your\r
-      features.xml file, you need a corresponding dependency here.\r
-\r
-      Example (presuming here version is coming from the parent pom):\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>controller-config</artifactId>\r
-        <version>${project.version}</version>\r
-        <type>xml</type>\r
-        <classifier>config</classifier>\r
-      </dependency>\r
-    -->\r
-\r
-    <!--\r
-      Optional TODO: Remove TODO comments.\r
-    -->\r
-    <!-- test to validate features.xml -->\r
-    <dependency>\r
-      <groupId>org.opendaylight.odlparent</groupId>\r
-      <artifactId>features-test</artifactId>\r
-      <scope>test</scope>\r
-    </dependency>\r
-    <!-- dependency for opendaylight-karaf-empty for use by testing -->\r
-    <dependency>\r
-      <groupId>org.opendaylight.controller</groupId>\r
-      <artifactId>opendaylight-karaf-empty</artifactId>\r
-      <version>${karaf.distro.empty.version}</version>\r
-      <type>zip</type>\r
-    </dependency>\r
-    <!-- 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;\r
-    <dependency>\r
-      <groupId>org.slf4j</groupId>\r
-      <artifactId>slf4j-simple</artifactId>\r
-      <version>1.7.2</version>\r
-    </dependency>\r
-    -->\r
-\r
-   </dependencies>\r
-   <build>\r
-      <resources>\r
-         <resource>\r
-            <directory>src/main/resources</directory>\r
-            <filtering>true</filtering>\r
-         </resource>\r
-      </resources>\r
-      <plugins>\r
-         <plugin>\r
-            <groupId>org.apache.maven.plugins</groupId>\r
-            <artifactId>maven-resources-plugin</artifactId>\r
-            <executions>\r
-               <execution>\r
-                  <id>filter</id>\r
-                  <phase>generate-resources</phase>\r
-                  <goals>\r
-                     <goal>resources</goal>\r
-                  </goals>\r
-               </execution>\r
-            </executions>\r
-         </plugin>\r
-         <plugin>\r
-            <groupId>org.codehaus.mojo</groupId>\r
-            <artifactId>build-helper-maven-plugin</artifactId>\r
-            <executions>\r
-               <execution>\r
-                  <id>attach-artifacts</id>\r
-                  <phase>package</phase>\r
-                  <goals>\r
-                     <goal>attach-artifact</goal>\r
-                  </goals>\r
-                  <configuration>\r
-                     <artifacts>\r
-                        <artifact>\r
-                           <file>${project.build.directory}/classes/${features.file}</file>\r
-                           <type>xml</type>\r
-                           <classifier>features</classifier>\r
-                        </artifact>\r
-                     </artifacts>\r
-                  </configuration>\r
-               </execution>\r
-            </executions>\r
-         </plugin>\r
-         <plugin>\r
-            <groupId>org.apache.maven.plugins</groupId>\r
-            <artifactId>maven-surefire-plugin</artifactId>\r
-            <configuration>\r
-              <systemPropertyVariables>\r
-                <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>\r
-                <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>\r
-                <karaf.distro.version>${karaf.distro.empty.version}</karaf.distro.version>\r
-              </systemPropertyVariables>\r
-              <dependenciesToScan>\r
-               <dependency>org.opendaylight.odlparent:features-test</dependency>\r
-              </dependenciesToScan>\r
-            </configuration>\r
-          </plugin>\r
-      </plugins>\r
-   </build>\r
-\r
-   <scm>\r
-     <connection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</connection>\r
-     <developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</developerConnection>\r
-     <url>https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main</url>\r
-     <tag>HEAD</tag>\r
-   </scm>\r
-\r
-</project>\r
diff --git a/legacy/features-legacy/src/main/resources/features.xml b/legacy/features-legacy/src/main/resources/features.xml
deleted file mode 100644 (file)
index e6b43a1..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
- Necessary TODO: Put your copyright statement here
-
- 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="openflowplugin-legacy-${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.controller/features-mdsal/${mdsal.version}/xml/features</repository>
-    <repository>mvn:org.opendaylight.controller/features-adsal/${sal.version}/xml/features</repository>
-    <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/${project.version}/xml/features</repository>
-
-    <feature name='odl-openflowplugin-adsal-compatibility-all' version='${project.version}' description='OpenDaylight :: openflowplugin :: All'>
-        <feature version='${project.version}'>odl-openflowplugin-adsal-compatibility</feature>
-    </feature>
-
-    <feature name='odl-openflowplugin-adsal-compatibility' description="OpenDaylight :: openflowplugin :: AD-SAL Compatibility" version="${project.version}">
-      <feature version="${mdsal.version}">odl-mdsal-broker</feature>
-      <feature version="${project.version}">odl-openflowplugin-nsf-model</feature>
-      <feature version="${sal.version}">odl-adsal-all</feature>
-      <bundle>mvn:org.opendaylight.openflowplugin.legacy/sal-compatibility/${project.version}</bundle>
-   </feature>
-</features>
diff --git a/legacy/pom.xml b/legacy/pom.xml
deleted file mode 100644 (file)
index 06a73c6..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-    <relativePath>../parent</relativePath>
-  </parent>
-  <groupId>org.opendaylight.openflowplugin.legacy</groupId>
-  <artifactId>legacy-parent</artifactId>
-  <packaging>pom</packaging>
-  <name>MD-SAL to AD-SAL Adaptation Parent</name>
-
-  <modules>
-    <module>sal-compatibility</module>
-    <module>features-legacy</module>
-  </modules>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-      <version>0.10.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-common-util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-Name>${project.name}</Bundle-Name>
-            <Bundle-Activator>org.opendaylight.controller.sal.compability.ComponentActivator</Bundle-Activator>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</developerConnection>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main</url>
-    <tag>HEAD</tag>
-  </scm>
-
-</project>
diff --git a/legacy/sal-compatibility/pom.xml b/legacy/sal-compatibility/pom.xml
deleted file mode 100644 (file)
index 3534546..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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.legacy</groupId>
-    <artifactId>legacy-parent</artifactId>
-    <version>0.2.0-SNAPSHOT</version>
-    <relativePath>../</relativePath>
-  </parent>
-  <artifactId>sal-compatibility</artifactId>
-  <packaging>bundle</packaging>
-  <name>MD-SAL to AD-SAL Adaptation</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-      <version>0.7.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.openflowplugin.model</groupId>
-      <artifactId>model-flow-statistics</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-topology</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-Name>${project.name}</Bundle-Name>
-            <Bundle-Activator>org.opendaylight.openflowplugin.legacy.sal.compatibility.ComponentActivator</Bundle-Activator>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</developerConnection>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main</url>
-    <tag>HEAD</tag>
-  </scm>
-
-</project>
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/AbstractDataChangeListener.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/AbstractDataChangeListener.java
deleted file mode 100644 (file)
index 20b898b..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-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.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-public abstract class AbstractDataChangeListener <T extends DataObject> implements AutoCloseable,DataChangeListener{
-
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractDataChangeListener.class);
-    protected InventoryAndReadAdapter adapter;
-    protected final Class<T> clazz;
-    protected ListenerRegistration<DataChangeListener> listenerRegistration;
-
-    public AbstractDataChangeListener(final InventoryAndReadAdapter adapter, DataBroker db, final Class<T> clazz) {
-        this.adapter = Preconditions.checkNotNull(adapter, "InventoryAndReadAdapter can not be null!");
-        this.clazz = Preconditions.checkNotNull(clazz, "Class can not be null!");
-        Preconditions.checkNotNull(db, "DataBroker can not be null!");
-        registrationListener(db, 5);
-    }
-
-    @Override
-    public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changeEvent) {
-        Preconditions.checkNotNull(changeEvent,"Async ChangeEvent can not be null!");
-        /* All DataObjects for create */
-        final Map<InstanceIdentifier<?>, DataObject> createdData = changeEvent.getCreatedData() != null
-                ? changeEvent.getCreatedData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        /* All DataObjects for remove */
-        final Set<InstanceIdentifier<?>> removeData = changeEvent.getRemovedPaths() != null
-                ? changeEvent.getRemovedPaths() : Collections.<InstanceIdentifier<?>> emptySet();
-        /* All DataObjects for updates */
-        final Map<InstanceIdentifier<?>, DataObject> updateData = changeEvent.getUpdatedData() != null
-                ? changeEvent.getUpdatedData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        /* All Original DataObjects */
-        final Map<InstanceIdentifier<?>, DataObject> originalData = changeEvent.getOriginalData() != null
-                ? changeEvent.getOriginalData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        this.createData(createdData);
-        this.updateData(updateData, originalData);
-        this.removeData(removeData, originalData);
-    }
-
-    @SuppressWarnings("unchecked")
-    private void createData(final Map<InstanceIdentifier<?>, DataObject> createdData) {
-        final Set<InstanceIdentifier<?>> keys = createdData.keySet() != null
-                ? createdData.keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-        for (InstanceIdentifier<?> key : keys) {
-            if (clazz.equals(key.getTargetType())) {
-                InstanceIdentifier<T> createKeyIdent = key.firstIdentifierOf(clazz);
-                final Optional<DataObject> value = Optional.of(createdData.get(key));
-                if (value.isPresent()) {
-                    this.add(createKeyIdent, (T)value.get());
-                }
-            }
-        }
-    }
-
-    abstract protected void add(InstanceIdentifier<T> createKeyIdent, T node);
-
-    @SuppressWarnings("unchecked")
-    private void updateData(final Map<InstanceIdentifier<?>, DataObject> updateData, final Map<InstanceIdentifier<?>, DataObject> originalData) {
-
-        final Set<InstanceIdentifier<?>> keys = updateData.keySet() != null
-                ? updateData.keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-        for (InstanceIdentifier<?> key : keys) {
-            if (clazz.equals(key.getTargetType())) {
-                InstanceIdentifier<T> updateKeyIdent = key.firstIdentifierOf(clazz);
-                final Optional<DataObject> value = Optional.of(updateData.get(key));
-                final Optional<DataObject> original = Optional.of(originalData.get(key));
-                if (value.isPresent() && original.isPresent()) {
-                    this.update(updateKeyIdent, (T)original.get(), (T)value.get());
-                }
-            }
-        }
-    }
-
-    abstract protected void update(InstanceIdentifier<T> updateKeyIdent, T node,
-            T node2);
-
-    @SuppressWarnings("unchecked")
-    private void removeData(final Set<InstanceIdentifier<?>> removeData, final Map<InstanceIdentifier<?>, DataObject> originalData) {
-
-        for (InstanceIdentifier<?> key : removeData) {
-            if (clazz.equals(key.getTargetType())) {
-                final InstanceIdentifier<T> ident = key.firstIdentifierOf(clazz);
-                final DataObject removeValue = originalData.get(key);
-                this.remove(ident, (T)removeValue);
-            }
-        }
-    }
-
-    abstract protected void remove(InstanceIdentifier<T> ident, T removeValue);
-
-    protected void registrationListener(final DataBroker db, int i) {
-        try {
-            listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                    getWildCardPath(), this, DataChangeScope.SUBTREE);
-        } catch (final Exception e) {
-            if (i >= 1) {
-                try {
-                    Thread.sleep(100);
-                } catch (InterruptedException e1) {
-                    LOG.error("Thread interrupted '{}'", e1);
-                    Thread.currentThread().interrupt();
-                }
-                registrationListener(db, --i);
-            } else {
-                LOG.error("AbstractDataChangeListener registration fail!", e);
-                throw new IllegalStateException("AbstractDataChangeListener registration Listener fail! System needs restart.", e);
-            }
-        }
-    }
-
-    protected abstract InstanceIdentifier<?> getWildCardPath();
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (final Exception e) {
-                LOG.error("Error by stop AbstractDataChangeListener.", e);
-            }
-            listenerRegistration = null;
-        }
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ComponentActivator.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ComponentActivator.java
deleted file mode 100644 (file)
index 1a08dfc..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import com.google.common.base.Preconditions;
-
-import org.apache.felix.dm.Component;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.discovery.IDiscoveryService;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginOutFlowProgrammerService;
-import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.controller.sal.packet.IPluginInDataPacketService;
-import org.opendaylight.controller.sal.packet.IPluginOutDataPacketService;
-import org.opendaylight.controller.sal.reader.IPluginInReadService;
-import org.opendaylight.controller.sal.reader.IPluginOutReadService;
-import org.opendaylight.controller.sal.topology.IPluginInTopologyService;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
-import org.opendaylight.controller.sal.utils.INodeConnectorFactory;
-import org.opendaylight.controller.sal.utils.INodeFactory;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.adsal.DataPacketServiceAdapter;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyAdapter;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyProvider;
-import org.osgi.framework.BundleContext;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-public class ComponentActivator extends ComponentActivatorAbstractBase {
-    private final INodeConnectorFactory nodeConnectorFactory = new MDSalNodeConnectorFactory();
-    private final DataPacketServiceAdapter dataPacketService = new DataPacketServiceAdapter();
-    private final InventoryAndReadAdapter inventory = new InventoryAndReadAdapter();
-    private final FlowProgrammerAdapter flow = new FlowProgrammerAdapter();
-    private final DataPacketAdapter dataPacket = new DataPacketAdapter();
-    private final TopologyProvider tpProvider = new TopologyProvider();
-    private final INodeFactory nodeFactory = new MDSalNodeFactory();
-    private final TopologyAdapter topology = new TopologyAdapter();
-    private BundleContext context;
-
-    public INodeConnectorFactory getNodeConnectorFactory() {
-        return nodeConnectorFactory;
-    }
-
-    public DataPacketServiceAdapter getDataPacketService() {
-        return dataPacketService;
-    }
-
-    public InventoryAndReadAdapter getInventory() {
-        return inventory;
-    }
-
-    public FlowProgrammerAdapter getFlow() {
-        return flow;
-    }
-
-    public DataPacketAdapter getDataPacket() {
-        return dataPacket;
-    }
-
-    public TopologyProvider getTpProvider() {
-        return tpProvider;
-    }
-
-    public INodeFactory getNodeFactory() {
-        return nodeFactory;
-    }
-
-    public TopologyAdapter getTopology() {
-        return topology;
-    }
-
-    @Override
-    protected void init() {
-        // TODO: deprecated, should be removed soon
-        NodeIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class);
-        NodeConnectorIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class, NodeMapping.MD_SAL_TYPE);
-    }
-
-    @Override
-    public void start(final BundleContext context) {
-        this.context = Preconditions.checkNotNull(context);
-        super.start(context);
-    }
-
-    public ProviderContext setBroker(final BindingAwareBroker broker) {
-        return broker.registerProvider(new SalCompatibilityProvider(this), context);
-    }
-
-    @Override
-    protected Object[] getGlobalImplementations() {
-        return new Object[] {
-                this, // Used for setBroker callback
-                flow,
-                inventory,
-                dataPacket,
-                nodeFactory,
-                nodeConnectorFactory,
-                topology,
-                tpProvider
-        };
-    }
-
-    @Override
-    protected void configureGlobalInstance(final Component c, final Object imp) {
-        if (imp instanceof DataPacketAdapter) {
-            _configure((DataPacketAdapter)imp, c);
-        } else if (imp instanceof FlowProgrammerAdapter) {
-            _configure((FlowProgrammerAdapter)imp, c);
-        } else if (imp instanceof InventoryAndReadAdapter) {
-            _configure((InventoryAndReadAdapter)imp, c);
-        } else if (imp instanceof ComponentActivator) {
-            _configure((ComponentActivator)imp, c);
-        } else if (imp instanceof MDSalNodeConnectorFactory) {
-            _configure((MDSalNodeConnectorFactory)imp, c);
-        } else if (imp instanceof MDSalNodeFactory) {
-            _configure((MDSalNodeFactory)imp, c);
-        } else if (imp instanceof TopologyAdapter) {
-            _configure((TopologyAdapter)imp, c);
-        } else if (imp instanceof TopologyProvider) {
-            _configure((TopologyProvider)imp, c);
-        } else {
-            throw new IllegalArgumentException(String.format("Unhandled implementation class %s", imp.getClass()));
-        }
-    }
-
-    @Override
-    protected Object[] getImplementations() {
-        return new Object[] {
-                dataPacketService,
-                inventory,
-        };
-    }
-
-    @Override
-    protected void configureInstance(final Component c, final Object imp, final String containerName) {
-        if (imp instanceof ComponentActivator) {
-            _instanceConfigure((ComponentActivator)imp, c, containerName);
-        } else if (imp instanceof DataPacketServiceAdapter) {
-            _instanceConfigure((DataPacketServiceAdapter)imp, c, containerName);
-        } else if (imp instanceof InventoryAndReadAdapter) {
-            _instanceConfigure((InventoryAndReadAdapter)imp, c, containerName);
-        } else {
-            throw new IllegalArgumentException(String.format("Unhandled implementation class %s", imp.getClass()));
-        }
-    }
-
-    private void _configure(final MDSalNodeFactory imp, final Component it) {
-        it.setInterface(INodeFactory.class.getName(), properties());
-    }
-
-    private void _configure(final MDSalNodeConnectorFactory imp, final Component it) {
-        it.setInterface(INodeConnectorFactory.class.getName(), properties());
-    }
-
-    private void _configure(final ComponentActivator imp, final Component it) {
-        it.add(createServiceDependency()
-                .setService(BindingAwareBroker.class)
-                .setCallbacks("setBroker", "setBroker")
-                .setRequired(true));
-    }
-
-    private void _configure(final DataPacketAdapter imp, final Component it) {
-        it.add(createServiceDependency()
-                .setService(IPluginOutDataPacketService.class)
-                .setCallbacks("setDataPacketPublisher", "setDataPacketPublisher")
-                .setRequired(false));
-    }
-
-    private void _configure(final FlowProgrammerAdapter imp, final Component it) {
-        it.setInterface(IPluginInFlowProgrammerService.class.getName(), properties());
-        it.add(createServiceDependency()
-                .setService(IPluginOutFlowProgrammerService.class)
-                .setCallbacks("setFlowProgrammerPublisher", "setFlowProgrammerPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IClusterGlobalServices.class)
-                .setCallbacks("setClusterGlobalServices", "unsetClusterGlobalServices")
-                .setRequired(false));
-    }
-
-    private void _instanceConfigure(final DataPacketServiceAdapter imp, final Component it, final String containerName) {
-        it.setInterface(IPluginInDataPacketService.class.getName(), properties());
-    }
-
-    private void _instanceConfigure(final ComponentActivator imp, final Component it, final String containerName) {
-        // No-op
-    }
-
-    private void _configure(final InventoryAndReadAdapter imp, final Component it) {
-        it.setInterface(new String[] {
-                IPluginInInventoryService.class.getName(),
-                IPluginInReadService.class.getName(),
-        }, properties());
-
-        it.add(createServiceDependency()
-                .setService(IPluginOutReadService.class)
-                .setCallbacks("setReadPublisher", "unsetReadPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IPluginOutInventoryService.class)
-                .setCallbacks("setInventoryPublisher", "unsetInventoryPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IDiscoveryService.class)
-                .setCallbacks("setDiscoveryPublisher", "setDiscoveryPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(BindingAwareBroker.class)
-                .setRequired(true));
-    }
-
-    private void _instanceConfigure(final InventoryAndReadAdapter imp, final Component it, String containerName) {
-        it.setInterface(new String[] {
-                IPluginInInventoryService.class.getName(),
-                IPluginInReadService.class.getName(),
-        }, properties());
-
-        it.add(createServiceDependency()
-                .setService(IPluginOutReadService.class)
-                .setCallbacks("setReadPublisher", "unsetReadPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IPluginOutInventoryService.class)
-                .setCallbacks("setInventoryPublisher", "unsetInventoryPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(BindingAwareBroker.class)
-                .setRequired(true));
-    }
-
-    private void _configure(final TopologyAdapter imp, final Component it) {
-        it.setInterface(IPluginInTopologyService.class.getName(), properties());
-
-        it.add(createServiceDependency()
-                .setService(IPluginOutTopologyService.class)
-                .setCallbacks("setTopologyPublisher", "setTopologyPublisher")
-                .setRequired(false));
-    }
-
-    private void _configure(final TopologyProvider imp, final Component it) {
-        it.add(createServiceDependency()
-                .setService(IPluginOutTopologyService.class)
-                .setCallbacks("setTopologyPublisher", "setTopologyPublisher")
-                .setRequired(false));
-    }
-
-    private Dictionary<String,Object> properties() {
-        final Hashtable<String,Object> props = new Hashtable<String, Object>();
-        props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), NodeIDType.OPENFLOW);
-        props.put("protocolName", NodeIDType.OPENFLOW);
-        return props;
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/DataPacketAdapter.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/DataPacketAdapter.java
deleted file mode 100644 (file)
index 3b5bb78..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.packet.IPluginOutDataPacketService;
-import org.opendaylight.controller.sal.packet.RawPacket;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class DataPacketAdapter implements PacketProcessingListener {
-    private static final Logger LOG = LoggerFactory.getLogger(DataPacketAdapter.class);
-
-    // These are injected via Apache DM (see ComponentActivator)
-    private IPluginOutDataPacketService dataPacketPublisher;
-
-    @Override
-    public void onPacketReceived(final PacketReceived packet) {
-        try {
-            RawPacket inPacket = toRawPacket(packet);
-            if (dataPacketPublisher != null) {
-                dataPacketPublisher.receiveDataPacket(inPacket);
-            } else {
-                LOG.warn("IPluginOutDataPacketService is not available. Not forwarding packet to AD-SAL.");
-            }
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct raw packet from {}, dropping it", packet, e);
-        }
-    }
-
-    public static RawPacket toRawPacket(final PacketReceived received) throws ConstructionException {
-        final RawPacket ret = new RawPacket(received.getPayload());
-        ret.setIncomingNodeConnector(NodeMapping.toADNodeConnector(received.getIngress()));
-        return ret;
-    }
-
-    public IPluginOutDataPacketService getDataPacketPublisher() {
-        return dataPacketPublisher;
-    }
-
-    // These are injected via Apache DM (see ComponentActivator)
-    public void setDataPacketPublisher(final IPluginOutDataPacketService dataPacketPublisher) {
-        this.dataPacketPublisher = dataPacketPublisher;
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/FlowProgrammerAdapter.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/FlowProgrammerAdapter.java
deleted file mode 100644 (file)
index a7b4ef5..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import java.util.EnumSet;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-import org.opendaylight.controller.clustering.services.CacheConfigException;
-import org.opendaylight.controller.clustering.services.CacheExistException;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.clustering.services.IClusterServices.cacheMode;
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
-import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginOutFlowProgrammerService;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.controller.sal.utils.StatusCode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowListener {
-    private final static Logger LOG = LoggerFactory.getLogger(FlowProgrammerAdapter.class);
-
-    // Note: clustering services manipulate this
-    private final Map<Flow, UUID> flowToFlowId = new ConcurrentHashMap<Flow, UUID>();
-    private final static String CACHE_NAME = "flowprogrammeradapter.flowtoid";
-
-    // These are injected via Apache DM (see ComponentActivator)
-    private IPluginOutFlowProgrammerService flowProgrammerPublisher;
-    private IClusterGlobalServices clusterGlobalServices;
-    private DataBrokerService dataBrokerService;
-    private SalFlowService delegate;
-
-    public SalFlowService getDelegate() {
-        return this.delegate;
-    }
-
-    public void setDelegate(final SalFlowService delegate) {
-        this.delegate = delegate;
-    }
-
-    public DataBrokerService getDataBrokerService() {
-        return this.dataBrokerService;
-    }
-
-    public void setDataBrokerService(final DataBrokerService dataBrokerService) {
-        this.dataBrokerService = dataBrokerService;
-    }
-
-    public IPluginOutFlowProgrammerService getFlowProgrammerPublisher() {
-        return this.flowProgrammerPublisher;
-    }
-
-    public void setFlowProgrammerPublisher(final IPluginOutFlowProgrammerService flowProgrammerPublisher) {
-        this.flowProgrammerPublisher = flowProgrammerPublisher;
-    }
-
-    public IClusterGlobalServices getClusterGlobalServices() {
-        return this.clusterGlobalServices;
-    }
-
-    public void setClusterGlobalServices(final IClusterGlobalServices clusterGlobalServices) {
-        this.clusterGlobalServices = clusterGlobalServices;
-    }
-
-    @Override
-    public Status addFlow(final Node node, final Flow flow) {
-        return toFutureStatus(internalAddFlowAsync(node, flow, 0));
-    }
-
-    @Override
-    public Status modifyFlow(final Node node, final Flow oldFlow, final Flow newFlow) {
-        return toFutureStatus(internalModifyFlowAsync(node, oldFlow, newFlow, 0));
-    }
-
-    @Override
-    public Status removeFlow(final Node node, final Flow flow) {
-        return toFutureStatus(internalRemoveFlowAsync(node, flow, 0));
-    }
-
-    @Override
-    public Status addFlowAsync(final Node node, final Flow flow, final long rid) {
-        // FIXME is this correct? What if the future fails?
-        this.internalAddFlowAsync(node, flow, rid);
-        return FlowProgrammerAdapter.toStatus(true);
-    }
-
-    @Override
-    public Status modifyFlowAsync(final Node node, final Flow oldFlow, final Flow newFlow, final long rid) {
-        // FIXME is this correct? What if the future fails?
-        this.internalModifyFlowAsync(node, oldFlow, newFlow, rid);
-        return FlowProgrammerAdapter.toStatus(true);
-    }
-
-    @Override
-    public Status removeFlowAsync(final Node node, final Flow flow, final long rid) {
-        // FIXME is this correct? What if the future fails?
-        this.internalRemoveFlowAsync(node, flow, rid);
-        return FlowProgrammerAdapter.toStatus(true);
-    }
-
-    @Override
-    public Status removeAllFlows(final Node node) {
-        // FIXME: unfinished?
-        return new Status(StatusCode.SUCCESS);
-    }
-
-    @Override
-    public Status syncSendBarrierMessage(final Node node) {
-        // FIXME: unfinished?
-        return null;
-    }
-
-    @Override
-    public Status asyncSendBarrierMessage(final Node node) {
-        // FIXME: unfinished?
-        return null;
-    }
-
-    private static Status toStatus(final boolean successful) {
-        return new Status(successful ? StatusCode.SUCCESS : StatusCode.INTERNALERROR);
-    }
-
-    public static Status toStatus(final RpcResult<? extends Object> result) {
-        return toStatus(result.isSuccessful());
-    }
-
-    @Override
-    public void onFlowAdded(final FlowAdded notification) {
-        // FIXME: unfinished?
-    }
-
-    @Override
-    public void onFlowRemoved(final FlowRemoved notification) {
-        // notified upon remove flow rpc successfully invoked
-        if (notification == null) {
-            return;
-        }
-
-        final NodeRef node = notification.getNode();
-        if (node == null) {
-            LOG.debug("Notification {} has not node, ignoring it", notification);
-            return;
-        }
-
-        Node adNode;
-        try {
-            adNode = NodeMapping.toADNode(notification.getNode());
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct AD node for {}, ignoring notification", node, e);
-            return;
-        }
-        flowProgrammerPublisher.flowRemoved(adNode, ToSalConversionsUtils.toFlow(notification, adNode));
-    }
-
-    @Override
-    public void onFlowUpdated(final FlowUpdated notification) {
-        // FIXME: unfinished?
-    }
-
-    @Override
-    public void onSwitchFlowRemoved(final SwitchFlowRemoved notification) {
-        // notified upon remove flow message from device arrives
-        if (notification == null) {
-            return;
-        }
-
-        final NodeRef node = notification.getNode();
-        if (node == null) {
-            LOG.debug("Notification {} has not node, ignoring it", notification);
-            return;
-        }
-
-        Node adNode;
-        try {
-            adNode = NodeMapping.toADNode(notification.getNode());
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct AD node for {}, ignoring notification", node, e);
-            return;
-        }
-        flowProgrammerPublisher.flowRemoved(adNode, ToSalConversionsUtils.toFlow(notification, adNode));
-    }
-
-    @Override
-    public void onNodeErrorNotification(final NodeErrorNotification notification) {
-        // FIXME: unfinished?
-    }
-
-    @Override
-    public void onNodeExperimenterErrorNotification(final NodeExperimenterErrorNotification notification) {
-        // FIXME: unfinished?
-    }
-
-    private static final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> flowPath(
-            final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, final NodeKey nodeKey) {
-        return InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey)
-                .augmentation(FlowCapableNode.class)
-                .child(Table.class, new TableKey(flow.getTableId()))
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.class, new FlowKey(flow.getId()))
-                .toInstance();
-    }
-
-    private Future<RpcResult<TransactionStatus>> writeFlowAsync(final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, final NodeKey nodeKey) {
-        final DataModificationTransaction modification = this.dataBrokerService.beginTransaction();
-        modification.putConfigurationData(flowPath(flow, nodeKey), flow);
-        return modification.commit();
-    }
-
-    private Future<RpcResult<TransactionStatus>> internalAddFlowAsync(final Node node, final Flow flow, final long rid) {
-        final Map<Flow,UUID> cache = this.getCache();
-        UUID flowId = cache.get(flow);
-        if (flowId != null) {
-            this.removeFlow(node, flow);
-        }
-
-        flowId = UUID.randomUUID();
-        cache.put(flow, flowId);
-        return this.writeFlowAsync(MDFlowMapping.toMDFlow(flow, flowId.toString()), new NodeKey(
-                new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID())));
-    }
-
-    private Future<RpcResult<TransactionStatus>> internalModifyFlowAsync(final Node node, final Flow oldFlow, final Flow newFlow, final long rid) {
-        final Map<Flow,UUID> cache = this.getCache();
-
-        UUID flowId = cache.remove(oldFlow);
-        if (flowId == null) {
-            flowId = UUID.randomUUID();
-            cache.put(oldFlow, flowId);
-            LOG.warn("Could not find flow {} in cache, assigned new ID {}", oldFlow.hashCode(), flowId);
-        }
-
-        cache.put(newFlow, flowId);
-        return this.writeFlowAsync(MDFlowMapping.toMDFlow(newFlow, flowId.toString()), new NodeKey(
-                new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID())));
-    }
-
-    private Future<RpcResult<TransactionStatus>> internalRemoveFlowAsync(final Node node, final Flow adflow, final long rid) {
-        final Map<Flow,UUID> cache = this.getCache();
-
-        final UUID flowId = cache.remove(adflow);
-        if (flowId == null) {
-            LOG.warn("Could not find flow {} in cache, nothing to do", adflow.hashCode());
-            return null;
-        }
-
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow = MDFlowMapping.toMDFlow(adflow, flowId.toString());
-        final DataModificationTransaction modification = this.dataBrokerService.beginTransaction();
-        modification.removeConfigurationData(flowPath(flow, new NodeKey(
-                new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID()))));
-        return modification.commit();
-    }
-
-    private static Status toFutureStatus(final Future<RpcResult<TransactionStatus>> future) {
-        if (future == null) {
-            // FIXME: really?
-            return FlowProgrammerAdapter.toStatus(true);
-        }
-
-        try {
-            final RpcResult<TransactionStatus> result = future.get();
-            return FlowProgrammerAdapter.toStatus(result);
-        } catch (final InterruptedException e) {
-            FlowProgrammerAdapter.LOG.error("Interrupted while processing flow", e);
-        } catch (ExecutionException e) {
-            FlowProgrammerAdapter.LOG.error("Failed to process flow", e);
-        }
-
-        return new Status(StatusCode.INTERNALERROR);
-    }
-
-    @SuppressWarnings("unchecked")
-    private Map<Flow,UUID> getCache() {
-        final IClusterGlobalServices cgs = getClusterGlobalServices();
-        if (cgs == null) {
-            return new ConcurrentHashMap<Flow, UUID>();
-        }
-
-        Map<Flow, UUID> cache = (Map<Flow, UUID>) cgs.getCache(FlowProgrammerAdapter.CACHE_NAME);
-        if (cache != null) {
-            return cache;
-        }
-
-        try {
-            return (Map<Flow, UUID>) cgs.createCache(CACHE_NAME, EnumSet.of(cacheMode.TRANSACTIONAL));
-        } catch (CacheExistException e) {
-            return (Map<Flow, UUID>) cgs.getCache(CACHE_NAME);
-        } catch (CacheConfigException e) {
-            throw new IllegalStateException("Unexpected cache configuration problem", e);
-        }
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/FromSalConversionsUtils.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/FromSalConversionsUtils.java
deleted file mode 100644 (file)
index f7ea9c0..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import static org.opendaylight.controller.sal.match.MatchType.DL_DST;
-import static org.opendaylight.controller.sal.match.MatchType.DL_SRC;
-import static org.opendaylight.controller.sal.match.MatchType.DL_TYPE;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.UDP;
-
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.match.Match;
-import org.opendaylight.controller.sal.match.MatchField;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.controller.sal.utils.NetUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
-
-import com.google.common.net.InetAddresses;
-
-/**
- * MD-SAL to AD-SAL conversions collection
- */
-public final class FromSalConversionsUtils {
-
-    /** http://en.wikipedia.org/wiki/IPv4#Packet_structure (end of octet number 1, bit 14.+15.) */
-    public static final int ENC_FIELD_BIT_SIZE = 2;
-
-    private FromSalConversionsUtils() {
-        throw new IllegalAccessError("forcing no instance for factory");
-    }
-
-    @SuppressWarnings("unused")
-    private static Address addressFromAction(InetAddress inetAddress) {
-        String strInetAddresss = InetAddresses.toAddrString(inetAddress);
-        if (inetAddress instanceof Inet4Address) {
-            Ipv4Builder ipv4Builder = new Ipv4Builder();
-            ipv4Builder.setIpv4Address(new Ipv4Prefix(strInetAddresss));
-            return ipv4Builder.build();
-        } else if (inetAddress instanceof Inet6Address) {
-            Ipv6Builder ipv6Builder = new Ipv6Builder();
-            ipv6Builder.setIpv6Address(new Ipv6Prefix(strInetAddresss));
-            return ipv6Builder.build();
-        }
-        return null;
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match toMatch(
-            Match sourceMatch) {
-        if (sourceMatch != null) {
-            MatchBuilder targetBuilder = new MatchBuilder();
-
-            targetBuilder.setEthernetMatch(ethernetMatch(sourceMatch));
-            targetBuilder.setIpMatch(ipMatch(sourceMatch));
-            targetBuilder.setVlanMatch(vlanMatch(sourceMatch));
-            targetBuilder.setLayer3Match(layer3Match(sourceMatch));
-            targetBuilder.setLayer4Match(layer4Match(sourceMatch));
-            targetBuilder.setInPort(inPortMatch(sourceMatch));
-
-            return targetBuilder.build();
-        }
-        return null;
-
-    }
-
-    private static NodeConnectorId inPortMatch(Match sourceMatch) {
-        MatchField inPort = sourceMatch.getField(MatchType.IN_PORT);
-        if(inPort != null && inPort.getValue() != null && (inPort.getValue() instanceof NodeConnector)) {
-            NodeConnector port = (NodeConnector)inPort.getValue();
-            return (NodeConnectorId)MDFlowMapping.toUri(port);
-        }
-        return null;
-    }
-
-    private static Layer4Match layer4Match(final Match sourceMatch) {
-        MatchField nwProto = sourceMatch.getField(MatchType.NW_PROTO);
-        Short nwProtocolSource = null;
-        if (nwProto != null && nwProto.getValue() != null) {
-            nwProtocolSource = (short) ((byte) nwProto.getValue());
-            switch (nwProtocolSource) {
-            case TCP:
-                return Layer4MatchAsTcp(sourceMatch);
-            case UDP:
-                return Layer4MatchAsUdp(sourceMatch);
-            case CRUDP:
-                return Layer4MatchAsSctp(sourceMatch);
-            }
-        }
-        return null;
-    }
-
-    private static Layer4Match Layer4MatchAsSctp(final Match sourceMatch) {
-        SctpMatchBuilder sctpMatchBuilder = new SctpMatchBuilder();
-
-        Integer sourcePort = transportPort(sourceMatch, MatchType.TP_SRC);
-        Integer destinationPort = transportPort(sourceMatch,
-                MatchType.TP_DST);
-
-        if (sourcePort != null) {
-            sctpMatchBuilder.setSctpSourcePort(new PortNumber(sourcePort));
-        }
-        if (destinationPort != null) {
-            sctpMatchBuilder.setSctpDestinationPort(new PortNumber(
-                    destinationPort));
-        }
-        if(sourcePort != null || destinationPort != null) {
-            return sctpMatchBuilder.build();
-        }
-        return null;
-    }
-
-    private static Layer4Match Layer4MatchAsUdp(final Match sourceMatch) {
-        UdpMatchBuilder udpMatchBuilder = new UdpMatchBuilder();
-
-        Integer sourcePort = transportPort(sourceMatch, MatchType.TP_SRC);
-        Integer destinationPort = transportPort(sourceMatch,
-                MatchType.TP_DST);
-
-        if (sourcePort != null) {
-            udpMatchBuilder.setUdpSourcePort(new PortNumber(sourcePort));
-        }
-
-        if (destinationPort != null) {
-            udpMatchBuilder.setUdpDestinationPort(new PortNumber(
-                    destinationPort));
-        }
-        if(sourcePort != null || destinationPort != null) {
-            return udpMatchBuilder.build();
-        }
-        return null;
-    }
-
-    private static Layer4Match Layer4MatchAsTcp(final Match sourceMatch) {
-        TcpMatchBuilder tcpMatchBuilder = new TcpMatchBuilder();
-
-        Integer sourcePort = transportPort(sourceMatch, MatchType.TP_SRC);
-        Integer destinationPort = transportPort(sourceMatch,
-                MatchType.TP_DST);
-
-        if (sourcePort != null) {
-            tcpMatchBuilder.setTcpSourcePort(new PortNumber(sourcePort));
-        }
-        if (destinationPort != null) {
-            tcpMatchBuilder.setTcpDestinationPort(new PortNumber(
-                    destinationPort));
-        }
-        if(sourcePort != null || destinationPort != null) {
-            return tcpMatchBuilder.build();
-        }
-        return null;
-    }
-
-    private static Integer transportPort(final Match sourceMatch,
-            final MatchType matchType) {
-        MatchField transportPort = sourceMatch.getField(matchType);
-        if (transportPort != null && transportPort.getValue() != null
-                && transportPort.getValue().getClass().equals(Short.class)) {
-            return NetUtils.getUnsignedShort((short) transportPort.getValue());
-        }
-        return null;
-    }
-
-    private static VlanMatch vlanMatch(final Match sourceMatch) {
-        VlanMatchBuilder vlanMatchBuild = new VlanMatchBuilder();
-
-        MatchField vlan = sourceMatch.getField(MatchType.DL_VLAN);
-        if (vlan != null && vlan.getValue() != null) {
-            VlanIdBuilder vlanIDBuilder = new VlanIdBuilder();
-            short vid = (short)vlan.getValue();
-            boolean present = (vid != MatchType.DL_VLAN_NONE);
-            vlanIDBuilder.setVlanId(new VlanId((NetUtils
-                    .getUnsignedShort(vid))));
-            vlanIDBuilder.setVlanIdPresent(present);
-            vlanMatchBuild.setVlanId(vlanIDBuilder.build());
-        }
-
-        MatchField vlanPriority = sourceMatch.getField(MatchType.DL_VLAN_PR);
-        if (vlanPriority != null && vlanPriority.getValue() != null) {
-            vlanMatchBuild.setVlanPcp(new VlanPcp((short) ((byte) vlanPriority
-                    .getValue())));
-        }
-        if((vlan != null && vlan.getValue() != null) || (vlanPriority != null && vlanPriority.getValue() != null)) {
-            return vlanMatchBuild.build();
-        }
-        return null;
-    }
-
-    private static IpMatch ipMatch(final Match sourceMatch) {
-        IpMatchBuilder targetIpMatchBuild = new IpMatchBuilder();
-        MatchField networkTos = sourceMatch.getField(MatchType.NW_TOS);
-        if (networkTos != null && networkTos.getValue() != null) {
-            Dscp dscp = new Dscp(
-                    (short) (NetUtils.getUnsignedByte((Byte) networkTos
-                            .getValue())));
-            targetIpMatchBuild.setIpDscp(dscp);
-        }
-
-        MatchField protocol = sourceMatch.getField(MatchType.NW_PROTO);
-        if (protocol != null && protocol.getValue() != null) {
-            targetIpMatchBuild.setIpProtocol((short) ((byte) protocol
-                    .getValue()));
-        }
-        if((networkTos != null && networkTos.getValue() != null) || (protocol != null && protocol.getValue() != null)) {
-            return targetIpMatchBuild.build();
-        }
-        return null;
-    }
-
-    private static EthernetMatch ethernetMatch(final Match sourceMatch) {
-        final EthernetMatchBuilder targetEthMatchBuild = new EthernetMatchBuilder();
-        if(sourceMatch.getField(DL_SRC) != null && sourceMatch.getField(DL_SRC).getValue() != null) {
-            EthernetSourceBuilder ethSourBuild = new EthernetSourceBuilder()
-                    .setAddress(ethernetSourceAddress(sourceMatch));
-            targetEthMatchBuild.setEthernetSource(ethSourBuild.build());
-        }
-        if(sourceMatch.getField(DL_DST) != null && sourceMatch.getField(DL_DST).getValue() != null) {
-            EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder()
-                    .setAddress(ethernetDestAddress(sourceMatch));
-            targetEthMatchBuild.setEthernetDestination(ethDestBuild.build());
-        }
-
-        final MatchField dataLinkType = sourceMatch.getField(MatchType.DL_TYPE);
-        if (dataLinkType != null && dataLinkType.getValue() != null) {
-            EtherType etherType = new EtherType((long) NetUtils.getUnsignedShort((Short) dataLinkType.getValue()));
-            EthernetTypeBuilder ethType = new EthernetTypeBuilder()
-                    .setType(etherType);
-            targetEthMatchBuild.setEthernetType(ethType.build());
-        }
-        if((sourceMatch.getField(DL_SRC) != null && sourceMatch.getField(DL_SRC).getValue() != null) ||
-                (sourceMatch.getField(DL_DST) != null && sourceMatch.getField(DL_DST).getValue() != null)||
-                dataLinkType != null ) {
-            return targetEthMatchBuild.build();
-        }
-        return null;
-    }
-
-    private static MacAddress ethernetSourceAddress(final Match sourceMatch) {
-        final MatchField dataLinkSource = sourceMatch.getField(DL_SRC);
-        if (dataLinkSource != null && dataLinkSource.getValue() != null) {
-            return MDFlowMapping.toMacAddress((byte[])dataLinkSource.getValue());
-        }
-        return null;
-
-    }
-
-    private static Layer3Match layer3Match(final Match sourceMatch) {
-        InetAddress inetSourceAddress = null;
-        MatchField netSource = sourceMatch.getField(MatchType.NW_SRC);
-        if (netSource != null && netSource.getValue() != null) {
-            inetSourceAddress = (InetAddress) (netSource.getValue());
-        }
-
-        InetAddress inetDestAddress = null;
-        MatchField netDest = sourceMatch.getField(MatchType.NW_DST);
-        if (netDest != null && netDest.getValue() != null) {
-            inetDestAddress = (InetAddress) (netDest.getValue());
-        }
-
-        if ((inetSourceAddress instanceof Inet4Address)
-                || (inetDestAddress instanceof Inet4Address)) {
-            MatchField dataLinkType = sourceMatch.getField(DL_TYPE);
-            Short dLType = null;
-            if (dataLinkType != null && dataLinkType.getValue() != null) {
-                dLType = (Short) (dataLinkType.getValue());
-            }
-            if (dLType != null && dLType.equals(ETHERNET_ARP)) {
-                return setLayer3MatchAsArp(sourceMatch,
-                        (Inet4Address) inetSourceAddress,
-                        (Inet4Address) inetDestAddress);
-            } else {
-                return setLayer3MatchAsIpv4((Inet4Address) inetSourceAddress,
-                        (Inet4Address) inetDestAddress);
-            }
-        } else if ((inetSourceAddress instanceof Inet6Address)
-                || (inetDestAddress instanceof Inet6Address)) {
-            return setLayer3MatchAsIpv6((Inet6Address) inetSourceAddress,
-                    (Inet6Address) inetDestAddress);
-        }
-
-        return null;
-
-    }
-
-    private static Layer3Match setLayer3MatchAsArp(final Match sourceMatch,
-            final Inet4Address inetSourceAddress,
-            final Inet4Address inetDestAddress) {
-        String inetSourceAddressStr = InetAddresses
-                .toAddrString(inetSourceAddress);
-        Ipv4Prefix ipv4SourcePrefix = new Ipv4Prefix(inetSourceAddressStr + "/32");
-
-        String inetDestAddressValue = InetAddresses
-                .toAddrString(inetDestAddress);
-        Ipv4Prefix ipv4DestPrefix = new Ipv4Prefix(inetDestAddressValue + "/32");
-
-        ArpMatchBuilder arpMatchBuilder = new ArpMatchBuilder();
-
-        arpMatchBuilder.setArpSourceTransportAddress(ipv4SourcePrefix);
-        arpMatchBuilder.setArpTargetTransportAddress(ipv4DestPrefix);
-
-        ArpSourceHardwareAddressBuilder arpSourceHardwareAddressBuilder = new ArpSourceHardwareAddressBuilder();
-        arpSourceHardwareAddressBuilder
-                .setAddress(ethernetSourceAddress(sourceMatch));
-        arpMatchBuilder
-                .setArpSourceHardwareAddress(arpSourceHardwareAddressBuilder
-                        .build());
-
-        ArpTargetHardwareAddressBuilder arpTargetHardwareAddressBuilder = new ArpTargetHardwareAddressBuilder();
-        arpTargetHardwareAddressBuilder
-                .setAddress(ethernetDestAddress(sourceMatch));
-        arpMatchBuilder
-                .setArpTargetHardwareAddress(arpTargetHardwareAddressBuilder
-                        .build());
-
-        return arpMatchBuilder.build();
-
-    }
-
-    private static MacAddress ethernetDestAddress(final Match sourceMatch) {
-        final MatchField dataLinkDest = sourceMatch.getField(DL_DST);
-        if (dataLinkDest != null && dataLinkDest.getValue() != null) {
-            return MDFlowMapping.toMacAddress((byte[]) dataLinkDest.getValue());
-        }
-        return null;
-    }
-
-    private static Layer3Match setLayer3MatchAsIpv4(
-            final Inet4Address inetSourceAddress,
-            final Inet4Address inetDestAddress) {
-        Ipv4MatchBuilder layer4MatchBuild = new Ipv4MatchBuilder();
-        if(inetSourceAddress != null) {
-            String inetSrcAddressString = InetAddresses
-                    .toAddrString(inetSourceAddress);
-            layer4MatchBuild.setIpv4Source(new Ipv4Prefix(inetSrcAddressString + "/32"));
-        }
-        if(inetDestAddress != null) {
-            String inetDstAddressString = InetAddresses
-                    .toAddrString(inetDestAddress);
-            layer4MatchBuild
-            .setIpv4Destination(new Ipv4Prefix(inetDstAddressString + "/32"));
-        }
-        return layer4MatchBuild.build();
-
-    }
-
-    private static Layer3Match setLayer3MatchAsIpv6(
-            final Inet6Address inetSourceAddress,
-            final Inet6Address inetDestAddress) {
-        Ipv6MatchBuilder layer6MatchBuild = new Ipv6MatchBuilder();
-        if(inetSourceAddress != null) {
-            String inetSrcAddressString = InetAddresses
-                    .toAddrString(inetSourceAddress);
-            layer6MatchBuild.setIpv6Source(new Ipv6Prefix(inetSrcAddressString + "/128"));
-        }
-        if(inetDestAddress != null) {
-            String inetDstAddressString = InetAddresses
-                    .toAddrString(inetDestAddress);
-            layer6MatchBuild
-                    .setIpv6Destination(new Ipv6Prefix(inetDstAddressString + "/128"));
-        }
-        return layer6MatchBuild.build();
-    }
-
-    public static boolean flowEquals(Flow statsFlow, Flow storedFlow) {
-        if (statsFlow.getClass() != storedFlow.getClass()) {
-            return false;
-        }
-        if (statsFlow.getBufferId()== null) {
-            if (storedFlow.getBufferId() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getBufferId().equals(storedFlow.getBufferId())) {
-            return false;
-        }
-        if (statsFlow.getContainerName()== null) {
-            if (storedFlow.getContainerName()!= null) {
-                return false;
-            }
-        } else if(!statsFlow.getContainerName().equals(storedFlow.getContainerName())) {
-            return false;
-        }
-        if (statsFlow.getCookie()== null) {
-            if (storedFlow.getCookie()!= null) {
-                return false;
-            }
-        } else if(!statsFlow.getCookie().equals(storedFlow.getCookie())) {
-            return false;
-        }
-        if (statsFlow.getMatch()== null) {
-            if (storedFlow.getMatch() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getMatch().equals(storedFlow.getMatch())) {
-            return false;
-        }
-        if (statsFlow.getCookie()== null) {
-            if (storedFlow.getCookie()!= null) {
-                return false;
-            }
-        } else if(!statsFlow.getCookie().equals(storedFlow.getCookie())) {
-            return false;
-        }
-        if (statsFlow.getHardTimeout() == null) {
-            if (storedFlow.getHardTimeout() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getHardTimeout().equals(storedFlow.getHardTimeout() )) {
-            return false;
-        }
-        if (statsFlow.getIdleTimeout()== null) {
-            if (storedFlow.getIdleTimeout() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getIdleTimeout().equals(storedFlow.getIdleTimeout())) {
-            return false;
-        }
-        if (statsFlow.getPriority() == null) {
-            if (storedFlow.getPriority() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getPriority().equals(storedFlow.getPriority())) {
-            return false;
-        }
-        if (statsFlow.getTableId() == null) {
-            if (storedFlow.getTableId() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getTableId().equals(storedFlow.getTableId())) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * @param nwDscp NW-DSCP
-     * @return shifted to NW-TOS (with empty ECN part)
-     */
-    public static int dscpToTos(int nwDscp) {
-        return (short) (nwDscp << ENC_FIELD_BIT_SIZE);
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryAndReadAdapter.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryAndReadAdapter.java
deleted file mode 100644 (file)
index e0b28d3..0000000
+++ /dev/null
@@ -1,917 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
-import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Edge;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeTable;
-import org.opendaylight.controller.sal.core.NodeTable.NodeTableIDType;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.controller.sal.reader.FlowOnNode;
-import org.opendaylight.controller.sal.reader.IPluginInReadService;
-import org.opendaylight.controller.sal.reader.IPluginOutReadService;
-import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
-import org.opendaylight.controller.sal.reader.NodeDescription;
-import org.opendaylight.controller.sal.reader.NodeTableStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.statistics.FlowTableStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.Link;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Bytes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Packets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.collect.Iterables;
-
-public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInInventoryService, OpendaylightFlowStatisticsListener, OpendaylightFlowTableStatisticsListener, OpendaylightPortStatisticsListener {
-    private static final Logger LOG = LoggerFactory.getLogger(InventoryAndReadAdapter.class);
-    private static final short OPENFLOWV10_TABLE_ID = 0;
-    private static final int SLEEP_FOR_NOTIFICATIONS_MILLIS = 500;
-
-    private final InventoryNotificationProvider inventoryNotificationProvider = new InventoryNotificationProvider();
-    private final Map<PathArgument,List<PathArgument>> nodeToNodeConnectorsMap = new ConcurrentHashMap<>();
-    private List<IPluginOutInventoryService> inventoryPublisher = new CopyOnWriteArrayList<>();
-    private List<IPluginOutReadService> statisticsPublisher = new CopyOnWriteArrayList<>();
-    private Cache<String, TransactionNotificationList<? extends TransactionAware>> txCache;
-
-    private OpendaylightFlowTableStatisticsService flowTableStatisticsService;
-    private OpendaylightPortStatisticsService nodeConnectorStatisticsService;
-    private OpendaylightFlowStatisticsService flowStatisticsService;
-    private FlowTopologyDiscoveryService topologyDiscovery;
-    private DataProviderService dataProviderService;
-    private DataBrokerService dataService;
-
-    public DataBrokerService getDataService() {
-        return dataService;
-    }
-
-    public void setDataService(final DataBrokerService dataService) {
-        this.dataService = dataService;
-    }
-
-    public DataProviderService getDataProviderService() {
-        return dataProviderService;
-    }
-
-    public void setDataProviderService(final DataProviderService dataProviderService) {
-        this.dataProviderService = dataProviderService;
-    }
-
-    public OpendaylightFlowStatisticsService getFlowStatisticsService() {
-        return flowStatisticsService;
-    }
-
-    public void setFlowStatisticsService(final OpendaylightFlowStatisticsService flowStatisticsService) {
-        this.flowStatisticsService = flowStatisticsService;
-    }
-
-    public OpendaylightPortStatisticsService getNodeConnectorStatisticsService() {
-        return nodeConnectorStatisticsService;
-    }
-
-    public void setNodeConnectorStatisticsService(final OpendaylightPortStatisticsService nodeConnectorStatisticsService) {
-        this.nodeConnectorStatisticsService = nodeConnectorStatisticsService;
-    }
-
-    public OpendaylightFlowTableStatisticsService getFlowTableStatisticsService() {
-        return flowTableStatisticsService;
-    }
-
-    public void setFlowTableStatisticsService(final OpendaylightFlowTableStatisticsService flowTableStatisticsService) {
-        this.flowTableStatisticsService = flowTableStatisticsService;
-    }
-
-    public FlowTopologyDiscoveryService getTopologyDiscovery() {
-        return topologyDiscovery;
-    }
-
-    public void setTopologyDiscovery(final FlowTopologyDiscoveryService topologyDiscovery) {
-        this.topologyDiscovery = topologyDiscovery;
-    }
-
-    public List<IPluginOutReadService> getStatisticsPublisher() {
-        return statisticsPublisher;
-    }
-
-    public void setStatisticsPublisher(final List<IPluginOutReadService> statisticsPublisher) {
-        this.statisticsPublisher = statisticsPublisher;
-    }
-
-    public List<IPluginOutInventoryService> getInventoryPublisher() {
-        return inventoryPublisher;
-    }
-
-    public void setInventoryPublisher(final List<IPluginOutInventoryService> inventoryPublisher) {
-        this.inventoryPublisher = inventoryPublisher;
-    }
-
-    public void startAdapter() {
-        inventoryNotificationProvider.setDataProviderService(getDataProviderService());
-        inventoryNotificationProvider.setInventoryPublisher(getInventoryPublisher());
-        txCache = CacheBuilder.newBuilder().expireAfterWrite(60L, TimeUnit.SECONDS).maximumSize(10000).build();
-        // inventoryNotificationProvider.start();
-    }
-
-    public boolean setInventoryPublisher(final IPluginOutInventoryService listener) {
-        return getInventoryPublisher().add(listener);
-    }
-
-    public boolean unsetInventoryPublisher(final IPluginOutInventoryService listener) {
-        return getInventoryPublisher().remove(listener);
-    }
-
-    public boolean setReadPublisher(final IPluginOutReadService listener) {
-        return getStatisticsPublisher().add(listener);
-    }
-
-    public Boolean unsetReadPublisher(final IPluginOutReadService listener) {
-        if (listener != null) {
-            return getStatisticsPublisher().remove(listener);
-        }
-        return false;
-    }
-
-    protected DataModificationTransaction startChange() {
-        return getDataProviderService().beginTransaction();
-    }
-
-    @Override
-    public long getTransmitRate(final NodeConnector connector) {
-        final FlowCapableNodeConnector nodeConnector = this.readOperFlowCapableNodeConnector(NodeMapping.toNodeConnectorRef(connector));
-        return nodeConnector.getCurrentSpeed().longValue();
-    }
-
-    private FlowCapableNode readOperFlowCapableNode(final NodeRef ref) {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node =
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)getDataService().readOperationalData(ref.getValue());
-        if (node == null) {
-            return null;
-        }
-
-        return node.getAugmentation(FlowCapableNode.class);
-    }
-
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node readConfigNode(final Node node) {
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, InventoryMapping.toNodeKey(node))
-                .build();
-
-        return (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) startChange().readConfigurationData(nodeRef);
-    }
-
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector readConfigNodeConnector(final NodeConnector connector) {
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> nodeConnectorRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, InventoryMapping.toNodeKey(connector.getNode()))
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class, InventoryMapping.toNodeConnectorKey(connector))
-                .toInstance();
-
-        return((org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) startChange().readConfigurationData(nodeConnectorRef));
-    }
-
-    /**
-     * Read a table of a node from configuration data store.
-     *
-     * @param node Node id
-     * @param id Table id
-     * @return Table contents, or null if not present
-     */
-    private Table readOperationalTable(final Node node, final short id) {
-        final InstanceIdentifier<Table> tableRef = InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, NodeMapping.toNodeKey(node))
-                .augmentation(FlowCapableNode.class)
-                .child(Table.class, new TableKey(id))
-                .build();
-
-        return (Table) startChange().readOperationalData(tableRef);
-    }
-
-    @Override
-    public List<FlowOnNode> readAllFlow(final Node node, final boolean cached) {
-        final ArrayList<FlowOnNode> ret= new ArrayList<>();
-        if (cached) {
-            final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID);
-            if (table != null) {
-                final List<Flow> flows = table.getFlow();
-                LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size());
-
-                for (final Flow flow : flows) {
-                    final FlowStatisticsData statsFromDataStore = flow.getAugmentation(FlowStatisticsData.class);
-                    if (statsFromDataStore != null) {
-                        final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flow, node));
-                        ret.add(addFlowStats(it, statsFromDataStore.getFlowStatistics()));
-                    }
-                }
-            }
-        } else {
-            LOG.debug("readAllFlow cached:{}", cached);
-            GetAllFlowStatisticsFromFlowTableInput input =
-                new GetAllFlowStatisticsFromFlowTableInputBuilder()
-                    .setNode(NodeMapping.toNodeRef(node))
-                    .setTableId(new TableId(OPENFLOWV10_TABLE_ID))
-                    .build();
-
-            Future<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> future =
-                getFlowStatisticsService().getAllFlowStatisticsFromFlowTable(input);
-
-            RpcResult<GetAllFlowStatisticsFromFlowTableOutput> result = null;
-            try {
-                // having a blocking call is fine here, as we need to join
-                // the notifications and return the result
-                result = future.get();
-            } catch (Exception e) {
-               LOG.error("Exception in getAllFlowStatisticsFromFlowTable ", e);
-               return ret;
-            }
-
-            GetAllFlowStatisticsFromFlowTableOutput output = result.getResult();
-            if (output == null) {
-                return ret;
-            }
-
-            TransactionId transactionId = output.getTransactionId();
-            String cacheKey = buildCacheKey(transactionId, NodeMapping.toNodeId(node));
-            LOG.info("readAllFlow transactionId:{} cacheKey:{}", transactionId, cacheKey);
-
-            // insert an entry in tempcache, will get updated when notification is received
-            txCache.put(cacheKey, new TransactionNotificationList<FlowsStatisticsUpdate>(
-                transactionId, node.getNodeIDString()));
-
-            TransactionNotificationList<FlowsStatisticsUpdate> txnList =
-                (TransactionNotificationList<FlowsStatisticsUpdate>) txCache.getIfPresent(cacheKey);
-
-            // this loop would not be infinite as the cache will remove an entry
-            // after defined time if not written to
-            while (txnList != null && !txnList.areAllNotificationsGathered()) {
-                LOG.debug("readAllFlow waiting for notification...");
-                waitForNotification();
-                txnList = (TransactionNotificationList<FlowsStatisticsUpdate>) txCache.getIfPresent(cacheKey);
-            }
-
-            if (txnList == null) {
-                return ret;
-            }
-
-            List<FlowsStatisticsUpdate> notifications = txnList.getNotifications();
-            for (FlowsStatisticsUpdate flowsStatisticsUpdate : notifications) {
-                List<FlowAndStatisticsMapList> flowAndStatisticsMapList = flowsStatisticsUpdate.getFlowAndStatisticsMapList();
-                if (flowAndStatisticsMapList != null) {
-                    for (FlowAndStatisticsMapList flowAndStatistics : flowAndStatisticsMapList) {
-                        final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flowAndStatistics, node));
-                        ret.add(addFlowStats(it, flowAndStatistics));
-                    }
-                }
-            }
-        }
-        return ret;
-    }
-
-    private String buildCacheKey(final TransactionId id, final NodeId nodeId) {
-        return String.valueOf(id.getValue()) + "-" + nodeId.getValue();
-    }
-
-    private void waitForNotification() {
-        try {
-            // going for a simple sleep approach,as wait-notify on a monitor would require
-            // us to maintain monitors per txn-node combo
-            Thread.sleep(SLEEP_FOR_NOTIFICATIONS_MILLIS);
-            LOG.trace("statCollector is waking up from a wait stat Response sleep");
-        } catch (final InterruptedException e) {
-            LOG.warn("statCollector has been interrupted waiting stat Response sleep", e);
-        }
-    }
-
-    @Override
-    public List<NodeConnectorStatistics> readAllNodeConnector(final Node node, final boolean cached) {
-        final ArrayList<NodeConnectorStatistics> ret = new ArrayList<>();
-
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node dsNode = readConfigNode(node);
-        if (dsNode != null) {
-            for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector dsNodeConnector : dsNode.getNodeConnector()) {
-                final FlowCapableNodeConnectorStatistics stats = (dsNodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class));
-                if (stats != null) {
-                    try {
-                        ret.add(toNodeConnectorStatistics(stats.getFlowCapableNodeConnectorStatistics(), dsNode.getId(), dsNodeConnector.getId()));
-                    } catch (ConstructionException e) {
-                        LOG.warn("Failed to instantiate node connector statistics for node {} connector {}, ignoring it",
-                                dsNode.getId(), dsNodeConnector.getId(), e);
-                    }
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        getNodeConnectorStatisticsService().getAllNodeConnectorsStatistics(
-                new GetAllNodeConnectorsStatisticsInputBuilder().setNode(NodeMapping.toNodeRef(node)).build());
-        return ret;
-    }
-
-    @Override
-    public List<NodeTableStatistics> readAllNodeTable(final Node node, final boolean cached) {
-        final NodeRef nodeRef = NodeMapping.toNodeRef(node);
-
-        final ArrayList<NodeTableStatistics> ret = new ArrayList<>();
-        final FlowCapableNode dsFlowCapableNode = this.readOperFlowCapableNode(nodeRef);
-        if (dsFlowCapableNode != null) {
-            for (final Table table : dsFlowCapableNode.getTable()) {
-                final FlowTableStatisticsData tableStats = table.getAugmentation(FlowTableStatisticsData.class);
-                if (tableStats != null) {
-                    try {
-                        ret.add(toNodeTableStatistics(tableStats.getFlowTableStatistics(), table.getId(), node));
-                    } catch (ConstructionException e) {
-                        LOG.warn("Failed to instantiate table statistics for node {} table {}, ignoring it", node, table.getId(), e);
-                    }
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        getFlowTableStatisticsService().getFlowTablesStatistics(new GetFlowTablesStatisticsInputBuilder().setNode(nodeRef).build());
-        return ret;
-    }
-
-    @Override
-    public NodeDescription readDescription(final Node node, final boolean cached) {
-        return this.toNodeDescription(NodeMapping.toNodeRef(node));
-    }
-
-    @Override
-    public FlowOnNode readFlow(final Node node, final org.opendaylight.controller.sal.flowprogrammer.Flow targetFlow, final boolean cached) {
-        FlowOnNode ret = null;
-        final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID);
-        if (table != null) {
-            final List<Flow> flows = table.getFlow();
-            InventoryAndReadAdapter.LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size());
-
-            for (final Flow mdsalFlow : flows) {
-                if(FromSalConversionsUtils.flowEquals(mdsalFlow, MDFlowMapping.toMDSalflow(targetFlow))) {
-                    final FlowStatisticsData statsFromDataStore = mdsalFlow.getAugmentation(FlowStatisticsData.class);
-                    if (statsFromDataStore != null) {
-                        InventoryAndReadAdapter.LOG.debug("Found matching flow in the data store flow table ");
-                        ret = addFlowStats(new FlowOnNode(targetFlow), statsFromDataStore.getFlowStatistics());
-
-                        // FIXME: break; ?
-                    }
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        final GetFlowStatisticsFromFlowTableInputBuilder input = new GetFlowStatisticsFromFlowTableInputBuilder().setNode(NodeMapping.toNodeRef(node));
-        input.fieldsFrom(MDFlowMapping.toMDSalflow(targetFlow));
-        getFlowStatisticsService().getFlowStatisticsFromFlowTable(input.build());
-        return ret;
-    }
-
-    @Override
-    public NodeConnectorStatistics readNodeConnector(final NodeConnector connector, final boolean cached) {
-        final NodeConnectorId ncId = InventoryMapping.toNodeConnectorKey(connector).getId();
-
-        NodeConnectorStatistics ret = null;
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nodeConnectorFromDS = readConfigNodeConnector(connector);
-        if (nodeConnectorFromDS != null) {
-            final FlowCapableNodeConnectorStatistics stats = nodeConnectorFromDS.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
-            if (stats != null) {
-                try {
-                    ret = toNodeConnectorStatistics(stats.getFlowCapableNodeConnectorStatistics(),
-                            InventoryMapping.toNodeKey(connector.getNode()).getId(), ncId);
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to instantiate node connector statistics for connector {}, ignoring it",
-                            connector, e);
-                }
-            }
-        }
-
-        getNodeConnectorStatisticsService().getNodeConnectorStatistics(
-                new GetNodeConnectorStatisticsInputBuilder().setNode(NodeMapping.toNodeRef(connector.getNode())).setNodeConnectorId(ncId).build());
-        return ret;
-    }
-
-    @Override
-    public NodeTableStatistics readNodeTable(final NodeTable nodeTable, final boolean cached) {
-        NodeTableStatistics nodeStats = null;
-        final Table table = readOperationalTable(nodeTable.getNode(), (short) nodeTable.getID());
-        if (table != null) {
-            final FlowTableStatisticsData tableStats = table.getAugmentation(FlowTableStatisticsData.class);
-            if (tableStats != null) {
-                try {
-                    nodeStats = toNodeTableStatistics(tableStats.getFlowTableStatistics(), table.getId(), nodeTable.getNode());
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to instantiate table statistics for node {} table {}, ignoring it",
-                            nodeTable.getNode(), table.getId(), e);
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        getFlowTableStatisticsService().getFlowTablesStatistics(
-                new GetFlowTablesStatisticsInputBuilder().setNode(NodeMapping.toNodeRef(nodeTable.getNode())).build());
-        return nodeStats;
-    }
-
-    public void onNodeConnectorRemovedInternal(final NodeConnectorRemoved update) {
-        // Never received
-    }
-
-    public void onNodeRemovedInternal(final NodeRemoved notification) {
-        this.removeNodeConnectors(notification.getNodeRef().getValue());
-        try {
-            final Node aDNode = NodeMapping.toADNode(notification.getNodeRef());
-            this.publishNodeUpdate(aDNode, UpdateType.REMOVED, Collections.<Property>emptySet());
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, not propagating update", notification.getNodeRef(), e);
-        }
-    }
-
-    public void onNodeConnectorUpdatedInternal(final NodeConnectorUpdated update) {
-        final NodeConnectorRef ref = update.getNodeConnectorRef();
-        final UpdateType updateType;
-        if (!this.isKnownNodeConnector(ref.getValue())) {
-            this.recordNodeConnector(ref.getValue());
-            updateType = UpdateType.ADDED;
-        } else {
-            updateType = UpdateType.CHANGED;
-        }
-
-        try {
-            final NodeConnector nodeConnector;
-            nodeConnector = NodeMapping.toADNodeConnector(ref);
-            this.publishNodeConnectorUpdate(nodeConnector, updateType, NodeMapping.toADNodeConnectorProperties(update));
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node connector for {}, not reporting the update", ref, e);
-        }
-    }
-
-    public void onNodeUpdatedInternal(final NodeUpdated notification) {
-        final NodeRef ref = notification.getNodeRef();
-
-        final UpdateType updateType;
-        if (dataService.readOperationalData(ref.getValue()) == null) {
-            updateType = UpdateType.ADDED;
-        } else {
-            updateType = UpdateType.CHANGED;
-        }
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(ref);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, not reporting the update", ref, e);
-            return;
-        }
-
-        this.publishNodeUpdate(aDNode, updateType, NodeMapping.toADNodeProperties(notification));
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            final NodeDescription description = this.toNodeDescription(ref);
-            if (description != null) {
-                final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                        InstanceIdentifier.builder(Nodes.class)
-                        .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                        .toInstance();
-                try {
-                    statsPublisher.descriptionStatisticsUpdated(NodeMapping.toADNode(nodeRef), description);
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to construct node for {}, not reporting the update to publisher {}", nodeRef, statsPublisher, e);
-                }
-            }
-        }
-    }
-
-    @Override
-    public ConcurrentMap<Node,Map<String,Property>> getNodeProps() {
-        final ConcurrentHashMap<Node,Map<String,Property>> props = new ConcurrentHashMap<>();
-        final Nodes nodes = this.readOperAllMDNodes();
-        for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node : nodes.getNode()) {
-            final FlowCapableNode fcn = node.getAugmentation(FlowCapableNode.class);
-            if (fcn != null) {
-                final ConcurrentHashMap<String,Property> perNodePropMap = new ConcurrentHashMap<String, Property>();
-                final HashSet<Property> perNodeProps = NodeMapping.toADNodeProperties(fcn, node.getId());
-                if (perNodeProps != null) {
-                    for (final Property perNodeProp : perNodeProps) {
-                        perNodePropMap.put(perNodeProp.getName(), perNodeProp);
-                    }
-                }
-
-                try {
-                    final Node adNode = NodeMapping.toADNode(node.getId());
-                    props.put(adNode, perNodePropMap);
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to construct node for {}, skipping it", node, e);
-                }
-            }
-        }
-        return props;
-    }
-
-    private Nodes readOperAllMDNodes() {
-        final TypeSafeDataReader reader = TypeSafeDataReader.forReader(getDataService());
-        return reader.readOperationalData(InstanceIdentifier.builder(Nodes.class).build());
-    }
-
-    @Override
-    public ConcurrentMap<NodeConnector,Map<String,Property>> getNodeConnectorProps(final Boolean refresh) {
-        final ConcurrentHashMap<NodeConnector,Map<String,Property>> props = new ConcurrentHashMap<>();
-        for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node : this.readOperAllMDNodes().getNode()) {
-            for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc : node.getNodeConnector()) {
-                final FlowCapableNodeConnector fcnc = nc.getAugmentation(FlowCapableNodeConnector.class);
-                if (fcnc != null) {
-                    final ConcurrentHashMap<String,Property> ncpsm = new ConcurrentHashMap<>();
-                    final HashSet<Property> ncps = NodeMapping.toADNodeConnectorProperties(fcnc);
-                    if (ncps != null) {
-                        for (final Property p : ncps) {
-                            ncpsm.put(p.getName(), p);
-                        }
-                    }
-
-                    try {
-                        props.put(NodeMapping.toADNodeConnector(nc.getId(), node.getId()), ncpsm);
-                    } catch (ConstructionException e) {
-                        LOG.warn("Failed to instantiate node {} connector {}, not reporting it", node.getId(), nc.getId(), e);
-                    }
-                }
-            }
-        }
-        return props;
-    }
-
-    private FlowCapableNodeConnector readOperFlowCapableNodeConnector(final NodeConnectorRef ref) {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc =
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector)
-                getDataService().readOperationalData(ref.getValue());
-        return nc.getAugmentation(FlowCapableNodeConnector.class);
-    }
-
-    private static NodeConnectorStatistics toNodeConnectorStatistics(final org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.NodeConnectorStatistics nodeConnectorStatistics, final NodeId nodeId, final NodeConnectorId nodeConnectorId) throws ConstructionException {
-        final NodeConnectorStatistics it = new NodeConnectorStatistics();
-
-        final Packets packets = nodeConnectorStatistics.getPackets();
-        it.setReceivePacketCount(packets.getReceived().longValue());
-        it.setTransmitPacketCount(packets.getTransmitted().longValue());
-
-        final Bytes bytes = nodeConnectorStatistics.getBytes();
-        it.setReceiveByteCount(bytes.getReceived().longValue());
-        it.setTransmitByteCount(bytes.getTransmitted().longValue());
-
-        it.setReceiveDropCount(nodeConnectorStatistics.getReceiveDrops().longValue());
-        it.setTransmitDropCount(nodeConnectorStatistics.getTransmitDrops().longValue());
-        it.setReceiveErrorCount(nodeConnectorStatistics.getReceiveErrors().longValue());
-        it.setTransmitErrorCount(nodeConnectorStatistics.getTransmitErrors().longValue());
-        it.setReceiveFrameErrorCount(nodeConnectorStatistics.getReceiveFrameError().longValue());
-        it.setReceiveOverRunErrorCount(nodeConnectorStatistics.getReceiveOverRunError().longValue());
-        it.setReceiveCRCErrorCount(nodeConnectorStatistics.getReceiveCrcError().longValue());
-        it.setCollisionCount(nodeConnectorStatistics.getCollisionCount().longValue());
-
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> nodeConnectorRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(nodeId))
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class, new NodeConnectorKey(nodeConnectorId))
-                .build();
-        it.setNodeConnector(NodeMapping.toADNodeConnector(new NodeConnectorRef(nodeConnectorRef)));
-        return it;
-    }
-
-    private static NodeTableStatistics toNodeTableStatistics(final FlowTableStatistics tableStats, final Short tableId, final Node node) throws ConstructionException {
-        final NodeTableStatistics it = new NodeTableStatistics();
-        it.setActiveCount(tableStats.getActiveFlows().getValue().intValue());
-        it.setLookupCount(tableStats.getPacketsLookedUp().getValue().longValue());
-        it.setMatchedCount(tableStats.getPacketsMatched().getValue().longValue());
-        it.setName(tableId.toString());
-        it.setNodeTable(new NodeTable(NodeTableIDType.OPENFLOW, tableId.byteValue(), node));
-        return it;
-    }
-
-    private NodeDescription toNodeDescription(final NodeRef nodeRef) {
-        final FlowCapableNode capableNode = this.readOperFlowCapableNode(nodeRef);
-        if (capableNode == null) {
-            return null;
-        }
-
-        final NodeDescription it = new NodeDescription();
-        it.setManufacturer(capableNode.getManufacturer());
-        it.setSerialNumber(capableNode.getSerialNumber());
-        it.setSoftware(capableNode.getSoftware());
-        it.setDescription(capableNode.getDescription());
-        return it;
-    }
-
-    public Edge toADEdge(final Link link) throws ConstructionException {
-        NodeConnectorRef _source = link.getSource();
-        NodeConnector _aDNodeConnector = NodeMapping.toADNodeConnector(_source);
-        NodeConnectorRef _destination = link.getDestination();
-        NodeConnector _aDNodeConnector_1 = NodeMapping.toADNodeConnector(_destination);
-        Edge _edge = new Edge(_aDNodeConnector, _aDNodeConnector_1);
-        return _edge;
-    }
-
-    /**
-     * OpendaylightFlowStatisticsListener interface implementation
-     */
-    @Override
-    public void onAggregateFlowStatisticsUpdate(final AggregateFlowStatisticsUpdate notification) {
-        // Ignoring this notification as there does not seem to be a way to bubble this up to AD-SAL
-    }
-
-    @Override
-    public void onFlowsStatisticsUpdate(final FlowsStatisticsUpdate notification) {
-        final ArrayList<FlowOnNode> adsalFlowsStatistics = new ArrayList<>();
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                .build();
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(nodeRef);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, ignoring it", notification.getId(), e);
-            return;
-        }
-
-        for (final FlowAndStatisticsMapList flowStats : notification.getFlowAndStatisticsMapList()) {
-            if (flowStats.getTableId() == 0) {
-                adsalFlowsStatistics.add(InventoryAndReadAdapter.toFlowOnNode(flowStats, aDNode));
-            }
-        }
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            statsPublisher.nodeFlowStatisticsUpdated(aDNode, adsalFlowsStatistics);
-        }
-
-        updateTransactionCache(notification, notification.getId(), !notification.isMoreReplies());
-    }
-
-    /**
-     * OpendaylightFlowTableStatisticsListener interface implementation
-     */
-    @Override
-    public void onFlowTableStatisticsUpdate(final FlowTableStatisticsUpdate notification) {
-        ArrayList<NodeTableStatistics> adsalFlowTableStatistics = new ArrayList<>();
-        for (final FlowTableAndStatisticsMap stats : notification.getFlowTableAndStatisticsMap()) {
-            if (stats.getTableId().getValue() == 0) {
-                final NodeTableStatistics it = new NodeTableStatistics();
-                it.setActiveCount(stats.getActiveFlows().getValue().intValue());
-                it.setLookupCount(stats.getPacketsLookedUp().getValue().longValue());
-                it.setMatchedCount(stats.getPacketsMatched().getValue().longValue());
-                adsalFlowTableStatistics.add(it);
-            }
-        }
-
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                .build();
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(nodeRef);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, ignoring it", notification.getId(), e);
-            return;
-        }
-
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            statsPublisher.nodeTableStatisticsUpdated(aDNode, adsalFlowTableStatistics);
-        }
-    }
-
-    /**
-     * OpendaylightPortStatisticsUpdate interface implementation
-     */
-    @Override
-    public void onNodeConnectorStatisticsUpdate(final NodeConnectorStatisticsUpdate notification) {
-        final ArrayList<NodeConnectorStatistics> adsalPortStatistics = new ArrayList<NodeConnectorStatistics>();
-        for (final NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatistics : notification.getNodeConnectorStatisticsAndPortNumberMap()) {
-            try {
-                adsalPortStatistics.add(toNodeConnectorStatistics(
-                        nodeConnectorStatistics, notification.getId(), nodeConnectorStatistics.getNodeConnectorId()));
-            } catch (ConstructionException e) {
-                LOG.warn("Failed to create statistics for node {} connector {}, not updating them",
-                        notification.getId(), nodeConnectorStatistics.getNodeConnectorId(), e);
-            }
-        }
-
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                .build();
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(nodeRef);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, ignoring it", notification.getId(), e);
-            return;
-        }
-
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            statsPublisher.nodeConnectorStatisticsUpdated(aDNode, adsalPortStatistics);
-        }
-    }
-
-    private static FlowOnNode toFlowOnNode(final FlowAndStatisticsMapList flowAndStatsMap, final Node node) {
-        final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flowAndStatsMap, node));
-        return addFlowStats(it, flowAndStatsMap);
-    }
-
-    private static FlowOnNode addFlowStats(final FlowOnNode node, final GenericStatistics stats) {
-        node.setByteCount(stats.getByteCount().getValue().longValue());
-        node.setPacketCount(stats.getPacketCount().getValue().longValue());
-        node.setDurationSeconds(stats.getDuration().getSecond().getValue().intValue());
-        node.setDurationNanoseconds(stats.getDuration().getNanosecond().getValue().intValue());
-        return node;
-    }
-
-    @Override
-    public Set<Node> getConfiguredNotConnectedNodes() {
-        return Collections.emptySet();
-    }
-
-    private void publishNodeUpdate(final Node node, final UpdateType updateType, final Set<Property> properties) {
-        for (final IPluginOutInventoryService publisher : getInventoryPublisher()) {
-            publisher.updateNode(node, updateType, properties);
-        }
-    }
-
-    private void publishNodeConnectorUpdate(final NodeConnector nodeConnector, final UpdateType updateType, final Set<Property> properties) {
-        for (final IPluginOutInventoryService publisher : getInventoryPublisher()) {
-            publisher.updateNodeConnector(nodeConnector, updateType, properties);
-        }
-    }
-
-    private boolean isKnownNodeConnector(final InstanceIdentifier<? extends Object> nodeConnectorIdentifier) {
-        final Iterator<PathArgument> it = nodeConnectorIdentifier.getPathArguments().iterator();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodePath = it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodeConnectorPath = it.next();
-
-        final List<PathArgument> nodeConnectors = nodeToNodeConnectorsMap.get(nodePath);
-        return nodeConnectors == null ? false :
-            nodeConnectors.contains(nodeConnectorPath);
-    }
-
-    private boolean recordNodeConnector(final InstanceIdentifier<? extends Object> nodeConnectorIdentifier) {
-        final Iterator<PathArgument> it = nodeConnectorIdentifier.getPathArguments().iterator();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodePath = it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodeConnectorPath = it.next();
-
-        synchronized (this) {
-            List<PathArgument> nodeConnectors = this.nodeToNodeConnectorsMap.get(nodePath);
-            if (nodeConnectors == null) {
-                nodeConnectors = new ArrayList<>();
-                this.nodeToNodeConnectorsMap.put(nodePath, nodeConnectors);
-            }
-
-            return nodeConnectors.add(nodeConnectorPath);
-        }
-    }
-
-    private List<PathArgument> removeNodeConnectors(final InstanceIdentifier<? extends Object> nodeIdentifier) {
-        return this.nodeToNodeConnectorsMap.remove(Iterables.get(nodeIdentifier.getPathArguments(), 1));
-    }
-
-    private <T extends TransactionAware> void updateTransactionCache(T notification, NodeId nodeId, boolean lastNotification) {
-
-        String cacheKey = buildCacheKey(notification.getTransactionId(), nodeId);
-        TransactionNotificationList<T> txnList = (TransactionNotificationList<T>) txCache.getIfPresent(cacheKey);
-        final Optional<TransactionNotificationList<T>> optional = Optional.<TransactionNotificationList<T>>fromNullable(txnList);
-        if (optional.isPresent()) {
-            LOG.info("updateTransactionCache cacheKey:{}, lastNotification:{}, txnList-present:{}", cacheKey, lastNotification, optional.isPresent());
-            TransactionNotificationList<T> txn = optional.get();
-            txn.addNotification(notification);
-            txn.setAllNotificationsGathered(lastNotification);
-        }
-    }
-
-    private class TransactionNotificationList<T extends TransactionAware> {
-        private TransactionId id;
-        private String nId;
-        private List<T> notifications;
-        private boolean allNotificationsGathered;
-
-        public TransactionNotificationList(TransactionId id, String nId) {
-            this.nId = nId;
-            this.id = id;
-            notifications = new ArrayList<T>();
-        }
-
-        public void addNotification(T notification) {
-            notifications.add(notification);
-        }
-
-        public void setAllNotificationsGathered(boolean allNotificationsGathered) {
-            this.allNotificationsGathered = allNotificationsGathered;
-        }
-
-        public boolean areAllNotificationsGathered() {
-            return allNotificationsGathered;
-        }
-
-        public List<T> getNotifications() {
-            return notifications;
-        }
-
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryMapping.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryMapping.java
deleted file mode 100644 (file)
index 92b485c..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright (c) 2013 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import java.util.Iterator;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-
-import com.google.common.base.Splitter;
-
-public final class InventoryMapping {
-    private static final String NODE_TYPE_STRING = "::";
-    private static final Splitter NODE_TYPE_SPLITTER = Splitter.on(NODE_TYPE_STRING);
-
-    private InventoryMapping() {
-        throw new UnsupportedOperationException("Utility class");
-    }
-
-    public static org.opendaylight.controller.sal.core.NodeConnector toAdNodeConnector(final InstanceIdentifier<NodeConnector> identifier) {
-        @SuppressWarnings("unchecked")
-        final NodeConnectorKey tpKey = ((KeyedInstanceIdentifier<NodeConnector, NodeConnectorKey>) identifier).getKey();
-        return InventoryMapping.nodeConnectorFromId(tpKey.getId().getValue());
-    }
-
-    public static org.opendaylight.controller.sal.core.Node toAdNode(final InstanceIdentifier<Node> identifier) {
-        @SuppressWarnings("unchecked")
-        final NodeKey tpKey = ((KeyedInstanceIdentifier<Node,NodeKey>)identifier).getKey();
-        return InventoryMapping.nodeFromNodeId(tpKey.getId().getValue());
-    }
-
-    public static NodeRef toNodeRef(final org.opendaylight.controller.sal.core.Node node) {
-        final NodeKey nodeKey = new NodeKey(new NodeId(InventoryMapping.toNodeId(node)));
-        final InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class)
-                .child(Node.class, nodeKey).toInstance();
-        return new NodeRef(path);
-    }
-
-    public static NodeKey toNodeKey(final org.opendaylight.controller.sal.core.Node node) {
-        final NodeId nodeId = new NodeId(InventoryMapping.toNodeId(node));
-        return new NodeKey(nodeId);
-    }
-
-    public static NodeConnectorKey toNodeConnectorKey(final org.opendaylight.controller.sal.core.NodeConnector nc) {
-        final NodeConnectorId nodeConnectorId = new NodeConnectorId(InventoryMapping.toNodeConnectorId(nc));
-        return new NodeConnectorKey(nodeConnectorId);
-    }
-
-    private static StringBuilder nodeIdBulder(final org.opendaylight.controller.sal.core.Node node) {
-        final StringBuilder sb = new StringBuilder();
-        sb.append("ad-sal:");
-        sb.append(node.getType());
-        sb.append(NODE_TYPE_STRING);
-        sb.append(node.getNodeIDString());
-        return sb;
-    }
-
-    public static String toNodeId(final org.opendaylight.controller.sal.core.Node node) {
-        return nodeIdBulder(node).toString();
-    }
-
-    public static String toNodeConnectorId(final org.opendaylight.controller.sal.core.NodeConnector nc) {
-        final StringBuilder sb = nodeIdBulder(nc.getNode());
-        sb.append(NODE_TYPE_STRING);
-        sb.append(nc.getNodeConnectorIDString());
-        return sb.toString();
-    }
-
-    public static org.opendaylight.controller.sal.core.Node nodeFromNodeId(final String nodeId) {
-        return InventoryMapping.nodeFromStrings(NODE_TYPE_SPLITTER.split(nodeId).iterator());
-    }
-
-    public static org.opendaylight.controller.sal.core.NodeConnector nodeConnectorFromId(final String invId) {
-        return InventoryMapping.nodeConnectorFromString(NODE_TYPE_SPLITTER.split(invId).iterator());
-    }
-
-    private static org.opendaylight.controller.sal.core.NodeConnector nodeConnectorFromString(final Iterator<String> it) {
-        final org.opendaylight.controller.sal.core.Node node = InventoryMapping.nodeFromStrings(it);
-        return org.opendaylight.controller.sal.core.NodeConnector.fromStringNoNode(it.next(), node);
-    }
-
-    private static org.opendaylight.controller.sal.core.Node nodeFromStrings(final Iterator<String> it) {
-        final String type = it.next().substring(6);
-        return org.opendaylight.controller.sal.core.Node.fromString(type, it.next());
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryNotificationProvider.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/InventoryNotificationProvider.java
deleted file mode 100644 (file)
index 1e1925d..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import java.util.List;
-
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class InventoryNotificationProvider implements AutoCloseable{
-
-    private ListenerRegistration<DataChangeListener> nodeConnectorDataChangeListenerRegistration;
-
-    private NodeConnectorDataChangeListener nodeConnectorDataChangeListener;
-
-    private DataProviderService dataProviderService;
-
-    private List<IPluginOutInventoryService> inventoryPublisher;
-
-    private final static Logger LOG = LoggerFactory.getLogger(NodeConnectorDataChangeListener.class);
-
-    public void start(){
-
-        LOG.info("InventoryNotificationProvider started");
-
-        if(dataProviderService != null
-                && inventoryPublisher!= null){
-
-            if(nodeConnectorDataChangeListener == null){
-                InstanceIdentifier<NodeConnector> nodeConnectorPath = InstanceIdentifier.builder(Nodes.class).child(Node.class).child(NodeConnector.class).build();
-                nodeConnectorDataChangeListener = new NodeConnectorDataChangeListener();
-                nodeConnectorDataChangeListener.setInventoryPublisher(inventoryPublisher);
-                nodeConnectorDataChangeListenerRegistration = dataProviderService.registerDataChangeListener(nodeConnectorPath, nodeConnectorDataChangeListener);
-            }
-
-        }
-    }
-
-    @Override
-    public void close() throws Exception {
-        if(nodeConnectorDataChangeListenerRegistration != null){
-            nodeConnectorDataChangeListenerRegistration.close();
-        }
-    }
-
-    public void setDataProviderService(DataProviderService dataProviderService) {
-        this.dataProviderService = dataProviderService;
-    }
-
-    public void setInventoryPublisher(List<IPluginOutInventoryService> inventoryPublisher) {
-        this.inventoryPublisher = inventoryPublisher;
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDFlowMapping.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDFlowMapping.java
deleted file mode 100644 (file)
index b9577c3..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import com.google.common.base.Preconditions;
-import com.google.common.net.InetAddresses;
-import org.opendaylight.controller.sal.action.Action;
-import org.opendaylight.controller.sal.action.Controller;
-import org.opendaylight.controller.sal.action.Drop;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.Output;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCaseBuilder;
-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.action.OutputActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.action._case.FloodActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.hw.path.action._case.HwPathActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.loopback.action._case.LoopbackActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.vlan.action._case.PopVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.OriginalFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.UpdatedFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-
-import java.math.BigInteger;
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public final class MDFlowMapping {
-    private MDFlowMapping() {
-        throw new UnsupportedOperationException("Utility class");
-    }
-
-    private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> toMDActions(final List<Action> actions) {
-        final ArrayList<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> ret =
-                new ArrayList<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>(actions.size());
-        int action = 0;
-        for (final Action sourceAction : actions) {
-            ret.add(toAction(sourceAction, action));
-            action++;
-        }
-
-        return ret;
-    }
-
-    public static FlowAdded flowAdded(final Flow sourceFlow) {
-        Preconditions.checkArgument(sourceFlow != null);
-
-        return new FlowAddedBuilder()
-        .setHardTimeout(Integer.valueOf(sourceFlow.getHardTimeout()))
-        .setIdleTimeout(Integer.valueOf(sourceFlow.getIdleTimeout()))
-        .setCookie(new FlowCookie(BigInteger.valueOf(sourceFlow.getId())))
-        .setPriority(Integer.valueOf(sourceFlow.getPriority()))
-        .setInstructions(MDFlowMapping.toApplyInstruction(toMDActions(sourceFlow.getActions())))
-        .setMatch(FromSalConversionsUtils.toMatch(sourceFlow.getMatch()))
-        .setTableId((short)0)
-        .build();
-    }
-
-    private static FlowBuilder internalToMDFlow(final Flow sourceFlow) {
-        Preconditions.checkArgument(sourceFlow != null);
-
-        return new FlowBuilder()
-        .setHardTimeout(Integer.valueOf(sourceFlow.getHardTimeout()))
-        .setIdleTimeout(Integer.valueOf(sourceFlow.getIdleTimeout()))
-        .setCookie(new FlowCookie(BigInteger.valueOf(sourceFlow.getId())))
-        .setPriority(Integer.valueOf((sourceFlow.getPriority())))
-        .setInstructions(MDFlowMapping.toApplyInstruction(toMDActions(sourceFlow.getActions())))
-        .setMatch(FromSalConversionsUtils.toMatch(sourceFlow.getMatch()));
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow toMDFlow(final Flow sourceFlow, final String flowId) {
-        return internalToMDFlow(sourceFlow)
-                .setTableId((short)0)
-                .setId(new FlowId(flowId))
-                .build();
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow toMDSalflow(final Flow sourceFlow) {
-        return internalToMDFlow(sourceFlow).build();
-    }
-
-    public static Instructions toApplyInstruction(final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions) {
-        return new InstructionsBuilder()
-        .setInstruction(
-                Collections.singletonList(
-                        new InstructionBuilder()
-                        .setOrder(0)
-                        .setInstruction(
-                                new ApplyActionsCaseBuilder()
-                                .setApplyActions(new ApplyActionsBuilder().setAction(actions).build())
-                                .build()
-                                ).build())
-                ).build();
-    }
-
-    public static RemoveFlowInput removeFlowInput(final Node sourceNode, final Flow sourceFlow) {
-        final FlowAdded source = MDFlowMapping.flowAdded(sourceFlow);
-        return new RemoveFlowInputBuilder((org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow) source)
-        .setNode(NodeMapping.toNodeRef(sourceNode))
-        .build();
-    }
-
-    public static AddFlowInput addFlowInput(final Node sourceNode, final Flow sourceFlow) {
-        final FlowAdded source = MDFlowMapping.flowAdded(sourceFlow);
-        return new AddFlowInputBuilder(((org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow) source))
-        .setNode(NodeMapping.toNodeRef(sourceNode))
-        .build();
-    }
-
-    public static UpdateFlowInput updateFlowInput(final Node sourceNode, final Flow oldFlow, final Flow newFlow) {
-        return new UpdateFlowInputBuilder()
-        .setOriginalFlow(new OriginalFlowBuilder(MDFlowMapping.flowAdded(newFlow)).build())
-        .setUpdatedFlow(new UpdatedFlowBuilder(MDFlowMapping.flowAdded(newFlow)).build())
-        .setNode(NodeMapping.toNodeRef(sourceNode))
-        .build();
-    }
-
-    private static ControllerActionCase _toAction(final Controller sourceAction) {
-        return new ControllerActionCaseBuilder().setControllerAction(new ControllerActionBuilder().build()).build();
-    }
-
-    private static DropActionCase _toAction(final Drop sourceAction) {
-        return new DropActionCaseBuilder().setDropAction(new DropActionBuilder().build()).build();
-    }
-
-    private static FloodActionCase _toAction(final Flood sourceAction) {
-        return new FloodActionCaseBuilder().setFloodAction(new FloodActionBuilder().build()).build();
-    }
-
-    private static FloodAllActionCase _toAction(final FloodAll sourceAction) {
-        return new FloodAllActionCaseBuilder().setFloodAllAction(new FloodAllActionBuilder().build()).build();
-    }
-
-    private static HwPathActionCase _toAction(final HwPath sourceAction) {
-        return new HwPathActionCaseBuilder().setHwPathAction(new HwPathActionBuilder().build()).build();
-    }
-
-    private static LoopbackActionCase _toAction(final Loopback sourceAction) {
-        return new LoopbackActionCaseBuilder().setLoopbackAction( new LoopbackActionBuilder().build()).build();
-    }
-
-    private static OutputActionCase _toAction(final Output sourceAction) {
-        return new OutputActionCaseBuilder()
-        .setOutputAction(
-                new OutputActionBuilder().setOutputNodeConnector(MDFlowMapping.toUri(sourceAction.getPort())).build()
-                ).build();
-    }
-
-    private static PopVlanActionCase _toAction(final PopVlan sourceAction) {
-        PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
-        return new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build();
-    }
-
-    private static PushVlanActionCase _toAction(final PushVlan sourceAction) {
-        return new PushVlanActionCaseBuilder()
-        .setPushVlanAction(
-                new PushVlanActionBuilder()
-                .setEthernetType(Integer.valueOf(sourceAction.getTag()))
-                .build()
-                ).build();
-    }
-
-    private static SetDlDstActionCase _toAction(final SetDlDst sourceAction) {
-        return new SetDlDstActionCaseBuilder()
-        .setSetDlDstAction(new SetDlDstActionBuilder().setAddress(MDFlowMapping.toMacAddress(sourceAction.getDlAddress())).build())
-        .build();
-    }
-
-    private static SetDlSrcActionCase _toAction(final SetDlSrc sourceAction) {
-        return new SetDlSrcActionCaseBuilder()
-        .setSetDlSrcAction(new SetDlSrcActionBuilder().setAddress(MDFlowMapping.toMacAddress(sourceAction.getDlAddress())).build())
-        .build();
-    }
-
-    private static SetDlTypeActionCase _toAction(final SetDlType sourceAction) {
-        return new SetDlTypeActionCaseBuilder()
-        .setSetDlTypeAction(new SetDlTypeActionBuilder().setDlType(new EtherType(Long.valueOf(sourceAction.getDlType()))).build())
-        .build();
-    }
-
-    private static SetNextHopActionCase _toAction(final SetNextHop sourceAction) {
-        return new SetNextHopActionCaseBuilder()
-        .setSetNextHopAction(new SetNextHopActionBuilder().setAddress(MDFlowMapping.toInetAddress(sourceAction.getAddress())).build())
-        .build();
-    }
-
-    private static SetNwDstActionCase _toAction(final SetNwDst sourceAction) {
-        return new SetNwDstActionCaseBuilder()
-        .setSetNwDstAction(new SetNwDstActionBuilder().setAddress(MDFlowMapping.toInetAddress(sourceAction.getAddress())).build())
-        .build();
-    }
-
-    private static SetNwSrcActionCase _toAction(final SetNwSrc sourceAction) {
-        return new SetNwSrcActionCaseBuilder()
-        .setSetNwSrcAction(new SetNwSrcActionBuilder().setAddress(MDFlowMapping.toInetAddress(sourceAction.getAddress())).build())
-        .build();
-    }
-
-    private static SetNwTosActionCase _toAction(final SetNwTos sourceAction) {
-        return new SetNwTosActionCaseBuilder()
-        .setSetNwTosAction(new SetNwTosActionBuilder().setTos(FromSalConversionsUtils.dscpToTos(sourceAction.getNwTos())).build())
-        .build();
-    }
-
-    private static SetTpDstActionCase _toAction(final SetTpDst sourceAction) {
-        return new SetTpDstActionCaseBuilder()
-        .setSetTpDstAction(new SetTpDstActionBuilder().setPort(new PortNumber(sourceAction.getPort())).build())
-        .build();
-    }
-
-    private static SetTpSrcActionCase _toAction(final SetTpSrc sourceAction) {
-        return new SetTpSrcActionCaseBuilder()
-        .setSetTpSrcAction(new SetTpSrcActionBuilder().setPort(new PortNumber(sourceAction.getPort())).build())
-        .build();
-    }
-
-    private static SetVlanCfiActionCase _toAction(final SetVlanCfi sourceAction) {
-        return new SetVlanCfiActionCaseBuilder()
-        .setSetVlanCfiAction(new SetVlanCfiActionBuilder().setVlanCfi(new VlanCfi(sourceAction.getCfi())).build())
-        .build();
-    }
-
-    private static SetVlanIdActionCase _toAction(final SetVlanId sourceAction) {
-        return new SetVlanIdActionCaseBuilder()
-        .setSetVlanIdAction(new SetVlanIdActionBuilder().setVlanId(new VlanId(sourceAction.getVlanId())).build())
-        .build();
-    }
-
-    private static SetVlanPcpActionCase _toAction(final SetVlanPcp sourceAction) {
-        return new SetVlanPcpActionCaseBuilder()
-        .setSetVlanPcpAction(new SetVlanPcpActionBuilder().setVlanPcp(new VlanPcp((short) sourceAction.getPcp())).build())
-        .build();
-    }
-
-    private static SwPathActionCase _toAction(final SwPath sourceAction) {
-        return new SwPathActionCaseBuilder().setSwPathAction(new SwPathActionBuilder().build()).build();
-    }
-
-    public static Uri toUri(final NodeConnector connector) {
-        return new NodeConnectorId(NodeMapping.OPENFLOW_ID_PREFIX + connector.getNode().getID() + ":" + (connector.getID()));
-    }
-
-    public static MacAddress toMacAddress(final byte[] bytes) {
-        final StringBuilder sb = new StringBuilder(18);
-        boolean first = true;
-
-        for (final byte b : bytes) {
-            if (first) {
-                first = false;
-            } else {
-                sb.append(':');
-            }
-            sb.append(String.format("%02x", Byte.valueOf(b)));
-        }
-        return new MacAddress(sb.toString());
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action toAction(final Action sourceAction, final int order) {
-        final ActionBuilder ret = new ActionBuilder().setOrder(order);
-
-        if (sourceAction instanceof Controller) {
-            ret.setAction(_toAction((Controller)sourceAction));
-        } else if (sourceAction instanceof Drop) {
-            ret.setAction(_toAction((Drop)sourceAction));
-        } else if (sourceAction instanceof Flood) {
-            ret.setAction(_toAction((Flood)sourceAction));
-        } else if (sourceAction instanceof FloodAll) {
-            ret.setAction(_toAction((FloodAll)sourceAction));
-        } else if (sourceAction instanceof HwPath) {
-            ret.setAction(_toAction((HwPath)sourceAction));
-        } else if (sourceAction instanceof Loopback) {
-            ret.setAction(_toAction((Loopback)sourceAction));
-        } else if (sourceAction instanceof Output) {
-            ret.setAction(_toAction((Output)sourceAction));
-        } else if (sourceAction instanceof PopVlan) {
-            ret.setAction(_toAction((PopVlan)sourceAction));
-        } else if (sourceAction instanceof PushVlan) {
-            ret.setAction(_toAction((PushVlan)sourceAction));
-        } else if (sourceAction instanceof SetDlDst) {
-            ret.setAction(_toAction((SetDlDst)sourceAction));
-        } else if (sourceAction instanceof SetDlSrc) {
-            ret.setAction(_toAction((SetDlSrc)sourceAction));
-        } else if (sourceAction instanceof SetDlType) {
-            ret.setAction(_toAction((SetDlType)sourceAction));
-        } else if (sourceAction instanceof SetNextHop) {
-            ret.setAction(_toAction((SetNextHop)sourceAction));
-        } else if (sourceAction instanceof SetNwDst) {
-            ret.setAction(_toAction((SetNwDst)sourceAction));
-        } else if (sourceAction instanceof SetNwSrc) {
-            ret.setAction(_toAction((SetNwSrc)sourceAction));
-        } else if (sourceAction instanceof SetNwTos) {
-            ret.setAction(_toAction((SetNwTos)sourceAction));
-        } else if (sourceAction instanceof SetTpDst) {
-            ret.setAction(_toAction((SetTpDst)sourceAction));
-        } else if (sourceAction instanceof SetTpSrc) {
-            ret.setAction(_toAction((SetTpSrc)sourceAction));
-        } else if (sourceAction instanceof SetVlanCfi) {
-            ret.setAction(_toAction((SetVlanCfi)sourceAction));
-        } else if (sourceAction instanceof SetVlanId) {
-            ret.setAction(_toAction((SetVlanId)sourceAction));
-        } else if (sourceAction instanceof SetVlanPcp) {
-            ret.setAction(_toAction((SetVlanPcp)sourceAction));
-        } else if (sourceAction instanceof SwPath) {
-            ret.setAction(_toAction((SwPath)sourceAction));
-        } else {
-            throw new IllegalArgumentException(String.format("Unhandled action class %s", sourceAction.getClass()));
-        }
-
-        return ret.build();
-    }
-
-    public static Address toInetAddress(final InetAddress address) {
-        if (address instanceof Inet4Address) {
-            return new Ipv4Builder()
-            .setIpv4Address(new Ipv4Prefix(InetAddresses.toAddrString(address) + "/32"))
-            .build();
-        }
-        if (address instanceof Inet6Address) {
-            return new Ipv6Builder()
-            .setIpv6Address(new Ipv6Prefix(InetAddresses.toAddrString(address) + "/128"))
-            .build();
-        }
-
-        throw new IllegalArgumentException(String.format("Unhandled address class %s", address.getClass()));
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDSalNodeConnectorFactory.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDSalNodeConnectorFactory.java
deleted file mode 100644 (file)
index 487574e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.utils.INodeConnectorFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MDSalNodeConnectorFactory implements INodeConnectorFactory{
-    private Logger logger = LoggerFactory.getLogger(MDSalNodeConnectorFactory.class);
-
-    @Override
-    public NodeConnector fromStringNoNode(String type, String id, Node node) {
-        try {
-            return new NodeConnector(type, id, node);
-        } catch (ConstructionException e) {
-            logger.error("Could not construct NodeConnector", e);
-        }
-        return null;
-
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDSalNodeFactory.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/MDSalNodeFactory.java
deleted file mode 100644 (file)
index 42ec473..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.utils.INodeFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MDSalNodeFactory implements INodeFactory{
-    private Logger logger = LoggerFactory.getLogger(MDSalNodeFactory.class);
-
-    @Override
-    public Node fromString(String type, String id) {
-
-        try {
-            return new Node(type, id);
-        } catch (ConstructionException e) {
-            logger.error("Could not construct Node", e);
-        }
-        return null;
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NCDataChangeListener.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NCDataChangeListener.java
deleted file mode 100644 (file)
index 171c169..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NCDataChangeListener extends AbstractDataChangeListener<NodeConnector> {
-    private static final Logger LOG = LoggerFactory.getLogger(NodeDataChangeListener.class);
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-    public NCDataChangeListener (final InventoryAndReadAdapter adapter, final DataBroker db) {
-        super(adapter,db,NodeConnector.class);
-    }
-
-    @Override
-    protected void add(InstanceIdentifier<NodeConnector> createKeyIdent, NodeConnector node) {
-        FlowCapableNodeConnector fcnc = node.getAugmentation(FlowCapableNodeConnector.class);
-        if(fcnc != null) {
-            FlowCapableNodeConnectorUpdatedBuilder fcncub = new FlowCapableNodeConnectorUpdatedBuilder(fcnc);
-            NodeConnectorUpdatedBuilder builder = new NodeConnectorUpdatedBuilder();
-            builder.setId(node.getId());
-            builder.setNodeConnectorRef(new NodeConnectorRef(createKeyIdent));
-            builder.addAugmentation(FlowCapableNodeConnectorUpdated.class, fcncub.build());
-            adapter.onNodeConnectorUpdatedInternal(builder.build());
-        }
-    }
-
-    @Override
-    protected void update(InstanceIdentifier<NodeConnector> updateKeyIdent, NodeConnector original,
-            NodeConnector update) {
-        add(updateKeyIdent,update);
-    }
-
-    @Override
-    protected void remove(InstanceIdentifier<NodeConnector> ident, NodeConnector removeValue) {
-        NodeConnectorRemovedBuilder builder = new NodeConnectorRemovedBuilder();
-        builder.setNodeConnectorRef(new NodeConnectorRef(ident));
-        adapter.onNodeConnectorRemovedInternal(builder.build());
-    }
-
-    protected InstanceIdentifier<NodeConnector> getWildCardPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class).child(NodeConnector.class);
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeConnectorDataChangeListener.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeConnectorDataChangeListener.java
deleted file mode 100644 (file)
index 7957bc7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-// org.opendaylight.controller.sal.compatibility.NodeConnectorDataChangeListener
-public class NodeConnectorDataChangeListener implements DataChangeListener{
-    private final static Logger LOG = LoggerFactory.getLogger(NodeConnectorDataChangeListener.class);
-
-    private List<IPluginOutInventoryService> inventoryPublisher;
-
-    public List<IPluginOutInventoryService> getInventoryPublisher() {
-      return this.inventoryPublisher;
-    }
-
-    public void setInventoryPublisher(final List<IPluginOutInventoryService> inventoryPublisher) {
-      this.inventoryPublisher = inventoryPublisher;
-    }
-
-    @Override
-    public void onDataChanged(DataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
-        final Map<InstanceIdentifier<?>,DataObject> createdOperationalData = change.getCreatedOperationalData();
-        final Map<InstanceIdentifier<?>,DataObject> updatedOperationalData = change.getUpdatedOperationalData();
-
-        final Set<Map.Entry<InstanceIdentifier<?>,DataObject>> createdEntries = createdOperationalData.entrySet();
-        final Set<Map.Entry<InstanceIdentifier<?>,DataObject>> updatedEntries = new HashSet<>();
-
-        updatedEntries.addAll(updatedOperationalData.entrySet());
-        updatedEntries.removeAll(createdEntries);
-
-        for(final Map.Entry<InstanceIdentifier<?>,DataObject> entry : createdEntries){
-            publishNodeConnectorUpdate(entry, UpdateType.ADDED);
-        }
-
-        for(final Map.Entry<InstanceIdentifier<?>,DataObject> entry : updatedEntries){
-            publishNodeConnectorUpdate(entry, UpdateType.CHANGED);
-        }
-    }
-
-    private void publishNodeConnectorUpdate(final Map.Entry<InstanceIdentifier<?>,DataObject> entry, final UpdateType updateType) {
-        if (entry.getKey().getTargetType().equals(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class)) {
-            NodeConnectorRef nodeConnectorRef = new NodeConnectorRef(entry.getKey());
-            NodeConnector nodeConnector = null;
-            try {
-                nodeConnector = NodeMapping.toADNodeConnector(nodeConnectorRef);
-            } catch (ConstructionException e) {
-                LOG.debug("Construction exception: %s",e.getMessage());
-            }
-            HashSet<Property> _aDNodeConnectorProperties = NodeMapping.toADNodeConnectorProperties((org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) entry.getValue());
-            this.publishNodeConnectorUpdate(nodeConnector, updateType, _aDNodeConnectorProperties);
-        }
-    }
-
-    private void publishNodeConnectorUpdate(final NodeConnector nodeConnector, final UpdateType updateType, final Set<Property> properties) {
-      LOG.debug("Publishing NodeConnector " + updateType.toString() + " nodeConnector Id = " + nodeConnector.getNodeConnectorIdAsString());
-
-      List<IPluginOutInventoryService> _inventoryPublisher = getInventoryPublisher();
-      for (final IPluginOutInventoryService publisher : _inventoryPublisher) {
-        publisher.updateNodeConnector(nodeConnector, updateType, properties);
-      }
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeDataChangeListener.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeDataChangeListener.java
deleted file mode 100644 (file)
index ff847e7..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdatedBuilder;
-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;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NodeDataChangeListener extends AbstractDataChangeListener<Node> {
-    private static final Logger LOG = LoggerFactory.getLogger(NodeDataChangeListener.class);
-
-
-    public NodeDataChangeListener (final InventoryAndReadAdapter adapter, final DataBroker db) {
-        super(adapter,db,Node.class);
-    }
-
-    protected void add(InstanceIdentifier<Node> createKeyIdent, Node node) {
-        FlowCapableNode fcn = node.getAugmentation(FlowCapableNode.class);
-        if(fcn != null) {
-            FlowCapableNodeUpdatedBuilder fcbnu = new FlowCapableNodeUpdatedBuilder(fcn);
-            NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
-            builder.setId(node.getId());
-            builder.setNodeRef(new NodeRef(createKeyIdent));
-            builder.setNodeConnector(node.getNodeConnector());
-            builder.addAugmentation(FlowCapableNodeUpdated.class, fcbnu.build());
-            adapter.onNodeUpdatedInternal(builder.build());
-        }
-    }
-
-    protected void update(InstanceIdentifier<Node> updateKeyIdent, Node original,
-            Node update) {
-        this.add(updateKeyIdent, update);
-    }
-
-    protected void remove(InstanceIdentifier<Node> ident, Node removeValue) {
-        NodeRemovedBuilder builder = new NodeRemovedBuilder();
-        builder.setNodeRef(new NodeRef(ident));
-        adapter.onNodeRemovedInternal(builder.build());
-    }
-
-    protected InstanceIdentifier<Node> getWildCardPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class);
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeMapping.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/NodeMapping.java
deleted file mode 100644 (file)
index b58d46a..0000000
+++ /dev/null
@@ -1,514 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-
-import org.opendaylight.controller.sal.common.util.Arguments;
-import org.opendaylight.controller.sal.core.AdvertisedBandwidth;
-import org.opendaylight.controller.sal.core.Bandwidth;
-import org.opendaylight.controller.sal.core.Buffers;
-import org.opendaylight.controller.sal.core.Capabilities;
-import org.opendaylight.controller.sal.core.Config;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Description;
-import org.opendaylight.controller.sal.core.MacAddress;
-import org.opendaylight.controller.sal.core.Name;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.core.PeerBandwidth;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.SupportedBandwidth;
-import org.opendaylight.controller.sal.core.Tables;
-import org.opendaylight.controller.sal.core.TimeStamp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityArpMatchIp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityFlowStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityIpReasm;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityPortStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityQueueStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityStp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityTableStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.math.BigInteger;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.regex.Pattern;
-
-public final class NodeMapping {
-
-    private static final Logger LOG = LoggerFactory
-            .getLogger(NodeMapping.class);
-
-    /**
-     * openflow id prefix
-     */
-    public static final String OPENFLOW_ID_PREFIX = "openflow:";
-
-    public final static String MD_SAL_TYPE = "MD_SAL_DEPRECATED";
-
-    private final static Class<Node> NODE_CLASS = Node.class;
-
-    private final static Class<NodeConnector> NODECONNECTOR_CLASS = NodeConnector.class;
-
-    private final static Pattern COLON_NUMBERS_EOL = Pattern.compile(":[0-9]+$");
-
-    private final static Pattern NUMBERS_ONLY = Pattern.compile("[0-9]+");
-
-    private final static Pattern ALL_CHARS_TO_COLON = Pattern.compile("^.*:");
-
-    private NodeMapping() {
-        throw new UnsupportedOperationException("Utility class. Instantiation is not allowed.");
-    }
-
-    public static org.opendaylight.controller.sal.core.Node toADNode(final InstanceIdentifier<? extends Object> node) throws ConstructionException {
-        NodeId nodeId = NodeMapping.toNodeId(node);
-        return NodeMapping.toADNode(nodeId);
-    }
-
-    public static org.opendaylight.controller.sal.core.Node toADNode(final NodeId id) throws ConstructionException {
-        String nodeId = NodeMapping.toADNodeId(id);
-        String nodeIdasNumber = nodeId.replaceFirst("^.*:", "");
-        if (isInteger(nodeIdasNumber)) {
-            Long aDNodeId = openflowFullNodeIdToLong(nodeIdasNumber);
-            return new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, aDNodeId);
-        } else {
-            return new org.opendaylight.controller.sal.core.Node(NodeIDType.PRODUCTION, nodeId);
-        }
-    }
-
-    /**
-     * @param adNodeId
-     * @return nodeId as long
-     */
-    @VisibleForTesting
-    public static Long openflowFullNodeIdToLong(String adNodeId) {
-        if (adNodeId == null) {
-            return null;
-        }
-        return new BigInteger(adNodeId).longValue();
-    }
-
-    public static NodeId toNodeId(final InstanceIdentifier<?> id) {
-        final NodeKey key = id.firstKeyOf(Node.class, NodeKey.class);
-        Preconditions.checkArgument(key != null, "No node identifier found in %s", id);
-        return key.getId();
-    }
-
-    /**
-     * @param nodeId containing "&lt;NodeTypeString&gt;:&lt;plainIntegerId&gt;"
-     * @return adNodeId form
-     */
-    public static String toADNodeId(final NodeId nodeId) {
-        if (nodeId == null) {
-            return null;
-        }
-        return nodeId.getValue();
-    }
-
-    public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorRef source) throws ConstructionException {
-        final InstanceIdentifier<?> id = Preconditions.checkNotNull(source.getValue());
-        final NodeConnectorKey key = id.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
-        return NodeMapping.toADNodeConnector(key.getId(), NodeMapping.toNodeId(id));
-    }
-
-    public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorId ncid, final NodeId nid) throws ConstructionException {
-        String nodeConnectorType = NodeMapping.toNodeConnectorType(ncid, nid);
-        Object aDNodeConnectorId = NodeMapping.toADNodeConnectorId(ncid, nid);
-        org.opendaylight.controller.sal.core.Node aDNode = NodeMapping.toADNode(nid);
-        return new org.opendaylight.controller.sal.core.NodeConnector(nodeConnectorType, aDNodeConnectorId, aDNode);
-    }
-
-    /**
-     * @param ncid   nodeConnector identifier, e.g.: OF:21 or CTRL
-     * @param aDNode
-     * @return nodeConnector attached to given node
-     * @throws ConstructionException
-     */
-    public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(
-            final NodeConnectorId ncid, final org.opendaylight.controller.sal.core.Node aDNode) throws ConstructionException {
-        NodeId nid = NodeMapping.toNodeId(aDNode);
-        String nodeConnectorType = NodeMapping.toNodeConnectorType(ncid, nid);
-        Object aDNodeConnectorId = NodeMapping.toADNodeConnectorId(ncid, nid);
-        return new org.opendaylight.controller.sal.core.NodeConnector(nodeConnectorType, aDNodeConnectorId, aDNode);
-    }
-
-    /**
-     * @param aDNode
-     * @return
-     */
-    public static NodeId toNodeId(org.opendaylight.controller.sal.core.Node aDNode) {
-        String targetPrefix = null;
-        if (NodeIDType.OPENFLOW.equals(aDNode.getType())) {
-                targetPrefix = OPENFLOW_ID_PREFIX;
-        } else {
-            targetPrefix = aDNode.getType() + ":";
-        }
-
-        return new NodeId(targetPrefix + String.valueOf(aDNode.getID()));
-    }
-
-    /**
-     * @param aDNode
-     * @return md-sal {@link NodeKey}
-     */
-    public static NodeKey toNodeKey(org.opendaylight.controller.sal.core.Node aDNode) {
-        return new NodeKey(toNodeId(aDNode));
-    }
-
-    public static String toNodeConnectorType(final NodeConnectorId ncId, final NodeId nodeId) {
-        if (ncId.equals(toLocalNodeConnectorId(nodeId))) {
-            return NodeConnectorIDType.SWSTACK;
-        } else if (ncId.equals(toNormalNodeConnectorId(nodeId))) {
-            return NodeConnectorIDType.HWPATH;
-        } else if (ncId.equals(toControllerNodeConnectorId(nodeId))) {
-            return NodeConnectorIDType.CONTROLLER;
-        }
-        return NodeConnectorIDType.OPENFLOW;
-    }
-
-    public static Object toADNodeConnectorId(final NodeConnectorId nodeConnectorId, final NodeId nodeId) {
-        if (nodeConnectorId.equals(toLocalNodeConnectorId(nodeId)) ||
-                nodeConnectorId.equals(toNormalNodeConnectorId(nodeId)) ||
-                nodeConnectorId.equals(toControllerNodeConnectorId(nodeId))) {
-            return org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID;
-        }
-
-        String nodeConnectorIdStripped = stripToColon(nodeConnectorId.getValue());
-
-        if (NUMBERS_ONLY.matcher(nodeConnectorIdStripped).matches()) {
-            Short nodeConnectorIdVal = null;
-            try {
-                nodeConnectorIdVal = Short.valueOf(nodeConnectorIdStripped);
-                return nodeConnectorIdVal;
-            } catch (NumberFormatException e) {
-                LOG.warn("nodeConnectorId not supported (long): {}", nodeConnectorIdStripped, e);
-            }
-        }
-        return nodeConnectorIdStripped;
-    }
-
-    public static String stripToColon(final String elementId) {
-        return ALL_CHARS_TO_COLON.matcher(elementId).replaceFirst("");
-    }
-
-    public static NodeId toAdNodeId(final NodeConnectorId nodeConnectorId) {
-        NodeId nodeId = null;
-        if (nodeConnectorId != null) {
-            nodeId = new NodeId(COLON_NUMBERS_EOL.matcher(nodeConnectorId.getValue()).replaceFirst(""));
-        }
-        return nodeId;
-    }
-
-    public static NodeConnectorId toControllerNodeConnectorId(final NodeId node) {
-        return new NodeConnectorId(node.getValue() + ":" + OutputPortValues.CONTROLLER.toString());
-    }
-
-    public static NodeConnectorId toLocalNodeConnectorId(final NodeId node) {
-        return new NodeConnectorId(node.getValue() + ":" + OutputPortValues.LOCAL.toString());
-    }
-
-    public static NodeConnectorId toNormalNodeConnectorId(final NodeId node) {
-        return new NodeConnectorId(node.getValue() + ":" + OutputPortValues.NORMAL.toString());
-    }
-
-    public static NodeRef toNodeRef(final org.opendaylight.controller.sal.core.Node node) {
-        Preconditions.checkArgument(NodeIDType.OPENFLOW.equals(node.getType()));
-        final Long nodeId = Arguments.<Long>checkInstanceOf(node.getID(), Long.class);
-        final NodeKey nodeKey = new NodeKey(new NodeId(OPENFLOW_ID_PREFIX + nodeId));
-        final InstanceIdentifier<Node> nodePath = InstanceIdentifier.builder(Nodes.class).child(NODE_CLASS, nodeKey).toInstance();
-        return new NodeRef(nodePath);
-    }
-
-    public static NodeConnectorRef toNodeConnectorRef(final org.opendaylight.controller.sal.core.NodeConnector nodeConnector) {
-
-        final NodeRef node = NodeMapping.toNodeRef(nodeConnector.getNode());
-        @SuppressWarnings("unchecked")
-        final InstanceIdentifier<Node> nodePath = ((InstanceIdentifier<Node>) node.getValue());
-        NodeConnectorId nodeConnectorId = null;
-
-        if (nodeConnector.getID().equals(org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID)) {
-            final NodeId nodeId = toNodeId(nodePath);
-            final String nodeConnectorType = nodeConnector.getType();
-            if (nodeConnectorType.equals(NodeConnectorIDType.SWSTACK)) {
-                nodeConnectorId = toLocalNodeConnectorId(nodeId);
-            } else if (nodeConnectorType.equals(NodeConnectorIDType.HWPATH)) {
-                nodeConnectorId = toNormalNodeConnectorId(nodeId);
-            } else if (nodeConnectorType.equals(NodeConnectorIDType.CONTROLLER)) {
-                nodeConnectorId = toControllerNodeConnectorId(nodeId);
-            }
-        } else {
-            nodeConnectorId = new NodeConnectorId(OPENFLOW_ID_PREFIX
-                    + Arguments.<Short>checkInstanceOf(nodeConnector.getID(), Short.class));
-        }
-        final NodeConnectorKey connectorKey = new NodeConnectorKey(nodeConnectorId);
-        final InstanceIdentifier<NodeConnector> path = nodePath.child(NODECONNECTOR_CLASS, connectorKey);
-        return new NodeConnectorRef(path);
-    }
-
-    public static org.opendaylight.controller.sal.core.Node toADNode(final NodeRef node) throws ConstructionException {
-        return NodeMapping.toADNode(node.getValue());
-    }
-
-    public static HashSet<Property> toADNodeConnectorProperties(final NodeConnectorUpdated nc) {
-        final FlowCapableNodeConnectorUpdated fcncu = nc.<FlowCapableNodeConnectorUpdated>getAugmentation(FlowCapableNodeConnectorUpdated.class);
-        if (!Objects.equal(fcncu, null)) {
-            HashSet<Property> adNodeConnectorProperties = NodeMapping.toADNodeConnectorProperties(fcncu);
-            return adNodeConnectorProperties;
-        }
-        return new HashSet<Property>();
-    }
-
-    /**
-     * @param nodeRef
-     * @return node description in AD form, e.g.: OF|00:00:00:...:01
-     */
-    private static Description toADDescription(NodeRef nodeRef) {
-        Description desc;
-        try {
-            desc = new Description(toADNode(nodeRef).toString());
-        } catch (ConstructionException e) {
-            desc = new Description("none");
-            LOG.warn("node description extraction failed: {}", nodeRef);
-        }
-        return desc;
-    }
-
-    public static HashSet<Property> toADNodeConnectorProperties(final NodeConnector nc) {
-        final FlowCapableNodeConnector fcnc = nc.<FlowCapableNodeConnector>getAugmentation(FlowCapableNodeConnector.class);
-        if (!Objects.equal(fcnc, null)) {
-            return NodeMapping.toADNodeConnectorProperties(fcnc);
-        }
-        return new HashSet<Property>();
-    }
-
-    public static HashSet<Property> toADNodeConnectorProperties(final FlowNodeConnector fcncu) {
-
-        final HashSet<org.opendaylight.controller.sal.core.Property> props = new HashSet<>();
-        if (fcncu != null) {
-            if (fcncu.getCurrentFeature() != null && toAdBandwidth(fcncu.getCurrentFeature()) != null) {
-                props.add(toAdBandwidth(fcncu.getCurrentFeature()));
-            }
-            if (fcncu.getAdvertisedFeatures() != null && toAdAdvertizedBandwidth(fcncu.getAdvertisedFeatures()) != null) {
-                props.add(toAdAdvertizedBandwidth(fcncu.getAdvertisedFeatures()));
-            }
-            if (fcncu.getSupported() != null && toAdSupportedBandwidth(fcncu.getSupported()) != null) {
-                props.add(toAdSupportedBandwidth(fcncu.getSupported()));
-            }
-            if (fcncu.getPeerFeatures() != null && toAdPeerBandwidth(fcncu.getPeerFeatures()) != null) {
-                props.add(toAdPeerBandwidth(fcncu.getPeerFeatures()));
-            }
-            if (fcncu.getName() != null && toAdName(fcncu.getName()) != null) {
-                props.add(toAdName(fcncu.getName()));
-            }
-            if (fcncu.getConfiguration() != null && toAdConfig(fcncu.getConfiguration()) != null) {
-                props.add(toAdConfig(fcncu.getConfiguration()));
-            }
-            if (fcncu.getState() != null && toAdState(fcncu.getState()) != null) {
-                props.add(toAdState(fcncu.getState()));
-            }
-        }
-        return props;
-    }
-
-    public static Name toAdName(final String name) {
-        return new Name(name);
-    }
-
-    public static Config toAdConfig(final PortConfig pc) {
-        Config config = null;
-        if (pc.isPORTDOWN()) {
-            config = new Config(Config.ADMIN_DOWN);
-        } else {
-            config = new Config(Config.ADMIN_UP);
-        }
-        return config;
-    }
-
-    public static org.opendaylight.controller.sal.core.State toAdState(final State s) {
-
-        org.opendaylight.controller.sal.core.State state = null;
-        if (s.isLinkDown()) {
-            state = new org.opendaylight.controller.sal.core.State(org.opendaylight.controller.sal.core.State.EDGE_DOWN);
-        } else {
-            state = new org.opendaylight.controller.sal.core.State(org.opendaylight.controller.sal.core.State.EDGE_UP);
-        }
-        return state;
-    }
-
-    public static Bandwidth toAdBandwidth(final PortFeatures pf) {
-        Bandwidth bw = null;
-        if (pf.isTenMbHd() || pf.isTenMbFd()) {
-            bw = new Bandwidth(Bandwidth.BW10Mbps);
-        } else if (pf.isHundredMbHd() || pf.isHundredMbFd()) {
-            bw = new Bandwidth(Bandwidth.BW100Mbps);
-        } else if (pf.isOneGbHd() || pf.isOneGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW1Gbps);
-        } else if (pf.isOneGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW10Gbps);
-        } else if (pf.isTenGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW10Gbps);
-        } else if (pf.isFortyGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW40Gbps);
-        } else if (pf.isHundredGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW100Gbps);
-        } else if (pf.isOneTbFd()) {
-            bw = new Bandwidth(Bandwidth.BW1Tbps);
-        }
-        return bw;
-    }
-
-    public static AdvertisedBandwidth toAdAdvertizedBandwidth(final PortFeatures pf) {
-        AdvertisedBandwidth abw = null;
-        final Bandwidth bw = toAdBandwidth(pf);
-        if (bw != null) {
-            abw = new AdvertisedBandwidth(bw.getValue());
-        }
-        return abw;
-    }
-
-    public static SupportedBandwidth toAdSupportedBandwidth(final PortFeatures pf) {
-        SupportedBandwidth sbw = null;
-        final Bandwidth bw = toAdBandwidth(pf);
-        if (bw != null) {
-            sbw = new SupportedBandwidth(bw.getValue());
-        }
-        return sbw;
-    }
-
-    public static PeerBandwidth toAdPeerBandwidth(final PortFeatures pf) {
-        PeerBandwidth pbw = null;
-        final Bandwidth bw = toAdBandwidth(pf);
-        if (bw != null) {
-            pbw = new PeerBandwidth(bw.getValue());
-        }
-        return pbw;
-    }
-
-    public static HashSet<Property> toADNodeProperties(final NodeUpdated nu) {
-        final FlowCapableNodeUpdated fcnu = nu.getAugmentation(FlowCapableNodeUpdated.class);
-        if (fcnu != null) {
-            HashSet<Property> adNodeProperties = toADNodeProperties(fcnu, nu.getId());
-            adNodeProperties.add(toADDescription(nu.getNodeRef()));
-            return adNodeProperties;
-        }
-        return new HashSet<org.opendaylight.controller.sal.core.Property>();
-    }
-
-    public static HashSet<Property> toADNodeProperties(final FlowNode fcnu, final NodeId id) {
-
-        final HashSet<org.opendaylight.controller.sal.core.Property> props = new HashSet<>();
-
-        if (fcnu != null) {
-            props.add(toADTimestamp());
-
-            // props.add(fcnu.supportedActions.toADActions) - TODO
-            if (id != null) {
-                props.add(toADMacAddress(id));
-            }
-            SwitchFeatures switchFeatures = fcnu.getSwitchFeatures();
-            if (switchFeatures != null) {
-                if (switchFeatures.getMaxTables() != null) {
-                    props.add(toADTables(switchFeatures.getMaxTables()));
-                }
-                if (switchFeatures.getCapabilities() != null) {
-                    props.add(toADCapabiliities(switchFeatures.getCapabilities()));
-                }
-                if (switchFeatures.getMaxBuffers() != null) {
-                    props.add(toADBuffers(switchFeatures.getMaxBuffers()));
-                }
-            }
-        }
-        return props;
-    }
-
-    public static TimeStamp toADTimestamp() {
-        final Date date = new Date();
-        final TimeStamp timestamp = new TimeStamp(date.getTime(), "connectedSince");
-        return timestamp;
-    }
-
-    public static MacAddress toADMacAddress(final NodeId id) {
-        final String nodeId = id.getValue().replaceAll(OPENFLOW_ID_PREFIX, "");
-        BigInteger nodeIdRaw = new BigInteger(nodeId);
-        long lNodeId = nodeIdRaw.longValue();
-        byte[] bytesFromDpid = ToSalConversionsUtils.bytesFromDpid(lNodeId);
-        return new MacAddress(bytesFromDpid);
-    }
-
-    public static Tables toADTables(final Short tables) {
-        return new Tables(tables.byteValue());
-    }
-
-    public static Capabilities toADCapabiliities(final List<Class<? extends FeatureCapability>> capabilities) {
-
-        int b = 0;
-        for (Class<? extends FeatureCapability> capability : capabilities) {
-            if (capability.equals(FlowFeatureCapabilityFlowStats.class)) {
-                b = Capabilities.CapabilitiesType.FLOW_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityTableStats.class)) {
-                b = Capabilities.CapabilitiesType.TABLE_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityPortStats.class)) {
-                b = Capabilities.CapabilitiesType.PORT_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityStp.class)) {
-                b = Capabilities.CapabilitiesType.STP_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityIpReasm.class)) {
-                b = Capabilities.CapabilitiesType.IP_REASSEM_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityQueueStats.class)) {
-                b = Capabilities.CapabilitiesType.QUEUE_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityArpMatchIp.class)) {
-                b = Capabilities.CapabilitiesType.ARP_MATCH_IP_CAPABILITY.getValue() | b;
-            }
-        }
-        return new Capabilities(b);
-    }
-
-    public static Buffers toADBuffers(final Long buffers) {
-        return new Buffers(buffers.intValue());
-    }
-
-
-    private static final boolean isInteger(String value) {
-        if (value.isEmpty()) return false;
-        for (int i = 0; i < value.length(); i++) {
-            if (i == 0 && value.charAt(i) == '-') {
-                if (value.length() == 1) return false;
-                else continue;
-            }
-            if (Character.digit(value.charAt(i), 10) < 0) return false;
-        }
-        return true;
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ProtocolConstants.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ProtocolConstants.java
deleted file mode 100644 (file)
index 3082606..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-public class ProtocolConstants {
-    // source: http://en.wikipedia.org/wiki/Ethertype
-    public static final short ETHERNET_ARP = (short) 0x0806;
-
-    // source: http://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
-    public static final byte TCP = (byte) 0x06;
-    public static final byte UDP = (byte) 0x11;
-    public static final byte CRUDP = (byte) 0x7F;
-
-    private ProtocolConstants() {
-
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/SalCompatibilityProvider.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/SalCompatibilityProvider.java
deleted file mode 100644 (file)
index 76b9808..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.adsal.DataPacketServiceAdapter;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyAdapter;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyProvider;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-
-import com.google.common.base.Preconditions;
-
-class SalCompatibilityProvider implements BindingAwareProvider {
-    private final ComponentActivator activator;
-
-    public SalCompatibilityProvider(final ComponentActivator cmpAct) {
-        this.activator = Preconditions.checkNotNull(cmpAct);
-    }
-
-    @Override
-    public void onSessionInitiated(final ProviderContext session) {
-        final NotificationService subscribe = session.getSALService(NotificationService.class);
-
-        final FlowProgrammerAdapter flow = activator.getFlow();
-        flow.setDelegate(session.getRpcService(SalFlowService.class));
-        flow.setDataBrokerService(session.getSALService(DataBrokerService.class));
-        // FIXME: remember registration for clean shutdown
-        subscribe.registerNotificationListener(flow);
-
-        final InventoryAndReadAdapter inv = activator.getInventory();
-        inv.setDataService(session.getSALService(DataBrokerService.class));
-        inv.setFlowStatisticsService(session.getRpcService(OpendaylightFlowStatisticsService.class));
-        inv.setFlowTableStatisticsService(session.getRpcService(OpendaylightFlowTableStatisticsService.class));
-        inv.setNodeConnectorStatisticsService(session.getRpcService(OpendaylightPortStatisticsService.class));
-        inv.setTopologyDiscovery(session.getRpcService(FlowTopologyDiscoveryService.class));
-        inv.setDataProviderService(session.getSALService(DataProviderService.class));
-
-        final NodeDataChangeListener ndcl = new NodeDataChangeListener(inv,session.getSALService(DataBroker.class));
-        final NCDataChangeListener ncdcl = new NCDataChangeListener(inv,session.getSALService(DataBroker.class));
-
-        // FIXME: remember registration for clean shutdown
-        subscribe.registerNotificationListener(inv);
-
-        final DataPacketServiceAdapter dps = activator.getDataPacketService();
-        dps.setDelegate(session.getRpcService(PacketProcessingService.class));
-
-        final TopologyAdapter topo = activator.getTopology();
-        topo.setDataService(session.getSALService(DataProviderService.class));
-
-        final TopologyProvider tpp = activator.getTpProvider();
-        tpp.setDataService(session.getSALService(DataProviderService.class));
-
-        inv.startAdapter();
-        tpp.startAdapter();
-
-        subscribe.registerNotificationListener(activator.getDataPacket());
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ToSalConversionsUtils.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/ToSalConversionsUtils.java
deleted file mode 100644 (file)
index 914ae9f..0000000
+++ /dev/null
@@ -1,662 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility;
-
-import static org.opendaylight.controller.sal.match.MatchType.DL_DST;
-import static org.opendaylight.controller.sal.match.MatchType.DL_SRC;
-import static org.opendaylight.controller.sal.match.MatchType.DL_TYPE;
-import static org.opendaylight.controller.sal.match.MatchType.DL_VLAN;
-import static org.opendaylight.controller.sal.match.MatchType.DL_VLAN_PR;
-import static org.opendaylight.controller.sal.match.MatchType.NW_DST;
-import static org.opendaylight.controller.sal.match.MatchType.NW_PROTO;
-import static org.opendaylight.controller.sal.match.MatchType.NW_SRC;
-import static org.opendaylight.controller.sal.match.MatchType.NW_TOS;
-import static org.opendaylight.controller.sal.match.MatchType.TP_DST;
-import static org.opendaylight.controller.sal.match.MatchType.TP_SRC;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.UDP;
-
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opendaylight.controller.sal.action.Controller;
-import org.opendaylight.controller.sal.action.Drop;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.Output;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.match.Match;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCase;
-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.action.PopMplsActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.GenericFlowAttributes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.MacAddressFilter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanId;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.net.InetAddresses;
-
-public class ToSalConversionsUtils {
-
-    private static final Logger LOG = LoggerFactory.getLogger(ToSalConversionsUtils.class);
-
-    private ToSalConversionsUtils() {
-        throw new IllegalAccessError("forcing no instance for factory");
-    }
-
-    public static Flow toFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow source, Node node) {
-        final Flow target = new Flow();
-        genericFlowToAdFlow(source, target);
-
-        target.setMatch(toMatch(source.getMatch()));
-
-        List<Action> actions = getAction(source);
-        if (actions != null) {
-            target.setActions(actionFrom(actions, node));
-        }
-
-        return target;
-    }
-
-    /**
-     * @param source notification, missing instructions
-     * @param node corresponding node where the flow change occured
-     * @return ad-sal node, build from given data
-     */
-    public static Flow toFlow(SwitchFlowRemoved source, Node node) {
-        final Flow target = new Flow();
-        genericFlowToAdFlow(source, target);
-
-        target.setMatch(toMatch(source.getMatch()));
-
-        return target;
-    }
-
-    /**
-     * @param source
-     * @param target
-     */
-    private static void genericFlowToAdFlow(GenericFlowAttributes source,
-            final Flow target) {
-        Integer hardTimeout = source.getHardTimeout();
-        if (hardTimeout != null) {
-            target.setHardTimeout(hardTimeout.shortValue());
-        }
-
-        Integer idleTimeout = source.getIdleTimeout();
-        if (idleTimeout != null) {
-            target.setIdleTimeout(idleTimeout.shortValue());
-        }
-
-        Integer priority = source.getPriority();
-        if (priority != null) {
-            target.setPriority(priority.shortValue());
-        }
-        target.setId(source.getCookie().getValue().longValue());
-    }
-
-    public static List<Action> getAction(
-            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow source) {
-        if (source.getInstructions() != null) {
-            for (Instruction instruction : source.getInstructions().getInstruction()) {
-                if (instruction.getInstruction() instanceof ApplyActionsCase) {
-                    return (((ApplyActionsCase) instruction.getInstruction()).getApplyActions().getAction());
-                }
-            }
-        }
-        // TODO Auto-generated method stub
-        return Collections.emptyList();
-    }
-
-    public static List<org.opendaylight.controller.sal.action.Action> actionFrom(List<Action> actions, Node node) {
-        List<org.opendaylight.controller.sal.action.Action> targetAction = new ArrayList<>();
-        for (Action action : actions) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action sourceAction = action
-                    .getAction();
-
-            if (sourceAction instanceof ControllerActionCase) {
-                targetAction.add(new Controller());
-            } else if (sourceAction instanceof OutputActionCase) {
-
-                Uri nodeConnector = ((OutputActionCase) sourceAction).getOutputAction().getOutputNodeConnector();
-                if (nodeConnector != null) {
-                    // TODO: We should really have a bi-directional map from AD-SAL node types to
-                    //       MD-SAL node types, but lets fix that later.
-                    String type = node.getType();
-                    if( type.equals(NodeIDType.OPENFLOW) ){
-                        type = NodeMapping.OPENFLOW_ID_PREFIX;
-                    }else{
-                        type = type + ":";
-                    }
-                    Uri fullNodeConnector = new Uri(type+node.getID()+":"
-                            +NodeMapping.stripToColon(nodeConnector.getValue()));
-                    targetAction.add(new Output(fromNodeConnectorRef(fullNodeConnector, node)));
-                }
-            } else if (sourceAction instanceof PopMplsActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof PushMplsActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof PushPbbActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof SetMplsTtlActionCase) {
-                // TODO: define maping
-                // targetAction = //no action to map
-            } else if (sourceAction instanceof SetNwTtlActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof SetQueueActionCase) {
-                // TODO: define maping
-                // targetAction = //no action to map
-            } else if (sourceAction instanceof DropActionCase) {
-                targetAction.add(new Drop());
-            } else if (sourceAction instanceof FloodActionCase) {
-                targetAction.add(new Flood());
-            } else if (sourceAction instanceof FloodAllActionCase) {
-                targetAction.add(new FloodAll());
-            } else if (sourceAction instanceof HwPathActionCase) {
-                targetAction.add(new HwPath());
-            } else if (sourceAction instanceof LoopbackActionCase) {
-                targetAction.add(new Loopback());
-            } else if (sourceAction instanceof PopVlanActionCase) {
-                targetAction.add(new PopVlan());
-            } else if (sourceAction instanceof PushVlanActionCase) {
-                PushVlanActionCase pushVlanAction = (PushVlanActionCase) sourceAction;
-                PushVlan pushVlan = pushVlanFrom(pushVlanAction.getPushVlanAction());
-                if (pushVlan != null) {
-                    targetAction.add(pushVlan);
-                }
-            } else if (sourceAction instanceof SetDlDstActionCase) {
-                MacAddress addressL2Dest = ((SetDlDstActionCase) sourceAction).getSetDlDstAction().getAddress();
-                if (addressL2Dest != null) {
-                    targetAction.add(new SetDlDst(bytesFrom(addressL2Dest)));
-                }
-            } else if (sourceAction instanceof SetDlSrcActionCase) {
-                MacAddress addressL2Src = ((SetDlSrcActionCase) sourceAction).getSetDlSrcAction().getAddress();
-                if (addressL2Src != null) {
-                    targetAction.add(new SetDlSrc(bytesFrom(addressL2Src)));
-
-                }
-            } else if (sourceAction instanceof SetDlTypeActionCase) {
-                EtherType dlType = ((SetDlTypeActionCase) sourceAction).getSetDlTypeAction().getDlType();
-                if (dlType != null) {
-                    Long dlTypeValue = dlType.getValue();
-                    if (dlTypeValue != null) {
-                        targetAction.add(new SetDlType(dlTypeValue.intValue()));
-                    }
-                }
-            } else if (sourceAction instanceof SetNextHopActionCase) {
-                Address addressL3 = ((SetNextHopActionCase) sourceAction).getSetNextHopAction().getAddress();
-
-                InetAddress inetAddress = inetAddressFrom(addressL3);
-                if (inetAddress != null) {
-                    targetAction.add(new SetNextHop(inetAddress));
-                }
-            } else if (sourceAction instanceof SetNwDstActionCase) {
-                Address addressL3 = ((SetNwDstActionCase) sourceAction).getSetNwDstAction().getAddress();
-
-                InetAddress inetAddress = inetAddressFrom(addressL3);
-                if (inetAddress != null) {
-                    targetAction.add(new SetNwDst(inetAddress));
-                }
-            } else if (sourceAction instanceof SetNwSrcActionCase) {
-                Address addressL3 = ((SetNwSrcActionCase) sourceAction).getSetNwSrcAction().getAddress();
-
-                InetAddress inetAddress = inetAddressFrom(addressL3);
-                if (inetAddress != null) {
-                    targetAction.add(new SetNwSrc(inetAddress));
-                }
-            } else if (sourceAction instanceof SetNwTosActionCase) {
-                Integer tos = ((SetNwTosActionCase) sourceAction).getSetNwTosAction().getTos();
-                if (tos != null) {
-                    targetAction.add(new SetNwTos(ToSalConversionsUtils.tosToNwDscp(tos)));
-                }
-            } else if (sourceAction instanceof SetTpDstActionCase) {
-                PortNumber port = ((SetTpDstActionCase) sourceAction).getSetTpDstAction().getPort();
-                if (port != null) {
-                    Integer portValue = port.getValue();
-                    if (port.getValue() != null) {
-                        targetAction.add(new SetTpDst(portValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetTpSrcActionCase) {
-                PortNumber port = ((SetTpSrcActionCase) sourceAction).getSetTpSrcAction().getPort();
-                if (port != null) {
-                    Integer portValue = port.getValue();
-                    if (port.getValue() != null) {
-                        targetAction.add(new SetTpSrc(portValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetVlanCfiActionCase) {
-                VlanCfi vlanCfi = ((SetVlanCfiActionCase) sourceAction).getSetVlanCfiAction().getVlanCfi();
-                if (vlanCfi != null) {
-                    Integer vlanCfiValue = vlanCfi.getValue();
-                    if (vlanCfiValue != null) {
-                        targetAction.add(new SetVlanCfi(vlanCfiValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetVlanIdActionCase) {
-                org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanID = ((SetVlanIdActionCase) sourceAction).getSetVlanIdAction()
-                        .getVlanId();
-                if (vlanID != null) {
-                    Integer vlanIdValue = vlanID.getValue();
-                    if (vlanIdValue != null) {
-                        targetAction.add(new SetVlanId(vlanIdValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetVlanPcpActionCase) {
-                VlanPcp vlanPcp = ((SetVlanPcpActionCase) sourceAction).getSetVlanPcpAction().getVlanPcp();
-                if (vlanPcp != null) {
-                    Short vlanPcpValue = vlanPcp.getValue();
-                    if (vlanPcpValue != null) {
-                        targetAction.add(new SetVlanPcp(vlanPcpValue));
-                    }
-                }
-            } else if (sourceAction instanceof SwPathActionCase) {
-                targetAction.add(new SwPath());
-            }
-        }
-
-        return targetAction;
-    }
-
-    private static InetAddress inetAddressFrom(Address addressL3) {
-        if (addressL3 != null) {
-            if (addressL3 instanceof Ipv4) {
-                Ipv4Prefix addressL3Ipv4 = ((Ipv4) addressL3).getIpv4Address();
-                if (addressL3Ipv4 != null) {
-                    return inetAddressFrom(addressL3Ipv4);
-                }
-            } else if (addressL3 instanceof Ipv6) {
-                Ipv6Prefix addressL3Ipv6 = ((Ipv6) addressL3).getIpv6Address();
-                if (addressL3Ipv6 != null) {
-                    return inetAddressFrom(addressL3Ipv6);
-                }
-            }
-        }
-        return null;
-    }
-
-    private static PushVlan pushVlanFrom(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanAction pushVlanAction) {
-        Integer tag = pushVlanAction.getTag();
-        if (tag != null) {
-            return new PushVlan(tag.intValue());
-        }
-        return null;
-    }
-
-    /**
-     * @param uri openflow nodeConnector URI
-     * @param node
-     * @return assembled nodeConnector
-     */
-    public static NodeConnector fromNodeConnectorRef(Uri uri, Node node) {
-        NodeConnector nodeConnector = null;
-        try {
-            NodeConnectorId nodeConnectorId = new NodeConnectorId(uri.getValue());
-            nodeConnector = NodeMapping.toADNodeConnector(nodeConnectorId, node);
-        } catch (ConstructionException e) {
-            LOG.warn("nodeConnector creation failed at node: {} with nodeConnectorUri: {}",
-                    node, uri.getValue());
-        }
-        return nodeConnector;
-    }
-
-    public static Match toMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match source) {
-        Match target = new Match();
-        if (source != null) {
-            fillFrom(target, source.getVlanMatch());
-            fillFrom(target, source.getEthernetMatch());
-            fillFrom(target, source.getLayer3Match());
-            fillFrom(target, source.getLayer4Match());
-            fillFrom(target, source.getIpMatch());
-            fillFrom(target, source.getInPort());
-        }
-
-        return target;
-    }
-
-    /**
-     * @param target
-     * @param inPort
-     */
-    private static void fillFrom(Match target, NodeConnectorId inPort) {
-        if (inPort != null) {
-            String inPortValue = inPort.getValue();
-            if (inPortValue != null) {
-                try {
-                    target.setField(MatchType.IN_PORT, NodeMapping.toADNodeConnector(inPort,
-                            NodeMapping.toAdNodeId(inPort)));
-                } catch (ConstructionException e) {
-                    LOG.warn("nodeConnector construction failed", e);
-                }
-            }
-        }
-    }
-
-    private static void fillFrom(Match target, VlanMatch vlanMatch) {
-        if (vlanMatch != null) {
-            VlanId vlanId = vlanMatch.getVlanId();
-            if (vlanId != null) {
-                if (Boolean.TRUE.equals(vlanId.isVlanIdPresent())) {
-                    org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanIdInner = vlanId
-                            .getVlanId();
-                    if (vlanIdInner != null) {
-                        Integer vlanValue = vlanIdInner.getValue();
-                        if (vlanValue != null) {
-                            target.setField(DL_VLAN, vlanValue.shortValue());
-                        }
-                    }
-                } else {
-                    target.setField(DL_VLAN, MatchType.DL_VLAN_NONE);
-                }
-            }
-            VlanPcp vlanPcp = vlanMatch.getVlanPcp();
-            if (vlanPcp != null) {
-                Short vlanPcpValue = vlanPcp.getValue();
-                if (vlanPcpValue != null) {
-                    target.setField(DL_VLAN_PR, vlanPcpValue.byteValue());
-                }
-            }
-        }
-    }
-
-    private static void fillFrom(Match target, IpMatch ipMatch) {
-        if (ipMatch != null) {
-            Short ipProtocol = ipMatch.getIpProtocol();
-
-            if (ipProtocol != null && target.getField(NW_PROTO) == null) {
-                target.setField(NW_PROTO, ipProtocol.byteValue());
-            }
-            Dscp dscp = ipMatch.getIpDscp();
-            if (dscp != null) {
-                Short dscpValue = dscp.getValue();
-                if (dscpValue != null) {
-                    target.setField(NW_TOS, dscpValue.byteValue());
-                }
-            }
-        }
-    }
-
-    private static void fillFrom(Match target, Layer4Match layer4Match) {
-        if (layer4Match == null) {
-            return;
-        }
-        if (layer4Match instanceof SctpMatch) {
-            fillTransportLayer(target, (SctpMatch) layer4Match);
-        } else if (layer4Match instanceof TcpMatch) {
-            fillTransportLayer(target, (TcpMatch) layer4Match);
-        } else if (layer4Match instanceof UdpMatch) {
-            fillTransportLayer(target, (UdpMatch) layer4Match);
-        }
-    }
-
-    private static void fillTransportLayer(Match target, UdpMatch source) {
-        PortNumber udpSourcePort = source.getUdpSourcePort();
-        if (udpSourcePort != null) {
-            Integer udpSourcePortValue = udpSourcePort.getValue();
-            if (udpSourcePortValue != null) {
-                target.setField(TP_SRC, udpSourcePortValue.shortValue());
-            }
-        }
-
-        PortNumber udpDestPort = source.getUdpDestinationPort();
-        if (udpDestPort != null) {
-            Integer udpDestPortValue = udpDestPort.getValue();
-            if (udpDestPortValue != null) {
-                target.setField(TP_DST, udpDestPortValue.shortValue());
-            }
-        }
-
-        target.setField(NW_PROTO, UDP);
-    }
-
-    private static void fillTransportLayer(Match target, TcpMatch source) {
-        PortNumber tcpSourcePort = source.getTcpSourcePort();
-        if (tcpSourcePort != null) {
-            Integer tcpSourcePortValue = tcpSourcePort.getValue();
-            if (tcpSourcePortValue != null) {
-                target.setField(TP_SRC, tcpSourcePortValue.shortValue());
-            }
-        }
-
-        PortNumber tcpDestPort = source.getTcpDestinationPort();
-        if (tcpDestPort != null) {
-            Integer tcpDestPortValue = tcpDestPort.getValue();
-            if (tcpDestPortValue != null) {
-                target.setField(TP_DST, tcpDestPortValue.shortValue());
-            }
-        }
-
-        target.setField(NW_PROTO, TCP);
-    }
-
-    private static void fillTransportLayer(Match target, SctpMatch source) {
-        PortNumber sctpSourcePort = source.getSctpSourcePort();
-        if (sctpSourcePort != null) {
-            Integer sctpSourcePortValue = sctpSourcePort.getValue();
-            if (sctpSourcePortValue != null) {
-                target.setField(TP_SRC, sctpSourcePortValue.shortValue());
-            }
-        }
-        PortNumber sctpDestPort = source.getSctpDestinationPort();
-        if (sctpDestPort != null) {
-            Integer sctpDestPortValue = sctpDestPort.getValue();
-            if (sctpDestPortValue != null) {
-                target.setField(TP_DST, sctpDestPortValue.shortValue());
-            }
-        }
-
-        target.setField(NW_PROTO, CRUDP);
-
-    }
-
-    private static void fillFrom(Match target, Layer3Match source) {
-        if (source == null)
-            return;
-        if (source instanceof Ipv4Match) {
-            fillFromIpv4(target, (Ipv4Match) source);
-        } else if (source instanceof Ipv6Match) {
-            fillFromIpv6(target, (Ipv6Match) source);
-        } else if (source instanceof ArpMatch) {
-            fillFromArp(target, (ArpMatch) source);
-        }
-    }
-
-    private static void fillFromArp(Match target, ArpMatch source) {
-        Ipv4Prefix sourceAddress = source.getArpSourceTransportAddress();
-        if (sourceAddress != null) {
-            target.setField(NW_SRC, inetAddressFrom(sourceAddress), null);
-        }
-        Ipv4Prefix destAddress = source.getArpTargetTransportAddress();
-        if (destAddress != null) {
-            target.setField(NW_DST, inetAddressFrom(destAddress), null);
-        }
-        ArpSourceHardwareAddress sourceHwAddress = source.getArpSourceHardwareAddress();
-        if (sourceHwAddress != null) {
-            target.setField(DL_SRC, bytesFrom(sourceHwAddress.getAddress()));
-        }
-        ArpTargetHardwareAddress targetHwAddress = source.getArpTargetHardwareAddress();
-        if (targetHwAddress != null) {
-            target.setField(DL_DST, bytesFrom(targetHwAddress.getAddress()));
-        }
-
-        target.setField(DL_TYPE, ETHERNET_ARP);
-
-    }
-
-    private static void fillFromIpv6(Match target, Ipv6Match source) {
-        Ipv6Prefix sourceAddress = source.getIpv6Source();
-        if (sourceAddress != null) {
-            target.setField(NW_SRC, inetAddressFrom(sourceAddress), null);
-        }
-        Ipv6Prefix destAddress = source.getIpv6Destination();
-        if (destAddress != null) {
-            target.setField(NW_DST, inetAddressFrom(destAddress), null);
-        }
-    }
-
-    private static void fillFromIpv4(Match target, Ipv4Match source) {
-        Ipv4Prefix sourceAddress = source.getIpv4Source();
-        if (sourceAddress != null) {
-            target.setField(NW_SRC, inetAddressFrom(sourceAddress), null);
-        }
-        Ipv4Prefix destAddress = source.getIpv4Destination();
-        if (destAddress != null) {
-            target.setField(NW_DST, inetAddressFrom(destAddress), null);
-        }
-    }
-
-    private static InetAddress inetAddressFrom(Ipv4Prefix source) {
-        if (source != null) {
-            String[] parts = source.getValue().split("/");
-            return InetAddresses.forString(parts[0]);
-        }
-        return null;
-    }
-
-    private static InetAddress inetAddressFrom(Ipv6Prefix source) {
-        if (source != null) {
-            String[] parts = source.getValue().split("/");
-            return InetAddresses.forString(parts[0]);
-        }
-        return null;
-    }
-
-    private static void fillFrom(Match target, EthernetMatch source) {
-        if (source == null)
-            return;
-        EthernetType ethType = source.getEthernetType();
-        if (ethType != null) {
-            EtherType ethInnerType = ethType.getType();
-            if (ethInnerType != null && target.getField(DL_TYPE) == null) {
-                Long value = ethInnerType.getValue();
-                target.setField(DL_TYPE, value.shortValue());
-            }
-        }
-
-        MacAddressFilter ethSource = source.getEthernetSource();
-        if (ethSource != null) {
-            target.setField(DL_SRC, bytesFrom(ethSource.getAddress()));
-        }
-
-        MacAddressFilter ethDest = source.getEthernetDestination();
-        if (ethDest != null) {
-            target.setField(DL_DST, bytesFrom(ethDest.getAddress()));
-        }
-    }
-
-    public static byte[] bytesFrom(MacAddress address) {
-        String[] mac = address.getValue().split(":");
-        byte[] macAddress = new byte[6]; // mac.length == 6 bytes
-        for (int i = 0; i < mac.length; i++) {
-            macAddress[i] = Integer.decode("0x" + mac[i]).byteValue();
-        }
-        return macAddress;
-    }
-
-    public static byte[] bytesFromDpid(long dpid) {
-        byte[] mac = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-
-        for (short i = 0; i < 6; i++) {
-            mac[5 - i] = (byte) dpid;
-            dpid >>= 8;
-        }
-
-        return mac;
-    }
-
-    /**
-     * @param nwTos NW-TOS
-     * @return shifted to NW-DSCP
-     */
-    public static int tosToNwDscp(int nwTos) {
-        return (short) (nwTos >>> FromSalConversionsUtils.ENC_FIELD_BIT_SIZE);
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/DataPacketServiceAdapter.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/DataPacketServiceAdapter.java
deleted file mode 100644 (file)
index f5c84a6..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.adsal;
-
-import org.opendaylight.controller.sal.packet.IPluginInDataPacketService;
-import org.opendaylight.controller.sal.packet.RawPacket;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInputBuilder;
-
-public class DataPacketServiceAdapter implements IPluginInDataPacketService {
-
-    PacketProcessingService delegate;
-
-    @Override
-    public void transmitDataPacket(RawPacket outPkt) {
-        TransmitPacketInput packet = toTransmitPacketInput(outPkt);
-        delegate.transmitPacket(packet);
-    }
-
-    private TransmitPacketInput toTransmitPacketInput(RawPacket rawPacket) {
-        TransmitPacketInputBuilder builderTPIB = new TransmitPacketInputBuilder();
-
-        builderTPIB.setNode(NodeMapping.toNodeRef(rawPacket.getOutgoingNodeConnector().getNode()));
-
-        NodeConnectorRef egress = rawPacket.getOutgoingNodeConnector() == null ? null :
-                NodeMapping.toNodeConnectorRef(rawPacket.getOutgoingNodeConnector());
-        NodeConnectorRef ingress = rawPacket.getIncomingNodeConnector() == null ? null :
-                NodeMapping.toNodeConnectorRef(rawPacket.getIncomingNodeConnector());
-        byte[] payload = rawPacket.getPacketData();
-
-        builderTPIB.setEgress(egress);
-        builderTPIB.setIngress(ingress);
-        builderTPIB.setPayload(payload);
-
-        return builderTPIB.build();
-    }
-
-    public PacketProcessingService getDelegate() {
-        return delegate;
-    }
-
-    public void setDelegate(PacketProcessingService delegate) {
-        this.delegate = delegate;
-    }
-
-
-
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/FlowServiceAdapter.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/FlowServiceAdapter.java
deleted file mode 100644 (file)
index 785be05..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.adsal;
-
-import java.math.BigInteger;
-
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerListener;
-import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerService;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.InventoryMapping;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public class FlowServiceAdapter implements SalFlowService, IFlowProgrammerListener {
-
-    private static final Logger LOG = LoggerFactory.getLogger(FlowServiceAdapter.class);
-
-    private IFlowProgrammerService delegate;
-
-    private NotificationProviderService publish;
-
-    @Override
-    public void flowRemoved(org.opendaylight.controller.sal.core.Node node, Flow flow) {
-        FlowRemovedBuilder flowRemovedBuilder = new FlowRemovedBuilder();
-        flowRemovedBuilder.setNode(InventoryMapping.toNodeRef(node));
-        publish.publish(flowRemovedBuilder.build());
-    }
-
-    @Override
-    public void flowErrorReported(org.opendaylight.controller.sal.core.Node node, long rid, Object err) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
-
-        Flow flow = ToSalConversionsUtils.toFlow(input, null);
-        @SuppressWarnings("unchecked")
-        org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
-                .getNode().getValue());
-        Status status = delegate.addFlowAsync(node, flow);
-        AddFlowOutputBuilder builder = new AddFlowOutputBuilder();
-        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
-        AddFlowOutput rpcResultType = builder.build();
-        return Futures.immediateFuture(RpcResultBuilder.<AddFlowOutput>status(status.isSuccess())
-                .withResult(rpcResultType).build());
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
-
-        Flow flow = ToSalConversionsUtils.toFlow(input, null);
-        @SuppressWarnings("unchecked")
-        org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
-                .getNode().getValue());
-        Status status = delegate.removeFlowAsync(node, flow);
-        RemoveFlowOutputBuilder builder = new RemoveFlowOutputBuilder();
-        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
-        RemoveFlowOutput rpcResultType = builder.build();
-        return Futures.immediateFuture(RpcResultBuilder.<RemoveFlowOutput>status(status.isSuccess())
-                                                         .withResult(rpcResultType).build());
-
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
-        @SuppressWarnings("unchecked")
-        org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
-                .getNode().getValue());
-        Flow originalFlow = ToSalConversionsUtils.toFlow(input.getOriginalFlow(), null);
-        Flow updatedFlow = ToSalConversionsUtils.toFlow(input.getUpdatedFlow(), null);
-        Status status = delegate.modifyFlowAsync(node, originalFlow, updatedFlow);
-        UpdateFlowOutputBuilder builder = new UpdateFlowOutputBuilder();
-        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
-        UpdateFlowOutput rpcResultType = builder.build();
-        throw new UnsupportedOperationException("Need to translate AD-SAL status to MD-SAL UpdateFlowOuptut - eaw@cisco.com");
-        // return Futures.immediateFuture(Rpcs.getRpcResult(status.isSuccess(), rpcResultType, null));
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/FlowStatisticsAdapter.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/adsal/FlowStatisticsAdapter.java
deleted file mode 100644 (file)
index c1459c4..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.adsal;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.reader.FlowOnNode;
-import org.opendaylight.controller.sal.reader.IReadService;
-import org.opendaylight.controller.sal.reader.IReadServiceListener;
-import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
-import org.opendaylight.controller.sal.reader.NodeDescription;
-import org.opendaylight.controller.sal.reader.NodeTableStatistics;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.FromSalConversionsUtils;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.InventoryMapping;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter32;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter64;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.DurationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Bytes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.BytesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Packets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.PacketsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public class FlowStatisticsAdapter implements OpendaylightFlowStatisticsService, IReadServiceListener{
-
-    private static final Logger LOG = LoggerFactory.getLogger(FlowStatisticsAdapter.class);
-    private IReadService readDelegate;
-    private NotificationProviderService notifier;
-
-    @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> getAggregateFlowStatisticsFromFlowTableForAllFlows(
-            GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
-        //TODO: No supported API exist in AD-SAL, it can either be implemented by fetching all the stats of the flows and
-        // generating aggregate flow statistics out of those individual flow stats.
-        return null;
-    }
-
-    @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> getAggregateFlowStatisticsFromFlowTableForGivenMatch(
-            GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
-        //TODO: No supported API exist in AD-SAL, it can either be implemented by fetching all the stats of the flows and
-        // generating aggregate flow statistics out of those individual flow stats.
-        return null;
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> getAllFlowStatisticsFromFlowTable(
-            GetAllFlowStatisticsFromFlowTableInput input) {
-        GetAllFlowStatisticsFromFlowTableOutput rpcResultType = null;
-        boolean rpcResultBool = false;
-
-        try {
-            Node adNode = NodeMapping.toADNode(input.getNode());
-            List<FlowOnNode> flowsOnNode = readDelegate.readAllFlows(adNode);
-            List<FlowAndStatisticsMapList> flowsStatistics = toOdFlowsStatistics(flowsOnNode);
-            GetAllFlowStatisticsFromFlowTableOutputBuilder builder = new GetAllFlowStatisticsFromFlowTableOutputBuilder();
-            builder.setTransactionId(new TransactionId(BigInteger.ZERO));
-            rpcResultType = builder.setFlowAndStatisticsMapList(flowsStatistics).build();
-
-            rpcResultBool = true;
-        } catch (ConstructionException e) {
-            LOG.error(e.getMessage());
-        }
-
-        return Futures.immediateFuture(RpcResultBuilder.<GetAllFlowStatisticsFromFlowTableOutput>
-                                                status(rpcResultBool).withResult(rpcResultType).build());
-    }
-
-    /**
-     * Essentially this API will return the same result as getAllFlowStatisticsFromFlowTable
-     */
-    @Override
-    public ListenableFuture<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>> getAllFlowsStatisticsFromAllFlowTables(
-            GetAllFlowsStatisticsFromAllFlowTablesInput input) {
-
-        GetAllFlowsStatisticsFromAllFlowTablesOutput rpcResultType = null;
-        boolean rpcResultBool = false;
-
-        try {
-            Node adNode = NodeMapping.toADNode(input.getNode());
-            List<FlowOnNode> flowsOnNode = readDelegate.readAllFlows(adNode);
-            List<FlowAndStatisticsMapList> flowsStatistics = toOdFlowsStatistics(flowsOnNode);
-            GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder builder = new GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder();
-            builder.setTransactionId(new TransactionId(BigInteger.ZERO));
-            rpcResultType = builder.setFlowAndStatisticsMapList(flowsStatistics).build();
-
-            rpcResultBool = true;
-        } catch (ConstructionException e) {
-            LOG.error(e.getMessage());
-        }
-
-        return Futures.immediateFuture(RpcResultBuilder.<GetAllFlowsStatisticsFromAllFlowTablesOutput>
-                                               status(rpcResultBool).withResult(rpcResultType).build());
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<GetFlowStatisticsFromFlowTableOutput>> getFlowStatisticsFromFlowTable(
-            GetFlowStatisticsFromFlowTableInput input) {
-        GetFlowStatisticsFromFlowTableOutput rpcResultType = null;
-        boolean rpcResultBool = false;
-
-        try {
-            Node node = NodeMapping.toADNode(input.getNode());
-            Flow flow = ToSalConversionsUtils.toFlow(input, null);
-            FlowOnNode readFlow = readDelegate.readFlow(node, flow);
-            List<FlowAndStatisticsMapList> flowOnNodeToFlowStatistics = new ArrayList<FlowAndStatisticsMapList>();
-            flowOnNodeToFlowStatistics.add(toOdFlowStatistics(readFlow));
-            rpcResultType = new GetFlowStatisticsFromFlowTableOutputBuilder().setFlowAndStatisticsMapList(flowOnNodeToFlowStatistics).build();
-            rpcResultBool = true;
-        } catch (ConstructionException e) {
-            LOG.error(e.getMessage());
-        }
-
-        return Futures.immediateFuture(RpcResultBuilder.<GetFlowStatisticsFromFlowTableOutput>
-                                              status(rpcResultBool).withResult(rpcResultType).build());
-    }
-
-    @Override
-    public void nodeFlowStatisticsUpdated(Node node, List<FlowOnNode> flowStatsList) {
-        List<FlowAndStatisticsMapList> flowStatistics = toOdFlowsStatistics(flowStatsList);
-        FlowsStatisticsUpdateBuilder flowsStatisticsUpdateBuilder = new FlowsStatisticsUpdateBuilder();
-        flowsStatisticsUpdateBuilder.setFlowAndStatisticsMapList(flowStatistics);
-        flowsStatisticsUpdateBuilder.setMoreReplies(false);
-        flowsStatisticsUpdateBuilder.setTransactionId(null);
-        flowsStatisticsUpdateBuilder.setId(InventoryMapping.toNodeKey(node).getId());
-        notifier.publish(flowsStatisticsUpdateBuilder.build());
-    }
-
-    @Override
-    public void nodeConnectorStatisticsUpdated(Node node, List<NodeConnectorStatistics> ncStatsList) {
-        NodeConnectorStatisticsUpdateBuilder nodeConnectorStatisticsUpdateBuilder = new NodeConnectorStatisticsUpdateBuilder();
-        List<NodeConnectorStatisticsAndPortNumberMap> nodeConnectorStatistics = toOdNodeConnectorStatistics(ncStatsList);
-
-        nodeConnectorStatisticsUpdateBuilder.setNodeConnectorStatisticsAndPortNumberMap(nodeConnectorStatistics);
-        nodeConnectorStatisticsUpdateBuilder.setMoreReplies(false);
-        nodeConnectorStatisticsUpdateBuilder.setTransactionId(null);
-        nodeConnectorStatisticsUpdateBuilder.setId(InventoryMapping.toNodeKey(node).getId());
-        notifier.publish(nodeConnectorStatisticsUpdateBuilder.build());
-    }
-
-    @Override
-    public void nodeTableStatisticsUpdated(Node node, List<NodeTableStatistics> tableStatsList) {
-
-        FlowTableStatisticsUpdateBuilder flowTableStatisticsUpdateBuilder = new FlowTableStatisticsUpdateBuilder();
-
-        List<FlowTableAndStatisticsMap>  flowTableStatistics = toOdFlowTableStatistics(tableStatsList);
-        flowTableStatisticsUpdateBuilder.setFlowTableAndStatisticsMap(flowTableStatistics);
-        flowTableStatisticsUpdateBuilder.setMoreReplies(false);
-        flowTableStatisticsUpdateBuilder.setTransactionId(null);
-        flowTableStatisticsUpdateBuilder.setId(InventoryMapping.toNodeKey(node).getId());
-        notifier.publish(flowTableStatisticsUpdateBuilder.build());
-}
-
-        @Override
-    public void descriptionStatisticsUpdated(Node node, NodeDescription nodeDescription) {
-            // TODO which *StatisticsUpdated interface should be used?
-
-    }
-
-    private List<FlowAndStatisticsMapList> toOdFlowsStatistics(List<FlowOnNode> flowsOnNode) {
-        List<FlowAndStatisticsMapList> flowsStatistics = new ArrayList<>();
-        for (FlowOnNode flowOnNode : flowsOnNode) {
-            flowsStatistics.add(toOdFlowStatistics(flowOnNode));
-        }
-        return flowsStatistics;
-    }
-
-    private FlowAndStatisticsMapList toOdFlowStatistics(FlowOnNode flowOnNode) {
-        FlowAndStatisticsMapListBuilder builder = new FlowAndStatisticsMapListBuilder();
-
-        builder.setByteCount(toCounter64(flowOnNode.getByteCount()));
-        builder.setPacketCount(toCounter64(flowOnNode.getPacketCount()));
-        builder.setDuration(extractDuration(flowOnNode));
-        builder.setMatch(FromSalConversionsUtils.toMatch(flowOnNode.getFlow().getMatch()));
-        builder.setPriority((int)flowOnNode.getFlow().getPriority());
-        builder.setHardTimeout((int)flowOnNode.getFlow().getHardTimeout());
-        builder.setIdleTimeout((int)flowOnNode.getFlow().getIdleTimeout());
-        //TODO: actions to instruction conversion
-        builder.setInstructions(null);
-        return builder.build();
-    }
-
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.Duration extractDuration(FlowOnNode flowOnNode) {
-        DurationBuilder builder = new DurationBuilder();
-        builder.setNanosecond(new Counter32((long)flowOnNode.getDurationNanoseconds()));
-        builder.setSecond(new Counter32((long)flowOnNode.getDurationSeconds()));
-        return builder.build();
-    }
-
-    private Counter64 toCounter64(long num) {
-        String byteCountStr = String.valueOf(num);
-        BigInteger byteCountBigInt = new BigInteger(byteCountStr);
-        return new Counter64(byteCountBigInt);
-    }
-
-    private List<FlowTableAndStatisticsMap> toOdFlowTableStatistics(List<NodeTableStatistics> tableStatsList) {
-
-        List<FlowTableAndStatisticsMap> flowTableStatsMap = new ArrayList<FlowTableAndStatisticsMap>();
-        for (NodeTableStatistics nodeTableStatistics : tableStatsList) {
-            FlowTableAndStatisticsMapBuilder flowTableAndStatisticsMapBuilder = new FlowTableAndStatisticsMapBuilder();
-            flowTableAndStatisticsMapBuilder.setActiveFlows(new Counter32((long) nodeTableStatistics.getActiveCount()));
-            flowTableAndStatisticsMapBuilder.setPacketsLookedUp(toCounter64(nodeTableStatistics.getLookupCount()));
-            flowTableAndStatisticsMapBuilder.setPacketsMatched(toCounter64(nodeTableStatistics.getMatchedCount()));
-            flowTableAndStatisticsMapBuilder.setActiveFlows(new Counter32((long) nodeTableStatistics.getActiveCount()));
-            flowTableAndStatisticsMapBuilder.setTableId(new TableId((short)nodeTableStatistics.getNodeTable().getID()));
-            flowTableStatsMap.add(flowTableAndStatisticsMapBuilder.build());
-        }
-
-        return flowTableStatsMap;
-    }
-
-    private List<NodeConnectorStatisticsAndPortNumberMap> toOdNodeConnectorStatistics(
-            List<NodeConnectorStatistics> ncStatsList) {
-        List<NodeConnectorStatisticsAndPortNumberMap> nodeConnectorStatisticsList = new ArrayList<NodeConnectorStatisticsAndPortNumberMap>();
-        for(NodeConnectorStatistics ofNodeConnectorStatistics : ncStatsList){
-            NodeConnectorStatisticsAndPortNumberMapBuilder nodeConnectorStatisticsAndPortNumberMapBuilder = new NodeConnectorStatisticsAndPortNumberMapBuilder();
-
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setBytes(extractBytes(ofNodeConnectorStatistics));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setCollisionCount(toBI(ofNodeConnectorStatistics.getCollisionCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setDuration(null);
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setPackets(extractPackets(ofNodeConnectorStatistics));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveCrcError(toBI(ofNodeConnectorStatistics.getReceiveCRCErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveDrops(toBI(ofNodeConnectorStatistics.getReceiveDropCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveErrors(toBI(ofNodeConnectorStatistics.getReceiveErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveFrameError(toBI(ofNodeConnectorStatistics.getReceiveFrameErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveOverRunError(toBI(ofNodeConnectorStatistics.getReceiveOverRunErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setTransmitDrops(toBI(ofNodeConnectorStatistics.getTransmitDropCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setTransmitErrors(toBI(ofNodeConnectorStatistics.getTransmitErrorCount()));
-            nodeConnectorStatisticsList.add(nodeConnectorStatisticsAndPortNumberMapBuilder.build());
-        }
-
-        return nodeConnectorStatisticsList;
-    }
-
-    private BigInteger toBI(long num) {
-        String numStr = String.valueOf(num);
-        return new BigInteger(numStr);
-    }
-
-    private Packets extractPackets(NodeConnectorStatistics nodeConnectorStatistics) {
-        long receivePacketCount = nodeConnectorStatistics.getReceivePacketCount();
-        long transmitPacketCount = nodeConnectorStatistics.getTransmitPacketCount();
-
-        PacketsBuilder builder = new PacketsBuilder();
-        builder.setReceived(toBI(receivePacketCount));
-        builder.setTransmitted(toBI(transmitPacketCount));
-
-        return builder.build();
-    }
-
-    private Bytes extractBytes(NodeConnectorStatistics nodeConnectorStatistics) {
-        long transmitByteCount = nodeConnectorStatistics.getTransmitByteCount();
-        long receiveByteCount = nodeConnectorStatistics.getReceiveByteCount();
-
-        BytesBuilder builder = new BytesBuilder();
-        builder.setReceived(toBI(receiveByteCount));
-        builder.setTransmitted(toBI(transmitByteCount));
-
-        return builder.build();
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyAdapter.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyAdapter.java
deleted file mode 100644 (file)
index 0581d15..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.topology;
-
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.topology.IPluginInTopologyService;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import com.google.common.base.Preconditions;
-
-public class TopologyAdapter implements IPluginInTopologyService {
-    private final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class)
-            .child(Topology.class, new TopologyKey(new TopologyId("flow:1"))).toInstance();
-
-    // Injected via Apache DM
-    private IPluginOutTopologyService topologyPublisher;
-
-
-    private DataProviderService dataService;
-
-    public void setDataService(final DataProviderService dataService) {
-        this.dataService = Preconditions.checkNotNull(dataService);
-    }
-
-    @Override
-    public void sollicitRefresh() {
-        final TypeSafeDataReader reader = TypeSafeDataReader.forReader(dataService);
-        final Topology t = reader.readOperationalData(topology);
-        topologyPublisher.edgeUpdate(TopologyMapping.toADEdgeUpdates(t, reader));
-    }
-
-    public IPluginOutTopologyService getTopologyPublisher() {
-        return topologyPublisher;
-    }
-
-    public void setTopologyPublisher(final IPluginOutTopologyService topologyPublisher) {
-        this.topologyPublisher = topologyPublisher;
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyCommitHandler.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyCommitHandler.java
deleted file mode 100644 (file)
index 23471e7..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.topology;
-
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping.toAdEdge;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping.toTopoEdgeUpdate;
-
-import java.util.Map.Entry;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TopologyCommitHandler implements DataChangeListener {
-    private static final Logger LOG = LoggerFactory.getLogger(TopologyCommitHandler.class);
-
-    private IPluginOutTopologyService topologyPublisher;
-
-    private final DataProviderService dataService;
-
-    public TopologyCommitHandler(final DataProviderService dataService, final IPluginOutTopologyService topologyPub) {
-        this.topologyPublisher = topologyPub;
-        this.dataService = dataService;
-    }
-
-    @Override
-    public void onDataChanged(final DataChangeEvent<InstanceIdentifier<?>, DataObject> modification) {
-        CopyOnWriteArrayList<TopoEdgeUpdate> msg = new CopyOnWriteArrayList<TopoEdgeUpdate>();
-        try {
-            TypeSafeDataReader reader = TypeSafeDataReader.forReader(dataService);
-            InstanceIdentifier<Topology> topologyPath = InstanceIdentifier.builder(NetworkTopology.class)
-                    .child(Topology.class, new TopologyKey(new TopologyId("flow:1"))).build();
-            Topology topology = reader.readOperationalData(topologyPath);
-
-            for (Entry<InstanceIdentifier<? extends DataObject>, DataObject> entry : modification
-                    .getCreatedOperationalData().entrySet()) {
-                if (entry.getValue() instanceof Link
-                        && modification.getCreatedOperationalData().containsKey(entry.getKey())) {
-                    msg.add(toTopoEdgeUpdate(toAdEdge((Link) entry.getValue(), topology), UpdateType.ADDED, reader));
-                }
-            }
-
-            for (Entry<InstanceIdentifier<? extends DataObject>, DataObject> entry : modification
-                    .getUpdatedOperationalData().entrySet()) {
-                if (entry.getValue() instanceof Link) {
-                    msg.add(toTopoEdgeUpdate(toAdEdge((Link) entry.getValue(), topology), UpdateType.CHANGED, reader));
-                }
-            }
-            for (InstanceIdentifier<? extends DataObject> path : modification.getRemovedOperationalData()) {
-                if (path.getTargetType() == Link.class) {
-                    Link link = (Link) modification.getOriginalOperationalData().get(path);
-                    msg.add(toTopoEdgeUpdate(toAdEdge(link, topology), UpdateType.REMOVED, reader));
-                }
-
-            }
-
-            if (topologyPublisher != null && msg != null && !msg.isEmpty()) {
-                topologyPublisher.edgeUpdate(msg);
-            }
-
-        } catch (Exception e) {
-            LOG.error("Exception caught", e);
-        }
-    }
-
-    protected IPluginOutTopologyService getTopologyPublisher() {
-        return topologyPublisher;
-    }
-
-    protected void setTopologyPublisher(final IPluginOutTopologyService topologyPublisher) {
-        this.topologyPublisher = topologyPublisher;
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyMapping.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyMapping.java
deleted file mode 100644 (file)
index 9fe78fb..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.topology;
-
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
-
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Edge;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.regex.Pattern;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public final class TopologyMapping {
-    private static final Logger LOG = LoggerFactory.getLogger(TopologyMapping.class);
-    private final static Pattern NUMBERS_ONLY = Pattern.compile("[0-9]+");
-
-    private TopologyMapping() {
-        throw new UnsupportedOperationException("Utility class. Instantiation is not allowed.");
-    }
-
-    public static List<TopoEdgeUpdate> toADEdgeUpdates(final Topology topology,final TypeSafeDataReader reader) {
-        final List<TopoEdgeUpdate> result = new CopyOnWriteArrayList<>();
-        return FluentIterable.from(topology.getLink()).transform(
-                new Function<Link, TopoEdgeUpdate>() {
-                    @Override
-                    public TopoEdgeUpdate apply(final Link input) {
-                        try {
-                            return toTopoEdgeUpdate(toAdEdge(input, topology), reader);
-                        } catch (ConstructionException e) {
-                            throw new IllegalArgumentException(String.format("Failed to construct edge update for {}", input), e);
-                        }
-                    }}
-                ).copyInto(result);
-    }
-
-    public static Edge toAdEdge(final Link link, final Topology topology) throws ConstructionException {
-        final NodeConnector adSrc = toADNodeConnector(link.getSource().getSourceTp(), link.getSource().getSourceNode());
-        final NodeConnector adDst = toADNodeConnector(link.getDestination().getDestTp(), link.getDestination().getDestNode());
-        return new Edge(adSrc, adDst);
-    }
-
-    public static TopoEdgeUpdate toTopoEdgeUpdate(final Edge e, final TypeSafeDataReader reader) {
-        return toTopoEdgeUpdate(e, UpdateType.ADDED, reader);
-    }
-
-    public static TopoEdgeUpdate toTopoEdgeUpdate(final Edge e,final UpdateType type,final TypeSafeDataReader reader) {
-        return new TopoEdgeUpdate(e, toAdEdgeProperties(e, reader), type);
-    }
-
-    public static Set<Property> toAdEdgeProperties(final Edge e,final TypeSafeDataReader reader) {
-        final NodeConnectorRef ncref = NodeMapping.toNodeConnectorRef(e.getTailNodeConnector());
-        if(ncref == null) {
-            LOG.debug("Edge {} ncref {}",e,ncref);
-            return null;
-        }
-
-        @SuppressWarnings("unchecked")
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> ncInstanceId =
-        (InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector>) ncref.getValue();
-        if(ncInstanceId == null) {
-            LOG.debug("Edge {} ncref {}",e,ncref);
-            return null;
-        }
-
-        final  org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc = reader.readOperationalData(ncInstanceId);
-        if(nc == null) {
-            return null;
-        }
-        return NodeMapping.toADNodeConnectorProperties(nc);
-    }
-
-    public static String toADNodeId(final NodeId nodeId) {
-        return nodeId.getValue().replaceFirst("^.*:", "");
-    }
-
-    public static NodeConnector toADNodeConnector(final TpId source, final NodeId nodeId) throws ConstructionException {
-        checkNotNull(source);
-        String nodeConnectorIdStripped = toADNodeConnectorId(source);
-        if (NUMBERS_ONLY.matcher(nodeConnectorIdStripped).matches()) {
-            return new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf(nodeConnectorIdStripped), toADNode(nodeId));
-        }
-        LOG.debug("NodeConnectorId does not match openflow id type, using " + NodeMapping.MD_SAL_TYPE +  "instead");
-        NodeConnectorIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class, NodeMapping.MD_SAL_TYPE);
-        return new NodeConnector(NodeMapping.MD_SAL_TYPE, nodeConnectorIdStripped, toADNode(nodeId));
-    }
-
-    public static String toADNodeConnectorId(final TpId nodeConnectorId) {
-        return nodeConnectorId.getValue().replaceFirst("^.*:", "");
-    }
-
-    public static Node toADNode(final NodeId nodeId) throws ConstructionException {
-        checkNotNull(nodeId);
-        String nodeIdStripped = toADNodeId(nodeId);
-        if (NUMBERS_ONLY.matcher(nodeIdStripped).matches()) {
-            return new Node(NodeIDType.OPENFLOW, Long.valueOf(nodeIdStripped));
-        }
-        LOG.debug("NodeId does not match openflow id type, using " + NodeMapping.MD_SAL_TYPE +  "instead");
-        NodeIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class);
-        return new Node(NodeMapping.MD_SAL_TYPE, nodeId.getValue());
-    }
-}
diff --git a/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyProvider.java b/legacy/sal-compatibility/src/main/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/TopologyProvider.java
deleted file mode 100644 (file)
index 5d0976e..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.topology;
-
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-public class TopologyProvider implements AutoCloseable{
-    private static final Logger LOG = LoggerFactory.getLogger(TopologyProvider.class);
-    private static final InstanceIdentifier<Link> PATH = InstanceIdentifier.builder(NetworkTopology.class)
-            .child(Topology.class ,new TopologyKey(new TopologyId("flow:1")))
-            .child(Link.class)
-            .toInstance();
-    private TopologyCommitHandler commitHandler;
-
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-    private IPluginOutTopologyService topologyPublisher;
-    private DataProviderService dataService;
-
-    public void startAdapter() {
-        if(dataService == null){
-            LOG.error("dataService not set");
-            return;
-        }
-        commitHandler = new TopologyCommitHandler(dataService,topologyPublisher);
-        listenerRegistration = dataService.registerDataChangeListener(PATH, commitHandler);
-        LOG.info("TopologyProvider started");
-    }
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            listenerRegistration.close();
-        }
-    }
-
-    void setTopologyPublisher(final IPluginOutTopologyService topologyPublisher) {
-        this.topologyPublisher = topologyPublisher;
-        if (commitHandler != null) {
-            commitHandler.setTopologyPublisher(topologyPublisher);
-        }
-    }
-
-    public void setDataService(final DataProviderService dataService) {
-        this.dataService = Preconditions.checkNotNull(dataService);
-    }
-}
diff --git a/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/FromSalConversionsUtilsTest.java b/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/FromSalConversionsUtilsTest.java
deleted file mode 100644 (file)
index 54d7a0a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.FromSalConversionsUtils;
-
-/**
- * test of {@link FromSalConversionsUtils}
- */
-public class FromSalConversionsUtilsTest {
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.FromSalConversionsUtils#dscpToTos(int)}.
-     */
-    @Test
-    public void testDscpToTos() {
-        Assert.assertEquals(0, FromSalConversionsUtils.dscpToTos(0));
-        Assert.assertEquals(4, FromSalConversionsUtils.dscpToTos(1));
-        Assert.assertEquals(252, FromSalConversionsUtils.dscpToTos(63));
-        Assert.assertEquals(256, FromSalConversionsUtils.dscpToTos(64));
-        Assert.assertEquals(-4, FromSalConversionsUtils.dscpToTos(-1));
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/MDFlowMappingTest.java b/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/MDFlowMappingTest.java
deleted file mode 100644 (file)
index e759e82..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.controller.sal.action.Action;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.utils.EtherTypes;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.MDFlowMapping;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-
-/**
- * test for {@link MDFlowMapping}
- */
-public class MDFlowMappingTest {
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.MDFlowMapping#toUri(org.opendaylight.controller.sal.core.NodeConnector)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToUri() throws ConstructionException {
-        Node node = new Node(NodeIDType.OPENFLOW, 41L);
-        NodeConnector connector = new NodeConnector(NodeConnectorIDType.OPENFLOW, (short) 42, node);
-        Uri observed = MDFlowMapping.toUri(connector );
-
-        Assert.assertEquals("openflow:41:42", observed.getValue());
-    }
-
-    /**
-     * Test method for {@link MDFlowMapping#toAction(Action, int)}.
-     */
-    @Test
-    public void testToAction() {
-        // PUSH_VLAN test.
-        EtherTypes[] tags = {EtherTypes.VLANTAGGED, EtherTypes.QINQ};
-        int order = 0;
-        for (EtherTypes tag: tags) {
-            Action action = new PushVlan(tag);
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.
-                rev131112.action.list.Action mdActionList =
-                MDFlowMapping.toAction(action, order);
-            Assert.assertEquals(order, mdActionList.getOrder().intValue());
-
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.
-                rev131112.action.Action mdAction = mdActionList.getAction();
-            Assert.assertTrue(mdAction instanceof PushVlanActionCase);
-            PushVlanActionCase pushVlan = (PushVlanActionCase)mdAction;
-            Assert.assertEquals(tag.intValue(),
-                                pushVlan.getPushVlanAction().getEthernetType().
-                                intValue());
-            order++;
-        }
-    }
-}
diff --git a/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/NodeMappingTest.java b/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/NodeMappingTest.java
deleted file mode 100644 (file)
index babf62f..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/**
- * Copyright (c) 2013 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.MacAddress;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * test of {@link NodeMapping} utility class
- */
-public class NodeMappingTest {
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toADMacAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)}
-     * .
-     */
-    @Test
-    public void testToADMacAddress() {
-        NodeId[] nodeIds = new NodeId[] {
-                // 0x0000|0000 0000002a (answer to the ultimate question of life, universe and everything)
-                new NodeId("42"),
-                // 0x7fff|ffff ffffffff (max long -> 2**63 - 1)
-                new NodeId("9223372036854775807"),
-                // 0x7fff|7fff ffffffff
-                new NodeId("9223231299366420479"),
-                // 0x8fff|7fff ffffffff (more than biggest positive long)
-                new NodeId("10376152803973267455"),
-                // 0xca13|764a e9ace65a (BUG-770)
-                new NodeId("14561112084339025498")
-        };
-
-        byte[][] expectedMacs = new byte[][] {
-                {0, 0, 0, 0, 0, 0x2a},
-                {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff},
-                {(byte) 0x7f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff},
-                {(byte) 0x7f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff},
-                {(byte) 0x76, (byte) 0x4a, (byte) 0xe9, (byte) 0xac, (byte) 0xe6, (byte) 0x5a}
-        };
-
-        Assert.assertEquals(expectedMacs.length, nodeIds.length);
-
-        for (int i = 0; i < expectedMacs.length; i++) {
-            NodeId nodeId = nodeIds[i];
-            MacAddress mac = NodeMapping.toADMacAddress(nodeId);
-            Assert.assertArrayEquals(expectedMacs[i], mac.getMacAddress());
-        }
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toAdNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)}
-     * .
-     */
-    @Test
-    public void testToAdNodeId() {
-        NodeId observed;
-        observed = NodeMapping.toAdNodeId(null);
-        Assert.assertNull(observed);
-
-        observed = NodeMapping.toAdNodeId(new NodeConnectorId("openflow:5:2"));
-        Assert.assertEquals("openflow:5", observed.getValue());
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toADNode(NodeId)}
-     * .
-     */
-    @Test
-    public void testToAdNode1() {
-        org.opendaylight.controller.sal.core.Node observed;
-        try {
-            observed = NodeMapping.toADNode((NodeId) null);
-        } catch (NullPointerException | ConstructionException e) {
-            //expected
-        }
-
-        NodeId nodeId = new NodeId("openflow:1");
-        try {
-            observed = NodeMapping.toADNode(nodeId);
-            Assert.assertEquals("OF|00:00:00:00:00:00:00:01", observed.toString());
-        } catch (ConstructionException e) {
-            Assert.fail("should succeed to construct Node: "+e.getMessage());
-        }
-
-        final String nodeUriPrefix = "opendaylight-inventory:nodes/node/";
-        nodeId = new NodeId(nodeUriPrefix + "iosv-2");
-        try {
-            observed = NodeMapping.toADNode(nodeId);
-            Assert.assertEquals("PR|opendaylight-inventory:nodes/node/iosv-2", observed.toString());
-        } catch (ConstructionException e) {
-            Assert.fail("should succeed to construct Node: "+e.getMessage());
-        }
-
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toNodeConnectorType(NodeConnectorId, NodeId)}
-     * .
-     */
-    @Test
-    public void testToNodeConnectorType() {
-        NodeConnectorId ncId;
-        NodeId nodeId = buildNodeId("1");
-
-        ncId = buildNodeConnectorId("1", "42");
-        Assert.assertEquals(NodeConnectorIDType.OPENFLOW, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-
-        ncId = buildNodeConnectorId("1", OutputPortValues.CONTROLLER.toString());
-        Assert.assertEquals(NodeConnectorIDType.CONTROLLER, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-
-        ncId = buildNodeConnectorId("1", OutputPortValues.NORMAL.toString());
-        Assert.assertEquals(NodeConnectorIDType.HWPATH, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-
-        ncId = buildNodeConnectorId("1", OutputPortValues.LOCAL.toString());
-        Assert.assertEquals(NodeConnectorIDType.SWSTACK, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toADNodeConnectorId(NodeConnectorId, NodeId)}
-     * .
-     */
-    @Test
-    public void testToAdNodeConnectorId() {
-        NodeConnectorId nodeConnectorId = buildNodeConnectorId("1", "2");
-        NodeId nodeId = buildNodeId("1");
-        Assert.assertEquals(Short.valueOf((short) 2), NodeMapping.toADNodeConnectorId(nodeConnectorId , nodeId));
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toNodeRef(Node)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToNodeRef() throws ConstructionException {
-        org.opendaylight.controller.sal.core.Node node = new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, 42L);
-        InstanceIdentifier<?> nodePath = NodeMapping.toNodeRef(node).getValue();
-
-        String observedId = nodePath.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
-        Assert.assertEquals("openflow:42", observedId);
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toNodeConnectorRef(org.opendaylight.controller.sal.core.NodeConnector)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToNodeConnectorRef() throws ConstructionException {
-        org.opendaylight.controller.sal.core.Node node = new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, 42L);
-        org.opendaylight.controller.sal.core.NodeConnector nodeConnector =
-                new org.opendaylight.controller.sal.core.NodeConnector(
-                        NodeConnectorIDType.OPENFLOW, (short) 1, node);
-
-        InstanceIdentifier<?> nodeConnectorPath = NodeMapping.toNodeConnectorRef(nodeConnector ).getValue();
-        String observedNodeId = nodeConnectorPath.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
-        Assert.assertEquals("openflow:42", observedNodeId);
-
-        String observedNodeConnectorId = nodeConnectorPath.firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue();
-        Assert.assertEquals("openflow:1", observedNodeConnectorId);
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#openflowFullNodeIdToLong(String)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testOpenflowFullNodeIdToLong() throws ConstructionException {
-        Assert.assertEquals(42L, NodeMapping.openflowFullNodeIdToLong("42").longValue());
-        Assert.assertEquals(0xCC4E241C4A000000L, NodeMapping.openflowFullNodeIdToLong("14721743935839928320").longValue());
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#toNodeKey(org.opendaylight.controller.sal.core.Node)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToNodeKey() throws ConstructionException {
-        org.opendaylight.controller.sal.core.Node aDNode = new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, 42L);
-        NodeKey nodeKey = NodeMapping.toNodeKey(aDNode);
-        Assert.assertEquals("openflow:42", nodeKey.getId().getValue());
-    }
-    
-    /**
-     * Test method for
-     * {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.NodeMapping#stripToColon(NodeConnectorId)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testStripToColon() {
-        Assert.assertEquals("1", NodeMapping.stripToColon("openflow:42:1"));
-        Assert.assertEquals("1", NodeMapping.stripToColon("openflow:1"));
-        Assert.assertEquals("1", NodeMapping.stripToColon("1"));
-    }
-    /**
-     * @param nodeId
-     * @param portId
-     * @return nodeConnectorId
-     */
-    public static NodeConnectorId buildNodeConnectorId(String nodeId, String portId) {
-        return new NodeConnectorId(NodeConnectorIDType.OPENFLOW+"|" + nodeId + ":" + portId);
-    }
-
-    /**
-     * @param id
-     * @return nodeId
-     */
-    public static NodeId buildNodeId(String id) {
-        return new NodeId(NodeConnectorIDType.OPENFLOW+"|" + id);
-    }
-}
diff --git a/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/TestFromSalConversionsUtils.java b/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/TestFromSalConversionsUtils.java
deleted file mode 100644 (file)
index 211fd9c..0000000
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2013-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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.UDP;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.action.Action;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.match.Match;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.MDFlowMapping;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
-
-import com.google.common.net.InetAddresses;
-
-public class TestFromSalConversionsUtils {
-    private enum MtchType {
-        other, untagged, ipv4, ipv6, arp, sctp, tcp, udp
-    }
-
-    @Test
-    public void testFromSalConversion() throws ConstructionException {
-
-        Flow salFlow = prepareSalFlowCommon();
-        NodeFlow odNodeFlow = MDFlowMapping.flowAdded(salFlow);
-
-        checkOdFlow(odNodeFlow);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.other));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.other);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.untagged));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.untagged);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.arp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.arp);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.ipv4));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.ipv4);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.ipv6));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.ipv6);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.sctp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.sctp);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.tcp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.tcp);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.udp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.udp);
-    }
-
-    private void checkOdMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match match,
-            MtchType mt) {
-        switch (mt) {
-        case arp:
-            assertEquals("Ether type is incorrect.", ETHERNET_ARP, (long) match.getEthernetMatch().getEthernetType()
-                    .getType().getValue());
-            Layer3Match layer3Match = match.getLayer3Match();
-            boolean arpFound = false;
-            if (layer3Match instanceof ArpMatch) {
-                assertEquals("Source IP address is wrong.", "192.168.100.100/32", ((ArpMatch) layer3Match)
-                        .getArpSourceTransportAddress().getValue());
-                assertEquals("Destination IP address is wrong.", "192.168.100.101/32", ((ArpMatch) layer3Match)
-                        .getArpTargetTransportAddress().getValue());
-                assertEquals("Source MAC address is wrong.", "ff:ee:dd:cc:bb:aa", ((ArpMatch) layer3Match)
-                        .getArpSourceHardwareAddress().getAddress().getValue());
-                assertEquals("Destination MAC address is wrong.", "ff:ee:dd:cc:bb:aa", ((ArpMatch) layer3Match)
-                        .getArpTargetHardwareAddress().getAddress().getValue());
-                arpFound = true;
-            }
-            assertNotNull("Arp wasn't found", arpFound);
-            break;
-        case ipv4:
-            assertEquals("Ether type is incorrect.", 0xffff, (long) match.getEthernetMatch().getEthernetType()
-                    .getType().getValue());
-            boolean ipv4Found = false;
-            layer3Match = match.getLayer3Match();
-            if (layer3Match instanceof Ipv4Match) {
-                assertEquals("Source IP address is wrong.", "192.168.100.102/32", ((Ipv4Match) layer3Match)
-                        .getIpv4Source().getValue());
-                assertEquals("Destination IP address is wrong.", "192.168.100.103/32", ((Ipv4Match) layer3Match)
-                        .getIpv4Destination().getValue());
-            }
-            assertNotNull("Ipv4 wasn't found", ipv4Found);
-            break;
-        case ipv6:
-            assertEquals("Ether type is incorrect.", 0xffff, (long) match.getEthernetMatch().getEthernetType()
-                    .getType().getValue());
-            boolean ipv6Found = false;
-            layer3Match = match.getLayer3Match();
-            if (layer3Match instanceof Ipv6Match) {
-                assertEquals("Source IP address is wrong.", "2001:db8:85a3::8a2e:370:7335/128", ((Ipv6Match) layer3Match)
-                        .getIpv6Source().getValue());
-                assertEquals("Destination IP address is wrong.", "2001:db8:85a3::8a2e:370:7336/128",
-                        ((Ipv6Match) layer3Match).getIpv6Destination().getValue());
-            }
-            assertNotNull("Ipv6 wasn't found", ipv6Found);
-            break;
-        case other:
-            assertEquals("Incoming port is wrong.", "openflow:12345:10", match.getInPort().getValue());
-            assertEquals("Source MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetSource().getAddress().getValue());
-            assertEquals("Destinatio MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetDestination().getAddress().getValue());
-            assertEquals("Vlan ID is not present.", Boolean.TRUE, match.getVlanMatch().getVlanId().isVlanIdPresent());
-            assertEquals("Vlan ID is wrong.", (Integer) 0xfff, match.getVlanMatch().getVlanId().getVlanId().getValue());
-            assertEquals("Vlan ID priority is wrong.", (short) 0x7, (short) match.getVlanMatch().getVlanPcp()
-                    .getValue());
-            assertEquals("DCSP is wrong.", (short) 0x3f, (short) match.getIpMatch().getIpDscp().getValue());
-            break;
-        case untagged:
-            assertEquals("Source MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetSource().getAddress().getValue());
-            assertEquals("Destinatio MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetDestination().getAddress().getValue());
-            assertEquals("Vlan ID is present.", Boolean.FALSE, match.getVlanMatch().getVlanId().isVlanIdPresent());
-            assertEquals("Vlan ID is wrong.", Integer.valueOf(0), match.getVlanMatch().getVlanId().getVlanId().getValue());
-            assertEquals("DCSP is wrong.", (short) 0x3f, (short) match.getIpMatch().getIpDscp().getValue());
-            break;
-        case sctp:
-            boolean sctpFound = false;
-            assertEquals("Wrong protocol", CRUDP, match.getIpMatch().getIpProtocol().byteValue());
-            Layer4Match layer4Match = match.getLayer4Match();
-            if (layer4Match instanceof SctpMatch) {
-                assertEquals("Sctp source port is incorrect.", 0xffff, (int) ((SctpMatch) layer4Match)
-                        .getSctpSourcePort().getValue());
-                assertEquals("Sctp dest port is incorrect.", 0xfffe, (int) ((SctpMatch) layer4Match)
-                        .getSctpDestinationPort().getValue());
-                sctpFound = true;
-            }
-            assertNotNull("Sctp wasn't found", sctpFound);
-            break;
-        case tcp:
-            boolean tcpFound = false;
-            assertEquals("Wrong protocol", TCP, match.getIpMatch().getIpProtocol().byteValue());
-            layer4Match = match.getLayer4Match();
-            if (layer4Match instanceof TcpMatch) {
-                assertEquals("Tcp source port is incorrect.", 0xabcd, (int) ((TcpMatch) layer4Match)
-                        .getTcpSourcePort().getValue());
-                assertEquals("Tcp dest port is incorrect.", 0xdcba, (int) ((TcpMatch) layer4Match)
-                        .getTcpDestinationPort().getValue());
-                sctpFound = true;
-            }
-            assertNotNull("Tcp wasn't found", tcpFound);
-            break;
-        case udp:
-            boolean udpFound = false;
-            assertEquals("Wrong protocol", UDP, match.getIpMatch().getIpProtocol().byteValue());
-            layer4Match = match.getLayer4Match();
-            if (layer4Match instanceof UdpMatch) {
-                assertEquals("Udp source port is incorrect.", 0xcdef, (int) ((UdpMatch) layer4Match)
-                        .getUdpSourcePort().getValue());
-                assertEquals("Udp dest port is incorrect.", 0xfedc, (int) ((UdpMatch) layer4Match)
-                        .getUdpDestinationPort().getValue());
-                sctpFound = true;
-            }
-            assertNotNull("Udp wasn't found", udpFound);
-            break;
-        }
-
-    }
-
-    private void checkOdFlow(NodeFlow odNodeFlow) {
-        assertEquals("Cookie is incorrect.", 9223372036854775807L, odNodeFlow.getCookie().getValue().longValue());
-        assertEquals("Hard timeout is incorrect.", 32765, odNodeFlow.getHardTimeout().shortValue());
-        assertEquals("Iddle timeout is incorrect.", 32766, odNodeFlow.getIdleTimeout().shortValue());
-        assertEquals("Priority is incorrect.", 32767, odNodeFlow.getPriority().shortValue());
-
-        checkOdActions(ToSalConversionsUtils.getAction(odNodeFlow));
-    }
-
-    private void checkOdActions(
-            List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions) {
-        checkOdAction(actions, FloodActionCase.class);
-        checkOdAction(actions, FloodAllActionCase.class);
-        checkOdAction(actions, HwPathActionCase.class);
-        checkOdAction(actions, LoopbackActionCase.class);
-        checkOdAction(actions, PopVlanActionCase.class);
-        checkOdAction(actions, PushVlanActionCase.class);
-        checkOdAction(actions, SetDlDstActionCase.class);
-        checkOdAction(actions, SetDlSrcActionCase.class);
-        checkOdAction(actions, SetDlTypeActionCase.class);
-        checkOdAction(actions, SetNwTosActionCase.class);
-        checkOdAction(actions, SetNwDstActionCase.class);
-        checkOdAction(actions, SetNwSrcActionCase.class);
-        checkOdAction(actions, SetNextHopActionCase.class);
-        checkOdAction(actions, SetTpDstActionCase.class);
-        checkOdAction(actions, SetTpSrcActionCase.class);
-        checkOdAction(actions, SetVlanCfiActionCase.class);
-        checkOdAction(actions, SetVlanIdActionCase.class);
-        checkOdAction(actions, SetVlanPcpActionCase.class);
-        checkOdAction(actions, SwPathActionCase.class);
-    }
-
-    private void checkOdAction(
-            List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions, Class<?> cl) {
-        int numOfFoundActions = 0;
-        for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action action : actions) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action innerAction = action
-                    .getAction();
-            if (cl.isInstance(innerAction)) {
-                numOfFoundActions++;
-                if (innerAction instanceof PushVlanActionCase) {
-                    assertEquals("Wrong value of tag in PushVlanAction.", (Integer) 0x8100,
-                            ((PushVlanActionCase) innerAction).getPushVlanAction().getEthernetType());
-                } else if (innerAction instanceof SetDlDstActionCase) {
-                    assertEquals("Wrong MAC destination address in SetDlDstAction.", "ff:ee:dd:cc:bb:aa",
-                            ((SetDlDstActionCase) innerAction).getSetDlDstAction().getAddress().getValue());
-                } else if (innerAction instanceof SetDlSrcActionCase) {
-                    assertEquals("Wrong MAC source address in SetDlDstAction.", "ff:ee:dd:cc:bb:aa",
-                            ((SetDlSrcActionCase) innerAction).getSetDlSrcAction().getAddress().getValue());
-                } else if (innerAction instanceof SetDlTypeActionCase) {
-                    assertEquals("Wrong data link type in SetDlTypeAction.", 513,
-                            (long) ((SetDlTypeActionCase) innerAction).getSetDlTypeAction().getDlType().getValue());
-                } else if (innerAction instanceof SetNextHopActionCase) {
-                    Address address = ((SetNextHopActionCase) innerAction).getSetNextHopAction().getAddress();
-                    boolean ipv4AddressFound = false;
-                    if (address instanceof Ipv4) {
-                        ipv4AddressFound = true;
-                        assertEquals("Wrong IP address type in SetNextHopAction.", "192.168.100.100/32", ((Ipv4) address)
-                                .getIpv4Address().getValue());
-                    }
-                    assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
-                } else if (innerAction instanceof SetNwTosActionCase) {
-                    assertEquals("Wrong TOS in SetNwTosAction.", (Integer) 252, ((SetNwTosActionCase) innerAction).getSetNwTosAction().getTos());
-                } else if (innerAction instanceof SetNwDstActionCase) {
-                    Address address = ((SetNwDstActionCase) innerAction).getSetNwDstAction().getAddress();
-                    boolean ipv4AddressFound = false;
-                    if (address instanceof Ipv4) {
-                        ipv4AddressFound = true;
-                        assertEquals("Wrong IP address type in SetNwDstAction.", "192.168.100.101/32", ((Ipv4) address)
-                                .getIpv4Address().getValue());
-                    }
-                    assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
-                } else if (innerAction instanceof SetNwSrcActionCase) {
-                    Address address = ((SetNwSrcActionCase) innerAction).getSetNwSrcAction().getAddress();
-                    boolean ipv4AddressFound = false;
-                    if (address instanceof Ipv4) {
-                        ipv4AddressFound = true;
-                        assertEquals("Wrong IP address type in SetNwSrcAction.", "192.168.100.102/32", ((Ipv4) address)
-                                .getIpv4Address().getValue());
-                    }
-                    assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
-                } else if (innerAction instanceof SetTpDstActionCase) {
-                    assertEquals("Port number is incorrect in SetTpDstAction.", (Integer) 65534,
-                            ((SetTpDstActionCase) innerAction).getSetTpDstAction().getPort().getValue());
-                } else if (innerAction instanceof SetTpSrcActionCase) {
-                    assertEquals("Port number is incorrect in SetTpSrcAction.", (Integer) 65535,
-                            ((SetTpSrcActionCase) innerAction).getSetTpSrcAction().getPort().getValue());
-                } else if (innerAction instanceof SetVlanCfiActionCase) {
-                    assertEquals("Vlan cfi number is incorrect in SetVlanCfiAction.", (Integer) 1,
-                            ((SetVlanCfiActionCase) innerAction).getSetVlanCfiAction().getVlanCfi().getValue());
-                } else if (innerAction instanceof SetVlanIdActionCase) {
-                    assertEquals("Vlan id number is incorrect in SetVlanIdAction.", (Integer) 4095,
-                            ((SetVlanIdActionCase) innerAction).getSetVlanIdAction().getVlanId().getValue());
-                } else if (innerAction instanceof SetVlanPcpActionCase) {
-                    assertEquals("Vlan pcp number is incorrect in SetVlanPcpAction.", new Short((short) 7),
-                            ((SetVlanPcpActionCase) innerAction).getSetVlanPcpAction().getVlanPcp().getValue());
-                }
-            }
-        }
-        assertEquals("Incorrrect number of action " + cl.getName() + ".", 1, numOfFoundActions);
-
-    }
-
-    private Flow prepareSalFlowCommon() {
-        Flow salFlow = new Flow();
-        salFlow.setId(9223372036854775807L);
-        salFlow.setHardTimeout((short) 32765);
-        salFlow.setIdleTimeout((short) 32766);
-        salFlow.setPriority((short) 32767);
-        salFlow.setActions(prepareSalActions());
-        salFlow.setMatch(new Match());
-
-        return salFlow;
-    }
-
-    private Flow prepareSalMatch(Flow salFlow, MtchType mt) throws ConstructionException {
-        Match salMatch = new Match();
-        switch (mt) {
-        case arp:
-            salMatch.setField(MatchType.DL_TYPE, ETHERNET_ARP);
-            salMatch.setField(MatchType.NW_SRC, InetAddresses.forString("192.168.100.100"));
-            salMatch.setField(MatchType.NW_DST, InetAddresses.forString("192.168.100.101"));
-            salMatch.setField(MatchType.DL_SRC, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_DST, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            break;
-        case ipv4:
-            salMatch.setField(MatchType.DL_TYPE, (short) 0xffff);
-            salMatch.setField(MatchType.NW_SRC, InetAddresses.forString("192.168.100.102"));
-            salMatch.setField(MatchType.NW_DST, InetAddresses.forString("192.168.100.103"));
-            break;
-        case ipv6:
-            salMatch.setField(MatchType.DL_TYPE, (short) 0xffff);
-            salMatch.setField(MatchType.NW_SRC, InetAddresses.forString("2001:0db8:85a3:0000:0000:8a2e:0370:7335"));
-            salMatch.setField(MatchType.NW_DST, InetAddresses.forString("2001:0db8:85a3:0000:0000:8a2e:0370:7336"));
-            break;
-        case other:
-            Node node = new Node(NodeIDType.OPENFLOW, 12345L);
-            NodeConnector port = new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf((short)10), node);
-            salMatch.setField(MatchType.IN_PORT, port);
-            salMatch.setField(MatchType.DL_SRC, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_DST, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_VLAN, (short) 0xfff);
-            salMatch.setField(MatchType.DL_VLAN_PR, (byte) 0x7);
-            salMatch.setField(MatchType.NW_TOS, (byte) 0x3f);
-            break;
-        case untagged:
-            salMatch.setField(MatchType.DL_SRC, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_DST, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_VLAN, MatchType.DL_VLAN_NONE);
-            salMatch.setField(MatchType.NW_TOS, (byte) 0x3f);
-            break;
-        case sctp:
-            salMatch.setField(MatchType.NW_PROTO, CRUDP);
-            salMatch.setField(MatchType.TP_SRC, (short) 0xffff);
-            salMatch.setField(MatchType.TP_DST, (short) 0xfffe);
-            break;
-        case tcp:
-            salMatch.setField(MatchType.NW_PROTO, TCP);
-            salMatch.setField(MatchType.TP_SRC, (short) 0xabcd);
-            salMatch.setField(MatchType.TP_DST, (short) 0xdcba);
-            break;
-        case udp:
-            salMatch.setField(MatchType.NW_PROTO, UDP);
-            salMatch.setField(MatchType.TP_SRC, (short) 0xcdef);
-            salMatch.setField(MatchType.TP_DST, (short) 0xfedc);
-            break;
-        default:
-            break;
-
-        }
-
-        salFlow.setMatch(salMatch);
-        return salFlow;
-    }
-
-    private List<Action> prepareSalActions() {
-        List<Action> salActions = new ArrayList<>();
-        salActions.add(new Flood());
-        salActions.add(new FloodAll());
-        salActions.add(new HwPath());
-        salActions.add(new Loopback());
-        // salActions.add(new Output //TODO: mapping is missing
-        salActions.add(new PopVlan());
-        salActions.add(new PushVlan(0x8100));
-        salActions.add(new SetDlDst(new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa}));
-        salActions.add(new SetDlSrc(new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa}));
-        salActions.add(new SetDlType(513));
-        salActions.add(new SetNextHop(InetAddresses.forString("192.168.100.100")));
-        salActions.add(new SetNwDst(InetAddresses.forString("192.168.100.101")));
-        salActions.add(new SetNwSrc(InetAddresses.forString("192.168.100.102")));
-        salActions.add(new SetNwTos(63));
-        salActions.add(new SetTpDst(65534));
-        salActions.add(new SetTpSrc(65535));
-        salActions.add(new SetVlanCfi(1));
-        salActions.add(new SetVlanId(4095));
-        salActions.add(new SetVlanPcp(7));
-        salActions.add(new SwPath());
-
-        return salActions;
-    }
-
-}
diff --git a/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/TestToSalConversionsUtils.java b/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/TestToSalConversionsUtils.java
deleted file mode 100644 (file)
index 60e5645..0000000
+++ /dev/null
@@ -1,749 +0,0 @@
-/*
- * Copyright (c) 2013-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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.openflowplugin.legacy.sal.compatibility.ProtocolConstants.UDP;
-
-import com.google.common.net.InetAddresses;
-import java.math.BigInteger;
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.junit.Test;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.Output;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestination;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSource;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
-
-public class TestToSalConversionsUtils {
-    // prefix:
-    // od|Od = Open Daylight
-    private enum MtchType {
-        other, untagged, ipv4, ipv6, arp, sctp, tcp, udp
-    }
-
-    @Test
-    public void testToSalConversion() throws ConstructionException {
-        FlowAddedBuilder odNodeFlowBuilder = new FlowAddedBuilder();
-        odNodeFlowBuilder = prepareOdFlowCommon();
-
-        final Node node = new Node(NodeIDType.OPENFLOW,(long)1);
-
-        Flow salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.other), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.other);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.untagged), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.untagged);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.ipv4), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.ipv4);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.ipv6), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.ipv6);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.arp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.arp);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.sctp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.sctp);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.tcp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.tcp);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.udp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.udp);
-
-        checkSalFlow(salFlow);
-    }
-
-    /**
-     * test of {@link ToSalConversionsUtils#fromNodeConnectorRef(Uri, Node)}
-     * @throws ConstructionException
-     */
-    @Test
-    public void testFromNodeConnectorRef() throws ConstructionException {
-        final Node node = new Node(NodeIDType.OPENFLOW, 42L);
-        final NodeConnector nodeConnector = ToSalConversionsUtils.fromNodeConnectorRef(new Uri("1"), node);
-        assertEquals("OF|1@OF|00:00:00:00:00:00:00:2a", nodeConnector.toString());
-    }
-
-    @Test
-    public void testActionFrom() throws ConstructionException {
-        // Bug 2021: Convert AD-SAL notation into MD-SAL notation before calling NodeConnector
-        final Node node = new Node(NodeIDType.OPENFLOW, 42L);
-        final List<Action> odActions = new ArrayList<>();
-
-        final OutputActionBuilder outputActionBuilder = new OutputActionBuilder();
-        outputActionBuilder.setOutputNodeConnector(new Uri("openflow:42:CONTROLLER"));
-        final OutputActionCaseBuilder outputActionCaseBuilder = new OutputActionCaseBuilder();
-        outputActionCaseBuilder.setOutputAction(outputActionBuilder.build());
-        odActions.add(new ActionBuilder().setAction(outputActionCaseBuilder.build()).build());
-
-        final List<org.opendaylight.controller.sal.action.Action> targetAction =
-                ToSalConversionsUtils.actionFrom(odActions, node);
-        assertNotNull(targetAction);
-        assertTrue( Output.class.isInstance(targetAction.get(0)) );
-        final Output targetActionOutput = (Output) targetAction.get(0);
-        final NodeConnector port = targetActionOutput.getPort();
-        assertNotNull(port);
-        assertEquals(port.getType(), NodeConnectorIDType.CONTROLLER);
-        assertEquals(port.getID(), org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID);
-    }
-
-    private void checkSalMatch(final org.opendaylight.controller.sal.match.Match match, final MtchType mt) throws ConstructionException {
-        switch (mt) {
-        case other:
-            /*assertNotNull("DL_DST isn't equal.", "3C:A9:F4:00:E0:C8",
-                    new String((byte[]) match.getField(MatchType.DL_DST).getValue()));
-            assertEquals("DL_SRC isn't equal.", "24:77:03:7C:C5:F1",
-                    new String((byte[]) match.getField(MatchType.DL_SRC).getValue()));
-            */
-            final Node node = new Node(NodeIDType.OPENFLOW, 12L);
-            final NodeConnector port = new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf((short)345), node);
-            assertEquals("IN_PORT isn't equal.", port, match.getField(MatchType.IN_PORT).getValue());
-            assertEquals("DL_TYPE isn't equal.", (short) 0xffff, (short) match.getField(MatchType.DL_TYPE).getValue());
-            assertEquals("NW_TOS isn't equal.", (byte) 0x33, (byte) match.getField(MatchType.NW_TOS).getValue());
-            assertEquals("NW_PROTO isn't equal.", (byte) 0x3f, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            assertEquals("DL_VLAN isn't equal.", (short) 0xfff, (short) match.getField(MatchType.DL_VLAN).getValue());
-            assertEquals("DL_VLAN_PR isn't equal.", (byte) 0x7, (byte) match.getField(MatchType.DL_VLAN_PR).getValue());
-            break;
-        case untagged:
-            assertEquals("DL_TYPE isn't equal.", (short) 0xffff, (short) match.getField(MatchType.DL_TYPE).getValue());
-            assertEquals("NW_TOS isn't equal.", (byte) 0x33, (byte) match.getField(MatchType.NW_TOS).getValue());
-            assertEquals("NW_PROTO isn't equal.", (byte) 0x3f, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            assertEquals("DL_VLAN isn't equal.", MatchType.DL_VLAN_NONE, (short) match.getField(MatchType.DL_VLAN).getValue());
-            break;
-        case arp:
-            /*
-            assertEquals("DL_SRC isn't equal.", "22:44:66:88:AA:CC",
-                    new String((byte[]) match.getField(MatchType.DL_SRC).getValue()));
-            assertEquals("DL_DST isn't equal.", "11:33:55:77:BB:DD",
-                    new String((byte[]) match.getField(MatchType.DL_DST).getValue()));
-            */
-            assertEquals("NW_SRC isn't equal.", "192.168.1.101",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_SRC).getValue()));
-            assertEquals("NW_DST isn't equal.", "192.168.1.102",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_DST).getValue()));
-            assertEquals("DL_TYPE isn't equal.", ETHERNET_ARP, match.getField(MatchType.DL_TYPE).getValue());
-            break;
-        case ipv4:
-            assertEquals("NW_SRC isn't equal.", "192.168.1.104",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_SRC).getValue()));
-            assertEquals("NW_DST isn't equal.", "192.168.1.105",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_DST).getValue()));
-            break;
-        case ipv6:
-            assertEquals("NW_SRC isn't equal.", "3001:db8:85a3::8a2e:370:7334",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_SRC).getValue()));
-            assertEquals("NW_DST isn't equal.", "3001:db8:85a3::8a2e:370:7335",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_DST).getValue()));
-            break;
-        case sctp:
-            assertEquals("TP_SRC isn't equal.", 31, (short) match.getField(MatchType.TP_SRC).getValue());
-            assertEquals("TP_DST isn't equal.", 32, (short) match.getField(MatchType.TP_DST).getValue());
-            assertEquals("NW_PROTO isn't equal.", CRUDP, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            break;
-        case tcp:
-            assertEquals("TP_SRC isn't equal.", 21, (short) match.getField(MatchType.TP_SRC).getValue());
-            assertEquals("TP_DST isn't equal.", 22, (short) match.getField(MatchType.TP_DST).getValue());
-            assertEquals("NW_PROTO isn't equal.", TCP, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            break;
-        case udp:
-            assertEquals("TP_SRC isn't equal.", 11, (short) match.getField(MatchType.TP_SRC).getValue());
-            assertEquals("TP_DST isn't equal.", 12, (short) match.getField(MatchType.TP_DST).getValue());
-            assertEquals("NW_PROTO isn't equal.", UDP, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            break;
-        default:
-            break;
-
-        }
-
-    }
-
-    private void checkSalFlow(final Flow salFlow) {
-        assertTrue("Id value is incorrect.", salFlow.getId() == 9223372036854775807L);
-        assertTrue("Hard timeout is incorrect.", salFlow.getHardTimeout() == 32767);
-        assertTrue("Iddle timeout is incorrect.", salFlow.getIdleTimeout() == 32767);
-        assertTrue("Priority value is incorrect.", salFlow.getPriority() == 32767);
-
-        checkSalActions(salFlow.getActions());
-    }
-
-    private void checkSalActions(final List<org.opendaylight.controller.sal.action.Action> actions) {
-        checkSalAction(actions, Flood.class, 1);
-        checkSalAction(actions, FloodAll.class, 1);
-        checkSalAction(actions, HwPath.class, 1);
-        checkSalAction(actions, Loopback.class, 1);
-        checkSalAction(actions, Output.class, 1, true);
-        checkSalAction(actions, PopVlan.class, 1);
-        checkSalAction(actions, PushVlan.class, 1, true);
-        checkSalAction(actions, SetDlDst.class, 1, true);
-        checkSalAction(actions, SetDlSrc.class, 1, true);
-        checkSalAction(actions, SetDlType.class, 1, true);
-        checkSalAction(actions, SetNextHop.class, 2, true);
-        checkSalAction(actions, SetNwDst.class, 2, true);
-        checkSalAction(actions, SetNwSrc.class, 2, true);
-        checkSalAction(actions, SetNwTos.class, 1, true);
-        checkSalAction(actions, SetTpDst.class, 1, true);
-        checkSalAction(actions, SetTpSrc.class, 1, true);
-        checkSalAction(actions, SetVlanCfi.class, 1, true);
-        checkSalAction(actions, SetVlanId.class, 1, true);
-        checkSalAction(actions, SetVlanPcp.class, 1, true);
-        checkSalAction(actions, SwPath.class, 1);
-    }
-
-    private void checkSalAction(final List<org.opendaylight.controller.sal.action.Action> actions, final Class<?> cls,
-            final int numOfActions) {
-        checkSalAction(actions, cls, numOfActions, false);
-    }
-
-    private void checkSalAction(final List<org.opendaylight.controller.sal.action.Action> actions, final Class<?> cls,
-            final int numOfActions, final boolean additionalCheck) {
-        int numOfEqualClass = 0;
-        for (final org.opendaylight.controller.sal.action.Action action : actions) {
-            if (action.getClass().equals(cls)) {
-                if (additionalCheck) {
-                    additionalActionCheck(action);
-                }
-                numOfEqualClass++;
-            }
-        }
-        assertEquals("Incorrect number of actions of type " + cls.getName() + " was found.", numOfActions,
-                numOfEqualClass);
-    }
-
-    // implement special checks
-    private void additionalActionCheck(final org.opendaylight.controller.sal.action.Action action) {
-        if (action instanceof Output) {
-            // ((Output)action).getPort() //TODO finish check when mapping will
-            // be defined
-        } else if (action instanceof PushVlan) {
-            assertEquals("Wrong value for action PushVlan for tag.", 0x8100, ((PushVlan) action).getTag());
-        } else if (action instanceof SetDlDst) {
-            //assertEquals("Wrong value for action SetDlDst for MAC address.", "3C:A9:F4:00:E0:C8", new String(
-            //        ((SetDlDst) action).getDlAddress()));
-        } else if (action instanceof SetDlSrc) {
-            //assertEquals("Wrong value for action SetDlSrc for MAC address.", "24:77:03:7C:C5:F1", new String(
-            //      ((SetDlSrc) action).getDlAddress()));
-        } else if (action instanceof SetDlType) {
-            assertEquals("Wrong value for action SetDlType for.", 513L, ((SetDlType) action).getDlType());
-        } else if (action instanceof SetNextHop) {
-            final InetAddress inetAddress = ((SetNextHop) action).getAddress();
-            checkIpAddresses(inetAddress, "192.168.100.100", "2001:db8:85a3::8a2e:370:7334");
-        } else if (action instanceof SetNwDst) {
-            final InetAddress inetAddress = ((SetNwDst) action).getAddress();
-            checkIpAddresses(inetAddress, "192.168.100.101", "2001:db8:85a3::8a2e:370:7335");
-        } else if (action instanceof SetNwSrc) {
-            final InetAddress inetAddress = ((SetNwSrc) action).getAddress();
-            checkIpAddresses(inetAddress, "192.168.100.102", "2001:db8:85a3::8a2e:370:7336");
-        } else if (action instanceof SetNwTos) {
-            assertEquals("Wrong value for action SetNwTos for tos.", 63, ((SetNwTos) action).getNwTos());
-        } else if (action instanceof SetTpDst) {
-            assertEquals("Wrong value for action SetTpDst for port.", 65535, ((SetTpDst) action).getPort());
-        } else if (action instanceof SetTpSrc) {
-            assertEquals("Wrong value for action SetTpSrc for port.", 65535, ((SetTpSrc) action).getPort());
-        } else if (action instanceof SetVlanCfi) {
-            assertEquals("Wrong value for action SetVlanCfi for port.", 1, ((SetVlanCfi) action).getCfi());
-        } else if (action instanceof SetVlanId) {
-            assertEquals("Wrong value for action SetVlanId for vlan ID.", 4095, ((SetVlanId) action).getVlanId());
-        } else if (action instanceof SetVlanPcp) {
-            assertEquals("Wrong value for action SetVlanPcp for vlan ID.", 7, ((SetVlanPcp) action).getPcp());
-        }
-    }
-
-    private void checkIpAddresses(final InetAddress inetAddress, final String ipv4, final String ipv6) {
-        if (inetAddress instanceof Inet4Address) {
-            assertEquals("Wrong value for IP address.", ipv4, InetAddresses.toAddrString(inetAddress));
-        } else if (inetAddress instanceof Inet6Address) {
-            assertEquals("Wrong value for IP address.", ipv6, InetAddresses.toAddrString(inetAddress));
-        }
-    }
-
-    private FlowAddedBuilder prepareOdFlowCommon() {
-        final FlowAddedBuilder odNodeFlowBuilder = new FlowAddedBuilder();
-
-        odNodeFlowBuilder.setCookie(new FlowCookie(new BigInteger("9223372036854775807")));
-        odNodeFlowBuilder.setHardTimeout(32767);
-        odNodeFlowBuilder.setIdleTimeout(32767);
-        odNodeFlowBuilder.setPriority(32767);
-        odNodeFlowBuilder.setInstructions(prepareOdActions());
-        return odNodeFlowBuilder;
-    }
-
-    private NodeFlow prepareOdFlow(final FlowAddedBuilder odNodeFlowBuilder, final MtchType mt) {
-        odNodeFlowBuilder.setMatch(prepOdMatch(mt));
-        return odNodeFlowBuilder.build();
-    }
-
-    private Instructions prepareOdActions() {
-        final List<Action> odActions = new ArrayList<>();
-
-        final ControllerActionCaseBuilder controllerActionBuilder = new ControllerActionCaseBuilder();
-        final DropActionCaseBuilder dropActionBuilder = new DropActionCaseBuilder();
-        final FloodActionCaseBuilder floodActionBuilder = new FloodActionCaseBuilder();
-        final FloodAllActionCaseBuilder floodAllActionBuilder = new FloodAllActionCaseBuilder();
-        final HwPathActionCaseBuilder hwPathActionBuilder = new HwPathActionCaseBuilder();
-        final LoopbackActionCaseBuilder loopbackActionBuilder = new LoopbackActionCaseBuilder();
-        final OutputActionCaseBuilder outputActionBuilder = new OutputActionCaseBuilder();
-        final PopMplsActionCaseBuilder popMplsActionBuilder = new PopMplsActionCaseBuilder();
-        final PopVlanActionCaseBuilder popVlanActionBuilder = new PopVlanActionCaseBuilder();
-        final PushMplsActionCaseBuilder pushMplsActionBuilder = new PushMplsActionCaseBuilder();
-        final PushPbbActionCaseBuilder pushPbbActionBuilder = new PushPbbActionCaseBuilder();
-        final PushVlanActionCaseBuilder pushVlanActionBuilder = new PushVlanActionCaseBuilder();
-        final SetDlDstActionCaseBuilder setDlDstActionBuilder = new SetDlDstActionCaseBuilder();
-        final SetDlSrcActionCaseBuilder setDlSrcActionBuilder = new SetDlSrcActionCaseBuilder();
-        final SetDlTypeActionCaseBuilder setDlTypeActionBuilder = new SetDlTypeActionCaseBuilder();
-        final SetMplsTtlActionCaseBuilder setMplsTtlActionBuilder = new SetMplsTtlActionCaseBuilder();
-        final SetNwTosActionCaseBuilder setNwTosActionBuilder = new SetNwTosActionCaseBuilder();
-        final SetNwTtlActionCaseBuilder setNwTtlActionBuilder = new SetNwTtlActionCaseBuilder();
-        final SetQueueActionCaseBuilder setQueueActionBuilder = new SetQueueActionCaseBuilder();
-        final SetTpDstActionCaseBuilder setTpDstActionBuilder = new SetTpDstActionCaseBuilder();
-        final SetTpSrcActionCaseBuilder setTpSrcActionBuilder = new SetTpSrcActionCaseBuilder();
-        final SetVlanCfiActionCaseBuilder setVlanCfiActionBuilder = new SetVlanCfiActionCaseBuilder();
-        final SetVlanIdActionCaseBuilder setVlanIdActionBuilder = new SetVlanIdActionCaseBuilder();
-        final SetVlanPcpActionCaseBuilder setVlanPcpActionBuilder = new SetVlanPcpActionCaseBuilder();
-        final SwPathActionCaseBuilder swPathActionBuilder = new SwPathActionCaseBuilder();
-
-        prepareActionOutput(outputActionBuilder);
-        prepareActionPushVlan(pushVlanActionBuilder);
-        prepareActionSetDlDst(setDlDstActionBuilder);
-        prepareActionSetDlSrc(setDlSrcActionBuilder);
-        prepareActionSetDlType(setDlTypeActionBuilder);
-        prepareActionNextHop(odActions);
-        prepareActionSetNwDst(odActions);
-        prepareActionSetNwSrc(odActions);
-        prepareActionSetNwTos(setNwTosActionBuilder);
-        prepareActionSetTpDst(setTpDstActionBuilder);
-        prepareActionSetTpSrc(setTpSrcActionBuilder);
-        prepareActionSetVlanCfi(setVlanCfiActionBuilder);
-        prepareActionSetVladId(setVlanIdActionBuilder);
-        prepareActionSetVlanPcp(setVlanPcpActionBuilder);
-
-        odActions.add(new ActionBuilder().setAction(controllerActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(dropActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(floodActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(floodAllActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(hwPathActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(loopbackActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(outputActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(popMplsActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(popVlanActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(pushMplsActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(pushPbbActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(pushVlanActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setDlDstActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setDlSrcActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setDlTypeActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setMplsTtlActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setNwTosActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setNwTtlActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setQueueActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setTpDstActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setTpSrcActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setVlanCfiActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setVlanIdActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setVlanPcpActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(swPathActionBuilder.build()).build());
-
-
-        final ApplyActionsCase innerInst = new ApplyActionsCaseBuilder().setApplyActions(new ApplyActionsBuilder().setAction(odActions).build()).build();
-        final Instruction applyActions = new InstructionBuilder().setInstruction(innerInst).build();
-        final List<Instruction> instructions = Collections.singletonList(applyActions );
-        final InstructionsBuilder instBuilder = new InstructionsBuilder();
-
-        instBuilder.setInstruction(instructions);
-
-        return instBuilder.build();
-    }
-
-    private void prepareActionSetVlanPcp(final SetVlanPcpActionCaseBuilder wrapper) {
-        final SetVlanPcpActionBuilder setVlanPcpActionBuilder = new SetVlanPcpActionBuilder();
-        setVlanPcpActionBuilder.setVlanPcp(new VlanPcp((short) 7));
-        wrapper.setSetVlanPcpAction(setVlanPcpActionBuilder.build());
-    }
-
-    private void prepareActionSetVladId(final SetVlanIdActionCaseBuilder wrapper) {
-        final SetVlanIdActionBuilder setVlanIdActionBuilder = new SetVlanIdActionBuilder();
-        setVlanIdActionBuilder.setVlanId(new VlanId(4095));
-        wrapper.setSetVlanIdAction(setVlanIdActionBuilder.build());
-    }
-
-    private void prepareActionSetVlanCfi(final SetVlanCfiActionCaseBuilder wrapper) {
-        final SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
-        setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(1));
-        wrapper.setSetVlanCfiAction(setVlanCfiActionBuilder.build());
-    }
-
-    private void prepareActionSetTpDst(final SetTpDstActionCaseBuilder wrapper) {
-        final SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
-        setTpDstActionBuilder.setPort(new PortNumber(65535));
-        wrapper.setSetTpDstAction(setTpDstActionBuilder.build());
-    }
-
-    private void prepareActionSetTpSrc(final SetTpSrcActionCaseBuilder wrapper) {
-        final SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
-        setTpSrcActionBuilder.setPort(new PortNumber(65535));
-        wrapper.setSetTpSrcAction(setTpSrcActionBuilder.build());
-    }
-
-    private void prepareActionSetNwTos(final SetNwTosActionCaseBuilder wrapper) {
-        final SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
-        setNwTosActionBuilder.setTos(252);
-        wrapper.setSetNwTosAction(setNwTosActionBuilder.build());
-    }
-
-    private void prepareActionSetNwSrc(final List<Action> odActions) {
-        // test case for IPv4
-        final SetNwSrcActionBuilder setNwSrcActionBuilderIpv4 = new SetNwSrcActionBuilder();
-        setNwSrcActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.102"));
-        odActions.add(new ActionBuilder().setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwSrcActionBuilderIpv4.build()).build()).build());
-
-        // test case for IPv6
-        final SetNwSrcActionBuilder setNwSrcActionBuilderIpv6 = new SetNwSrcActionBuilder();
-        setNwSrcActionBuilderIpv6.setAddress(prapareIpv6Prefix("2001:0db8:85a3:0000:0000:8a2e:0370:7336/128"));
-        odActions.add(new ActionBuilder().setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwSrcActionBuilderIpv6.build()).build()).build());
-    }
-
-    private void prepareActionSetNwDst(final List<Action> odActions) {
-        // test case for IPv4
-
-        final SetNwDstActionBuilder setNwDstActionBuilderIpv4 = new SetNwDstActionBuilder();
-        setNwDstActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.101"));
-        odActions.add(new ActionBuilder().setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilderIpv4.build()).build()).build());
-
-        // test case for IPv6
-        final SetNwDstActionBuilder setNwDstActionBuilderIpv6 = new SetNwDstActionBuilder();
-        setNwDstActionBuilderIpv6.setAddress(prapareIpv6Prefix("2001:0db8:85a3:0000:0000:8a2e:0370:7335/128"));
-        odActions.add(new ActionBuilder().setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilderIpv6.build()).build()).build());
-    }
-
-    private void prepareActionNextHop(final List<Action> odActions) {
-        // test case for IPv4
-        final SetNextHopActionBuilder setNextHopActionBuilderIpv4 = new SetNextHopActionBuilder();
-        setNextHopActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.100"));
-        odActions.add(new ActionBuilder().setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilderIpv4.build()).build()).build());
-
-        // test case for IPv6
-        final SetNextHopActionBuilder setNextHopActionBuilderIpv6 = new SetNextHopActionBuilder();
-        setNextHopActionBuilderIpv6.setAddress(prapareIpv6Prefix("2001:0db8:85a3:0000:0000:8a2e:0370:7334/128"));
-        odActions.add(new ActionBuilder().setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilderIpv6.build()).build()).build());
-    }
-
-    private Address prapareIpv4Address(final String ipv4Address) {
-        final Ipv4Builder ipv4Builder = new Ipv4Builder();
-        ipv4Builder.setIpv4Address(new Ipv4Prefix(ipv4Address + "/32"));
-        return ipv4Builder.build();
-    }
-
-    private Address prapareIpv6Prefix(final String ipv6Address) {
-        final Ipv6Builder ipv6Builder = new Ipv6Builder();
-        ipv6Builder.setIpv6Address(new Ipv6Prefix(ipv6Address));
-        return ipv6Builder.build();
-    }
-
-    private void prepareActionSetDlType(final SetDlTypeActionCaseBuilder wrapper) {
-        final SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
-        setDlTypeActionBuilder.setDlType(new EtherType(513L));
-        wrapper.setSetDlTypeAction(setDlTypeActionBuilder.build());
-    }
-
-    private void prepareActionSetDlSrc(final SetDlSrcActionCaseBuilder wrapper) {
-        final SetDlSrcActionBuilder setDlSrcActionBuilder = new SetDlSrcActionBuilder();
-        setDlSrcActionBuilder.setAddress(new MacAddress("24:77:03:7C:C5:F1"));
-        wrapper.setSetDlSrcAction(setDlSrcActionBuilder.build());
-    }
-
-    private void prepareActionSetDlDst(final SetDlDstActionCaseBuilder wrapper) {
-        final SetDlDstActionBuilder setDlDstActionBuilder = new SetDlDstActionBuilder();
-        setDlDstActionBuilder.setAddress(new MacAddress("3C:A9:F4:00:E0:C8"));
-        wrapper.setSetDlDstAction(setDlDstActionBuilder.build());
-    }
-
-    private void prepareActionPushVlan(final PushVlanActionCaseBuilder wrapper) {
-        final PushVlanActionBuilder pushVlanActionBuilder = new PushVlanActionBuilder();
-        pushVlanActionBuilder.setTag(0x8100); // 12 bit
-        wrapper.setPushVlanAction(pushVlanActionBuilder.build());
-    }
-
-    private void prepareActionOutput(final OutputActionCaseBuilder wrapper) {
-        final OutputActionBuilder outputActionBuilder = new OutputActionBuilder();
-        outputActionBuilder.setOutputNodeConnector(new Uri("openflow:1:1"));
-        wrapper.setOutputAction(outputActionBuilder.build());
-    }
-
-    private Match prepOdMatch(final MtchType mt) {
-        final MatchBuilder odMatchBuilder = new MatchBuilder();
-        switch (mt) {
-        case other:
-            odMatchBuilder.setInPort(new NodeConnectorId("openflow:12:345"));
-            odMatchBuilder.setEthernetMatch(prepEthernetMatch());
-            odMatchBuilder.setIpMatch(prepIpMatch());
-            odMatchBuilder.setVlanMatch(prepVlanMatch());
-            break;
-        case untagged:
-            odMatchBuilder.setEthernetMatch(prepEthernetMatch());
-            odMatchBuilder.setIpMatch(prepIpMatch());
-            odMatchBuilder.setVlanMatch(prepVlanNoneMatch());
-            break;
-        case ipv4:
-            odMatchBuilder.setLayer3Match(prepLayer3MatchIpv4());
-            break;
-        case ipv6:
-            odMatchBuilder.setLayer3Match(prepLayer3MatchIpv6());
-            break;
-        case arp:
-            odMatchBuilder.setLayer3Match(prepLayer3MatchArp());
-            break;
-        case sctp:
-            odMatchBuilder.setLayer4Match(prepLayer4MatchSctp());
-            break;
-        case tcp:
-            odMatchBuilder.setLayer4Match(prepLayer4MatchTcp());
-            break;
-        case udp:
-            odMatchBuilder.setLayer4Match(prepLayer4MatchUdp());
-            break;
-        }
-        return odMatchBuilder.build();
-    }
-
-    private Layer4Match prepLayer4MatchUdp() {
-        final UdpMatchBuilder udpMatchBuilder = new UdpMatchBuilder();
-
-        udpMatchBuilder.setUdpSourcePort(new PortNumber(11));
-        udpMatchBuilder.setUdpDestinationPort(new PortNumber(12));
-
-        return udpMatchBuilder.build();
-    }
-
-    private Layer4Match prepLayer4MatchTcp() {
-        final TcpMatchBuilder tcpMatchBuilder = new TcpMatchBuilder();
-
-        tcpMatchBuilder.setTcpSourcePort(new PortNumber(21));
-        tcpMatchBuilder.setTcpDestinationPort(new PortNumber(22));
-
-        return tcpMatchBuilder.build();
-    }
-
-    private Layer4Match prepLayer4MatchSctp() {
-        final SctpMatchBuilder sctpMatchBuilder = new SctpMatchBuilder();
-
-        sctpMatchBuilder.setSctpSourcePort(new PortNumber(31));
-        sctpMatchBuilder.setSctpDestinationPort(new PortNumber(32));
-
-        return sctpMatchBuilder.build();
-    }
-
-    private Layer3Match prepLayer3MatchIpv4() {
-        final Ipv4MatchBuilder ipv4MatchBuilder = new Ipv4MatchBuilder();
-        ipv4MatchBuilder.setIpv4Source(new Ipv4Prefix("192.168.1.104/32"));
-        ipv4MatchBuilder.setIpv4Destination(new Ipv4Prefix("192.168.1.105/32"));
-        return ipv4MatchBuilder.build();
-    }
-
-    private Layer3Match prepLayer3MatchIpv6() {
-        final Ipv6MatchBuilder ipv6MatchBuilder = new Ipv6MatchBuilder();
-        ipv6MatchBuilder.setIpv6Source(new Ipv6Prefix("3001:0db8:85a3:0000:0000:8a2e:0370:7334/128"));
-        ipv6MatchBuilder.setIpv6Destination(new Ipv6Prefix("3001:0db8:85a3:0000:0000:8a2e:0370:7335/128"));
-        return ipv6MatchBuilder.build();
-    }
-
-    private Layer3Match prepLayer3MatchArp() {
-        final ArpMatchBuilder arpMatchBuilder = new ArpMatchBuilder();
-        arpMatchBuilder.setArpSourceTransportAddress(new Ipv4Prefix("192.168.1.101/32"));
-        arpMatchBuilder.setArpTargetTransportAddress(new Ipv4Prefix("192.168.1.102/32"));
-
-        final ArpSourceHardwareAddressBuilder arpSourAddressBuild = new ArpSourceHardwareAddressBuilder();
-        arpSourAddressBuild.setAddress(new MacAddress("22:44:66:88:AA:CC"));
-        arpMatchBuilder.setArpSourceHardwareAddress(arpSourAddressBuild.build());
-
-        final ArpTargetHardwareAddressBuilder arpTarAddressBuild = new ArpTargetHardwareAddressBuilder();
-        arpTarAddressBuild.setAddress(new MacAddress("11:33:55:77:BB:DD"));
-        arpMatchBuilder.setArpTargetHardwareAddress(arpTarAddressBuild.build());
-        return arpMatchBuilder.build();
-    }
-
-    private VlanMatch prepVlanMatch() {
-        final VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
-
-        final VlanIdBuilder vlanIdBuilder = new VlanIdBuilder().setVlanId(new VlanId(0xfff));
-        vlanMatchBuilder.setVlanId(vlanIdBuilder.setVlanIdPresent(true).build());
-        vlanMatchBuilder.setVlanPcp(new VlanPcp((short) 0x7));
-
-        return vlanMatchBuilder.build();
-    }
-
-    private VlanMatch prepVlanNoneMatch() {
-        final VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
-
-        final VlanIdBuilder vlanIdBuilder = new VlanIdBuilder().
-            setVlanIdPresent(false);
-        vlanMatchBuilder.setVlanId(vlanIdBuilder.build());
-
-        return vlanMatchBuilder.build();
-    }
-
-    private IpMatch prepIpMatch() {
-        final IpMatchBuilder ipMatchBuilder = new IpMatchBuilder();
-        ipMatchBuilder.setIpDscp(new Dscp((short) 0x33));
-        ipMatchBuilder.setIpProtocol((short) 0x3f);
-        return ipMatchBuilder.build();
-    }
-
-    private EthernetMatch prepEthernetMatch() {
-        final EthernetMatchBuilder odEthernetMatchBuilder = new EthernetMatchBuilder();
-        odEthernetMatchBuilder.setEthernetDestination(prepEthDest());
-        odEthernetMatchBuilder.setEthernetSource(prepEthSour());
-        odEthernetMatchBuilder.setEthernetType(prepEthType());
-        return odEthernetMatchBuilder.build();
-    }
-
-    private EthernetType prepEthType() {
-        final EthernetTypeBuilder ethTypeBuild = new EthernetTypeBuilder();
-        ethTypeBuild.setType(new EtherType(0xffffL));
-        return ethTypeBuild.build();
-    }
-
-    private EthernetSource prepEthSour() {
-        final EthernetSourceBuilder ethSourBuild = new EthernetSourceBuilder();
-        ethSourBuild.setAddress(new MacAddress("24:77:03:7C:C5:F1"));
-        return ethSourBuild.build();
-    }
-
-    private EthernetDestination prepEthDest() {
-        final EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder();
-        ethDestBuild.setAddress(new MacAddress("3C:A9:F4:00:E0:C8"));
-        return ethDestBuild.build();
-    }
-}
diff --git a/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/ToSalConversionsUtilsTest.java b/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/test/ToSalConversionsUtilsTest.java
deleted file mode 100644 (file)
index e928870..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.ToSalConversionsUtils;
-
-/**
- * test of {@link ToSalConversionsUtils}
- */
-public class ToSalConversionsUtilsTest {
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.ToSalConversionsUtils#tosToNwDscp(int)}.
-     */
-    @Test
-    public void testTosToNwDscp() {
-        Assert.assertEquals(0, ToSalConversionsUtils.tosToNwDscp(0));
-        Assert.assertEquals(0, ToSalConversionsUtils.tosToNwDscp(1));
-        Assert.assertEquals(1, ToSalConversionsUtils.tosToNwDscp(4));
-        Assert.assertEquals(63, ToSalConversionsUtils.tosToNwDscp(252));
-        Assert.assertEquals(63, ToSalConversionsUtils.tosToNwDscp(253));
-        Assert.assertEquals(-1, ToSalConversionsUtils.tosToNwDscp(-1));
-    }
-}
diff --git a/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/test/TopologyMappingTest.java b/legacy/sal-compatibility/src/test/java/org/opendaylight/openflowplugin/legacy/sal/compatibility/topology/test/TopologyMappingTest.java
deleted file mode 100644 (file)
index cfe8720..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * 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
- */
-package org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.test;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-
-/**
- * test for {@link TopologyMapping}
- */
-public class TopologyMappingTest {
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping#toADNodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     */
-    @Test
-    public void testToADNodeId() {
-        NodeId nodeId = new NodeId("openflow:1");
-        String observedNodeId = TopologyMapping.toADNodeId(nodeId);
-
-        assertEquals("1", observedNodeId);
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping#toADNodeConnector(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToADNodeConnector() throws ConstructionException {
-        NodeId nodeId = new NodeId("openflow:1");
-        TpId source = new TpId("foo:2");
-        NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
-
-        assertEquals("OF|2@OF|00:00:00:00:00:00:00:01", observedNodeConnector.toString());
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping#toADNodeConnectorId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId)}.
-     */
-    @Test
-    public void testToADNodeConnectorId() {
-        TpId source = new TpId("foo:2");
-        String observedNodeConnectorId = TopologyMapping.toADNodeConnectorId(source);
-
-        assertEquals("2", observedNodeConnectorId);
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping#toADNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToADNode() throws ConstructionException {
-        NodeId nodeId = new NodeId("openflow:1");
-        Node observedNode = TopologyMapping.toADNode(nodeId);
-
-        assertEquals("OF|00:00:00:00:00:00:00:01", observedNode.toString());
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.legacy.sal.compatibility.topology.TopologyMapping#toADNodeConnector(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void bug1309ToADNodeConnector() throws ConstructionException {
-        NodeId nodeId = new NodeId("some_unknown_node");
-        TpId source = new TpId("192.168.0.1");
-        NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
-
-        assertEquals("MD_SAL_DEPRECATED|192.168.0.1@MD_SAL_DEPRECATED|some_unknown_node", observedNodeConnector.toString());
-    }
-
-}
diff --git a/pom.xml b/pom.xml
index 915e6bbd8cf2f23c153ef679fb347fd2f90e82b6..16c487db3a50166e76d0d8a696704cf7e2d0b49a 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -42,6 +42,5 @@
       <module>samples/learning-switch</module>
       <module>applications</module>
       <module>model</module>
-      <module>legacy</module>
   </modules>
 </project>