Search in sources :

Example 16 with GroupRef

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();
}
Also used : GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) GroupAddedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAddedBuilder)

Example 17 with GroupRef

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();
}
Also used : GroupUpdatedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupUpdatedBuilder) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef)

Example 18 with GroupRef

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.");
        }
    }
}
Also used : Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) NodeGroupDescStats(org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupDescStats) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) GroupKey(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) ReadOnlyTransaction(org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)

Example 19 with GroupRef

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());
}
Also used : Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) Test(org.junit.Test)

Aggregations

GroupRef (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef)12 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)8 Group (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group)6 GroupRef (org.gluu.oxtrust.model.scim2.GroupRef)5 ArrayList (java.util.ArrayList)4 Address (org.gluu.oxtrust.model.scim2.Address)4 Email (org.gluu.oxtrust.model.scim2.Email)4 Entitlement (org.gluu.oxtrust.model.scim2.Entitlement)4 Im (org.gluu.oxtrust.model.scim2.Im)4 PhoneNumber (org.gluu.oxtrust.model.scim2.PhoneNumber)4 Photo (org.gluu.oxtrust.model.scim2.Photo)4 Role (org.gluu.oxtrust.model.scim2.Role)4 X509Certificate (org.gluu.oxtrust.model.scim2.X509Certificate)4 Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)4 StaleGroup (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup)4 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)3 AddGroupInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInputBuilder)3 RemoveGroupInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder)3 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)3 IOException (java.io.IOException)2