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);
}
@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 {