import java.util.concurrent.ExecutionException;
import org.apache.karaf.shell.support.table.ShellTable;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stateful.stats.rev171113.PcepEntityIdStatsAug;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stateful.stats.rev171113.StatefulCapabilitiesStatsAug;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stateful.stats.rev171113.StatefulMessagesStatsAug;
stream.println(String.format("Node [%s] not found", nodeId));
return;
}
- final PcepTopologyNodeStatsAug state = node.getAugmentation(PcepTopologyNodeStatsAug.class);
+ final PcepTopologyNodeStatsAug state = node.augmentation(PcepTopologyNodeStatsAug.class);
if (state == null) {
stream.println(String.format("State not found for [%s]", nodeId));
return;
addHeader(table, "Local preferences");
final LocalPref localPref = pcepSessionState.getLocalPref();
showPreferences(table, localPref);
- final PcepEntityIdStatsAug entAug = localPref.getAugmentation(PcepEntityIdStatsAug.class);
+ final PcepEntityIdStatsAug entAug = localPref.augmentation(PcepEntityIdStatsAug.class);
if (entAug != null) {
table.addRow().addContent("Speaker Entity Identifier",
Arrays.toString(entAug.getSpeakerEntityIdValue()));
if (capa == null) {
return;
}
- final StatefulCapabilitiesStatsAug stateFulCapa = capa.getAugmentation(StatefulCapabilitiesStatsAug.class);
+ final StatefulCapabilitiesStatsAug stateFulCapa = capa.augmentation(StatefulCapabilitiesStatsAug.class);
if (stateFulCapa != null) {
addHeader(table, "Stateful Capabilities");
table.addRow().addContent("Stateful", stateFulCapa.isStateful());
table.addRow().addContent("Sent Msg Count", messages.getSentMsgCount());
table.addRow().addContent("Unknown Msg Received", messages.getUnknownMsgReceived());
- final StatefulMessagesStatsAug statefulMessages = messages.getAugmentation(StatefulMessagesStatsAug.class);
+ final StatefulMessagesStatsAug statefulMessages = messages.augmentation(StatefulMessagesStatsAug.class);
if (statefulMessages == null) {
return;
}
.child(Topology.class, new TopologyKey(new TopologyId(topologyId)))
.child(Node.class, new NodeKey(new NodeId(nodeId))).build();
- final ReadOnlyTransaction rot = dataBroker.newReadOnlyTransaction();
+ final ReadTransaction rot = dataBroker.newReadOnlyTransaction();
try {
- return rot.read(LogicalDatastoreType.OPERATIONAL, topology).get().orNull();
+ return rot.read(LogicalDatastoreType.OPERATIONAL, topology).get().orElse(null);
} catch (final InterruptedException | ExecutionException e) {
LOG.warn("Failed to read node {}", nodeId, e);
}