use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterConfigStats in project openflowplugin by opendaylight.
the class OpenflowpluginStatsTestCommandProvider method _meterConfigStats.
public void _meterConfigStats(CommandInterpreter ci) {
int meterCount = 0;
int meterConfigStatsCount = 0;
NodeMeterConfigStats data = null;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
NodeKey nodeKey = node2.getKey();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
if (node != null) {
if (node.getMeter() != null) {
List<Meter> meters = node.getMeter();
for (Meter meter2 : meters) {
meterCount++;
MeterKey meterKey = meter2.getKey();
InstanceIdentifier<Meter> meterRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey).augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
Meter meter = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, meterRef);
if (meter != null) {
data = meter.getAugmentation(NodeMeterConfigStats.class);
if (null != data) {
meterConfigStatsCount++;
}
}
}
}
}
}
if (meterCount == meterConfigStatsCount) {
LOG.debug("---------------------------meterConfigStats - Success-------------------------------------");
ci.print(data);
} else {
LOG.debug("----------------------------meterConfigStats - Failed-------------------------------------");
LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
}
}
Aggregations