Merge "Fixed inappropriate uses of log level INFO"
[controller.git] / opendaylight / md-sal / compatibility / sal-compatibility / src / main / java / org / opendaylight / controller / sal / compatibility / NodeMapping.xtend
index 4ad91c26779dcdfdb451200636c958ca3d4ae027..a3be5dd970f775141ad5483ec7ebeb8260641ad9 100644 (file)
@@ -48,6 +48,7 @@ import java.util.Date
 import org.opendaylight.controller.sal.core.TimeStamp
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNodeConnector
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNode
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector
 
 public class NodeMapping {
 
@@ -171,6 +172,14 @@ public class NodeMapping {
         return new HashSet<org.opendaylight.controller.sal.core.Property>();
     }
 
+    public static def toADNodeConnectorProperties(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc) {
+        val fcnc = nc.getAugmentation(FlowCapableNodeConnector)
+        if (fcnc != null) {
+            return fcnc.toADNodeConnectorProperties
+        }
+        return new HashSet<org.opendaylight.controller.sal.core.Property>();
+    }
+
     public static def toADNodeConnectorProperties(FlowNodeConnector fcncu) {
         val props = new HashSet<org.opendaylight.controller.sal.core.Property>();
         if (fcncu != null) {
@@ -225,21 +234,21 @@ public class NodeMapping {
 
     public static def toAdBandwidth(PortFeatures pf) {
         var Bandwidth bw = null
-        if (pf.is_10mbHd || pf.is_10mbFd) {
+        if (pf.isTenMbHd || pf.isTenMbFd) {
             bw = new Bandwidth(Bandwidth.BW10Mbps)
-        } else if (pf.is_100mbHd || pf.is_100mbFd) {
+        } else if (pf.isHundredMbHd || pf.isHundredMbFd) {
             bw = new Bandwidth(Bandwidth.BW100Mbps)
-        } else if (pf.is_1gbHd || pf.is_1gbFd) {
+        } else if (pf.isOneGbHd || pf.isOneGbFd) {
             bw = new Bandwidth(Bandwidth.BW1Gbps)
-        } else if (pf.is_1gbFd) {
+        } else if (pf.isOneGbFd) {
             bw = new Bandwidth(Bandwidth.BW10Gbps)
-        } else if (pf.is_10gbFd) {
+        } else if (pf.isTenGbFd) {
             bw = new Bandwidth(Bandwidth.BW10Gbps)
-        } else if (pf.is_40gbFd) {
+        } else if (pf.isFortyGbFd) {
             bw = new Bandwidth(Bandwidth.BW40Gbps)
-        } else if (pf.is_100gbFd) {
+        } else if (pf.isHundredGbFd) {
             bw = new Bandwidth(Bandwidth.BW100Gbps)
-        } else if (pf.is_1tbFd) {
+        } else if (pf.isOneTbFd) {
             bw = new Bandwidth(Bandwidth.BW1Tbps)
         }
         return bw;