Add netconf.api.NamespaceURN
[netconf.git] / protocol / netconf-server / src / main / java / org / opendaylight / netconf / server / api / operations / AbstractNetconfOperation.java
index e910409d93ebaa53b6ed9fffcf1e01d8bd8ce148..47884c9c8ffa9a23c6a49fea4b2bf98eacfcf8a7 100644 (file)
@@ -13,6 +13,7 @@ import java.util.Map;
 import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.netconf.api.DocumentedException;
+import org.opendaylight.netconf.api.NamespaceURN;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -73,7 +74,7 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
 
     protected static XmlElement getRequestElementWithCheck(final Document message) throws DocumentedException {
         return XmlElement.fromDomElementWithExpected(message.getDocumentElement(), XmlNetconfConstants.RPC_KEY,
-                XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
+            NamespaceURN.BASE);
     }
 
     protected HandlingPriority getHandlingPriority() {
@@ -81,7 +82,7 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
     }
 
     protected String getOperationNamespace() {
-        return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0;
+        return NamespaceURN.BASE;
     }
 
     protected abstract String getOperationName();
@@ -99,13 +100,13 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
 
         Element response = handle(document, operationElement, subsequentOperation);
         Element rpcReply = XmlUtil.createElement(document, XmlNetconfConstants.RPC_REPLY_KEY,
-                Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0));
+                Optional.of(NamespaceURN.BASE));
 
         if (XmlElement.fromDomElement(response).hasNamespace()) {
             rpcReply.appendChild(response);
         } else {
             Element responseNS = XmlUtil.createElement(document, response.getNodeName(),
-                    Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0));
+                    Optional.of(NamespaceURN.BASE));
             NodeList list = response.getChildNodes();
             while (list.getLength() != 0) {
                 responseNS.appendChild(list.item(0));