use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef in project openflowplugin by opendaylight.
the class OpenflowpluginStatsTestCommandProvider method _descStats.
public void _descStats(CommandInterpreter ci) {
int descCount = 0;
int descStatsCount = 0;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
descCount++;
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 (null != node.getHardware() && null != node.getManufacturer() && null != node.getSoftware()) {
descStatsCount++;
}
}
}
if (descCount == descStatsCount) {
LOG.debug("descStats - Success");
} else {
LOG.debug("descStats - Failed");
LOG.debug("System fetches stats data in 50 seconds interval, so please wait and try again.");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef in project openflowplugin by opendaylight.
the class OpenflowpluginStatsTestCommandProvider method _portStats.
public void _portStats(CommandInterpreter ci) {
int nodeConnectorCount = 0;
int nodeConnectorStatsCount = 0;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
NodeKey nodeKey = node2.getKey();
InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
if (node != null) {
if (node.getNodeConnector() != null) {
List<NodeConnector> ports = node.getNodeConnector();
for (NodeConnector nodeConnector2 : ports) {
nodeConnectorCount++;
NodeConnectorKey nodeConnectorKey = nodeConnector2.getKey();
InstanceIdentifier<NodeConnector> connectorRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey);
NodeConnector nodeConnector = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, connectorRef);
if (nodeConnector != null) {
FlowCapableNodeConnectorStatisticsData data = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
if (null != data) {
nodeConnectorStatsCount++;
}
}
}
}
}
}
if (nodeConnectorCount == nodeConnectorStatsCount) {
LOG.debug("portStats - Success");
} else {
LOG.debug("portStats - Failed");
LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef 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.");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef in project openflowplugin by opendaylight.
the class OpenflowpluginStatsTestCommandProvider method _groupDescStats.
public void _groupDescStats(CommandInterpreter ci) {
int groupCount = 0;
int groupDescStatsCount = 0;
NodeGroupDescStats 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.getGroup() != null) {
List<Group> groups = node.getGroup();
for (Group group2 : groups) {
groupCount++;
GroupKey groupKey = group2.getKey();
InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey).augmentation(FlowCapableNode.class).child(Group.class, groupKey);
Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
if (group != null) {
data = group.getAugmentation(NodeGroupDescStats.class);
if (null != data) {
groupDescStatsCount++;
}
}
}
}
}
if (groupCount == groupDescStatsCount) {
LOG.debug("---------------------groupDescStats - Success-------------------------------");
} else {
LOG.debug("------------------------------groupDescStats - Failed--------------------------");
LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef in project openflowplugin by opendaylight.
the class DeviceManagerImpl method sendNodeRemovedNotification.
@Override
public void sendNodeRemovedNotification(@Nonnull final KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier) {
if (notificationCreateNodeSend.remove(instanceIdentifier)) {
NodeRemovedBuilder builder = new NodeRemovedBuilder();
builder.setNodeRef(new NodeRef(instanceIdentifier));
LOG.info("Publishing node removed notification for {}", instanceIdentifier.firstKeyOf(Node.class).getId());
notificationPublishService.offerNotification(builder.build());
}
}
Aggregations