Merge "Un-deprecate JSONRestconfService(Impl)"
[netconf.git] / netconf / mdsal-netconf-connector / src / main / java / org / opendaylight / netconf / mdsal / connector / ops / Lock.java
index 73559967f2e2f9f0a97b2cd58360239e2c0f17e9..3c0089d227a1d8c39f0261f7a35b338f85c51cac 100644 (file)
@@ -19,8 +19,10 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-// FIXME Duplicated code
-// netconf/netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/Lock.java
+/* FIXME Duplicated code
+   netconf/netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/
+   confignetconfconnector/operations/Lock.java
+ */
 public class Lock extends AbstractSingletonNetconfOperation {
 
     private static final Logger LOG = LoggerFactory.getLogger(Lock.class);
@@ -33,15 +35,17 @@ public class Lock extends AbstractSingletonNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
+            throws DocumentedException {
         final Datastore targetDatastore = extractTargetParameter(operationElement);
         if (targetDatastore == Datastore.candidate) {
             LOG.debug("Locking candidate datastore on session: {}", getNetconfSessionIdForReporting());
             return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
         }
 
-        throw new DocumentedException("Unable to lock " + targetDatastore + " datastore", DocumentedException.ErrorType.application,
-                DocumentedException.ErrorTag.operation_not_supported, DocumentedException.ErrorSeverity.error);
+        throw new DocumentedException("Unable to lock " + targetDatastore + " datastore",
+                DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_NOT_SUPPORTED,
+                DocumentedException.ErrorSeverity.ERROR);
     }
 
     static Datastore extractTargetParameter(final XmlElement operationElement) throws DocumentedException {