use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef in project openflowplugin by opendaylight.
the class GroupNotificationSupplierImpl method createNotification.
@Override
public GroupAdded createNotification(final Group dataTreeItemObject, final InstanceIdentifier<Group> path) {
Preconditions.checkArgument(dataTreeItemObject != null);
Preconditions.checkArgument(path != null);
final GroupAddedBuilder builder = new GroupAddedBuilder(dataTreeItemObject);
builder.setGroupRef(new GroupRef(path));
builder.setNode(createNodeRef(path));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef in project openflowplugin by opendaylight.
the class GroupNotificationSupplierImpl method updateNotification.
@Override
public GroupUpdated updateNotification(final Group group, final InstanceIdentifier<Group> path) {
Preconditions.checkArgument(group != null);
Preconditions.checkArgument(path != null);
final GroupUpdatedBuilder builder = new GroupUpdatedBuilder(group);
builder.setGroupRef(new GroupRef(path));
builder.setNode(createNodeRef(path));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef 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.group.types.rev131018.GroupRef in project openflowplugin by opendaylight.
the class GroupUtilTest method testBuildGroupPath.
@Test
public void testBuildGroupPath() throws Exception {
final InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(DUMMY_NODE_ID));
final GroupRef groupRef = GroupUtil.buildGroupPath(nodePath, DUMMY_GROUP_ID);
final InstanceIdentifier<?> groupRefValue = groupRef.getValue();
Assert.assertEquals(DUMMY_NODE_ID, groupRefValue.firstKeyOf(Node.class).getId());
Assert.assertEquals(DUMMY_GROUP_ID, groupRefValue.firstKeyOf(Group.class).getGroupId());
}
Aggregations