* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
@Override
public final FluentFuture<Optional<NormalizedNode>> read(final LogicalDatastoreType store,
final YangInstanceIdentifier path) {
- switch (store) {
- case CONFIGURATION:
- return readConfigurationData(path);
- case OPERATIONAL:
- return readOperationalData(path);
- default:
+ return switch (store) {
+ case CONFIGURATION -> readConfigurationData(path);
+ case OPERATIONAL -> readOperationalData(path);
+ default -> {
LOG.info("Unknown datastore type: {}.", store);
throw new IllegalArgumentException(String.format(
"%s, Cannot read data %s for %s datastore, unknown datastore type", id, path, store));
- }
+ }
+ };
}
@Override
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static com.google.common.base.Preconditions.checkState;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public abstract class AbstractWriteTx implements DOMDataTreeWriteTransaction {
-
+abstract class AbstractWriteTx implements DOMDataTreeWriteTransaction {
private static final Logger LOG = LoggerFactory.getLogger(AbstractWriteTx.class);
- protected final RemoteDeviceId id;
- protected final NetconfBaseOps netOps;
- protected final boolean rollbackSupport;
- protected final List<ListenableFuture<? extends DOMRpcResult>> resultsFutures = new ArrayList<>();
+ final RemoteDeviceId id;
+ final NetconfBaseOps netOps;
+ final boolean rollbackSupport;
+ final List<ListenableFuture<? extends DOMRpcResult>> resultsFutures = new ArrayList<>();
private final List<TxListener> listeners = new CopyOnWriteArrayList<>();
// Allow commit to be called only once
- protected volatile boolean finished = false;
- protected final boolean isLockAllowed;
+ volatile boolean finished = false;
+ final boolean isLockAllowed;
@SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR", justification = "Behavior-only subclasses")
AbstractWriteTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport,
init();
}
- protected static boolean isSuccess(final DOMRpcResult result) {
+ static boolean isSuccess(final DOMRpcResult result) {
return result.errors().isEmpty();
}
- protected void checkNotFinished() {
+ void checkNotFinished() {
checkState(!isFinished(), "%s: Transaction %s already finished", id, getIdentifier());
}
- protected boolean isFinished() {
+ boolean isFinished() {
return finished;
}
}
// FIXME: only called from ctor which needs @SuppressDBWarnings. Refactor class hierarchy without this method (here)
- protected abstract void init();
+ abstract void init();
- protected abstract void cleanup();
+ abstract void cleanup();
@Override
public Object getIdentifier() {
return FluentFuture.from(resultFuture);
}
- protected final ListenableFuture<RpcResult<Void>> commitConfiguration() {
+ final ListenableFuture<RpcResult<Void>> commitConfiguration() {
listeners.forEach(listener -> listener.onTransactionSubmitted(this));
checkNotFinished();
finished = true;
return result;
}
- protected abstract ListenableFuture<RpcResult<Void>> performCommit();
+ abstract ListenableFuture<RpcResult<Void>> performCommit();
private void checkEditable(final LogicalDatastoreType store) {
checkNotFinished();
"Can edit only configuration data, not %s", store);
}
- protected abstract void editConfig(YangInstanceIdentifier path, Optional<NormalizedNode> data,
- DataContainerChild editStructure,
- Optional<EffectiveOperation> defaultOperation, String operation);
+ abstract void editConfig(YangInstanceIdentifier path, Optional<NormalizedNode> data,
+ DataContainerChild editStructure, Optional<EffectiveOperation> defaultOperation,
+ String operation);
- protected ListenableFuture<RpcResult<Void>> resultsToTxStatus() {
+ ListenableFuture<RpcResult<Void>> resultsToTxStatus() {
final SettableFuture<RpcResult<Void>> transformed = SettableFuture.create();
Futures.addCallback(Futures.allAsList(resultsFutures), new FutureCallback<List<DOMRpcResult>>() {
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import com.google.common.util.concurrent.FluentFuture;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public final class FieldsAwareReadOnlyTx extends AbstractReadOnlyTx implements NetconfDOMFieldsReadTransaction {
+final class FieldsAwareReadOnlyTx extends AbstractReadOnlyTx implements NetconfDOMFieldsReadTransaction {
private static final Logger LOG = LoggerFactory.getLogger(FieldsAwareReadOnlyTx.class);
- public FieldsAwareReadOnlyTx(final NetconfBaseOps netconfOps, final RemoteDeviceId id) {
+ FieldsAwareReadOnlyTx(final NetconfBaseOps netconfOps, final RemoteDeviceId id) {
super(netconfOps, id);
}
@Override
public FluentFuture<Optional<NormalizedNode>> read(final LogicalDatastoreType store,
final YangInstanceIdentifier path, final List<YangInstanceIdentifier> fields) {
- switch (store) {
- case CONFIGURATION:
- return readConfigurationData(path, fields);
- case OPERATIONAL:
- return readOperationalData(path, fields);
- default:
+ return switch (store) {
+ case CONFIGURATION -> readConfigurationData(path, fields);
+ case OPERATIONAL -> readOperationalData(path, fields);
+ default -> {
LOG.warn("Unknown datastore type: {}.", store);
throw new IllegalArgumentException(String.format(
"%s, Cannot read data %s with fields %s for %s datastore, unknown datastore type",
id, path, fields, store));
- }
+ }
+ };
}
private @NonNull FluentFuture<Optional<NormalizedNode>> readConfigurationData(
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import com.google.common.util.concurrent.FluentFuture;
import java.util.List;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-public final class FieldsAwareReadWriteTx extends ReadWriteTx<NetconfDOMFieldsReadTransaction>
+final class FieldsAwareReadWriteTx extends ReadWriteTx<NetconfDOMFieldsReadTransaction>
implements NetconfDOMFieldsReadWriteTransaction {
-
- public FieldsAwareReadWriteTx(final NetconfDOMFieldsReadTransaction readTransaction,
- final DOMDataTreeWriteTransaction writeTransaction) {
+ FieldsAwareReadWriteTx(final NetconfDOMFieldsReadTransaction readTransaction,
+ final DOMDataTreeWriteTransaction writeTransaction) {
super(readTransaction, writeTransaction);
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static java.util.Objects.requireNonNull;
public final class FieldsAwareTxChain extends AbstractTxChain implements NetconfDOMFieldsTransactionChain {
private final NetconfDOMDataBrokerFieldsExtension dataBrokerFieldsExtension;
- public FieldsAwareTxChain(final DOMDataBroker dataBroker, final DOMTransactionChainListener listener,
+ FieldsAwareTxChain(final DOMDataBroker dataBroker, final DOMTransactionChainListener listener,
final NetconfDOMDataBrokerFieldsExtension dataBrokerFieldsExtension) {
super(dataBroker, listener);
this.dataBrokerFieldsExtension = requireNonNull(dataBrokerFieldsExtension);
import org.opendaylight.netconf.dom.api.tx.NetconfDOMFieldsReadWriteTransaction;
import org.opendaylight.netconf.dom.api.tx.NetconfDOMFieldsTransactionChain;
import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.FieldsAwareReadOnlyTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.FieldsAwareReadWriteTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.FieldsAwareTxChain;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadOnlyTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadWriteTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.TxChain;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateRunningTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteRunningTx;
import org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps;
import org.opendaylight.yangtools.rfc8528.data.api.MountPointContext;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import org.opendaylight.netconf.client.mdsal.api.RemoteDeviceId;
import org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps;
-public final class ReadOnlyTx extends AbstractReadOnlyTx {
- public ReadOnlyTx(final NetconfBaseOps netconfOps, final RemoteDeviceId id) {
+final class ReadOnlyTx extends AbstractReadOnlyTx {
+ ReadOnlyTx(final NetconfBaseOps netconfOps, final RemoteDeviceId id) {
super(netconfOps, id);
}
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import com.google.common.util.concurrent.FluentFuture;
import java.util.Optional;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-public class ReadWriteTx<T extends DOMDataTreeReadTransaction> implements DOMDataTreeReadWriteTransaction {
+class ReadWriteTx<T extends DOMDataTreeReadTransaction> implements DOMDataTreeReadWriteTransaction {
private final DOMDataTreeWriteTransaction delegateWriteTx;
final T delegateReadTx;
- public ReadWriteTx(final T delegateReadTx, final DOMDataTreeWriteTransaction delegateWriteTx) {
+ ReadWriteTx(final T delegateReadTx, final DOMDataTreeWriteTransaction delegateWriteTx) {
this.delegateReadTx = delegateReadTx;
this.delegateWriteTx = delegateWriteTx;
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
/**
* {@link DOMTransactionChain} implementation for Netconf connector.
*/
-public final class TxChain extends AbstractTxChain {
- public TxChain(final DOMDataBroker dataBroker, final DOMTransactionChainListener listener) {
+final class TxChain extends AbstractTxChain {
+ TxChain(final DOMDataBroker dataBroker, final DOMTransactionChainListener listener) {
super(dataBroker, listener);
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
interface TxListener {
-
/**
* Invoked, when transaction completes successfully.
* @param transaction transaction
* @param transaction transaction
*/
void onTransactionSubmitted(AbstractWriteTx transaction);
-
-
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import org.opendaylight.netconf.client.mdsal.api.RemoteDeviceId;
import org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps;
* <li>Running datastore is locked as the first thing and this lock has to succeed</li>
* </ul>
*/
-public class WriteCandidateRunningTx extends WriteCandidateTx {
+class WriteCandidateRunningTx extends WriteCandidateTx {
private static final Logger LOG = LoggerFactory.getLogger(WriteCandidateRunningTx.class);
- public WriteCandidateRunningTx(final RemoteDeviceId id, final NetconfBaseOps netOps,
- final boolean rollbackSupport) {
+ WriteCandidateRunningTx(final RemoteDeviceId id, final NetconfBaseOps netOps, final boolean rollbackSupport) {
this(id, netOps, rollbackSupport, true);
}
- public WriteCandidateRunningTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps,
- final boolean rollbackSupport, final boolean isLockAllowed) {
+ WriteCandidateRunningTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport,
+ final boolean isLockAllowed) {
super(id, netconfOps, rollbackSupport, isLockAllowed);
}
@Override
- protected synchronized void init() {
+ synchronized void init() {
lockRunning();
super.init();
}
@Override
- protected void cleanupOnSuccess() {
+ void cleanupOnSuccess() {
super.cleanupOnSuccess();
unlockRunning();
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
* <li>Commit and Unlock candidate datastore async</li>
* </ol>
*/
-public class WriteCandidateTx extends AbstractWriteTx {
+class WriteCandidateTx extends AbstractWriteTx {
private static final Logger LOG = LoggerFactory.getLogger(WriteCandidateTx.class);
- public WriteCandidateTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport) {
+ WriteCandidateTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport) {
this(id, netconfOps, rollbackSupport, true);
}
- public WriteCandidateTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport,
+ WriteCandidateTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport,
final boolean isLockAllowed) {
super(id, netconfOps, rollbackSupport, isLockAllowed);
}
@Override
- protected synchronized void init() {
+ synchronized void init() {
LOG.trace("{}: Initializing {} transaction", id, getClass().getSimpleName());
lock();
}
}
@Override
- protected void cleanup() {
+ void cleanup() {
discardChanges();
cleanupOnSuccess();
}
return txResult;
}
- protected void cleanupOnSuccess() {
+ void cleanupOnSuccess() {
unlock();
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
* <li>Unlock running datastore on tx commit</li>
* </ol>
*/
-public class WriteRunningTx extends AbstractWriteTx {
-
+class WriteRunningTx extends AbstractWriteTx {
private static final Logger LOG = LoggerFactory.getLogger(WriteRunningTx.class);
+
private final List<Change> changes = new ArrayList<>();
- public WriteRunningTx(final RemoteDeviceId id, final NetconfBaseOps netOps,
- final boolean rollbackSupport) {
+ WriteRunningTx(final RemoteDeviceId id, final NetconfBaseOps netOps, final boolean rollbackSupport) {
this(id, netOps, rollbackSupport, true);
}
- public WriteRunningTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport,
+ WriteRunningTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport,
final boolean isLockAllowed) {
super(id, netconfOps, rollbackSupport, isLockAllowed);
}
@Override
- protected synchronized void init() {
+ synchronized void init() {
lock();
}
}
@Override
- protected void cleanup() {
+ void cleanup() {
unlock();
}
}
private static final class Change {
-
private final DataContainerChild editStructure;
private final Optional<EffectiveOperation> defaultOperation;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.mockito.Mockito.verify;
import org.opendaylight.netconf.client.mdsal.api.RemoteDeviceServices.Rpcs;
import org.opendaylight.netconf.client.mdsal.impl.NetconfMessageTransformer;
import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.TxTestUtils;
import org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.IetfNetconfService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
import org.opendaylight.netconf.dom.api.tx.NetconfDOMFieldsReadTransaction;
import org.opendaylight.netconf.dom.api.tx.NetconfDOMFieldsReadWriteTransaction;
import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.AbstractWriteTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateRunningTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateTx;
-import org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteRunningTx;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.IetfNetconfService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.monitoring.rev220718.NetconfTcp;
import org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class NetconfDeviceWriteOnlyTxTest extends AbstractBaseSchemasTest {
-
private final RemoteDeviceId id = new RemoteDeviceId("test-mount", new InetSocketAddress(99));
@Mock
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.junit.Assert.assertNotEquals;
import static org.mockito.ArgumentMatchers.any;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.never;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class TxChainTest {
-
@Mock
private DOMDataBroker broker;
@Mock
private AutoCloseable registration2;
@Mock
private AutoCloseable registration3;
- private final ArgumentCaptor<TxListener> captor = ArgumentCaptor.forClass(TxListener.class);
+ @Captor
+ private ArgumentCaptor<TxListener> captor;
private TxChain chain;
@Before
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
+import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
public final class TxTestUtils {
-
private static final QName Q_NAME_1 = QName.create("test:namespace", "2013-07-22", "c");
private static final QName Q_NAME_2 = QName.create(Q_NAME_1, "a");
private TxTestUtils() {
-
+ // Hidden on purpose
}
static YangInstanceIdentifier getContainerId() {
- return YangInstanceIdentifier.builder()
- .node(Q_NAME_1)
- .build();
+ return YangInstanceIdentifier.builder().node(Q_NAME_1).build();
}
- public static YangInstanceIdentifier getLeafId() {
- return YangInstanceIdentifier.builder()
- .node(Q_NAME_1)
- .node(Q_NAME_2)
- .build();
+ static YangInstanceIdentifier getLeafId() {
+ return YangInstanceIdentifier.builder().node(Q_NAME_1).node(Q_NAME_2).build();
}
static ContainerNode getContainerNode() {
- return Builders.containerBuilder()
- .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(Q_NAME_1))
- .build();
+ return ImmutableNodes.containerNode(Q_NAME_1);
}
public static LeafNode<String> getLeafNode() {
- return Builders.<String>leafBuilder()
- .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(Q_NAME_2))
- .withValue("data")
- .build();
+ return ImmutableNodes.leafNode(Q_NAME_2, "data");
}
}
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
* 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;
+package org.opendaylight.netconf.sal.connect.netconf.sal;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;