Serialization of config was incorrectly using derived service name
instead of the name that was configured in xml.
Change-Id: Idf455f62b1ade06a3e52e4936227f485f74c8ef3
Signed-off-by: Tomas Cere <tcere@cisco.com>
public AttributeMappingStrategy<?, ? extends OpenType<?>> prepareStrategy(AttributeIfc attributeIfc) {
if(attributeIfc instanceof DependencyAttribute) {
public AttributeMappingStrategy<?, ? extends OpenType<?>> prepareStrategy(AttributeIfc attributeIfc) {
if(attributeIfc instanceof DependencyAttribute) {
- serviceNameOfDepAttr = ((DependencyAttribute)attributeIfc).getDependency().getSie().getQName().getLocalName();
namespaceOfDepAttr = ((DependencyAttribute)attributeIfc).getDependency().getSie().getQName().getNamespace().toString();
} else if (attributeIfc instanceof ListDependenciesAttribute) {
namespaceOfDepAttr = ((DependencyAttribute)attributeIfc).getDependency().getSie().getQName().getNamespace().toString();
} else if (attributeIfc instanceof ListDependenciesAttribute) {
- serviceNameOfDepAttr = ((ListDependenciesAttribute)attributeIfc).getDependency().getSie().getQName().getLocalName();
namespaceOfDepAttr = ((ListDependenciesAttribute)attributeIfc).getDependency().getSie().getQName().getNamespace().toString();
}
namespaceOfDepAttr = ((ListDependenciesAttribute)attributeIfc).getDependency().getSie().getQName().getNamespace().toString();
}
return new UnionCompositeAttributeMappingStrategy(compositeType, innerStrategies, attributeMapping);
}
return new UnionCompositeAttributeMappingStrategy(compositeType, innerStrategies, attributeMapping);
}
- private String serviceNameOfDepAttr;
private String namespaceOfDepAttr;
@Override
protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseDependencyAttribute(
SimpleType<?> openType) {
private String namespaceOfDepAttr;
@Override
protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseDependencyAttribute(
SimpleType<?> openType) {
- return new ObjectNameAttributeMappingStrategy(openType,
- serviceNameOfDepAttr, namespaceOfDepAttr);
+ return new ObjectNameAttributeMappingStrategy(openType, namespaceOfDepAttr);
import javax.management.openmbean.SimpleType;
import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
import org.opendaylight.controller.netconf.confignetconfconnector.util.Util;
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<?>> {
public class ObjectNameAttributeMappingStrategy extends
AbstractAttributeMappingStrategy<ObjectNameAttributeMappingStrategy.MappedDependency, SimpleType<?>> {
- private final String serviceName;
private final String namespace;
private final String namespace;
- public ObjectNameAttributeMappingStrategy(SimpleType<?> openType, String serviceName, String namespace) {
+ public ObjectNameAttributeMappingStrategy(SimpleType<?> openType, String namespace) {
- this.serviceName = serviceName;
this.namespace = namespace;
}
this.namespace = namespace;
}
String refName = ObjectNameUtil.getReferenceName(on);
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 {
}
public static class MappedDependency {