Added Compatibility for Switch Manager and Topology Manager 75/2375/6
authorTony Tkacik <ttkacik@cisco.com>
Tue, 5 Nov 2013 07:05:13 +0000 (08:05 +0100)
committerEd Warnicke <eaw@cisco.com>
Thu, 7 Nov 2013 10:11:48 +0000 (04:11 -0600)
  - Created model-topology under controller for easier
    retrieval of topology models (baseline model is ietf draft
    and is present in YANGTools git).
  - Added aggregate topology view
  - Added mapping to inventory

Change-Id: I26d73415bd19478984908d34d77a476a7a842c9f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
36 files changed:
opendaylight/distribution/opendaylight/pom.xml
opendaylight/md-sal/compatibility/flow-management-compatibility/pom.xml [moved from opendaylight/md-sal/flow-management-compatibility/pom.xml with 94% similarity]
opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/FRMRuntimeDataProvider.xtend [moved from opendaylight/md-sal/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/FRMRuntimeDataProvider.xtend with 98% similarity]
opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/FlowConfigMapping.xtend [moved from opendaylight/md-sal/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/FlowConfigMapping.xtend with 89% similarity]
opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/FlowManagementReader.java [moved from opendaylight/md-sal/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/FlowManagementReader.java with 100% similarity]
opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/SampleConsumer.java [new file with mode: 0644]
opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml [new file with mode: 0644]
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend [new file with mode: 0644]
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/ConfigurableSwitchManager.xtend [new file with mode: 0644]
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/AdSalTopologyMapping.xtend [new file with mode: 0644]
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/CompatibleTopologyManager.xtend [new file with mode: 0644]
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/ConfigurableLinkManager.xtend [new file with mode: 0644]
opendaylight/md-sal/compatibility/pom.xml [new file with mode: 0644]
opendaylight/md-sal/compatibility/sal-compatibility/pom.xml [moved from opendaylight/md-sal/sal-compability/pom.xml with 65% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.xtend [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/ComponentActivator.xtend with 97% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/DataPacketAdapter.xtend [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/DataPacketAdapter.xtend with 93% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/FlowProgrammerAdapter.xtend with 93% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/FromSalConversionsUtils.java with 98% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.xtend [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/InventoryAndReadAdapter.xtend with 98% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.xtend [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/MDFlowMapping.xtend with 98% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.xtend [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/NodeMapping.xtend with 98% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ProtocolConstants.java [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/ProtocolConstants.java with 88% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/ToSalConversionsUtils.java with 98% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/DataPacketServiceAdapter.java [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/adsal/DataPacketServiceAdapter.java with 92% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowServiceAdapter.java [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/adsal/FlowServiceAdapter.java with 94% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowStatisticsAdapter.java [moved from opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/adsal/FlowStatisticsAdapter.java with 98% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java [moved from opendaylight/md-sal/sal-compability/src/test/java/org/opendaylight/controller/sal/compability/TestFromSalConversionsUtils.java with 85% similarity]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java [moved from opendaylight/md-sal/sal-compability/src/test/java/org/opendaylight/controller/sal/compability/TestToSalConversionsUtils.java with 82% similarity]
opendaylight/md-sal/model/model-topology/pom.xml [new file with mode: 0644]
opendaylight/md-sal/model/model-topology/src/main/yang/opendaylight-topology-inventory.yang [new file with mode: 0644]
opendaylight/md-sal/model/model-topology/src/main/yang/opendaylight-topology.yang [new file with mode: 0644]
opendaylight/md-sal/model/model-topology/src/main/yang/topology-view.yang [new file with mode: 0644]
opendaylight/md-sal/model/pom.xml
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-binding-util/pom.xml [new file with mode: 0644]
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java [new file with mode: 0644]

index 4482df0..9b07f75 100644 (file)
@@ -81,7 +81,7 @@
         </dependency>
         <dependency>
           <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-compability</artifactId>
+          <artifactId>sal-compatibility</artifactId>
           <version>${mdsal.version}</version>
         </dependency>
         <dependency>
@@ -2,8 +2,8 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>sal-parent</artifactId>
+     <groupId>org.opendaylight.controller</groupId>
+    <artifactId>compatibility-parent</artifactId>
     <version>1.0-SNAPSHOT</version>
   </parent>
   <artifactId>flow-management-compatibility</artifactId>
@@ -81,7 +81,7 @@
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-compability</artifactId>
+      <artifactId>sal-compatibility</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
 
@@ -15,7 +15,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.Flows
 import org.opendaylight.controller.forwardingrulesmanager.IForwardingRulesManager
 import static com.google.common.base.Preconditions.*;
 import static extension org.opendaylight.controller.md.frm.compatibility.FlowConfigMapping.*;
-import static extension org.opendaylight.controller.sal.compability.NodeMapping.*;
+import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*;
 import org.opendaylight.controller.sal.common.util.Arguments
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem
 import org.opendaylight.yangtools.yang.common.RpcResult
@@ -3,9 +3,9 @@ package org.opendaylight.controller.md.frm.compatibility
 import org.opendaylight.controller.forwardingrulesmanager.FlowConfig
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.flows.FlowBuilder
 
-import static extension org.opendaylight.controller.sal.compability.NodeMapping.*
-import static org.opendaylight.controller.sal.compability.MDFlowMapping.*
-import static org.opendaylight.controller.sal.compability.ToSalConversionsUtils.*
+import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
+import static org.opendaylight.controller.sal.compatibility.MDFlowMapping.*
+import static org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils.*
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.flows.FlowKey
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.flows.Flow
diff --git a/opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/SampleConsumer.java b/opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/SampleConsumer.java
new file mode 100644 (file)
index 0000000..a82eedc
--- /dev/null
@@ -0,0 +1,38 @@
+package org.opendaylight.controller.md.frm.compatibility;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
+import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
+import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.Flows;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.flows.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.flows.FlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.flows.FlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+public class SampleConsumer {
+
+    ConsumerContext context;
+
+    void addFlowExample() {
+
+        DataBrokerService dataService = context.getSALService(DataBrokerService.class);
+
+        DataModificationTransaction transaction = dataService.beginTransaction();
+        Flow flow = createSampleFlow("foo", null);
+        InstanceIdentifier<Flow> path = InstanceIdentifier.builder().node(Flows.class).node(Flow.class, flow.getKey())
+                .toInstance();
+        transaction.putConfigurationData(path, flow);
+
+        transaction.commit();
+
+        dataService.readConfigurationData(path);
+    }
+
+    Flow createSampleFlow(String name, NodeRef node) {
+        FlowBuilder ret = new FlowBuilder();
+        FlowKey key = new FlowKey(name, node);
+        ret.setKey(key);
+        return ret.build();
+    }
+}
diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml
new file mode 100644 (file)
index 0000000..d9fb18f
--- /dev/null
@@ -0,0 +1,109 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>compatibility-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>inventory-topology-compatibility</artifactId>
+    <packaging>bundle</packaging>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Name>Forwarding Rules Manager Adapter
+                            for MD-SAL</Bundle-Name>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.eclipse.xtend</groupId>
+                <artifactId>xtend-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-common-util</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-api</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>switchmanager</artifactId>
+            <version>0.6.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>topologymanager</artifactId>
+            <version>0.4.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.xtend</groupId>
+            <artifactId>org.eclipse.xtend.lib</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.model</groupId>
+            <artifactId>model-flow-management</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-util</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.model</groupId>
+            <artifactId>model-topology</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>forwardingrulesmanager</artifactId>
+            <version>0.4.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-compatibility</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend
new file mode 100644 (file)
index 0000000..430b595
--- /dev/null
@@ -0,0 +1,289 @@
+package org.opendaylight.controller.md.compatibility.switchmanager
+
+import org.opendaylight.controller.switchmanager.ISwitchManager
+import org.opendaylight.controller.sal.core.NodeConnector
+import org.opendaylight.controller.sal.core.Property
+import java.util.List
+import org.opendaylight.controller.sal.core.Node
+import java.net.InetAddress
+import org.opendaylight.controller.sal.binding.api.data.DataBrokerService
+import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
+import org.opendaylight.controller.sal.core.Description
+import org.opendaylight.controller.sal.core.Tier
+import org.opendaylight.controller.sal.core.Bandwidth
+import org.opendaylight.controller.sal.core.ForwardingMode
+import org.opendaylight.controller.sal.core.MacAddress
+
+import org.slf4j.LoggerFactory
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
+import org.opendaylight.yangtools.yang.binding.DataObject
+import java.net.NetworkInterface
+import java.net.SocketException
+import java.util.Collections
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
+import java.util.ArrayList
+import org.opendaylight.controller.switchmanager.Switch
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
+import java.util.Map
+import java.util.HashSet
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState
+
+class CompatibleSwitchManager extends ConfigurableSwitchManager implements ISwitchManager {
+
+    private static val log = LoggerFactory.getLogger(CompatibleSwitchManager)
+
+    @org.eclipse.xtend.lib.Property
+    var DataBrokerService dataService;
+
+    override addNodeConnectorProp(NodeConnector nodeConnector, Property prop) {
+        val it = dataService.beginTransaction
+        val path = nodeConnector.toNodeConnectorRef
+
+        // TODO: Update FlowCapableNode
+        return null;
+    }
+
+    override createProperty(String propName, String propValue) {
+        try {
+            if (propName.equalsIgnoreCase(Description.propertyName)) {
+                return new Description(propValue);
+            } else if (propName.equalsIgnoreCase(Tier.TierPropName)) {
+                val tier = Integer.parseInt(propValue);
+                return new Tier(tier);
+            } else if (propName.equalsIgnoreCase(Bandwidth.BandwidthPropName)) {
+                val bw = Long.parseLong(propValue);
+                return new Bandwidth(bw);
+            } else if (propName.equalsIgnoreCase(ForwardingMode.name)) {
+                val mode = Integer.parseInt(propValue);
+                return new ForwardingMode(mode);
+            } else if (propName.equalsIgnoreCase(MacAddress.name)) {
+                return new MacAddress(propValue);
+            } else {
+                log.debug("Not able to create {} property", propName);
+            }
+        } catch (Exception e) {
+            log.debug("createProperty caught exception {}", e.getMessage());
+        }
+        return null;
+    }
+
+    override doesNodeConnectorExist(NodeConnector nc) {
+        val ref = nc.toNodeConnectorRef
+        return dataService.readOperationalData(ref.value as InstanceIdentifier<? extends DataObject>) !== null
+    }
+
+    override getControllerMAC() {
+        var byte[] macAddress = null;
+
+        try {
+            val nis = NetworkInterface.getNetworkInterfaces();
+            while (nis.hasMoreElements()) {
+                val ni = nis.nextElement();
+                try {
+                    macAddress = ni.getHardwareAddress();
+                    return macAddress;
+                } catch (SocketException e) {
+                    log.error("Failed to acquire controller MAC: ", e);
+                }
+            }
+        } catch (SocketException e) {
+            log.error("Failed to acquire controller MAC: ", e);
+            return macAddress;
+        }
+
+        if (macAddress == null) {
+            log.warn("Failed to acquire controller MAC: No physical interface found");
+
+            // This happens when running controller on windows VM, for example
+            // Try parsing the OS command output
+            }
+            return macAddress;
+        }
+
+    override getControllerProperties() {
+        return Collections.emptyMap()
+    }
+
+    override getControllerProperty(String propertyName) {
+        return null;
+    }
+
+    override getNetworkDevices() {
+        val path = InstanceIdentifier.builder().node(Nodes).toInstance;
+        val data = dataService.readOperationalData(path) as Nodes;
+        val ret = new ArrayList<Switch>();
+        for (node : data.node) {
+            ret.add(node.toSwitch());
+        }
+        return ret;
+    }
+
+    override getNodeConnector(Node node, String nodeConnectorName) {
+        val key = new NodeConnectorKey(new NodeConnectorId(nodeConnectorName));
+        return new NodeConnector(MD_SAL_TYPE, key, node);
+    }
+
+    override getNodeConnectorProp(NodeConnector nodeConnector, String propName) {
+        getNodeConnectorProps(nodeConnector).get(propName);
+    }
+
+    override getNodeConnectorProps(NodeConnector nodeConnector) {
+        val ref = nodeConnector.toNodeConnectorRef
+        val data = readNodeConnector(ref.value);
+        return data.toAdProperties();
+    }
+
+    override getNodeConnectors(Node node) {
+        val ref = node.toNodeRef;
+        val data = readNode(ref.value);
+        val ret = new HashSet();
+        for (nc : data.nodeConnector) {
+
+            val adConnector = new NodeConnector(MD_SAL_TYPE, nc.key, node);
+            ret.add(adConnector);
+        }
+        return ret;
+    }
+
+    override getNodeDescription(Node node) {
+        (getNodeProps(node).get(Description.propertyName) as Description).value;
+    }
+
+    override getNodeMAC(Node node) {
+        (getNodeProps(node).get(MacAddress.name) as MacAddress).macAddress;
+    }
+
+    override getNodeProp(Node node, String propName) {
+        getNodeProps(node).get(propName)
+    }
+
+    override getNodeProps(Node node) {
+        val ref = node.toNodeRef;
+        val data = dataService.readOperationalData(ref.value as InstanceIdentifier<? extends DataObject>) as org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+        return data.toAdProperties();
+    }
+
+    override getNodes() {
+        val path = InstanceIdentifier.builder().node(Nodes).toInstance;
+        val data = dataService.readOperationalData(path) as Nodes;
+        val ret = new HashSet<Node>();
+        for (node : data.node) {
+            ret.add(new Node(MD_SAL_TYPE, node.key));
+        }
+        return ret;
+    }
+
+    def Switch toSwitch(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node) {
+        val adNode = new Node(MD_SAL_TYPE, node.key);
+        val sw = new Switch(adNode)
+        return sw;
+    }
+
+    override getPhysicalNodeConnectors(Node node) {
+        val ref = node.toNodeRef;
+        val data = readNode(ref.value);
+        val ret = new HashSet();
+        for (nc : data.nodeConnector) {
+            val flowConnector = nc.getAugmentation(FlowCapableNodeConnector)
+            val adConnector = new NodeConnector(MD_SAL_TYPE, nc.key, node);
+            ret.add(adConnector);
+        }
+        return ret;
+    }
+
+    def Map<String, Property> toAdProperties(
+        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector connector) {
+        return Collections.emptyMap
+    }
+
+    def Map<String, Property> toAdProperties(
+        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node connector) {
+        return Collections.emptyMap
+    }
+
+    def readNode(InstanceIdentifier<?> ref) {
+        dataService.readOperationalData(ref as InstanceIdentifier<? extends DataObject>) as org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
+    }
+
+    def readNodeConnector(InstanceIdentifier<?> ref) {
+        dataService.readOperationalData(ref as InstanceIdentifier<? extends DataObject>) as org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector
+    }
+
+    override getSpanPorts(Node node) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    override getSubnetByNetworkAddress(InetAddress networkAddress) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    override getUpNodeConnectors(Node node) {
+        val ref = node.toNodeRef
+        val data = readNode(ref.value);
+        val ret = new HashSet<NodeConnector>();
+        for (nc : data.nodeConnector) {
+            val flowConn = nc.getAugmentation(FlowCapableNodeConnector);
+            if (flowConn != null && flowConn.state == PortState.Live) {
+                ret.add(new NodeConnector(MD_SAL_TYPE, nc.key, node));
+            }
+        }
+        return ret;
+    }
+
+    override isNodeConnectorEnabled(NodeConnector nodeConnector) {
+        val ref = nodeConnector.toNodeConnectorRef
+        val data = readNodeConnector(ref.value);
+
+        return true;
+    }
+
+    override isSpecial(NodeConnector p) {
+        val ref = p.toNodeConnectorRef
+        val data = readNodeConnector(ref.value);
+
+        return true;
+    }
+
+    override removeControllerProperty(String propertyName) {
+        // NOOP
+    }
+
+    override removeNodeAllProps(Node node) {
+        // NOOP: not supported node has more properties than AD-SAL is capable to see
+    }
+
+    override removeNodeConnectorAllProps(NodeConnector nodeConnector) {
+        // NOOP: not supported node has more properties than AD-SAL is capable to see
+    }
+
+    override removeNodeConnectorProp(NodeConnector nc, String propName) {
+        // NOOP: not supported node has more properties than AD-SAL is capable to see
+    }
+
+    override removeNodeProp(Node node, String propName) {
+        // NOOP: not supported node has more properties than AD-SAL is capable to see
+    }
+
+    override removePortsFromSubnet(String name, List<String> nodeConnectors) {
+        // NOOP
+    }
+
+    override removeSubnet(String name) {
+        // NOOP
+    }
+
+    override setControllerProperty(Property property) {
+        // NOOP
+    }
+
+    override setNodeProp(Node node, Property prop) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    override addPortsToSubnet(String name, List<String> nodeConnectors) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    }
diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/ConfigurableSwitchManager.xtend b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/ConfigurableSwitchManager.xtend
new file mode 100644 (file)
index 0000000..122aa32
--- /dev/null
@@ -0,0 +1,71 @@
+package org.opendaylight.controller.md.compatibility.switchmanager
+
+import org.opendaylight.controller.switchmanager.ISwitchManager
+import org.opendaylight.controller.switchmanager.SpanConfig
+import org.opendaylight.controller.switchmanager.SwitchConfig
+import org.opendaylight.controller.switchmanager.SubnetConfig
+
+/**
+ * 
+ * THis methods should be backed by config subsystem.
+ * 
+ */
+abstract class ConfigurableSwitchManager implements ISwitchManager {
+
+    override saveSwitchConfig() {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    override removeSpanConfig(SpanConfig cfgObject) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    override addSubnet(SubnetConfig configObject) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+
+    }
+
+    final override addSpanConfig(SpanConfig configObject) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+
+    }
+
+    final override getSpanConfigList() {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+
+    }
+
+    final override updateSwitchConfig(SwitchConfig cfgObject) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+
+    }
+
+    final override updateNodeConfig(SwitchConfig switchConfig) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+
+    }
+
+    final override getSubnetConfig(String subnet) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    final override removeNodeConfig(String nodeId) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    final override removeSubnet(SubnetConfig configObject) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    final override getSubnetsConfigList() {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    final override getSwitchConfig(String nodeId) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    override modifySubnet(SubnetConfig configObject) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+}
diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/AdSalTopologyMapping.xtend b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/AdSalTopologyMapping.xtend
new file mode 100644 (file)
index 0000000..ad7537b
--- /dev/null
@@ -0,0 +1,94 @@
+package org.opendaylight.controller.md.compatibility.topologymanager
+
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.network.topology.TopologyKey
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.network.topology.topology.node.TerminationPoint
+import org.opendaylight.controller.sal.core.NodeConnector
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.network.topology.Topology
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.NetworkTopology
+import java.util.Map
+import org.opendaylight.controller.sal.core.Edge
+import java.util.Set
+import java.util.List
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.network.topology.topology.Node
+import java.util.Collections
+import com.google.common.collect.FluentIterable
+import java.util.HashSet
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
+import org.opendaylight.controller.sal.compatibility.NodeMapping
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.network.topology.topology.Link
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.link.attributes.Source
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.link.attributes.Destination
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.TpId
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.network.topology.topology.node.TerminationPointKey
+import java.util.HashMap
+
+class AdSalTopologyMapping {
+
+    val TopologyKey topologyMapping;
+    @Property
+    val InstanceIdentifier<Topology> topologyPath;
+
+    new(TopologyKey topology) {
+        topologyMapping = topology;
+        _topologyPath = InstanceIdentifier.builder.node(NetworkTopology).child(Topology, topology).toInstance;
+    }
+
+    def InstanceIdentifier<TerminationPoint> toTerminationPoint(NodeConnector connector) {
+        InstanceIdentifier.builder(topologyPath).node(Node).child(TerminationPoint, connector.toTerminationPointKey()).toInstance;
+    }
+
+    def Map<Edge, Set<org.opendaylight.controller.sal.core.Property>> toEdgePropertiesMap(Iterable<Link> links) {
+        val ret = new HashMap<Edge, Set<org.opendaylight.controller.sal.core.Property>>
+        for (link : links) {
+            ret.put(link.toEdge(), link.toProperties())
+        }
+        return ret;
+    }
+
+    def Set<Edge> toEdges(Iterable<Link> links) {
+        val ret = new HashSet<Edge>
+        for (link : links) {
+            ret.add(link.toEdge)
+        }
+        return ret;
+    }
+
+    def Edge toEdge(Link link) {
+        val tail = link.source.toNodeConnector();
+        val head = link.destination.toNodeConnector();
+        return new Edge(tail, head);
+    }
+
+    def org.opendaylight.controller.sal.core.Node toAdNode(Node node) {
+        return node.nodeId.toAdNode;
+    }
+
+    def org.opendaylight.controller.sal.core.Node toAdNode(
+        org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.NodeId node) {
+        val key = new NodeKey(new NodeId(node))
+        return new org.opendaylight.controller.sal.core.Node(NodeMapping.MD_SAL_TYPE, key);
+    }
+
+    def NodeConnector toNodeConnector(Source ref) {
+        val adNode = ref.sourceNode.toAdNode();
+        val key = new NodeConnectorKey(new NodeConnectorId(ref.sourceTp))
+        return new NodeConnector(NodeMapping.MD_SAL_TYPE, key, adNode);
+    }
+
+    def NodeConnector toNodeConnector(Destination ref) {
+        val adNode = ref.destNode.toAdNode();
+        val key = new NodeConnectorKey(new NodeConnectorId(ref.destTp))
+        return new NodeConnector(NodeMapping.MD_SAL_TYPE, key, adNode);
+    }
+
+    def TerminationPointKey toTerminationPointKey(NodeConnector connector) {
+    }
+
+    def Set<org.opendaylight.controller.sal.core.Property> toProperties(Link link) {
+    }
+}
diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/CompatibleTopologyManager.xtend b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/CompatibleTopologyManager.xtend
new file mode 100644 (file)
index 0000000..c6a4912
--- /dev/null
@@ -0,0 +1,85 @@
+package org.opendaylight.controller.md.compatibility.topologymanager
+
+import org.opendaylight.controller.topologymanager.ITopologyManager
+import org.opendaylight.controller.sal.core.NodeConnector
+import org.opendaylight.controller.sal.core.Host
+import org.opendaylight.controller.sal.core.UpdateType
+import java.util.Set
+import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader
+import java.util.HashMap
+import org.opendaylight.controller.sal.core.Edge
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev130712.network.topology.topology.node.TerminationPoint
+import com.google.common.collect.FluentIterable
+
+class CompatibleTopologyManager extends ConfigurableLinkManager implements ITopologyManager {
+
+    @Property
+    var TypeSafeDataReader dataReader;
+
+    @Property
+    var extension AdSalTopologyMapping topologyMapping;
+
+    override getEdges() {
+        val topology = dataReader.readOperationalData(topologyPath);
+        return topology.link.toEdgePropertiesMap();
+    }
+
+    override getNodeEdges() {
+        val topology = dataReader.readOperationalData(topologyPath);
+        val ret = new HashMap<org.opendaylight.controller.sal.core.Node, Set<Edge>>;
+        for (node : topology.node) {
+            val adNode = node.toAdNode();
+            val adEdges = FluentIterable.from(topology.link).filter[
+                source.sourceNode == node.nodeId || destination.destNode == node.nodeId].toEdges();
+            ret.put(adNode, adEdges)
+        }
+        return ret;
+    }
+
+    /**
+     *   Returns true if point is connected to link
+    */
+    def isInternal(TerminationPoint point) {
+        val topology = dataReader.readConfigurationData(topologyPath);
+        val tpId = point.key.tpId;
+        return FluentIterable.from(topology.link).anyMatch(
+            [
+                source.sourceTp == tpId || destination.destTp == tpId
+            ])
+    }
+
+    override getNodeConnectorWithHost() {
+    }
+
+    override getHostAttachedToNodeConnector(NodeConnector p) {
+        val tpPath = p.toTerminationPoint();
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    override getHostsAttachedToNodeConnector(NodeConnector p) {
+        val topology = dataReader.readOperationalData(topologyPath);
+
+        throw new UnsupportedOperationException("Hosts not mapped yet")
+    }
+
+    override getNodesWithNodeConnectorHost() {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+
+    }
+
+    override isInternal(NodeConnector p) {
+        val tpPath = p.toTerminationPoint();
+        val connector = dataReader.readConfigurationData(tpPath);
+        return connector.isInternal();
+    }
+
+    override updateHostLink(NodeConnector p, Host h, UpdateType t,
+        Set<org.opendaylight.controller.sal.core.Property> props) {
+        // Update app defined topology
+    }
+
+    override saveConfig() {
+        // FIXME: commit configuration
+    }
+
+}
diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/ConfigurableLinkManager.xtend b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/ConfigurableLinkManager.xtend
new file mode 100644 (file)
index 0000000..da3bf66
--- /dev/null
@@ -0,0 +1,24 @@
+package org.opendaylight.controller.md.compatibility.topologymanager
+
+import org.opendaylight.controller.topologymanager.ITopologyManager
+import org.opendaylight.controller.topologymanager.TopologyUserLinkConfig
+
+abstract class ConfigurableLinkManager implements ITopologyManager {
+    
+    final override addUserLink(TopologyUserLinkConfig link) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+        
+    }
+    
+    
+    final override deleteUserLink(String linkName) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+        
+    }
+    
+    
+    final override getUserLinks() {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+        
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/compatibility/pom.xml b/opendaylight/md-sal/compatibility/pom.xml
new file mode 100644 (file)
index 0000000..a829380
--- /dev/null
@@ -0,0 +1,101 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>sal-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>compatibility-parent</artifactId>
+    <packaging>pom</packaging>
+    <name>MD-SAL to AD-SAL Adaptation</name>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+    </scm>
+
+    <modules>
+        <module>sal-compatibility</module>
+        <module>inventory-topology-compatibility</module>
+        <module>flow-management-compatibility</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal</artifactId>
+            <version>0.5.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.model</groupId>
+            <artifactId>model-flow-service</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-common-util</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-api</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.xtend</groupId>
+            <artifactId>org.eclipse.xtend.lib</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.eclipse.xtend</groupId>
+                <artifactId>xtend-maven-plugin</artifactId>
+            </plugin>
+            <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>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <configuration>
+                    <includes>org.opendaylight.controller.*</includes>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>pre-test</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>post-test</id>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
@@ -3,10 +3,10 @@
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.opendaylight.controller</groupId>
-    <artifactId>sal-parent</artifactId>
+    <artifactId>compatibility-parent</artifactId>
     <version>1.0-SNAPSHOT</version>
   </parent>
-  <artifactId>sal-compability</artifactId>
+  <artifactId>sal-compatibility</artifactId>
   <name>MD-SAL to AD-SAL Adaptation</name>
   <scm>
     <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
   </scm>
 
   <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller.model</groupId>
       <artifactId>model-flow-statistics</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-common-util</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.xtend</groupId>
-      <artifactId>org.eclipse.xtend.lib</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
   <packaging>bundle</packaging>
 
@@ -68,7 +35,7 @@
         <configuration>
           <instructions>
             <Bundle-Name>${project.name}</Bundle-Name>
-            <Bundle-Activator>org.opendaylight.controller.sal.compability.ComponentActivator</Bundle-Activator>
+            <Bundle-Activator>org.opendaylight.controller.sal.compatibility.ComponentActivator</Bundle-Activator>
           </instructions>
         </configuration>
       </plugin>
@@ -1,10 +1,10 @@
-package org.opendaylight.controller.sal.compability
+package org.opendaylight.controller.sal.compatibility
 
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
 import org.opendaylight.controller.sal.core.Node
 import org.opendaylight.controller.sal.core.NodeConnector
-import static org.opendaylight.controller.sal.compability.NodeMapping.*
+import static org.opendaylight.controller.sal.compatibility.NodeMapping.*
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
 import org.apache.felix.dm.Component
 import java.util.Arrays
@@ -1,4 +1,4 @@
-package org.opendaylight.controller.sal.compability
+package org.opendaylight.controller.sal.compatibility
 
 import java.util.concurrent.ExecutionException
 import org.opendaylight.controller.sal.core.Node
@@ -15,10 +15,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalF
 import org.opendaylight.yangtools.yang.common.RpcResult
 import org.slf4j.LoggerFactory
 
-import static org.opendaylight.controller.sal.compability.MDFlowMapping.*
+import static org.opendaylight.controller.sal.compatibility.MDFlowMapping.*
 
-import static extension org.opendaylight.controller.sal.compability.NodeMapping.*
-import static extension org.opendaylight.controller.sal.compability.ToSalConversionsUtils.*
+import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
+import static extension org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils.*
 
 class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowListener {
 
@@ -1,4 +1,4 @@
-package org.opendaylight.controller.sal.compability;
+package org.opendaylight.controller.sal.compatibility;
 
 import static org.opendaylight.controller.sal.match.MatchType.DL_DST;
 import static org.opendaylight.controller.sal.match.MatchType.DL_SRC;
@@ -12,6 +12,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import org.opendaylight.controller.sal.compatibility.MDFlowMapping;
 import org.opendaylight.controller.sal.core.NodeConnector;
 
 
@@ -25,7 +26,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 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.flow.statistics.rev130819.GetNodeConnectorStatisticsInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetNodeConnectorStatisticsInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address;
@@ -57,18 +57,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 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;
-
-
-
-
-
-
-
-
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.*;
-import static org.opendaylight.controller.sal.compability.NodeMapping.*;
+import static org.opendaylight.controller.sal.compatibility.NodeMapping.*;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.*;
 
 public class FromSalConversionsUtils {
 
@@ -1,4 +1,4 @@
-package org.opendaylight.controller.sal.compability
+package org.opendaylight.controller.sal.compatibility
 
 import org.opendaylight.controller.sal.reader.IPluginInReadService
 import org.opendaylight.controller.sal.core.NodeConnector
@@ -8,8 +8,8 @@ import org.opendaylight.controller.sal.core.NodeTable
 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService
 
 import static extension org.opendaylight.controller.sal.common.util.Arguments.*
-import static extension org.opendaylight.controller.sal.compability.NodeMapping.*
-import static org.opendaylight.controller.sal.compability.MDFlowMapping.*
+import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
+import static org.opendaylight.controller.sal.compatibility.MDFlowMapping.*
 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.inventory.rev130819.NodeRef
@@ -1,4 +1,4 @@
-package org.opendaylight.controller.sal.compability;
+package org.opendaylight.controller.sal.compatibility;
 
 import com.google.common.net.InetAddresses
 import java.math.BigInteger
@@ -73,8 +73,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherTyp
 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 static extension org.opendaylight.controller.sal.compability.FromSalConversionsUtils.*
-import static extension org.opendaylight.controller.sal.compability.NodeMapping.*
+import static extension org.opendaylight.controller.sal.compatibility.FromSalConversionsUtils.*
+import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
 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.flow.Instructions
@@ -1,6 +1,7 @@
-package org.opendaylight.controller.sal.compability;
+package org.opendaylight.controller.sal.compatibility;
 
 import com.google.common.net.InetAddresses;
+
 import org.opendaylight.controller.sal.action.Controller;
 import org.opendaylight.controller.sal.action.Drop;
 import org.opendaylight.controller.sal.action.Flood;
@@ -91,10 +92,10 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.SCTP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.TCP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.UDP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.SCTP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.TCP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.UDP;
 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;
@@ -1,12 +1,12 @@
-package org.opendaylight.controller.sal.compability.adsal;
+package org.opendaylight.controller.sal.compatibility.adsal;
 
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.common.util.Futures;
 import org.opendaylight.controller.sal.common.util.Rpcs;
-import org.opendaylight.controller.sal.compability.NodeMapping;
-import org.opendaylight.controller.sal.compability.ToSalConversionsUtils;
+import org.opendaylight.controller.sal.compatibility.NodeMapping;
+import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.flowprogrammer.Flow;
@@ -1,4 +1,4 @@
-package org.opendaylight.controller.sal.compability.adsal;
+package org.opendaylight.controller.sal.compatibility.adsal;
 
 import java.math.BigInteger;
 import java.util.ArrayList;
@@ -8,8 +8,8 @@ import java.util.concurrent.Future;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.common.util.Futures;
 import org.opendaylight.controller.sal.common.util.Rpcs;
-import org.opendaylight.controller.sal.compability.NodeMapping;
-import org.opendaylight.controller.sal.compability.ToSalConversionsUtils;
+import org.opendaylight.controller.sal.compatibility.NodeMapping;
+import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.flowprogrammer.Flow;
@@ -3,58 +3,23 @@ package org.opendaylight.controller.sal.compability;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.SCTP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.TCP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.UDP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.SCTP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.TCP;
+import static org.opendaylight.controller.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.action.*;
+import org.opendaylight.controller.sal.compatibility.MDFlowMapping;
+import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
 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.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodAllAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.HwPathAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.LoopbackAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PopVlanAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushVlanAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlDstAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlSrcAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlTypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNextHopAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwDstAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwSrcAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpDstAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpSrcAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanCfiAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SwPathAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.*;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
@@ -1,77 +1,36 @@
 package org.opendaylight.controller.sal.compability;
 
-import com.google.common.net.InetAddresses;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+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.action.*;
+import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
 import org.opendaylight.controller.sal.flowprogrammer.Flow;
 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.inet.types.rev100924.*;
 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.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.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.ControllerActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.DropActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodAllActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.HwPathActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.LoopbackActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.OutputActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PopMplsActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PopVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushMplsActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushPbbActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlTypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetMplsTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNextHopActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetQueueActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanCfiActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SwPathActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.*;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv4Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.ActionBuilder;
 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.ApplyActions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.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.l2.types.rev130827.EtherType;
@@ -79,20 +38,8 @@ 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.ethernet.match.fields.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.*;
 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;
@@ -100,21 +47,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 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 org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActions;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsBuilder;
 
-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 com.google.common.net.InetAddresses;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.SCTP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.TCP;
-import static org.opendaylight.controller.sal.compability.ProtocolConstants.UDP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.SCTP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.TCP;
+import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.UDP;
 
 public class TestToSalConversionsUtils {
     // prefix:
diff --git a/opendaylight/md-sal/model/model-topology/pom.xml b/opendaylight/md-sal/model/model-topology/pom.xml
new file mode 100644 (file)
index 0000000..c91b9dd
--- /dev/null
@@ -0,0 +1,31 @@
+<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">
+
+    <parent>
+        <artifactId>model-parent</artifactId>
+        <groupId>org.opendaylight.controller.model</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <scm>
+      <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+      <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+      <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+    </scm>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>model-topology</artifactId>
+    <packaging>bundle</packaging>
+    
+    <dependencies>
+    <dependency>
+        <groupId>org.opendaylight.controller.model</groupId>
+        <artifactId>model-inventory</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+        <groupId>org.opendaylight.yangtools.model</groupId>
+        <artifactId>ietf-topology</artifactId>
+        <version>2013.07.12.2-SNAPSHOT</version>
+    </dependency>
+    </dependencies>
+</project>
diff --git a/opendaylight/md-sal/model/model-topology/src/main/yang/opendaylight-topology-inventory.yang b/opendaylight/md-sal/model/model-topology/src/main/yang/opendaylight-topology-inventory.yang
new file mode 100644 (file)
index 0000000..33c03ba
--- /dev/null
@@ -0,0 +1,34 @@
+module opendaylight-topology-inventory {
+    yang-version 1;
+    namespace "urn:opendaylight:model:topology:inventory";
+    // replace with IANA namespace when assigned
+    prefix "nt";
+
+    import yang-ext { prefix "ext"; }
+    import ietf-inet-types { prefix "inet"; }
+    import opendaylight-inventory {prefix "inv";}
+    import opendaylight-topology {prefix "odt";}
+    import network-topology {prefix "topo";}
+
+    organization "TBD";
+
+    contact "WILL-BE-DEFINED-LATER";
+
+    revision 2013-10-30 {
+        description
+            "Initial revision.";
+    }
+
+    augment "/topo:network-topology/topo:topology/topo:node" {
+        ext:augment-identifier "inventory-node";
+        uses inv:node-context-ref;
+    }
+
+    augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
+        ext:augment-identifier "inventory-node-connector";
+        leaf node-connector {
+            ext:context-reference "inv:node-connector-context";
+            type inv:node-connector-ref;
+        }
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/model/model-topology/src/main/yang/opendaylight-topology.yang b/opendaylight/md-sal/model/model-topology/src/main/yang/opendaylight-topology.yang
new file mode 100644 (file)
index 0000000..038a1b7
--- /dev/null
@@ -0,0 +1,64 @@
+module opendaylight-topology {
+    yang-version 1;
+    namespace "urn:opendaylight:model:topology:general";
+    // replace with IANA namespace when assigned
+    prefix "nt";
+
+    import yang-ext { prefix "ext"; }
+    import ietf-inet-types { prefix "inet"; }
+    import opendaylight-inventory {prefix "inv";}
+    import network-topology {prefix "topo";}
+
+    organization "TBD";
+
+    contact "WILL-BE-DEFINED-LATER";
+
+    revision 2013-10-30 {
+        description
+            "Initial revision.";
+    }
+
+    identity node-type {
+    
+    }
+    
+    typedef node-type-ref {
+        type identityref {
+            base node-type;
+       }
+    }
+    
+    identity topology-context {
+    
+    }
+    
+    identity topology-node-context {
+        
+    }
+
+    grouping node-identifiers {
+        list node-identifier {
+            key "type identifier";
+            leaf type {
+                type node-type-ref;
+            }
+            leaf identifier {
+                type inet:uri;
+            }
+        }
+    }
+
+    augment "/topo:network-topology/topo:topology" {
+        ext:context-instance "topology-context";
+    }
+
+    /* Inventory Augmentations */
+    augment "/topo:network-topology/topo:topology/topo:node" {
+        ext:context-instance "topology-node-context";
+    }
+
+    augment "/topo:network-topology/topo:topology/topo:node" {
+        ext:augment-identifier "identifiable-node";
+        uses node-identifiers;
+    }
+}
diff --git a/opendaylight/md-sal/model/model-topology/src/main/yang/topology-view.yang b/opendaylight/md-sal/model/model-topology/src/main/yang/topology-view.yang
new file mode 100644 (file)
index 0000000..2fecb32
--- /dev/null
@@ -0,0 +1,48 @@
+module opendaylight-topology-view  {
+    yang-version 1;
+    namespace "urn:opendaylight:model:topology:view";
+    // replace with IANA namespace when assigned
+    prefix "nt";
+
+    import yang-ext { prefix "ext"; }
+    import ietf-inet-types { prefix "inet"; }
+    import network-topology {prefix "topo";}
+    import opendaylight-topology {prefix "odl";}
+
+    organization "TBD";
+
+    contact "WILL-BE-DEFINED-LATER";
+
+    revision 2013-10-30 {
+        description
+            "Initial revision.";
+    }
+    
+
+    grouping aggregate-topology {
+        leaf-list original-topology {
+            type topo:topology-ref;    
+        }
+    }
+
+    grouping aggregate-node {
+        list original-node {
+            leaf topology {
+                type topo:topology-ref;
+            }
+            leaf node {
+                type topo:node-ref;
+            }
+        }
+    }
+
+    augment "/topo:network-topology/topo:topology" {
+        ext:augment-identifier "aggregated-topology";
+        uses aggregate-topology;
+    }
+
+    augment "/topo:network-topology/topo:topology/topo:node" {
+        ext:augment-identifier "aggregated-node";
+        uses aggregate-node;
+    }
+}
\ No newline at end of file
index ca97232..eccb691 100644 (file)
@@ -28,6 +28,7 @@
         <module>model-flow-service</module>
         <module>model-flow-statistics</module>
         <module>model-flow-management</module>
+        <module>model-topology</module>
     </modules>
 
     <build>
index 06df83e..fd89da4 100644 (file)
         <module>sal-binding-config</module>
         <module>sal-binding-broker</module>
 
+        <module>sal-binding-util</module>
+
         <!-- Samples -->
         <module>samples</module>
 
         <!-- Base Models -->
         <module>model</module>
 
-        <!-- Compability Packages -->
-        <module>sal-compability</module>
 
         <!-- Connectors -->
         <module>sal-connector-api</module>
         <module>sal-rest-connector</module>
-        <module>flow-management-compatibility</module>
 
         <!-- Clustered Data Store -->
         <module>clustered-data-store/implementation</module>
 
+        <module>inventory-manager</module>
+        <!-- Compability Packages -->
+        <module>compatibility</module>
+
         <module>sal-zeromq-connector</module>
         <module>test</module>
     </modules>
diff --git a/opendaylight/md-sal/sal-binding-util/pom.xml b/opendaylight/md-sal/sal-binding-util/pom.xml
new file mode 100644 (file)
index 0000000..26041ea
--- /dev/null
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>sal-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>sal-binding-util</artifactId>
+    <packaging>bundle</packaging>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+    </scm>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-api</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.dependencymanager</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java b/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java
new file mode 100644 (file)
index 0000000..738a14a
--- /dev/null
@@ -0,0 +1,38 @@
+package org.opendaylight.controller.md.sal.binding.util;
+
+import org.opendaylight.controller.md.sal.common.api.data.DataReader;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+public final class TypeSafeDataReader {
+
+    
+    private final DataReader<InstanceIdentifier<?>,DataObject> delegate;
+    
+    
+    
+    public DataReader<InstanceIdentifier<?>, DataObject> getDelegate() {
+        return delegate;
+    }
+
+
+    public TypeSafeDataReader(DataReader<InstanceIdentifier<?>, DataObject> delegate) {
+        this.delegate = delegate;
+    }
+
+
+    @SuppressWarnings("unchecked")
+    public <D extends DataObject> D readConfigurationData(InstanceIdentifier<D> path) {
+        return (D) delegate.readConfigurationData(path);
+    }
+    
+    
+    @SuppressWarnings("unchecked")
+    public <D extends DataObject> D  readOperationalData(InstanceIdentifier<D> path) {
+        return (D) delegate.readOperationalData(path);
+    }
+    
+    public static TypeSafeDataReader forReader(DataReader<InstanceIdentifier<?>, DataObject> delegate) {
+        return new TypeSafeDataReader(delegate);
+    }
+}

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.