BUG-1089: migrate CompatibleSwitchManager 18/7718/4
authorRobert Varga <rovarga@cisco.com>
Wed, 4 Jun 2014 21:16:24 +0000 (23:16 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Fri, 6 Jun 2014 09:51:19 +0000 (09:51 +0000)
Migrates CompatibleSwitchManager from xtend to Java, finishing up the
bundle conversion.

Change-Id: I99fa044e7dad329d40aa11aa8759cab5f315238f
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.java [new file with mode: 0644]
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend [deleted file]

index 18fb785..fc58ed9 100644 (file)
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.eclipse.xtend</groupId>
-      <artifactId>org.eclipse.xtend.lib</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
           </instructions>
         </configuration>
       </plugin>
-      <plugin>
-        <groupId>org.eclipse.xtend</groupId>
-        <artifactId>xtend-maven-plugin</artifactId>
-      </plugin>
     </plugins>
   </build>
   <scm>
diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.java b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.java
new file mode 100644 (file)
index 0000000..82c5b7b
--- /dev/null
@@ -0,0 +1,347 @@
+/**
+ * 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.controller.md.compatibility.switchmanager;
+
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
+import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.controller.sal.compatibility.NodeMapping;
+import org.opendaylight.controller.sal.core.Bandwidth;
+import org.opendaylight.controller.sal.core.ConstructionException;
+import org.opendaylight.controller.sal.core.Description;
+import org.opendaylight.controller.sal.core.ForwardingMode;
+import org.opendaylight.controller.sal.core.MacAddress;
+import org.opendaylight.controller.sal.core.NodeConnector;
+import org.opendaylight.controller.sal.core.Property;
+import org.opendaylight.controller.sal.core.Tier;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.switchmanager.ISwitchManager;
+import org.opendaylight.controller.switchmanager.Subnet;
+import org.opendaylight.controller.switchmanager.Switch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
+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.NodeRef;
+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.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CompatibleSwitchManager extends ConfigurableSwitchManager implements ISwitchManager {
+    private static final  Logger LOG = LoggerFactory.getLogger(CompatibleSwitchManager.class);
+
+    private DataBrokerService _dataService;
+
+    public DataBrokerService getDataService() {
+        return this._dataService;
+    }
+
+    public void setDataService(final DataBrokerService dataService) {
+        this._dataService = dataService;
+    }
+
+    @Override
+    public Status addNodeConnectorProp(final NodeConnector nodeConnector, final Property prop) {
+        final DataModificationTransaction it = getDataService().beginTransaction();
+        final NodeConnectorRef path = NodeMapping.toNodeConnectorRef(nodeConnector);
+        return null;
+    }
+
+    @Override
+    public Property createProperty(final String propName, final String propValue) {
+        try {
+            if (propName.equalsIgnoreCase(Description.propertyName)) {
+                return new Description(propValue);
+            } else if (propName.equalsIgnoreCase(Tier.TierPropName)) {
+                return new Tier(Integer.parseInt(propValue));
+            } else if (propName.equalsIgnoreCase(Bandwidth.BandwidthPropName)) {
+                return new Bandwidth(Long.parseLong(propValue));
+            } else if (propName.equalsIgnoreCase(ForwardingMode.name)) {
+                return new ForwardingMode(Integer.parseInt(propValue));
+            } 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
+    public boolean doesNodeConnectorExist(final NodeConnector nc) {
+        return (getDataService().readOperationalData(NodeMapping.toNodeConnectorRef(nc).getValue()) != null);
+    }
+
+    @Override
+    public byte[] getControllerMAC() {
+        final Enumeration<NetworkInterface> nis;
+        try {
+            nis = NetworkInterface.getNetworkInterfaces();
+        } catch (SocketException e) {
+            LOG.error("Failed to acquire list of interfaces, cannot determine controller MAC", e);
+            return null;
+        }
+
+        while (nis.hasMoreElements()) {
+            final NetworkInterface ni = nis.nextElement();
+            try {
+                return ni.getHardwareAddress();
+            } catch (SocketException e) {
+                LOG.error("Failed to acquire controller MAC from interface {}", ni, e);
+            }
+        }
+
+        // This happens when running controller on windows VM, for example
+        // Try parsing the OS command output
+        LOG.warn("Failed to acquire controller MAC: No physical interface found");
+        return null;
+    }
+
+    @Override
+    public Map<String,Property> getControllerProperties() {
+        return Collections.<String, Property>emptyMap();
+    }
+
+    @Override
+    public Property getControllerProperty(final String propertyName) {
+        return null;
+    }
+
+    @Override
+    public List<Switch> getNetworkDevices() {
+        final InstanceIdentifier<Nodes> path = InstanceIdentifier.builder(Nodes.class).toInstance();
+        final Nodes data = ((Nodes) getDataService().readOperationalData(path));
+        final ArrayList<Switch> ret = new ArrayList<>();
+        for (final Node node : data.getNode()) {
+            try {
+                ret.add(toSwitch(node));
+            } catch (ConstructionException e) {
+                throw new IllegalStateException(String.format("Failed to create switch {}", node), e);
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public NodeConnector getNodeConnector(final org.opendaylight.controller.sal.core.Node node, final String nodeConnectorName) {
+        final NodeConnectorKey key = new NodeConnectorKey(new NodeConnectorId(nodeConnectorName));
+        try {
+            return new NodeConnector(NodeMapping.MD_SAL_TYPE, key, node);
+        } catch (ConstructionException e) {
+            throw new IllegalStateException(String.format("Failed to create node connector for {} {}", node, nodeConnectorName), e);
+        }
+    }
+
+    @Override
+    public Property getNodeConnectorProp(final NodeConnector nodeConnector, final String propName) {
+        return getNodeConnectorProps(nodeConnector).get(propName);
+    }
+
+    @Override
+    public Map<String,Property> getNodeConnectorProps(final NodeConnector nodeConnector) {
+        final NodeConnectorRef ref = NodeMapping.toNodeConnectorRef(nodeConnector);
+        return toAdProperties(readNodeConnector(ref.getValue()));
+    }
+
+    @Override
+    public Set<NodeConnector> getNodeConnectors(final org.opendaylight.controller.sal.core.Node node) {
+        final Node data = this.readNode(NodeMapping.toNodeRef(node).getValue());
+        final HashSet<NodeConnector> ret = new HashSet<>();
+        for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc : data.getNodeConnector()) {
+            try {
+                ret.add(new NodeConnector(NodeMapping.MD_SAL_TYPE, nc.getKey(), node));
+            } catch (ConstructionException e) {
+                throw new IllegalStateException(String.format("Failed to create node {} connector", node, nc.getKey()), e);
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public String getNodeDescription(final org.opendaylight.controller.sal.core.Node node) {
+        return ((Description) getNodeProps(node).get(Description.propertyName)).getValue();
+    }
+
+    @Override
+    public byte[] getNodeMAC(final org.opendaylight.controller.sal.core.Node node) {
+        return ((MacAddress) getNodeProps(node).get(MacAddress.name)).getMacAddress();
+    }
+
+    @Override
+    public Property getNodeProp(final org.opendaylight.controller.sal.core.Node node, final String propName) {
+        return getNodeProps(node).get(propName);
+    }
+
+    @Override
+    public Map<String,Property> getNodeProps(final org.opendaylight.controller.sal.core.Node node) {
+        final NodeRef ref = NodeMapping.toNodeRef(node);
+        return toAdProperties(((Node) getDataService().readOperationalData(ref.getValue())));
+    }
+
+    @Override
+    public Set<org.opendaylight.controller.sal.core.Node> getNodes() {
+        final InstanceIdentifier<Nodes> path = InstanceIdentifier.builder(Nodes.class).toInstance();
+        final Nodes data = ((Nodes) getDataService().readOperationalData(path));
+        final HashSet<org.opendaylight.controller.sal.core.Node> ret = new HashSet<>();
+        for (final Node node : data.getNode()) {
+            try {
+                ret.add(new org.opendaylight.controller.sal.core.Node(NodeMapping.MD_SAL_TYPE, node.getKey()));
+            } catch (ConstructionException e) {
+                throw new IllegalStateException(String.format("Failed to create node for {}", node), e);
+            }
+        }
+        return ret;
+    }
+
+    private static Switch toSwitch(final Node node) throws ConstructionException {
+        return new Switch(new org.opendaylight.controller.sal.core.Node(NodeMapping.MD_SAL_TYPE, node.getKey()));
+    }
+
+    @Override
+    public Set<NodeConnector> getPhysicalNodeConnectors(final org.opendaylight.controller.sal.core.Node node) {
+        final NodeRef ref = NodeMapping.toNodeRef(node);
+        final Node data = readNode(ref.getValue());
+        final HashSet<NodeConnector> ret = new HashSet<>();
+        for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc : data.getNodeConnector()) {
+            final FlowCapableNodeConnector flowConnector = nc.getAugmentation(FlowCapableNodeConnector.class);
+            try {
+                ret.add(new NodeConnector(NodeMapping.MD_SAL_TYPE, nc.getKey(), node));
+            } catch (ConstructionException e) {
+                throw new IllegalStateException(String.format("Failed to create connector for {} on node {}", nc.getKey(), node), e);
+            }
+        }
+        return ret;
+    }
+
+    private static Map<String,Property> toAdProperties(final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector connector) {
+        return Collections.emptyMap();
+    }
+
+    private static Map<String,Property> toAdProperties(final Node connector) {
+        return Collections.emptyMap();
+    }
+
+    private Node readNode(final InstanceIdentifier<? extends Object> ref) {
+        return (Node) getDataService().readOperationalData((ref));
+    }
+
+    private org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector readNodeConnector(final InstanceIdentifier<? extends Object> ref) {
+        return ((org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) getDataService().readOperationalData(ref));
+    }
+
+    @Override
+    public List<NodeConnector> getSpanPorts(final org.opendaylight.controller.sal.core.Node node) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub");
+    }
+
+    @Override
+    public Subnet getSubnetByNetworkAddress(final InetAddress networkAddress) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub");
+    }
+
+    @Override
+    public Set<NodeConnector> getUpNodeConnectors(final org.opendaylight.controller.sal.core.Node node) {
+        final Node data = readNode(NodeMapping.toNodeRef(node).getValue());
+        final HashSet<NodeConnector> ret = new HashSet<>();
+        for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc : data.getNodeConnector()) {
+            final FlowCapableNodeConnector flowConn = nc.<FlowCapableNodeConnector>getAugmentation(FlowCapableNodeConnector.class);
+            if (flowConn != null && flowConn.getState() != null && !flowConn.getState().isLinkDown()) {
+                try {
+                    ret.add(new NodeConnector(NodeMapping.MD_SAL_TYPE, nc.getKey(), node));
+                } catch (ConstructionException e) {
+                    throw new IllegalStateException(String.format("Failed to create node connector for node {} connector {}", node, nc), e);
+                }
+            }
+        }
+        return ret;
+    }
+
+    @Override
+    public Boolean isNodeConnectorEnabled(final NodeConnector nodeConnector) {
+        final NodeConnectorRef ref = NodeMapping.toNodeConnectorRef(nodeConnector);
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector data = readNodeConnector(ref.getValue());
+        return true;
+    }
+
+    @Override
+    public boolean isSpecial(final NodeConnector p) {
+        final NodeConnectorRef ref = NodeMapping.toNodeConnectorRef(p);
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector data = readNodeConnector(ref.getValue());
+        return true;
+    }
+
+    @Override
+    public Status removeControllerProperty(final String propertyName) {
+        return null;
+    }
+
+    @Override
+    public Status removeNodeAllProps(final org.opendaylight.controller.sal.core.Node node) {
+        return null;
+    }
+
+    @Override
+    public Status removeNodeConnectorAllProps(final NodeConnector nodeConnector) {
+        return null;
+    }
+
+    @Override
+    public Status removeNodeConnectorProp(final NodeConnector nc, final String propName) {
+        return null;
+    }
+
+    @Override
+    public Status removeNodeProp(final org.opendaylight.controller.sal.core.Node node, final String propName) {
+        return null;
+    }
+
+    @Override
+    public Status removePortsFromSubnet(final String name, final List<String> nodeConnectors) {
+        return null;
+    }
+
+    @Override
+    public Status removeSubnet(final String name) {
+        return null;
+    }
+
+    @Override
+    public Status setControllerProperty(final Property property) {
+        return null;
+    }
+
+    @Override
+    public void setNodeProp(final org.opendaylight.controller.sal.core.Node node, final Property prop) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub");
+    }
+
+    @Override
+    public Status addPortsToSubnet(final String name, final List<String> nodeConnectors) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub");
+    }
+
+    @Override
+    public Set<Switch> getConfiguredNotConnectedSwitches() {
+        return null;
+    }
+}
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
deleted file mode 100644 (file)
index 20d375f..0000000
+++ /dev/null
@@ -1,298 +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.controller.md.compatibility.switchmanager
-
-import java.net.InetAddress
-import java.net.NetworkInterface
-import java.net.SocketException
-import java.util.ArrayList
-import java.util.Collections
-import java.util.HashSet
-import java.util.List
-import java.util.Map
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService
-import org.opendaylight.controller.sal.core.Bandwidth
-import org.opendaylight.controller.sal.core.Description
-import org.opendaylight.controller.sal.core.ForwardingMode
-import org.opendaylight.controller.sal.core.MacAddress
-import org.opendaylight.controller.sal.core.Node
-import org.opendaylight.controller.sal.core.NodeConnector
-import org.opendaylight.controller.sal.core.Property
-import org.opendaylight.controller.sal.core.Tier
-import org.opendaylight.controller.switchmanager.ISwitchManager
-import org.opendaylight.controller.switchmanager.Switch
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
-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.yangtools.yang.binding.DataObject
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
-
-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(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(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 != null && !flowConn.state.linkDown) {
-                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")
-    }
-
-    override getConfiguredNotConnectedSwitches() {
-        return null;
-    }
-}