use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.grouping.PcepSessionStateBuilder in project bgpcep by opendaylight.
the class TopologyStatsProviderImpl method updatePcepStats.
private synchronized void updatePcepStats() {
final WriteTransaction tx = TopologyStatsProviderImpl.this.transactionChain.newWriteOnlyTransaction();
for (final Map.Entry<KeyedInstanceIdentifier<Node, NodeKey>, PcepSessionState> entry : this.statsMap.entrySet()) {
final PcepTopologyNodeStatsAug nodeStatsAug = new PcepTopologyNodeStatsAugBuilder().setPcepSessionState(new PcepSessionStateBuilder(entry.getValue()).build()).build();
final InstanceIdentifier<PcepTopologyNodeStatsAug> statId = entry.getKey().augmentation(PcepTopologyNodeStatsAug.class);
tx.put(LogicalDatastoreType.OPERATIONAL, statId, nodeStatsAug);
}
tx.submit();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.grouping.PcepSessionStateBuilder in project bgpcep by opendaylight.
the class PcepStateUtilsTest method createPcepSessionState.
private PcepSessionState createPcepSessionState() {
final LocalPref pref = new LocalPrefBuilder().setKeepalive((short) 30).setDeadtimer((short) 120).setIpAddress(IP_ADDRESS).setSessionId(0).addAugmentation(PcepEntityIdStatsAug.class, new PcepEntityIdStatsAugBuilder().setSpeakerEntityIdValue(SPEAKER_ID).build()).build();
final PeerCapabilities capa = new PeerCapabilitiesBuilder().addAugmentation(StatefulCapabilitiesStatsAug.class, new StatefulCapabilitiesStatsAugBuilder().setStateful(true).setInstantiation(true).setActive(true).build()).build();
final ReplyTime reply = new ReplyTimeBuilder().setAverageTime(1L).setMaxTime(3L).setMinTime(2L).build();
final ErrorMessages errorMsg = new ErrorMessagesBuilder().setReceivedErrorMsgCount(1L).setSentErrorMsgCount(2L).build();
final StatefulMessagesStatsAug statefulMsg = new StatefulMessagesStatsAugBuilder().setLastReceivedRptMsgTimestamp(1512043769L).setSentUpdMsgCount(1L).setReceivedRptMsgCount(2L).setSentInitMsgCount(3L).build();
final Messages messages = new MessagesBuilder().setLastSentMsgTimestamp(1512043828L).setUnknownMsgReceived(1).setSentMsgCount(5L).setReceivedMsgCount(4L).setReplyTime(reply).setErrorMessages(errorMsg).addAugmentation(StatefulMessagesStatsAug.class, statefulMsg).build();
return new PcepSessionStateBuilder().setSynchronized(true).setSessionDuration("0:00:01:26").setDelegatedLspsCount(1).setLocalPref(pref).setPeerPref(new PeerPrefBuilder(pref).build()).setPeerCapabilities(capa).setMessages(messages).build();
}
Aggregations