* 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.sal.connect.netconf.sal.tx;
-import com.google.common.base.Optional;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.List;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
+import java.util.Optional;
+import org.opendaylight.mdsal.dom.api.DOMRpcResult;
import org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps;
import org.opendaylight.netconf.sal.connect.netconf.util.NetconfRpcFutureCallback;
import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
public WriteRunningTx(final RemoteDeviceId id, final NetconfBaseOps netOps,
final boolean rollbackSupport) {
- super(netOps, id, rollbackSupport);
+ this(id, netOps, rollbackSupport, true);
+ }
+
+ public WriteRunningTx(RemoteDeviceId id, NetconfBaseOps netconfOps, boolean rollbackSupport,
+ boolean isLockAllowed) {
+ super(id, netconfOps, rollbackSupport, isLockAllowed);
}
@Override
}
private void lock() {
- resultsFutures.add(netOps.lockRunning(new NetconfRpcFutureCallback("Lock running", id)));
+ if (isLockAllowed) {
+ resultsFutures.add(netOps.lockRunning(new NetconfRpcFutureCallback("Lock running", id)));
+ } else {
+ LOG.trace("Lock is not allowed: {}", id);
+ }
}
@Override
}
private void unlock() {
- netOps.unlockRunning(new NetconfRpcFutureCallback("Unlock running", id));
+ if (isLockAllowed) {
+ netOps.unlockRunning(new NetconfRpcFutureCallback("Unlock running", id));
+ } else {
+ LOG.trace("Unlock is not allowed: {}", id);
+ }
}
private static final class Change {