Bump upstream versions
[netconf.git] / netconf / mdsal-netconf-connector / src / main / java / org / opendaylight / netconf / mdsal / connector / ops / Unlock.java
index 00e7506bc5f68d7f0f4c5a201aff9529df01be96..4fd8f22feece27d84910fc89154fe3ef9a2f109b 100644 (file)
@@ -10,8 +10,10 @@ 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.opendaylight.yangtools.yang.common.ErrorSeverity;
+import org.opendaylight.yangtools.yang.common.ErrorTag;
+import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
@@ -22,9 +24,7 @@ import org.w3c.dom.Element;
    operations/UnLock.java
 */
 public class Unlock extends AbstractSingletonNetconfOperation {
-
     private static final Logger LOG = LoggerFactory.getLogger(Unlock.class);
-
     private static final String OPERATION_NAME = "unlock";
 
     public Unlock(final String netconfSessionIdForReporting) {
@@ -37,17 +37,15 @@ 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",
-                DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_NOT_SUPPORTED,
-                DocumentedException.ErrorSeverity.ERROR);
+                ErrorType.APPLICATION, ErrorTag.OPERATION_NOT_SUPPORTED, ErrorSeverity.ERROR);
     }
 
     @Override
     protected String getOperationName() {
         return OPERATION_NAME;
     }
-
 }