Package rocks.xmpp.core.roster.model

Examples of rocks.xmpp.core.roster.model.ContactGroup


        Assert.assertEquals(list.get(0).getContacts().iterator().next().getJid(), Jid.valueOf("contact5@domain"));
        Assert.assertEquals(list.get(0).getName(), "Group3");
        Assert.assertEquals(list.get(0).getContacts().size(), 1);
        Assert.assertEquals(list.get(0).getGroups().size(), 1);

        ContactGroup contactGroup = list.get(0).getGroups().iterator().next();
        Assert.assertEquals(contactGroup.getName(), "SubGroup");
        Assert.assertEquals(contactGroup.getGroups().size(), 1);
        Assert.assertEquals(contactGroup.getContacts().size(), 1);
        Assert.assertEquals(contactGroup.getContacts().iterator().next().getJid(), Jid.valueOf("contact3@domain"));
        ContactGroup nestedGroup = contactGroup.getGroups().iterator().next();
        Assert.assertEquals(nestedGroup.getName(), "3rdLevel");
        Assert.assertEquals(nestedGroup.getContacts().size(), 1);
        Assert.assertEquals(nestedGroup.getContacts().iterator().next().getJid(), Jid.valueOf("contact4@domain"));
    }
View Full Code Here


                        } else {
                            nestedGroups = new String[]{group};
                        }

                        String currentGroupName = "";
                        ContactGroup currentGroup = null;
                        for (int i = 0; i < nestedGroups.length; i++) {
                            String nestedGroupName = nestedGroups[i];
                            currentGroupName += nestedGroupName;
                            ContactGroup nestedGroup = rosterGroupMap.get(currentGroupName);
                            if (nestedGroup == null) {
                                nestedGroup = new ContactGroup(nestedGroupName, currentGroupName, currentGroup);
                                rosterGroupMap.put(currentGroupName, nestedGroup);
                                // Only add top level groups.
                                if (i == 0) {
                                    groups.add(nestedGroup);
                                }
View Full Code Here

     */
    public synchronized void renameContactGroup(ContactGroup contactGroup, String name) throws XmppException {
        // Make this method synchronized so that roster pushes (which will occur during this method) don't mess up with this logic here (because the ContactGroup objects are reused and modified).
        int depth = -1;
        // Determine the depth of this group.
        ContactGroup parentGroup = contactGroup;
        do {
            parentGroup = parentGroup.getParentGroup();
            depth++;
        } while (parentGroup != null);
        replaceGroupName(contactGroup, name, depth);
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.roster.model.ContactGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.