X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Fmapping%2Fattributes%2Ffromxml%2FObjectNameAttributeReadingStrategy.java;h=8720c654c61f993f09d6503305fdc471d4065a94;hb=25a9fb7730311a5ca298d8c6c8b24f0afb0e27be;hp=bf9eee7f267fd5ded0f73f431443eecb9fa76183;hpb=027bc8f87341f432654c3aaa7771658c25d2ca7d;p=controller.git diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/ObjectNameAttributeReadingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/ObjectNameAttributeReadingStrategy.java index bf9eee7f26..8720c654c6 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/ObjectNameAttributeReadingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/ObjectNameAttributeReadingStrategy.java @@ -8,20 +8,18 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.fromxml; import com.google.common.base.Preconditions; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.mapping.ObjectNameAttributeMappingStrategy; -import org.opendaylight.controller.netconf.util.xml.XmlElement; -import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.List; import java.util.Map; +import org.opendaylight.controller.netconf.api.NetconfDocumentedException; +import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.mapping.ObjectNameAttributeMappingStrategy; +import org.opendaylight.controller.netconf.util.xml.XmlElement; + public class ObjectNameAttributeReadingStrategy extends AbstractAttributeReadingStrategy { private static final Object PREFIX_SEPARATOR = ":"; - private static final Logger logger = LoggerFactory.getLogger(ObjectNameAttributeReadingStrategy.class); public ObjectNameAttributeReadingStrategy(String nullableDefault) { super(nullableDefault); @@ -39,8 +37,7 @@ public class ObjectNameAttributeReadingStrategy extends AbstractAttributeReading } private ObjectNameAttributeMappingStrategy.MappedDependency resolve(XmlElement firstChild) throws NetconfDocumentedException{ - XmlElement typeElement = null; - typeElement = firstChild.getOnlyChildElementWithSameNamespace(XmlNetconfConstants.TYPE_KEY); + XmlElement typeElement = firstChild.getOnlyChildElementWithSameNamespace(XmlNetconfConstants.TYPE_KEY); Map.Entry prefixNamespace = typeElement.findNamespaceOfTextContent(); String serviceName = checkPrefixAndExtractServiceName(typeElement, prefixNamespace); @@ -54,7 +51,7 @@ public class ObjectNameAttributeReadingStrategy extends AbstractAttributeReading public static String checkPrefixAndExtractServiceName(XmlElement typeElement, Map.Entry prefixNamespace) throws NetconfDocumentedException { String serviceName = typeElement.getTextContent(); - + // FIXME: comparing Entry with String: Preconditions.checkState(!prefixNamespace.equals(""), "Service %s value not prefixed with namespace", XmlNetconfConstants.TYPE_KEY); String prefix = prefixNamespace.getKey() + PREFIX_SEPARATOR;