X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fmapping%2FAbstractNetconfOperation.java;h=79d1ddf79a55c78397433bd5131f21ff55b33d5b;hb=3ab0ebe1df3e7606cce0a61572f79bf12deb17c0;hp=2e3100f8b22351b1f3736ddf2d6ac1df20e90b32;hpb=9070e358923aca6229137d46f9cae7ff458204dd;p=controller.git diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java index 2e3100f8b2..79d1ddf79a 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java @@ -22,6 +22,8 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; +import com.google.common.base.Optional; + public abstract class AbstractNetconfOperation implements NetconfOperation { private final String netconfSessionIdForReporting; @@ -92,13 +94,12 @@ public abstract class AbstractNetconfOperation implements NetconfOperation { Map attributes = requestElement.getAttributes(); Element response = handle(document, operationElement, subsequentOperation); - Element rpcReply = document.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, - XmlNetconfConstants.RPC_REPLY_KEY); + Element rpcReply = XmlUtil.createElement(document, XmlNetconfConstants.RPC_REPLY_KEY, Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); if(XmlElement.fromDomElement(response).hasNamespace()) { rpcReply.appendChild(response); } else { - Element responseNS = document.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, response.getNodeName()); + Element responseNS = XmlUtil.createElement(document, response.getNodeName(), Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); NodeList list = response.getChildNodes(); while(list.getLength()!=0) { responseNS.appendChild(list.item(0)); @@ -118,8 +119,12 @@ public abstract class AbstractNetconfOperation implements NetconfOperation { @Override public String toString() { - final StringBuffer sb = new StringBuffer("AbstractConfigNetconfOperation{"); - sb.append("name=").append(getOperationName()); + final StringBuffer sb = new StringBuffer(getClass().getName()); + try { + sb.append("{name=").append(getOperationName()); + } catch(UnsupportedOperationException e) { + // no problem + } sb.append(", namespace=").append(getOperationNamespace()); sb.append(", session=").append(netconfSessionIdForReporting); sb.append('}');