package org.opendaylight.netconf.mdsal.connector.ops;
import com.google.common.base.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.util.mapping.AbstractSingletonNetconfOperation;
import org.slf4j.Logger;
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/UnLock.java
+/* FIXME Duplicated code
+ netconf/netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/
+ operations/UnLock.java
+*/
public class Unlock extends AbstractSingletonNetconfOperation {
private static final Logger LOG = LoggerFactory.getLogger(Unlock.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 = Lock.extractTargetParameter(operationElement);
if (targetDatastore == Datastore.candidate) {
LOG.debug("Unlocking candidate datastore on session: {}", getNetconfSessionIdForReporting());
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
}
- throw new DocumentedException("Unable to unlock " + targetDatastore + " datastore", DocumentedException.ErrorType.application,
- DocumentedException.ErrorTag.operation_not_supported, DocumentedException.ErrorSeverity.error);
+ throw new DocumentedException("Unable to unlock " + targetDatastore + " datastore",
+ DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_NOT_SUPPORTED,
+ DocumentedException.ErrorSeverity.ERROR);
}
@Override