当前位置: 首页>>代码示例>>Java>>正文


Java RosterEntry.getGroups方法代码示例

本文整理汇总了Java中org.jivesoftware.smack.RosterEntry.getGroups方法的典型用法代码示例。如果您正苦于以下问题:Java RosterEntry.getGroups方法的具体用法?Java RosterEntry.getGroups怎么用?Java RosterEntry.getGroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.smack.RosterEntry的用法示例。


在下文中一共展示了RosterEntry.getGroups方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addRosterEntry

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
   * Adds a roster entry to the packet.
   *
   * @param rosterEntry a roster entry to add.
   */
  public void addRosterEntry(RosterEntry rosterEntry) {
// Obtain a String[] from the roster entry groups name 
List<String> groupNamesList = new ArrayList<String>();
String[] groupNames;
for (RosterGroup group : rosterEntry.getGroups()) {
	groupNamesList.add(group.getName());
}
groupNames = groupNamesList.toArray(new String[groupNamesList.size()]);

      // Create a new Entry based on the rosterEntry and add it to the packet
      RemoteRosterEntry remoteRosterEntry = new RemoteRosterEntry(rosterEntry.getUser(),
              rosterEntry.getName(), groupNames);

      addRosterEntry(remoteRosterEntry);
  }
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:21,代码来源:RosterExchange.java

示例2: addRosterEntry

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
 * Adds a roster entry to the packet.
 * 
 * @param rosterEntry
 *            a roster entry to add.
 */
public void addRosterEntry(RosterEntry rosterEntry) {
	// Obtain a String[] from the roster entry groups name
	List<String> groupNamesList = new ArrayList<String>();
	String[] groupNames;
	for (RosterGroup group : rosterEntry.getGroups()) {
		groupNamesList.add(group.getName());
	}
	groupNames = groupNamesList.toArray(new String[groupNamesList.size()]);

	// Create a new Entry based on the rosterEntry and add it to the packet
	RemoteRosterEntry remoteRosterEntry = new RemoteRosterEntry(
			rosterEntry.getUser(), rosterEntry.getName(), groupNames);

	addRosterEntry(remoteRosterEntry);
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:22,代码来源:RosterExchange.java

示例3: ParcelableRoster

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
public ParcelableRoster(RosterEntry entry, Presence presence) {

        if(entry != null) {
            // entry data 파싱
            this.userID = entry.getUser();
            this.userName = entry.getName();
            for(RosterGroup rosterGroup : entry.getGroups()) { this.group = rosterGroup.getName(); }
        }

        if(presence != null) {
            // 접속상태 확인
            this.availablity = presence.getType().toString();
            if(availablity.equals("available")) parseStatusString( presence.getStatus() );
            if(presence.getMode() != null) this.mode = presence.getMode().toString();
        }
    }
 
开发者ID:rokoroku,项目名称:LoLMessenger,代码行数:17,代码来源:ParcelableRoster.java

示例4: removeRosterEntryFromGroups

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
private void removeRosterEntryFromGroups(RosterEntry rosterEntry)
		throws XXException {// 从对应组中删除联系人,供外部服务调用
	Collection<RosterGroup> oldGroups = rosterEntry.getGroups();

	for (RosterGroup group : oldGroups) {
		tryToRemoveUserFromGroup(group, rosterEntry);
	}
}
 
开发者ID:victoryckl,项目名称:XmppTest,代码行数:9,代码来源:SmackImpl.java

示例5: removeRosterEntryFromGroups

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
private void removeRosterEntryFromGroups(RosterEntry rosterEntry)
		throws AppException {// 从对应组中删除联系人,供外部服务调用
	Collection<RosterGroup> oldGroups = rosterEntry.getGroups();

	for (RosterGroup group : oldGroups) {
		tryToRemoveUserFromGroup(group, rosterEntry);
	}
}
 
开发者ID:misty-rain,项目名称:smartedu,代码行数:9,代码来源:SmackImpl.java

示例6: removeRosterEntryFromGroups

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
private void removeRosterEntryFromGroups(RosterEntry rosterEntry)
		throws YaximXMPPException {
	Collection<RosterGroup> oldGroups = rosterEntry.getGroups();

	for (RosterGroup group : oldGroups) {
		tryToRemoveUserFromGroup(group, rosterEntry);
	}
}
 
开发者ID:ufo22940268,项目名称:maven-yaxim,代码行数:9,代码来源:SmackableImp.java

示例7: addUser

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
 * Adds a single user to the ContactList.
 *
 * @param entry the <code>RosterEntry</code> of the the user.
 */
private void addUser(RosterEntry entry) {
    ContactItem newContactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getUser());

    if (entry.getType() == RosterPacket.ItemType.none || entry.getType() == RosterPacket.ItemType.from) {
        // Ignore, since the new user is pending to be added.
        for (RosterGroup group : entry.getGroups()) {
            ContactGroup contactGroup = getContactGroup(group.getName());
            if (contactGroup == null) {
                contactGroup = addContactGroup(group.getName());
            }

            boolean isPending = entry.getType() == RosterPacket.ItemType.none || entry.getType() == RosterPacket.ItemType.from
                && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus();
            if (isPending) {
                contactGroup.setVisible(true);
            }
            contactGroup.addContactItem(newContactItem);

        }
        return;
    }
    else {
        moveToOffline(newContactItem);
    }

    // Update users icon
    Presence presence = SparkManager.getConnection().getRoster().getPresence(entry.getUser());
    try {
        updateUserPresence(presence);
    }
    catch (Exception e) {
        Log.error(e);
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:40,代码来源:ContactList.java


注:本文中的org.jivesoftware.smack.RosterEntry.getGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。