Merge "Custom Node Type jaxb string to id"
authorGiovanni Meo <gmeo@cisco.com>
Wed, 5 Jun 2013 14:40:02 +0000 (14:40 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 5 Jun 2013 14:40:02 +0000 (14:40 +0000)
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Node.java

index ef0c066..5a71ab8 100644 (file)
@@ -228,8 +228,13 @@ public class Node implements Serializable {
         } else if (typeStr.equals(NodeIDType.PRODUCTION)) {
             this.nodeID = IDStr;
         } else {
-            // We need to lookup via OSGi service registry for an
-            // handler for this
+            //Use plugin's method to get appropriate conversion from IDStr to nodeID
+            INodeFactory f = (INodeFactory) ServiceHelper
+                    .getGlobalInstance(INodeFactory.class, new Node(), "(protocolName="+typeStr+")");
+            if(f!=null){
+                Node n = f.fromString(typeStr, IDStr);
+                this.nodeID = n.nodeID;
+            }
         }
     }