BUG 2596: Use base service name in service serialization.
[controller.git] / opendaylight / netconf / config-netconf-connector / src / main / java / org / opendaylight / controller / netconf / confignetconfconnector / mapping / attributes / mapping / ObjectNameAttributeMappingStrategy.java
index b827a5b..b0569de 100644 (file)
@@ -14,16 +14,15 @@ import javax.management.ObjectName;
 import javax.management.openmbean.SimpleType;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.netconf.confignetconfconnector.util.Util;
+import org.opendaylight.yangtools.yang.common.QName;
 
 public class ObjectNameAttributeMappingStrategy extends
         AbstractAttributeMappingStrategy<ObjectNameAttributeMappingStrategy.MappedDependency, SimpleType<?>> {
 
-    private final String serviceName;
     private final String namespace;
 
-    public ObjectNameAttributeMappingStrategy(SimpleType<?> openType,  String serviceName, String namespace) {
+    public ObjectNameAttributeMappingStrategy(SimpleType<?> openType, String namespace) {
         super(openType);
-        this.serviceName = serviceName;
         this.namespace = namespace;
     }
 
@@ -43,7 +42,9 @@ public class ObjectNameAttributeMappingStrategy extends
 
         String refName = ObjectNameUtil.getReferenceName(on);
 
-        return Optional.of(new MappedDependency(namespace, serviceName, refName));
+        //we want to use the exact service name that was configured in xml so services that are referencing it can be resolved
+        return Optional.of(new MappedDependency(namespace,
+                QName.create(ObjectNameUtil.getServiceQName(on)).getLocalName(), refName));
     }
 
     public static class MappedDependency {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.