Merge "Eliminate XmlUtil.createElement(Document, String)"
authorJakub Morvay <jakub.morvay@gmail.com>
Thu, 17 Jan 2019 14:11:46 +0000 (14:11 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 17 Jan 2019 14:11:46 +0000 (14:11 +0000)
20 files changed:
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Commit.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/CopyConfig.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/DiscardChanges.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/EditConfig.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Lock.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Unlock.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Validate.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/Get.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/GetConfig.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlUtil.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultCloseSession.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/CreateSubscription.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedDiscardChanges.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedEditConfig.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedLock.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java

index 4f71ac89c07600db47496bff7e4e0740bc58810b..53b7ba4a107e0fdb0cdb41e0b2da10a3fd382872 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.mdsal.connector.ops;
 import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.mdsal.connector.TransactionProvider;
 import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.slf4j.Logger;
@@ -40,7 +39,7 @@ public class Commit extends AbstractSingletonNetconfOperation {
         boolean commitStatus = transactionProvider.commitTransaction();
         LOG.trace("Commit completed successfully {}", commitStatus);
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override
index a06dbf82a21be393f229d6ee93d3a249145973a8..99bb53650cf3e145658177ef7797c4ebb013e790 100644 (file)
@@ -93,7 +93,7 @@ public final class CopyConfig extends AbstractEdit {
                 ErrorTag.BAD_ELEMENT,
                 ErrorSeverity.ERROR);
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     private void copyToCandidate(final XmlElement operationElement)
index 3ec15d473db0f9d8401a248766a87892eb5ba89b..726a1606830a57bfc4a79429fb0703fb2759a944 100644 (file)
@@ -15,7 +15,6 @@ import org.opendaylight.netconf.api.DocumentedException.ErrorTag;
 import org.opendaylight.netconf.api.DocumentedException.ErrorType;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.mdsal.connector.TransactionProvider;
 import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.slf4j.Logger;
@@ -51,7 +50,7 @@ public class DiscardChanges extends AbstractSingletonNetconfOperation {
             throw new DocumentedException(e.getMessage(), e, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED,
                     ErrorSeverity.ERROR, errorInfo);
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override
index dc107b8f65b0eefca045b245469460ba045eb030..0fc35ee659b7210633489dfbcebdb48a3224f426 100644 (file)
@@ -20,7 +20,6 @@ import org.opendaylight.netconf.api.DocumentedException.ErrorTag;
 import org.opendaylight.netconf.api.DocumentedException.ErrorType;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.mdsal.connector.CurrentSchemaContext;
 import org.opendaylight.netconf.mdsal.connector.TransactionProvider;
 import org.opendaylight.netconf.mdsal.connector.ops.DataTreeChangeTracker.DataTreeChange;
@@ -81,7 +80,7 @@ public final class EditConfig extends AbstractEdit {
             executeOperations(changeTracker);
         }
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     private void executeOperations(final DataTreeChangeTracker changeTracker) throws DocumentedException {
index 4c0554a3581972ce02613ea1e3b0ec32864c4861..aac3f1e87506c80f3bcde22926bae4d07857cf8b 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.mdsal.connector.ops;
 import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -38,7 +37,7 @@ public class Lock extends AbstractSingletonNetconfOperation {
         final Datastore targetDatastore = extractTargetParameter(operationElement);
         if (targetDatastore == Datastore.candidate) {
             LOG.debug("Locking candidate datastore on session: {}", getNetconfSessionIdForReporting());
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+            return document.createElement(XmlNetconfConstants.OK);
         }
 
         throw new DocumentedException("Unable to lock " + targetDatastore + " datastore",
index 00e7506bc5f68d7f0f4c5a201aff9529df01be96..3690e1cc175cfadd4205d16d71f7211a8de2c1bf 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.mdsal.connector.ops;
 import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,7 +36,7 @@ public class Unlock extends AbstractSingletonNetconfOperation {
         final Datastore targetDatastore = Lock.extractTargetParameter(operationElement);
         if (targetDatastore == Datastore.candidate) {
             LOG.debug("Unlocking candidate datastore on session: {}", getNetconfSessionIdForReporting());
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+            return document.createElement(XmlNetconfConstants.OK);
         }
 
         throw new DocumentedException("Unable to unlock " + targetDatastore + " datastore",
index df1657b5bf51ea6cbae4927999dee57941a18f14..165e7eee948aa8c5eb7c57589ae6c50f3b2c8f86 100644 (file)
@@ -15,7 +15,6 @@ import org.opendaylight.netconf.api.DocumentedException.ErrorTag;
 import org.opendaylight.netconf.api.DocumentedException.ErrorType;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.mdsal.connector.TransactionProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,7 +47,7 @@ public final class Validate extends AbstractConfigOperation {
 
         transactionProvider.validateTransaction();
         LOG.trace("<validate> request completed successfully on session {}", getNetconfSessionIdForReporting());
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     protected static Datastore extractSourceParameter(final XmlElement operationElement, final String operationName)
index 8dadc6bec1e59deac8e1df78719f9a215a7019b2..d26b1fba65fe43cfd92207f78b7c2de0ce10a3ee 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.netconf.api.DocumentedException.ErrorTag;
 import org.opendaylight.netconf.api.DocumentedException.ErrorType;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.mdsal.connector.CurrentSchemaContext;
 import org.opendaylight.netconf.mdsal.connector.TransactionProvider;
 import org.opendaylight.netconf.mdsal.connector.ops.Datastore;
@@ -47,7 +46,7 @@ public class Get extends AbstractGet {
 
         final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
         if (!dataRootOptional.isPresent()) {
-            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
+            return document.createElement(XmlNetconfConstants.DATA_KEY);
         }
 
         final YangInstanceIdentifier dataRoot = dataRootOptional.get();
@@ -59,7 +58,7 @@ public class Get extends AbstractGet {
             transactionProvider.abortRunningTransaction(rwTx);
 
             if (!normalizedNodeOptional.isPresent()) {
-                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
+                return document.createElement(XmlNetconfConstants.DATA_KEY);
             }
 
             return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
index b23473da545c119cd9bb4cf28c4c8e1d156d246f..ef434b80f67aabc8f70864ba90c69bb6df6ce388 100644 (file)
@@ -18,7 +18,6 @@ import org.opendaylight.netconf.api.DocumentedException.ErrorTag;
 import org.opendaylight.netconf.api.DocumentedException.ErrorType;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.mdsal.connector.CurrentSchemaContext;
 import org.opendaylight.netconf.mdsal.connector.TransactionProvider;
 import org.opendaylight.netconf.mdsal.connector.ops.Datastore;
@@ -56,7 +55,7 @@ public class GetConfig extends AbstractGet {
 
         final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
         if (!dataRootOptional.isPresent()) {
-            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
+            return document.createElement(XmlNetconfConstants.DATA_KEY);
         }
 
         final YangInstanceIdentifier dataRoot = dataRootOptional.get();
@@ -73,7 +72,7 @@ public class GetConfig extends AbstractGet {
             }
 
             if (!normalizedNodeOptional.isPresent()) {
-                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
+                return document.createElement(XmlNetconfConstants.DATA_KEY);
             }
 
             return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
index b3d9d3e872399b5f69bb8ed94372f5225920fe0e..d3c40614280e9a28c099be6d8eb37d0d3715d707 100644 (file)
@@ -120,22 +120,20 @@ public final class XmlUtil {
         return DEFAULT_DOM_BUILDER.get().newDocument();
     }
 
-    public static Element createElement(final Document document, final String qname) {
-        return createElement(document, qname, Optional.empty());
-    }
-
     public static Element createElement(final Document document, final String qname,
             final Optional<String> namespaceURI) {
-        if (namespaceURI.isPresent()) {
-            final Element element = document.createElementNS(namespaceURI.get(), qname);
-            String name = XMLNS_ATTRIBUTE;
-            if (element.getPrefix() != null) {
-                name += ":" + element.getPrefix();
-            }
-            element.setAttributeNS(XMLNS_ATTRIBUTE_NS_URI, name, namespaceURI.get());
-            return element;
+        if (!namespaceURI.isPresent()) {
+            return document.createElement(qname);
         }
-        return document.createElement(qname);
+
+        final String uri = namespaceURI.get();
+        final Element element = document.createElementNS(uri, qname);
+        String name = XMLNS_ATTRIBUTE;
+        if (element.getPrefix() != null) {
+            name += ":" + element.getPrefix();
+        }
+        element.setAttributeNS(XMLNS_ATTRIBUTE_NS_URI, name, uri);
+        return element;
     }
 
     public static Element createTextElement(final Document document, final String qname, final String content,
index 1338ccdefddab234c06c641205c501b9bb6c7d93..5a5ae1cc43d837253c03637015975ac172f5f36b 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collections;
 import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.impl.NetconfServerSession;
 import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.slf4j.Logger;
@@ -58,7 +57,7 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation imple
                     DocumentedException.ErrorSeverity.ERROR, Collections.singletonMap(
                     DocumentedException.ErrorSeverity.ERROR.toString(), e.getMessage()));
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override
index 81c6af23e770c13aac3ae0c1662ecdc4acebc229..bfc59c25987040436eab781b249966011bf36ad7 100644 (file)
@@ -16,7 +16,6 @@ import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.NetconfSession;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.mapping.api.SessionAwareNetconfOperation;
 import org.opendaylight.netconf.notifications.NetconfNotification;
 import org.opendaylight.netconf.notifications.NetconfNotificationListener;
@@ -88,7 +87,7 @@ public class CreateSubscription extends AbstractSingletonNetconfOperation
                 .registerNotificationListener(streamNameType, new NotificationSubscription(netconfSession, filter));
         subscriptions.add(notificationListenerRegistration);
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     private static StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws DocumentedException {
index 93ea6eaff811877b5ce7fded318a0d01c4b00b97..aa7b3a437e18fbd593112d208b1780a5095f3700 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc;
 
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -21,7 +20,7 @@ public class SimulatedCommit extends AbstractLastNetconfOperation {
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override
index cf6fd1d74a1eb353e8362bf52dfcfbab19caa6c9..bf90d9479de66fa248cc4ffe5a3c251bef1fba44 100644 (file)
@@ -102,7 +102,7 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im
                 }, delayAggregator, TimeUnit.SECONDS);
             }
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     private static NetconfMessage parseNetconfNotification(String content) {
index 924024c2ba6311f59c0b8eb01ccdb96a2b824a98..dc445ab7ff74e140379a7ee0f19db645f48f03b7 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc;
 
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -22,7 +21,7 @@ public class SimulatedDiscardChanges extends AbstractLastNetconfOperation {
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override
index b2231f2f33cfa269cdd52cb44c4cb2172b7ceeac..65c222ec6744f0c849eac49a5956343fbea6ca2f 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.test.tool.rpc;
 import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -39,7 +38,7 @@ public class SimulatedEditConfig extends AbstractLastNetconfOperation {
             storage.setConfigList(configElementData.getChildElements());
         }
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override
index e7cc098d96fdf1f3095de83d26490d728015043b..41821f6b10ec4ca07194793b2770ec2f0c3c94bf 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc;
 
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -25,7 +24,7 @@ public class SimulatedGet extends AbstractLastNetconfOperation {
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
-        final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
+        final Element element = document.createElement(XmlNetconfConstants.DATA_KEY);
 
         for (final XmlElement e : storage.getConfigList()) {
             final Element domElement = e.getDomElement();
index ca09bb310c43a876e9bb10ea4ed8faefe8a5aad8..d7b9f09cbde07a79a38c6d450c97f1aea7db6752 100644 (file)
@@ -59,7 +59,7 @@ public class SimulatedGetConfig extends AbstractLastNetconfOperation {
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
-        final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
+        final Element element = document.createElement(XmlNetconfConstants.DATA_KEY);
 
         for (final XmlElement e : storage.getConfigList()) {
             final Element domElement = e.getDomElement();
index beda99d0660c0457f13633eee2dda724e87a43fa..38034de0e88a16e930377d3c338ed1b6ce71590e 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc;
 
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -22,7 +21,7 @@ public class SimulatedLock extends AbstractLastNetconfOperation {
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override
index 22d27f5c041e814b705bbd72340c56e4764d1758..99113eff9116d57703e370b49877cedc6644d1ad 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc;
 
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -22,7 +21,7 @@ public class SimulatedUnLock extends AbstractLastNetconfOperation {
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK);
+        return document.createElement(XmlNetconfConstants.OK);
     }
 
     @Override