From 91f932fd6ef4d5e3db81af8c739ace55d7c5c90e Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 24 Apr 2018 15:30:01 +0200 Subject: [PATCH] Fixup Augmentable and Identifiable methods changing This is a fixup of the change in binding codegen, adjusting: - getKey() -> key() - setKey() -> withKey() - getAugmentation() -> augmentation() Change-Id: I7533bd17bcd4a742862576d38f76991162845f4b Signed-off-by: Robert Varga Signed-off-by: Stephen Kitt --- .../mount/CallhomeStatusReporter.java | 8 ++--- .../IetfZeroTouchCallHomeServerProvider.java | 2 +- .../monitoring/MonitoringToMdsalWriter.java | 24 +++++++-------- .../MonitoringToMdsalWriterTest.java | 8 ++--- .../NotificationToMdsalWriter.java | 21 ++++++------- ...abilityChangeNotificationProducerTest.java | 10 +++---- .../NotificationToMdsalWriterTest.java | 6 ++-- .../netconf/NetconfEventSource.java | 2 +- .../netconf/NetconfEventSourceManager.java | 15 ++++------ .../NetconfEventSourceRegistration.java | 10 +++---- .../netconf/NetconfTestUtils.java | 18 +++++------ .../console/impl/NetconfCommandsImpl.java | 30 +++++++++---------- .../console/utils/NetconfConsoleUtils.java | 6 ++-- .../console/impl/NetconfCommandsImplTest.java | 14 ++++----- .../netconf/impl/NetconfServerSession.java | 10 ++----- .../NetconfCapabilityMonitoringService.java | 2 +- .../xml/model/MonitoringSession.java | 6 ++-- .../monitoring/xml/JaxBSerializerTest.java | 12 ++++---- .../impl/NetconfNotificationManager.java | 18 +++++------ .../notifications/impl/ops/GetTest.java | 2 +- .../singleton/impl/NetconfNodeManager.java | 2 +- .../impl/NetconfTopologyContext.java | 6 ++-- .../impl/NetconfTopologyManager.java | 6 ++-- .../impl/RemoteDeviceConnectorImpl.java | 2 +- .../impl/utils/NetconfTopologyUtils.java | 2 +- .../impl/MountPointEndToEndTest.java | 2 +- .../topology/AbstractNetconfTopology.java | 2 +- .../impl/NetconfConnectorFactoryImpl.java | 7 ++--- .../sal/NetconfDeviceTopologyAdapter.java | 7 ++--- .../netconf/sal/NetconfKeystoreAdapter.java | 8 ++--- .../util/NetconfSalKeystoreService.java | 21 +++++-------- .../sal/NetconfKeystoreAdapterTest.java | 4 +-- .../util/NetconfSalKeystoreServiceTest.java | 4 +-- .../test/tool/DummyMonitoringService.java | 19 ++++++------ .../listeners/ListenerAdapterTest.java | 4 +-- .../listeners/ListenerAdapterTest.java | 4 +-- 36 files changed, 150 insertions(+), 174 deletions(-) diff --git a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java index 226fd27d78..b315aeef98 100644 --- a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java +++ b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java @@ -78,7 +78,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener, StatusReco if (isNetconfNode(rootNode.getDataAfter())) { NodeId nodeId = getNodeId(identifier); if (nodeId != null) { - NetconfNode nnode = rootNode.getDataAfter().getAugmentation(NetconfNode.class); + NetconfNode nnode = rootNode.getDataAfter().augmentation(NetconfNode.class); handledNetconfNode(nodeId, nnode); } } @@ -98,7 +98,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener, StatusReco } private static boolean isNetconfNode(final Node node) { - return node.getAugmentation(NetconfNode.class) != null; + return node.augmentation(NetconfNode.class) != null; } private static NodeId getNodeId(final InstanceIdentifier path) { @@ -197,7 +197,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener, StatusReco Device1 d1 = new Device1Builder().setDeviceStatus(Device1.DeviceStatus.FAILEDNOTALLOWED).build(); DeviceBuilder builder = new DeviceBuilder() .setUniqueId(id) - .setKey(new DeviceKey(id)) + .withKey(new DeviceKey(id)) .setSshHostKey(sshEncodedKey) .addAugmentation(Device1.class, d1); @@ -262,7 +262,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener, StatusReco InstanceIdentifier deviceIId = InstanceIdentifier.create(NetconfCallhomeServer.class) .child(AllowedDevices.class) - .child(Device.class, device.getKey()); + .child(Device.class, device.key()); tx.merge(LogicalDatastoreType.OPERATIONAL, deviceIId, device); tx.submit(); diff --git a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java index 987fcc0364..982ec0c6f6 100644 --- a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java +++ b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java @@ -206,7 +206,7 @@ public class IetfZeroTouchCallHomeServerProvider implements AutoCloseable, DataT Device1 devStatus = new Device1Builder().setDeviceStatus(Device1.DeviceStatus.DISCONNECTED).build(); if (opDevGet.isPresent()) { Device opDevice = opDevGet.get(); - devStatus = opDevice.getAugmentation(Device1.class); + devStatus = opDevice.augmentation(Device1.class); } cfgDevice = new DeviceBuilder().addAugmentation(Device1.class, devStatus) diff --git a/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java b/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java index 0bd79fde0c..66079b9ed8 100644 --- a/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java +++ b/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java @@ -62,32 +62,32 @@ public final class MonitoringToMdsalWriter implements AutoCloseable, NetconfMoni } @Override - public void onSessionStarted(Session session) { + public void onSessionStarted(final Session session) { final InstanceIdentifier sessionPath = - SESSIONS_INSTANCE_IDENTIFIER.child(Session.class, session.getKey()); + SESSIONS_INSTANCE_IDENTIFIER.child(Session.class, session.key()); runTransaction((tx) -> tx.put(LogicalDatastoreType.OPERATIONAL, sessionPath, session)); } @Override - public void onSessionEnded(Session session) { + public void onSessionEnded(final Session session) { final InstanceIdentifier sessionPath = - SESSIONS_INSTANCE_IDENTIFIER.child(Session.class, session.getKey()); + SESSIONS_INSTANCE_IDENTIFIER.child(Session.class, session.key()); runTransaction((tx) -> tx.delete(LogicalDatastoreType.OPERATIONAL, sessionPath)); } @Override - public void onSessionsUpdated(Collection sessions) { + public void onSessionsUpdated(final Collection sessions) { runTransaction((tx) -> updateSessions(tx, sessions)); } @Override - public void onCapabilitiesChanged(Capabilities capabilities) { + public void onCapabilitiesChanged(final Capabilities capabilities) { runTransaction((tx) -> tx.put(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_INSTANCE_IDENTIFIER, capabilities)); } @Override - public void onSchemasChanged(Schemas schemas) { + public void onSchemasChanged(final Schemas schemas) { runTransaction((tx) -> tx.put(LogicalDatastoreType.OPERATIONAL, SCHEMAS_INSTANCE_IDENTIFIER, schemas)); } @@ -99,27 +99,27 @@ public final class MonitoringToMdsalWriter implements AutoCloseable, NetconfMoni serverMonitoringDependency.registerSessionsListener(this); } - private void runTransaction(Consumer txUser) { + private void runTransaction(final Consumer txUser) { Preconditions.checkState(dataBroker != null); final WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); txUser.accept(tx); Futures.addCallback(tx.submit(), new FutureCallback() { @Override - public void onSuccess(@Nullable Void result) { + public void onSuccess(@Nullable final Void result) { LOG.debug("Netconf state updated successfully"); } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.warn("Unable to update netconf state", throwable); } }, MoreExecutors.directExecutor()); } - private static void updateSessions(WriteTransaction tx, Collection sessions) { + private static void updateSessions(final WriteTransaction tx, final Collection sessions) { for (Session session : sessions) { final InstanceIdentifier sessionPath = - SESSIONS_INSTANCE_IDENTIFIER.child(Session.class, session.getKey()); + SESSIONS_INSTANCE_IDENTIFIER.child(Session.class, session.key()); tx.put(LogicalDatastoreType.OPERATIONAL, sessionPath, session); } } diff --git a/netconf/mdsal-netconf-monitoring/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriterTest.java b/netconf/mdsal-netconf-monitoring/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriterTest.java index 05b6bd15f9..5304743c8c 100644 --- a/netconf/mdsal-netconf-monitoring/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriterTest.java +++ b/netconf/mdsal-netconf-monitoring/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriterTest.java @@ -108,7 +108,7 @@ public class MonitoringToMdsalWriterTest { final InstanceIdentifier id = InstanceIdentifier.create(NetconfState.class) .child(Sessions.class) - .child(Session.class, session.getKey()); + .child(Session.class, session.key()); writer.start(); writer.onSessionStarted(session); InOrder inOrder = inOrder(writeTransaction); @@ -124,7 +124,7 @@ public class MonitoringToMdsalWriterTest { final InstanceIdentifier id = InstanceIdentifier.create(NetconfState.class) .child(Sessions.class) - .child(Session.class, session.getKey()); + .child(Session.class, session.key()); writer.start(); writer.onSessionEnded(session); InOrder inOrder = inOrder(writeTransaction); @@ -146,11 +146,11 @@ public class MonitoringToMdsalWriterTest { final InstanceIdentifier id1 = InstanceIdentifier.create(NetconfState.class) .child(Sessions.class) - .child(Session.class, session1.getKey()); + .child(Session.class, session1.key()); final InstanceIdentifier id2 = InstanceIdentifier.create(NetconfState.class) .child(Sessions.class) - .child(Session.class, session2.getKey()); + .child(Session.class, session2.key()); writer.start(); writer.onSessionsUpdated(sessions); InOrder inOrder = inOrder(writeTransaction); diff --git a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriter.java b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriter.java index d5ba353fe6..5621f1728e 100644 --- a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriter.java +++ b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriter.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.config.yang.netconf.mdsal.notification; -import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; @@ -35,6 +34,8 @@ public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNo .NetconfNotificationStreamListener { private static final Logger LOG = LoggerFactory.getLogger(NotificationToMdsalWriter.class); + private static final InstanceIdentifier STREAMS = InstanceIdentifier.builder(Netconf.class) + .child(Streams.class).build(); private final NetconfNotificationCollector netconfNotificationCollector; private final DataBroker dataBroker; @@ -50,16 +51,15 @@ public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNo public void close() { final WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); tx.delete(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Netconf.class)); - final CheckedFuture submit = tx.submit(); - Futures.addCallback(submit, new FutureCallback() { + Futures.addCallback(tx.submit(), new FutureCallback() { @Override - public void onSuccess(Void avoid) { + public void onSuccess(final Void avoid) { LOG.debug("Streams cleared successfully"); } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.warn("Unable to clear streams", throwable); } }, MoreExecutors.directExecutor()); @@ -75,11 +75,10 @@ public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNo } @Override - public void onStreamRegistered(Stream stream) { + public void onStreamRegistered(final Stream stream) { final WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); - final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class).child(Streams.class) - .builder().child(Stream.class, stream.getKey()).build(); + final InstanceIdentifier streamIdentifier = STREAMS.child(Stream.class, stream.key()); tx.merge(LogicalDatastoreType.OPERATIONAL, streamIdentifier, stream, true); try { @@ -91,12 +90,10 @@ public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNo } @Override - public void onStreamUnregistered(StreamNameType stream) { + public void onStreamUnregistered(final StreamNameType stream) { final WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); - final StreamKey streamKey = new StreamKey(stream); - final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class).child(Streams.class) - .builder().child(Stream.class, streamKey).build(); + final InstanceIdentifier streamIdentifier = STREAMS.child(Stream.class, new StreamKey(stream)); tx.delete(LogicalDatastoreType.OPERATIONAL, streamIdentifier); diff --git a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducerTest.java b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducerTest.java index 549c0ce2e1..5652af80ce 100644 --- a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducerTest.java +++ b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducerTest.java @@ -74,8 +74,8 @@ public class CapabilityChangeNotificationProducerTest { @Test public void testOnDataChangedCreate() { - final InstanceIdentifier capabilitiesIdentifier = - InstanceIdentifier.create(NetconfState.class).child(Capabilities.class).builder().build(); + final InstanceIdentifier capabilitiesIdentifier = + InstanceIdentifier.create(NetconfState.class).child(Capabilities.class); final List newCapabilitiesList = Lists.newArrayList(new Uri("newCapability"), new Uri("createdCapability")); Capabilities newCapabilities = new CapabilitiesBuilder().setCapability(newCapabilitiesList).build(); @@ -111,8 +111,8 @@ public class CapabilityChangeNotificationProducerTest { @SuppressWarnings("unchecked") private void verifyDataTreeChange(final DataObjectModification.ModificationType modificationType, - Capabilities originalCapabilities, Capabilities updatedCapabilities, - NetconfCapabilityChange expectedChange) { + final Capabilities originalCapabilities, final Capabilities updatedCapabilities, + final NetconfCapabilityChange expectedChange) { final DataTreeModification treeChange2 = mock(DataTreeModification.class); final DataObjectModification objectChange2 = mock(DataObjectModification.class); doReturn(modificationType).when(objectChange2).getModificationType(); @@ -123,7 +123,7 @@ public class CapabilityChangeNotificationProducerTest { verify(baseNotificationPublisherRegistration).onCapabilityChanged(expectedChange); } - private NetconfCapabilityChange changedCapabilitesFrom(List added, List deleted) { + private NetconfCapabilityChange changedCapabilitesFrom(final List added, final List deleted) { NetconfCapabilityChangeBuilder netconfCapabilityChangeBuilder = new NetconfCapabilityChangeBuilder(); netconfCapabilityChangeBuilder.setChangedBy(new ChangedByBuilder().setServerOrUser( new ServerBuilder().setServer(true).build()).build()); diff --git a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriterTest.java b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriterTest.java index 072fc3657a..5c7fdb8b93 100644 --- a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriterTest.java +++ b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriterTest.java @@ -69,8 +69,8 @@ public class NotificationToMdsalWriterTest { public void testStreamRegisteration() { final StreamNameType testStreamName = new StreamNameType("TESTSTREAM"); final Stream testStream = new StreamBuilder().setName(testStreamName).build(); - final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class).child(Streams.class) - .builder().child(Stream.class, testStream.getKey()).build(); + final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class) + .child(Streams.class).child(Stream.class, testStream.key()); writer.onStreamRegistered(testStream); @@ -86,7 +86,7 @@ public class NotificationToMdsalWriterTest { public void testClose() { doNothing().when(notificationRegistration).close(); - final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class); + final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class); writer.close(); diff --git a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSource.java b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSource.java index 0722d8ae01..2581ae6924 100644 --- a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSource.java +++ b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSource.java @@ -284,7 +284,7 @@ public class NetconfEventSource implements EventSource, DOMNotificationListener @Override public NodeKey getSourceNodeKey() { - return mount.getNode().getKey(); + return mount.getNode().key(); } @Override diff --git a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceManager.java b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceManager.java index 6360136b9f..fe409a8ed0 100644 --- a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceManager.java +++ b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceManager.java @@ -79,7 +79,7 @@ public final class NetconfEventSourceManager implements DataTreeChangeListener> changes) { + public void onDataTreeChanged(final Collection> changes) { for (DataTreeModification change: changes) { LOG.debug("DataTreeModification: {}", change); final DataObjectModification rootNode = change.getRootNode(); @@ -123,11 +123,8 @@ public final class NetconfEventSourceManager implements DataTreeChangeListener getStreamMap() { @@ -151,12 +148,12 @@ public final class NetconfEventSourceManager implements DataTreeChangeListener streamMap) { + public void setStreamMap(final Map streamMap) { this.streamMap = streamMap; } - private boolean isNetconfNode(final Node node) { - return node.getAugmentation(NetconfNode.class) != null; + private static boolean isNetconfNode(final Node node) { + return node.augmentation(NetconfNode.class) != null; } @Override diff --git a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java index 649454ef11..2d1aab54e8 100644 --- a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java +++ b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java @@ -60,7 +60,7 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { } private static boolean isEventSource(final Node node) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); if (netconfNode == null) { return false; } @@ -92,7 +92,7 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { } NetconfNode getNetconfNode() { - return node.getAugmentation(NetconfNode.class); + return node.augmentation(NetconfNode.class); } void updateStatus() { @@ -104,12 +104,12 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { changeStatus(netconfConnStatus); } - private boolean checkConnectionStatusType(ConnectionStatus status) { + private static boolean checkConnectionStatusType(final ConnectionStatus status) { return status == ConnectionStatus.Connected || status == ConnectionStatus.Connecting || status == ConnectionStatus.UnableToConnect; } - private void changeStatus(ConnectionStatus newStatus) { + private void changeStatus(final ConnectionStatus newStatus) { Preconditions.checkNotNull(newStatus); Preconditions.checkState(this.currentNetconfConnStatus != null); if (!checkConnectionStatusType(newStatus)) { @@ -155,7 +155,7 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { this.eventSourceRegistration = registration; } - private YangInstanceIdentifier domMountPath(final NodeId nodeId) { + private static YangInstanceIdentifier domMountPath(final NodeId nodeId) { return YangInstanceIdentifier.builder(NETCONF_DEVICE_DOM_PATH) .nodeWithKey(Node.QNAME, NODE_ID_QNAME, nodeId.getValue()).build(); } diff --git a/netconf/messagebus-netconf/src/test/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfTestUtils.java b/netconf/messagebus-netconf/src/test/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfTestUtils.java index 25c3a84756..aa908b2e09 100644 --- a/netconf/messagebus-netconf/src/test/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfTestUtils.java +++ b/netconf/messagebus-netconf/src/test/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfTestUtils.java @@ -51,8 +51,8 @@ public final class NetconfTestUtils { private NetconfTestUtils() { } - public static Node getNetconfNode(String nodeIdent, String hostName, ConnectionStatus cs, - String notificationCapabilityPrefix) { + public static Node getNetconfNode(final String nodeIdent, final String hostName, final ConnectionStatus cs, + final String notificationCapabilityPrefix) { DomainName dn = new DomainName(hostName); Host host = new Host(dn); @@ -67,28 +67,28 @@ public final class NetconfTestUtils { NodeId nodeId = new NodeId(nodeIdent); NodeKey nk = new NodeKey(nodeId); NodeBuilder nb = new NodeBuilder(); - nb.setKey(nk); + nb.withKey(nk); nb.addAugmentation(NetconfNode.class, nn); return nb.build(); } - public static Node getNode(String nodeIdent) { + public static Node getNode(final String nodeIdent) { NodeId nodeId = new NodeId(nodeIdent); NodeKey nk = new NodeKey(nodeId); NodeBuilder nb = new NodeBuilder(); - nb.setKey(nk); + nb.withKey(nk); return nb.build(); } - public static InstanceIdentifier getInstanceIdentifier(Node node) { + public static InstanceIdentifier getInstanceIdentifier(final Node node) { TopologyKey netconfTopologyKey = new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())); InstanceIdentifier nodeII = InstanceIdentifier.create(NetworkTopology.class) - .child(Topology.class, netconfTopologyKey).child(Node.class, node.getKey()); + .child(Topology.class, netconfTopologyKey).child(Node.class, node.key()); return nodeII; } - public static Optional getAvailableStream(String name, boolean replaySupport) { + public static Optional getAvailableStream(final String name, final boolean replaySupport) { Stream stream = new StreamBuilder().setName(new StreamNameType(name)).setReplaySupport(replaySupport).build(); List streamList = new ArrayList<>(); streamList.add(stream); @@ -96,7 +96,7 @@ public final class NetconfTestUtils { return Optional.of(streams); } - public static NormalizedNode getStreamsNode(String... streamName) { + public static NormalizedNode getStreamsNode(final String... streamName) { QName nameNode = QName.create(Stream.QNAME, "name"); Set streamSet = new HashSet<>(); for (String s : streamName) { diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java index 8954e4a294..21d1697659 100644 --- a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java +++ b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java @@ -68,7 +68,7 @@ public class NetconfCommandsImpl implements NetconfCommands { } final Map> netconfNodes = new HashMap<>(); for (final Node node : topology.getNode()) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); final Map attributes = new HashMap<>(); attributes.put(NetconfConsoleConstants.NETCONF_ID, node.getNodeId().getValue()); attributes.put(NetconfConsoleConstants.NETCONF_IP, @@ -93,7 +93,7 @@ public class NetconfCommandsImpl implements NetconfCommands { if (nodeList != null) { for (final Node node : nodeList) { if (node != null) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); final Map> attributes = new HashMap<>(); attributes.put(NetconfConsoleConstants.NETCONF_ID, ImmutableList.of(node.getNodeId().getValue())); attributes.put(NetconfConsoleConstants.NETCONF_IP, @@ -123,7 +123,7 @@ public class NetconfCommandsImpl implements NetconfCommands { final List nodeList = NetconfConsoleUtils.getNetconfNodeFromId(deviceId, dataBroker); if (nodeList != null && nodeList.size() > 0) { for (final Node node : nodeList) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); final Map> attributes = new HashMap<>(); attributes.put(NetconfConsoleConstants.NETCONF_ID, ImmutableList.of(node.getNodeId().getValue())); attributes.put(NetconfConsoleConstants.NETCONF_IP, @@ -146,7 +146,7 @@ public class NetconfCommandsImpl implements NetconfCommands { } @Override - public void connectDevice(NetconfNode netconfNode, String netconfNodeId) { + public void connectDevice(final NetconfNode netconfNode, final String netconfNodeId) { final NodeId nodeId; if (!Strings.isNullOrEmpty(netconfNodeId)) { nodeId = new NodeId(netconfNodeId); @@ -154,7 +154,7 @@ public class NetconfCommandsImpl implements NetconfCommands { nodeId = new NodeId(UUID.randomUUID().toString().replace("-", "")); } final Node node = new NodeBuilder() - .setKey(new NodeKey(nodeId)) + .withKey(new NodeKey(nodeId)) .setNodeId(nodeId) .addAugmentation(NetconfNode.class, netconfNode) .build(); @@ -165,12 +165,12 @@ public class NetconfCommandsImpl implements NetconfCommands { Futures.addCallback(transaction.submit(), new FutureCallback() { @Override - public void onSuccess(Void result) { + public void onSuccess(final Void result) { LOG.debug("NetconfNode={} created successfully", netconfNode); } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.error("Failed to created NetconfNode={}", netconfNode); throw new RuntimeException(throwable); } @@ -178,7 +178,7 @@ public class NetconfCommandsImpl implements NetconfCommands { } @Override - public boolean disconnectDevice(String netconfNodeId) { + public boolean disconnectDevice(final String netconfNodeId) { boolean result = false; final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction(); InstanceIdentifier iid = NetconfIidFactory.netconfNodeIid(netconfNodeId); @@ -202,13 +202,13 @@ public class NetconfCommandsImpl implements NetconfCommands { } @Override - public String updateDevice(final String netconfNodeId, String username, String password, - Map updated) { + public String updateDevice(final String netconfNodeId, final String username, final String password, + final Map updated) { final Node node = NetconfConsoleUtils .read(LogicalDatastoreType.OPERATIONAL, NetconfIidFactory.netconfNodeIid(netconfNodeId), dataBroker); - if (node != null && node.getAugmentation(NetconfNode.class) != null) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + if (node != null && node.augmentation(NetconfNode.class) != null) { + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); // Get NETCONF attributes to update if present else get their original values from NetconfNode instance final String deviceIp = Strings.isNullOrEmpty(updated.get(NetconfConsoleConstants.NETCONF_IP)) @@ -235,7 +235,7 @@ public class NetconfCommandsImpl implements NetconfCommands { .build(); final Node updatedNode = new NodeBuilder() - .setKey(node.getKey()) + .withKey(node.key()) .setNodeId(node.getNodeId()) .addAugmentation(NetconfNode.class, updatedNetconfNode) .build(); @@ -247,12 +247,12 @@ public class NetconfCommandsImpl implements NetconfCommands { Futures.addCallback(transaction.submit(), new FutureCallback() { @Override - public void onSuccess(Void result) { + public void onSuccess(final Void result) { LOG.debug("NetconfNode={} updated successfully", netconfNode); } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.error("Failed to updated NetconfNode={}", netconfNode); throw new RuntimeException(throwable); } diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/utils/NetconfConsoleUtils.java b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/utils/NetconfConsoleUtils.java index 560ddcae4a..7766847198 100644 --- a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/utils/NetconfConsoleUtils.java +++ b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/utils/NetconfConsoleUtils.java @@ -42,14 +42,14 @@ public final class NetconfConsoleUtils { List nodes = new ArrayList<>(); if (isNetconfNodesPresent(topology)) { for (Node node : topology.getNode()) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); if (netconfNode != null && netconfNode.getHost().getIpAddress().getIpv4Address().getValue().equals(deviceIp)) { nodes.add(node); } } } - return (nodes.isEmpty()) ? null : nodes; + return nodes.isEmpty() ? null : nodes; } /** @@ -78,7 +78,7 @@ public final class NetconfConsoleUtils { final Topology topology = read(LogicalDatastoreType.OPERATIONAL, NetconfIidFactory.NETCONF_TOPOLOGY_IID, db); if (isNetconfNodesPresent(topology)) { for (Node node : topology.getNode()) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); if (netconfNode != null && netconfNode.getHost().getIpAddress().getIpv4Address().getValue().equals(deviceIp) && devicePort.equals(netconfNode.getPort().getValue().toString())) { diff --git a/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java b/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java index 576408b371..0b5e6083fe 100644 --- a/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java +++ b/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java @@ -169,11 +169,11 @@ public class NetconfCommandsImplTest { assertEquals(2, nodes.size()); final Optional storedNode = nodes.stream().filter(node -> - node.getKey().getNodeId().getValue().equals("netconf-ID")).findFirst(); + node.key().getNodeId().getValue().equals("netconf-ID")).findFirst(); assertTrue(storedNode.isPresent()); - NetconfNode storedNetconfNode = storedNode.get().getAugmentation(NetconfNode.class); + NetconfNode storedNetconfNode = storedNode.get().augmentation(NetconfNode.class); assertEquals(7777, storedNetconfNode.getPort().getValue().longValue()); assertEquals("10.10.1.1", storedNetconfNode.getHost().getIpAddress().getIpv4Address().getValue()); @@ -185,7 +185,7 @@ public class NetconfCommandsImplTest { assertEquals(1, nodesDeleted.size()); final Optional storedNodeDeleted = nodesDeleted.stream().filter(node -> - node.getKey().getNodeId().getValue().equals("netconf-ID")).findFirst(); + node.key().getNodeId().getValue().equals("netconf-ID")).findFirst(); assertFalse(storedNodeDeleted.isPresent()); } @@ -210,10 +210,10 @@ public class NetconfCommandsImplTest { assertEquals(1, nodes.size()); final Optional storedNode = nodes.stream().filter(node -> - node.getKey().getNodeId().getValue().equals(NODE_ID)).findFirst(); + node.key().getNodeId().getValue().equals(NODE_ID)).findFirst(); assertTrue(storedNode.isPresent()); - NetconfNode storedNetconfNode = storedNode.get().getAugmentation(NetconfNode.class); + NetconfNode storedNetconfNode = storedNode.get().augmentation(NetconfNode.class); assertEquals("7.7.7.7", storedNetconfNode.getHost().getIpAddress().getIpv4Address().getValue()); } @@ -234,7 +234,7 @@ public class NetconfCommandsImplTest { nodes.add(node); final Topology topology = new TopologyBuilder() - .setKey(new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName()))) + .withKey(new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName()))) .setTopologyId(new TopologyId(TopologyNetconf.QNAME.getLocalName())).setNode(nodes).build(); final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); @@ -260,7 +260,7 @@ public class NetconfCommandsImplTest { final NodeId nodeId = new NodeId(nodeIdent); final NodeKey nk = new NodeKey(nodeId); final NodeBuilder nb = new NodeBuilder(); - nb.setKey(nk); + nb.withKey(nk); nb.setNodeId(nodeId); nb.addAugmentation(NetconfNode.class, nn); return nb.build(); diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java index dc314c05e0..bb0964bb58 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java @@ -12,7 +12,6 @@ import com.google.common.base.Preconditions; import com.google.common.net.InetAddresses; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelFutureListener; import io.netty.handler.codec.ByteToMessageDecoder; import io.netty.handler.codec.MessageToByteEncoder; import java.net.Inet4Address; @@ -97,12 +96,7 @@ public final class NetconfServerSession extends AbstractNetconfSession close()); } return channelFuture; } @@ -150,7 +144,7 @@ public final class NetconfServerSession extends AbstractNetconfSession format) { + private static Schema getMockSchema(final String id, final String version, final Class format) { final Schema mock = mock(Schema.class); doReturn(format).when(mock).getFormat(); @@ -101,23 +101,23 @@ public class JaxBSerializerTest { doReturn(new Uri("localhost")).when(mock).getNamespace(); doReturn(version).when(mock).getVersion(); doReturn(Lists.newArrayList(new Schema.Location(Schema.Location.Enumeration.NETCONF))).when(mock).getLocation(); - doReturn(new SchemaKey(format, id, version)).when(mock).getKey(); + doReturn(new SchemaKey(format, id, version)).when(mock).key(); return mock; } - private Session getMockIPv4Session(final Class transportType) { + private static Session getMockIPv4Session(final Class transportType) { final Session mocked = getMockSession(transportType); doReturn(new Host(new IpAddress(new Ipv4Address(IPV4)))).when(mocked).getSourceHost(); return mocked; } - private Session getMockIPv6Session(final Class transportType) { + private static Session getMockIPv6Session(final Class transportType) { final Session mocked = getMockSession(transportType); doReturn(new Host(new IpAddress(new Ipv6Address(IPV6)))).when(mocked).getSourceHost(); return mocked; } - private Session getMockSession(final Class transportType) { + private static Session getMockSession(final Class transportType) { final Session mocked = mock(Session.class); final Session1 mockedSession1 = mock(Session1.class); doReturn("client").when(mockedSession1).getSessionIdentifier(); @@ -129,7 +129,7 @@ public class JaxBSerializerTest { doReturn(new ZeroBasedCounter32(0L)).when(mocked).getOutRpcErrors(); doReturn(transportType).when(mocked).getTransport(); doReturn("username").when(mocked).getUsername(); - doReturn(mockedSession1).when(mocked).getAugmentation(Session1.class); + doReturn(mockedSession1).when(mocked).augmentation(Session1.class); return mocked; } } diff --git a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/NetconfNotificationManager.java b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/NetconfNotificationManager.java index c8989e5949..ac29d54744 100644 --- a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/NetconfNotificationManager.java +++ b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/NetconfNotificationManager.java @@ -53,7 +53,7 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, static { BASE_NETCONF_STREAM = new StreamBuilder() .setName(BASE_STREAM_NAME) - .setKey(new StreamKey(BASE_STREAM_NAME)) + .withKey(new StreamKey(BASE_STREAM_NAME)) .setReplaySupport(false) .setDescription("Default Event Stream") .build(); @@ -138,12 +138,9 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, listener.onStreamRegistered(availableStream); } - return new NotificationRegistration() { - @Override - public void close() { - synchronized (NetconfNotificationManager.this) { - streamListeners.remove(listener); - } + return () -> { + synchronized (NetconfNotificationManager.this) { + streamListeners.remove(listener); } }; } @@ -277,7 +274,8 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, baseRegistration.close(); } - private static NetconfNotification serializeNotification(final Notification notification, SchemaPath path) { + private static NetconfNotification serializeNotification(final Notification notification, + final SchemaPath path) { return NotificationsTransformUtil.transform(notification, path); } @@ -288,12 +286,12 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, } @Override - public void onSessionStarted(NetconfSessionStart start) { + public void onSessionStarted(final NetconfSessionStart start) { baseRegistration.onNotification(BASE_STREAM_NAME, serializeNotification(start, SESSION_START_PATH)); } @Override - public void onSessionEnded(NetconfSessionEnd end) { + public void onSessionEnded(final NetconfSessionEnd end) { baseRegistration.onNotification(BASE_STREAM_NAME, serializeNotification(end, SESSION_END_PATH)); } } diff --git a/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/netconf/notifications/impl/ops/GetTest.java b/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/netconf/notifications/impl/ops/GetTest.java index 90c975df4c..0a7aa6d7e5 100644 --- a/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/netconf/notifications/impl/ops/GetTest.java +++ b/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/netconf/notifications/impl/ops/GetTest.java @@ -28,7 +28,7 @@ public class GetTest { final StreamBuilder streamBuilder = new StreamBuilder(); final StreamNameType base = new StreamNameType("base"); streamBuilder.setName(base); - streamBuilder.setKey(new StreamKey(base)); + streamBuilder.withKey(new StreamKey(base)); streamBuilder.setDescription("description"); streamBuilder.setReplaySupport(false); streamsBuilder.setStream(Lists.newArrayList(streamBuilder.build())); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManager.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManager.java index b749d011ad..1fdce0c0b8 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManager.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManager.java @@ -158,7 +158,7 @@ class NetconfNodeManager } @SuppressWarnings("ConstantConditions") - final NetconfNode netconfNodeAfter = rootNode.getDataAfter().getAugmentation(NetconfNode.class); + final NetconfNode netconfNodeAfter = rootNode.getDataAfter().augmentation(NetconfNode.class); if (NetconfNodeConnectionStatus.ConnectionStatus.Connected.equals(netconfNodeAfter.getConnectionStatus())) { lastUpdateCount++; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java index 2560d7bd2f..7275be18e6 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java @@ -60,7 +60,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable { this.mountService = mountService; remoteDeviceId = NetconfTopologyUtils.createRemoteDeviceId(netconfTopologyDeviceSetup.getNode().getNodeId(), - netconfTopologyDeviceSetup.getNode().getAugmentation(NetconfNode.class)); + netconfTopologyDeviceSetup.getNode().augmentation(NetconfNode.class)); remoteDeviceConnector = new RemoteDeviceConnectorImpl(netconfTopologyDeviceSetup, remoteDeviceId); @@ -114,7 +114,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable { final NetconfNodeManager ndm = new NetconfNodeManager(netconfTopologyDeviceSetup, remoteDeviceId, actorResponseWaitTime, mountService); ndm.registerDataTreeChangeListener(netconfTopologyDeviceSetup.getTopologyId(), - netconfTopologyDeviceSetup.getNode().getKey()); + netconfTopologyDeviceSetup.getNode().key()); return ndm; } @@ -139,7 +139,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable { void refresh(@Nonnull final NetconfTopologySetup setup) { netconfTopologyDeviceSetup = Preconditions.checkNotNull(setup); remoteDeviceId = NetconfTopologyUtils.createRemoteDeviceId(netconfTopologyDeviceSetup.getNode().getNodeId(), - netconfTopologyDeviceSetup.getNode().getAugmentation(NetconfNode.class)); + netconfTopologyDeviceSetup.getNode().augmentation(NetconfNode.class)); if (isMaster) { remoteDeviceConnector.stopRemoteDeviceConnection(); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java index 4096153d12..86b7111f78 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java @@ -153,7 +153,7 @@ public class NetconfTopologyManager // TODO change to a specific documented Exception when changed in ClusterSingletonServiceProvider @SuppressWarnings("checkstyle:IllegalCatch") private void startNetconfDeviceContext(final InstanceIdentifier instanceIdentifier, final Node node) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); Preconditions.checkNotNull(netconfNode); Preconditions.checkNotNull(netconfNode.getHost()); Preconditions.checkNotNull(netconfNode.getHost().getIpAddress()); @@ -230,14 +230,14 @@ public class NetconfTopologyManager /** * Sets the private key path from location specified in configuration file using blueprint. */ - public void setPrivateKeyPath(String privateKeyPath) { + public void setPrivateKeyPath(final String privateKeyPath) { this.privateKeyPath = privateKeyPath; } /** * Sets the private key passphrase from location specified in configuration file using blueprint. */ - public void setPrivateKeyPassphrase(String privateKeyPassphrase) { + public void setPrivateKeyPassphrase(final String privateKeyPassphrase) { this.privateKeyPassphrase = privateKeyPassphrase; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java index eb99f5cf52..71fbda8ae3 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java @@ -105,7 +105,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { @Override public void startRemoteDeviceConnection(final RemoteDeviceHandler deviceHandler) { - final NetconfNode netconfNode = netconfTopologyDeviceSetup.getNode().getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = netconfTopologyDeviceSetup.getNode().augmentation(NetconfNode.class); final NodeId nodeId = netconfTopologyDeviceSetup.getNode().getNodeId(); Preconditions.checkNotNull(netconfNode.getHost()); Preconditions.checkNotNull(netconfNode.getPort()); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java index eff84bba1f..474619ee24 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java @@ -113,7 +113,7 @@ public final class NetconfTopologyUtils { } public static NetconfDevice.SchemaResourcesDTO setupSchemaCacheDTO(final Node node) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); final String moduleSchemaCacheDirectory = netconfNode.getSchemaCacheDirectory(); final RemoteDeviceId deviceId = createRemoteDeviceId(node.getNodeId(), netconfNode); diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java index b19a2cca20..6b29264700 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java @@ -451,7 +451,7 @@ public class MountPointEndToEndTest { Optional node = readTx.read(LogicalDatastoreType.OPERATIONAL, NODE_INSTANCE_ID).get(5, TimeUnit.SECONDS); assertTrue(node.isPresent()); - final NetconfNode netconfNode = node.get().getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.get().augmentation(NetconfNode.class); return netconfNode.getConnectionStatus() != NetconfNodeConnectionStatus.ConnectionStatus.Connected; } }); diff --git a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java index 5f7f3594de..b5f6a172fd 100644 --- a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java +++ b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java @@ -249,7 +249,7 @@ public abstract class AbstractNetconfTopology implements NetconfTopology { protected ListenableFuture setupConnection(final NodeId nodeId, final Node configNode) { - final NetconfNode netconfNode = configNode.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = configNode.augmentation(NetconfNode.class); Preconditions.checkNotNull(netconfNode.getHost()); Preconditions.checkNotNull(netconfNode.getPort()); diff --git a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java index 7017d807bc..f27f09eb7e 100644 --- a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java +++ b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java @@ -7,7 +7,6 @@ */ package org.opendaylight.netconf.topology.impl; -import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; @@ -15,7 +14,6 @@ import javax.annotation.Nullable; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.netconf.topology.api.NetconfConnectorFactory; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.HostBuilder; @@ -77,15 +75,14 @@ public class NetconfConnectorFactoryImpl implements NetconfConnectorFactory { .build(); final Node node = new NodeBuilder() .setNodeId(nodeId) - .setKey(nodeKey) + .withKey(nodeKey) .addAugmentation(NetconfNode.class, netconfNode) .build(); final InstanceIdentifier nodePath = TOPOLOGY_PATH.child(Node.class, nodeKey); final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction(); transaction.put(LogicalDatastoreType.CONFIGURATION, nodePath, node); - final CheckedFuture submitFuture = transaction.submit(); - Futures.addCallback(submitFuture, new FutureCallback() { + Futures.addCallback(transaction.submit(), new FutureCallback() { @Override public void onSuccess(@Nullable final Void result) { LOG.debug("Node {} was successfully added to the topology", instanceName); diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java index 9e247018e1..1d8b4a1aca 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.sal.connect.netconf.sal; import com.google.common.base.Preconditions; -import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; @@ -21,7 +20,6 @@ import java.util.stream.Collectors; import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities; import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber; @@ -229,9 +227,8 @@ public final class NetconfDeviceTopologyAdapter implements AutoCloseable { private void commitTransaction(final WriteTransaction transaction, final String txType) { LOG.trace("{}: Committing Transaction {}:{}", id, txType, transaction.getIdentifier()); - final CheckedFuture result = transaction.submit(); - Futures.addCallback(result, new FutureCallback() { + Futures.addCallback(transaction.submit(), new FutureCallback() { @Override public void onSuccess(final Void result) { LOG.trace("{}: Transaction({}) {} SUCCESSFUL", id, txType, @@ -250,7 +247,7 @@ public final class NetconfDeviceTopologyAdapter implements AutoCloseable { private static NodeBuilder getNodeIdBuilder(final RemoteDeviceId id) { final NodeBuilder nodeBuilder = new NodeBuilder(); - nodeBuilder.setKey(new NodeKey(new NodeId(id.getName()))); + nodeBuilder.withKey(new NodeKey(new NodeId(id.getName()))); return nodeBuilder; } diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapter.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapter.java index 6facc7d237..19577f4f24 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapter.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapter.java @@ -111,7 +111,7 @@ public class NetconfKeystoreAdapter implements ClusteredDataTreeChangeListener getCertificateChain(final String[] base64Certificates) + private static List getCertificateChain(final String[] base64Certificates) throws GeneralSecurityException { final CertificateFactory factory = CertificateFactory.getInstance("X.509"); final List certificates = new ArrayList<>(); @@ -141,7 +141,7 @@ public class NetconfKeystoreAdapter implements ClusteredDataTreeChangeListener pairs.put(pair.getKey().getKeyId(), pair)); + dataAfter.getKeyCredential().forEach(pair -> pairs.put(pair.key().getKeyId(), pair)); } break; diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/util/NetconfSalKeystoreService.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/util/NetconfSalKeystoreService.java index 3c3b733a93..29d345287a 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/util/NetconfSalKeystoreService.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/util/NetconfSalKeystoreService.java @@ -137,13 +137,12 @@ public class NetconfSalKeystoreService implements NetconfKeystoreService { for (KeyCredential keypair : keypairs) { writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, - keystoreIid.child(KeyCredential.class, keypair.getKey()), keypair); + keystoreIid.child(KeyCredential.class, keypair.key()), keypair); } final SettableFuture> rpcResult = SettableFuture.create(); - final ListenableFuture submit = writeTransaction.submit(); - Futures.addCallback(submit, new FutureCallback() { + Futures.addCallback(writeTransaction.submit(), new FutureCallback() { @Override public void onSuccess(@Nullable final Void result) { LOG.debug("add-key-pair success. Input: {}"); @@ -167,13 +166,12 @@ public class NetconfSalKeystoreService implements NetconfKeystoreService { for (TrustedCertificate certificate : input.getTrustedCertificate()) { writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, - keystoreIid.child(TrustedCertificate.class, certificate.getKey()), certificate); + keystoreIid.child(TrustedCertificate.class, certificate.key()), certificate); } final SettableFuture> rpcResult = SettableFuture.create(); - final ListenableFuture submit = writeTransaction.submit(); - Futures.addCallback(submit, new FutureCallback() { + Futures.addCallback(writeTransaction.submit(), new FutureCallback() { @Override public void onSuccess(@Nullable final Void result) { LOG.debug("add-trusted-certificate success. Input: {}", input); @@ -203,8 +201,7 @@ public class NetconfSalKeystoreService implements NetconfKeystoreService { final SettableFuture> rpcResult = SettableFuture.create(); - final ListenableFuture submit = writeTransaction.submit(); - Futures.addCallback(submit, new FutureCallback() { + Futures.addCallback(writeTransaction.submit(), new FutureCallback() { @Override public void onSuccess(@Nullable final Void result) { LOG.debug("remove-trusted-certificate success. Input: {}", input); @@ -227,13 +224,12 @@ public class NetconfSalKeystoreService implements NetconfKeystoreService { for (PrivateKey key: input.getPrivateKey()) { writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, - keystoreIid.child(PrivateKey.class, key.getKey()), key); + keystoreIid.child(PrivateKey.class, key.key()), key); } final SettableFuture> rpcResult = SettableFuture.create(); - final ListenableFuture submit = writeTransaction.submit(); - Futures.addCallback(submit, new FutureCallback() { + Futures.addCallback(writeTransaction.submit(), new FutureCallback() { @Override public void onSuccess(@Nullable final Void result) { LOG.debug("add-private-key success. Input: {}", input); @@ -262,8 +258,7 @@ public class NetconfSalKeystoreService implements NetconfKeystoreService { final SettableFuture> rpcResult = SettableFuture.create(); - final ListenableFuture submit = writeTransaction.submit(); - Futures.addCallback(submit, new FutureCallback() { + Futures.addCallback(writeTransaction.submit(), new FutureCallback() { @Override public void onSuccess(@Nullable final Void result) { LOG.debug("remove-private-key success. Input: {}", input); diff --git a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapterTest.java b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapterTest.java index 727614f6b5..a31bd083aa 100644 --- a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapterTest.java +++ b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfKeystoreAdapterTest.java @@ -166,7 +166,7 @@ public class NetconfKeystoreAdapterTest { } final PrivateKey privateKey = new PrivateKeyBuilder() - .setKey(new PrivateKeyKey(keyName)) + .withKey(new PrivateKeyKey(keyName)) .setName(keyName) .setData(keyData) .setCertificateChain(certChain) @@ -191,7 +191,7 @@ public class NetconfKeystoreAdapterTest { final String certData = element.getElementsByTagName(XML_ELEMENT_CERT).item(0).getTextContent(); final TrustedCertificate certificate = new TrustedCertificateBuilder() - .setKey(new TrustedCertificateKey(certName)) + .withKey(new TrustedCertificateKey(certName)) .setName(certName) .setCertificate(certData) .build(); diff --git a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfSalKeystoreServiceTest.java b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfSalKeystoreServiceTest.java index 2b98e5050c..1d85790b6b 100644 --- a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfSalKeystoreServiceTest.java +++ b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfSalKeystoreServiceTest.java @@ -114,7 +114,7 @@ public class NetconfSalKeystoreServiceTest { } final PrivateKey privateKey = new PrivateKeyBuilder() - .setKey(new PrivateKeyKey(keyName)) + .withKey(new PrivateKeyKey(keyName)) .setName(keyName) .setData(keyData) .setCertificateChain(certChain) @@ -139,7 +139,7 @@ public class NetconfSalKeystoreServiceTest { final String certData = element.getElementsByTagName(XML_ELEMENT_CERT).item(0).getTextContent(); final TrustedCertificate certificate = new TrustedCertificateBuilder() - .setKey(new TrustedCertificateKey(certName)) + .withKey(new TrustedCertificateKey(certName)) .setName(certName) .setCertificate(certData) .build(); diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/DummyMonitoringService.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/DummyMonitoringService.java index 53c89f1895..a3aa411bea 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/DummyMonitoringService.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/DummyMonitoringService.java @@ -46,14 +46,15 @@ public class DummyMonitoringService implements NetconfMonitoringService { private static final Function CAPABILITY_SCHEMA_FUNCTION = new Function() { @Nullable @Override - public Schema apply(@Nonnull Capability capability) { + public Schema apply(@Nonnull final Capability capability) { return new SchemaBuilder() .setIdentifier(capability.getModuleName().get()) .setNamespace(new Uri(capability.getModuleNamespace().get())) .setFormat(Yang.class) .setVersion(capability.getRevision().get()) .setLocation(Collections.singletonList(new Location(Enumeration.NETCONF))) - .setKey(new SchemaKey(Yang.class, capability.getModuleName().get(), capability.getRevision().get())) + .withKey(new SchemaKey(Yang.class, capability.getModuleName().get(), + capability.getRevision().get())) .build(); } }; @@ -62,7 +63,7 @@ public class DummyMonitoringService implements NetconfMonitoringService { private final ArrayListMultimap capabilityMultiMap; private final Schemas schemas; - public DummyMonitoringService(Set capabilities) { + public DummyMonitoringService(final Set capabilities) { this.capabilities = new CapabilitiesBuilder().setCapability( Lists.newArrayList(Collections2.transform(capabilities, CAPABILITY_URI_FUNCTION))).build(); @@ -89,17 +90,17 @@ public class DummyMonitoringService implements NetconfMonitoringService { public SessionListener getSessionListener() { return new SessionListener() { @Override - public void onSessionUp(NetconfManagementSession session) { + public void onSessionUp(final NetconfManagementSession session) { //no op } @Override - public void onSessionDown(NetconfManagementSession session) { + public void onSessionDown(final NetconfManagementSession session) { //no op } @Override - public void onSessionEvent(SessionEvent event) { + public void onSessionEvent(final SessionEvent event) { //no op } }; @@ -111,7 +112,7 @@ public class DummyMonitoringService implements NetconfMonitoringService { } @Override - public String getSchemaForCapability(String moduleName, Optional revision) { + public String getSchemaForCapability(final String moduleName, final Optional revision) { for (Capability capability : capabilityMultiMap.get(moduleName)) { if (capability.getRevision().get().equals(revision.get())) { @@ -128,12 +129,12 @@ public class DummyMonitoringService implements NetconfMonitoringService { } @Override - public AutoCloseable registerCapabilitiesListener(CapabilitiesListener listener) { + public AutoCloseable registerCapabilitiesListener(final CapabilitiesListener listener) { return null; } @Override - public AutoCloseable registerSessionsListener(SessionsListener listener) { + public AutoCloseable registerSessionsListener(final SessionsListener listener) { return null; } diff --git a/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/netconf/sal/streams/listeners/ListenerAdapterTest.java b/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/netconf/sal/streams/listeners/ListenerAdapterTest.java index 52ede84d41..68c398876a 100644 --- a/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/netconf/sal/streams/listeners/ListenerAdapterTest.java +++ b/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/netconf/sal/streams/listeners/ListenerAdapterTest.java @@ -143,7 +143,7 @@ public class ListenerAdapterTest extends AbstractConcurrentDataBrokerTest { adapter.assertGot(getNotifJson(JSON_NOTIF_LEAVES_CREATE)); writeTransaction = dataBroker.newWriteOnlyTransaction(); - builder = new MyList1Builder().setKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); + builder = new MyList1Builder().withKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iid, builder.build(), true); writeTransaction.submit(); adapter.assertGot(getNotifJson(JSON_NOTIF_LEAVES_UPDATE)); @@ -172,7 +172,7 @@ public class ListenerAdapterTest extends AbstractConcurrentDataBrokerTest { adapter.assertGot(getNotifJson(JSON_NOTIF_CREATE)); writeTransaction = dataBroker.newWriteOnlyTransaction(); - builder = new MyList1Builder().setKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); + builder = new MyList1Builder().withKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iid, builder.build(), true); writeTransaction.submit(); adapter.assertGot(getNotifJson(JSON_NOTIF_UPDATE)); diff --git a/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java b/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java index 5d1d335380..a1cb417bdf 100644 --- a/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java +++ b/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java @@ -148,7 +148,7 @@ public class ListenerAdapterTest extends AbstractConcurrentDataBrokerTest { adapter.assertGot(getNotifJson(JSON_NOTIF_LEAVES_CREATE)); writeTransaction = dataBroker.newWriteOnlyTransaction(); - builder = new MyList1Builder().setKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); + builder = new MyList1Builder().withKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iid, builder.build(), true); writeTransaction.submit(); adapter.assertGot(getNotifJson(JSON_NOTIF_LEAVES_UPDATE)); @@ -179,7 +179,7 @@ public class ListenerAdapterTest extends AbstractConcurrentDataBrokerTest { adapter.assertGot(getNotifJson(JSON_NOTIF_CREATE)); writeTransaction = dataBroker.newWriteOnlyTransaction(); - builder = new MyList1Builder().setKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); + builder = new MyList1Builder().withKey(new MyList1Key("Althea")).setMyLeaf12("Bertha"); writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iid, builder.build(), true); writeTransaction.submit(); adapter.assertGot(getNotifJson(JSON_NOTIF_UPDATE)); -- 2.36.6