From: Kalvin Hom Date: Fri, 31 May 2013 01:48:37 +0000 (-0700) Subject: Custom Node Type jaxb string to id X-Git-Tag: releasepom-0.1.0~395^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=acf200bcdbb1eb7645d803e949fd6133e80baf52 Custom Node Type jaxb string to id When using the web services, nodeIDString needs to be parsed into the correct type to get the nodeID when it is not one of the preset Node types. Change-Id: Ic55b440e0a5a951f9f8c6c167e1e1bcfa8c3b107 Signed-off-by: Kalvin Hom --- diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Node.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Node.java index ef0c0667aa..5a71ab8a69 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Node.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Node.java @@ -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; + } } }