Remove DocumentedException.ErrorTag
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / customrpc / SettableRpc.java
index fddc0be003f9de1acec2c32f874b28ac025cf3d0..54f9101d4e25448baaf01aaa49c06fd343c1f3e8 100644 (file)
@@ -5,18 +5,20 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.test.tool.customrpc;
 
 import java.io.File;
 import java.util.Optional;
-import org.opendaylight.controller.config.util.xml.DocumentedException;
-import org.opendaylight.controller.config.util.xml.XmlElement;
-import org.opendaylight.controller.config.util.xml.XmlUtil;
+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.mapping.api.HandlingPriority;
 import org.opendaylight.netconf.mapping.api.NetconfOperation;
 import org.opendaylight.netconf.mapping.api.NetconfOperationChainedExecution;
+import org.opendaylight.yangtools.yang.common.ErrorSeverity;
+import org.opendaylight.yangtools.yang.common.ErrorTag;
+import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.w3c.dom.Document;
 
 /**
@@ -33,7 +35,7 @@ class SettableRpc implements NetconfOperation {
     }
 
     @Override
-    public HandlingPriority canHandle(final Document message) throws DocumentedException {
+    public HandlingPriority canHandle(final Document message) {
         return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1000);
     }
 
@@ -51,14 +53,13 @@ class SettableRpc implements NetconfOperation {
             return document;
         } else if (subsequentOperation.isExecutionTermination()) {
             throw new DocumentedException("Mapping not found " + XmlUtil.toString(requestMessage),
-                    DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_NOT_SUPPORTED,
-                    DocumentedException.ErrorSeverity.ERROR);
+                    ErrorType.APPLICATION, ErrorTag.OPERATION_NOT_SUPPORTED, ErrorSeverity.ERROR);
         } else {
             return subsequentOperation.execute(requestMessage);
         }
     }
 
-    private void checkForError(final Document document) throws DocumentedException {
+    private static void checkForError(final Document document) throws DocumentedException {
         final XmlElement rpcReply = XmlElement.fromDomDocument(document);
         if (rpcReply.getOnlyChildElementOptionally("rpc-error").isPresent()) {
             throw DocumentedException.fromXMLDocument(document);