Bug 714 - Fixed creating DOM Document's element with namespace
[controller.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / controller / netconf / impl / mapping / operations / DefaultCloseSession.java
index 8bc93e051253098fdadd361c3fd4a87d23dd8a4a..2b48f5d51c5877d6441a9052e75b5aae283ac2c2 100644 (file)
@@ -14,9 +14,12 @@ import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
 import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import com.google.common.base.Optional;
+
 public class DefaultCloseSession extends AbstractSingletonNetconfOperation {
     public static final String CLOSE_SESSION = "close-session";
     private final AutoCloseable sessionResources;
@@ -48,6 +51,6 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation {
                     NetconfDocumentedException.ErrorSeverity.error, Collections.singletonMap(
                     NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage()));
         }
-        return document.createElement(XmlNetconfConstants.OK);
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
     }
 }