use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stateful.stats.rev181109.PcepEntityIdStatsAug in project bgpcep by opendaylight.
the class PcepStateUtils method displayNodeState.
private static void displayNodeState(final String topologyId, final String nodeId, final PcepSessionState pcepSessionState, final PrintStream stream) {
final ShellTable table = new ShellTable();
table.column("Attribute").alignLeft();
table.column("Value").alignLeft();
showNodeState(table, topologyId, nodeId, pcepSessionState);
addHeader(table, "Local preferences");
final LocalPref localPref = pcepSessionState.getLocalPref();
showPreferences(table, localPref);
final PcepEntityIdStatsAug entAug = localPref.augmentation(PcepEntityIdStatsAug.class);
if (entAug != null) {
table.addRow().addContent("Speaker Entity Identifier", Arrays.toString(entAug.getSpeakerEntityIdValue()));
}
addHeader(table, "Peer preferences");
final PeerPref peerPref = pcepSessionState.getPeerPref();
showPreferences(table, peerPref);
showCapabilities(table, pcepSessionState.getPeerCapabilities());
final Messages messages = pcepSessionState.getMessages();
showMessages(table, messages);
final ErrorMessages error = messages.getErrorMessages();
showErrorMessages(table, error);
final ReplyTime reply = messages.getReplyTime();
showReplyMessages(table, reply);
table.print(stream);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stateful.stats.rev181109.PcepEntityIdStatsAug in project bgpcep by opendaylight.
the class TopologyStatsRpcServiceImpl method transformStatefulAugmentation.
/*
* Replace stateful topology augmentations with ones for rpc in PCEP session
* stats data
*/
private static PcepSessionState transformStatefulAugmentation(final PcepSessionState pcepSessionState) {
if (pcepSessionState == null) {
return null;
}
final PcepSessionStateBuilder sb = new PcepSessionStateBuilder(pcepSessionState);
final Messages topoMessage = pcepSessionState.getMessages();
if (topoMessage != null) {
final StatefulMessagesStatsAug messageStatsAug = topoMessage.augmentation(StatefulMessagesStatsAug.class);
if (messageStatsAug != null) {
sb.setMessages(new MessagesBuilder(topoMessage).removeAugmentation(StatefulMessagesStatsAug.class).addAugmentation(new StatefulMessagesRpcAugBuilder().setLastReceivedRptMsgTimestamp(messageStatsAug.getLastReceivedRptMsgTimestamp()).setReceivedRptMsgCount(messageStatsAug.getReceivedRptMsgCount()).setSentInitMsgCount(messageStatsAug.getSentInitMsgCount()).setSentUpdMsgCount(messageStatsAug.getSentUpdMsgCount()).build()).build());
}
}
final PeerCapabilities topoPeerCapability = pcepSessionState.getPeerCapabilities();
if (topoPeerCapability != null) {
final StatefulCapabilitiesStatsAug capabilityStatsAug = topoPeerCapability.augmentation(StatefulCapabilitiesStatsAug.class);
if (capabilityStatsAug != null) {
sb.setPeerCapabilities(new PeerCapabilitiesBuilder(topoPeerCapability).removeAugmentation(StatefulCapabilitiesStatsAug.class).addAugmentation(new StatefulCapabilitiesRpcAugBuilder().setActive(capabilityStatsAug.getActive()).setInstantiation(capabilityStatsAug.getInstantiation()).setStateful(capabilityStatsAug.getStateful()).build()).build());
}
}
final LocalPref topoLocalPref = pcepSessionState.getLocalPref();
if (topoLocalPref != null) {
final PcepEntityIdStatsAug entityStatsAug = topoLocalPref.augmentation(PcepEntityIdStatsAug.class);
if (entityStatsAug != null) {
sb.setLocalPref(new LocalPrefBuilder(topoLocalPref).removeAugmentation(PcepEntityIdStatsAug.class).addAugmentation(new PcepEntityIdRpcAugBuilder().setSpeakerEntityIdValue(entityStatsAug.getSpeakerEntityIdValue()).build()).build());
}
}
return sb.build();
}
Aggregations