Handling port up down event for Bug 3558
[vpnservice.git] / interfacemgr / interfacemgr-impl / src / main / java / org / opendaylight / vpnservice / interfacemgr / IfmUtil.java
index c36df7f34d96e5246aff4e72de63c0c75a7d51d5..a347d9a185df69ce7f9722eeca01f387b074f2d2 100644 (file)
@@ -31,6 +31,13 @@ public class IfmUtil {
         return split[1];
     }
 
+    public static String getPortNoFromNodeConnectorId(NodeConnectorId portId) {
+        /*
+         * NodeConnectorId is of form 'openflow:dpnid:portnum'
+         */
+        String[] split = portId.getValue().split(IfmConstants.OF_URI_SEPARATOR);
+        return split[2];
+    }
 
     public static NodeId buildDpnNodeId(BigInteger dpnId) {
         return new NodeId(IfmConstants.OF_URI_PREFIX + dpnId);