- final List<Node> nodeList = NetconfConsoleUtils.getNetconfNodeFromId(deviceId, dataBroker);
- if (nodeList != null && nodeList.size() > 0) {
- for (final Node node : nodeList) {
- final NetconfNode netconfNode = node.augmentation(NetconfNode.class);
- final Map<String, List<String>> attributes = new HashMap<>();
- attributes.put(NetconfConsoleConstants.NETCONF_ID, ImmutableList.of(node.getNodeId().getValue()));
- attributes.put(NetconfConsoleConstants.NETCONF_IP,
- ImmutableList.of(netconfNode.getHost().getIpAddress().getIpv4Address().getValue()));
- attributes.put(NetconfConsoleConstants.NETCONF_PORT,
- ImmutableList.of(netconfNode.getPort().getValue().toString()));
- attributes.put(NetconfConsoleConstants.STATUS,
- ImmutableList.of(netconfNode.getConnectionStatus().name()));
- if (netconfNode.getConnectionStatus().equals(NetconfNodeConnectionStatus.ConnectionStatus.Connected)) {
- attributes.put(NetconfConsoleConstants.AVAILABLE_CAPABILITIES,
- netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
- .map(AvailableCapability::getCapability).collect(Collectors.toList()));
- } else {
- attributes.put(NetconfConsoleConstants.AVAILABLE_CAPABILITIES, Collections.singletonList(""));
- }
- device.put(node.getNodeId().getValue(), attributes);
+ final Node node = NetconfConsoleUtils.getNetconfNodeFromId(deviceId, dataBroker);
+ if (node != null) {
+ final NetconfNode netconfNode = node.augmentation(NetconfNode.class);
+ final Map<String, List<String>> attributes = new HashMap<>();
+ attributes.put(NetconfConsoleConstants.NETCONF_ID, List.of(node.getNodeId().getValue()));
+ attributes.put(NetconfConsoleConstants.NETCONF_IP,
+ List.of(netconfNode.getHost().getIpAddress().getIpv4Address().getValue()));
+ attributes.put(NetconfConsoleConstants.NETCONF_PORT, List.of(netconfNode.getPort().getValue().toString()));
+ attributes.put(NetconfConsoleConstants.STATUS, List.of(netconfNode.getConnectionStatus().name()));
+ if (netconfNode.getConnectionStatus().equals(NetconfNodeConnectionStatus.ConnectionStatus.Connected)) {
+ attributes.put(NetconfConsoleConstants.AVAILABLE_CAPABILITIES, netconfNode.getAvailableCapabilities()
+ .getAvailableCapability().stream()
+ .map(AvailableCapability::getCapability).collect(Collectors.toList()));
+ } else {
+ attributes.put(NetconfConsoleConstants.AVAILABLE_CAPABILITIES, List.of(""));