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


Java RosterEntry.getUser方法代码示例

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


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

示例1: namesToJIDs

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
 * Names to ji ds.
 *
 * @param devices
 *            the devices
 * @return the string[]
 */
public String[] namesToJIDs(String... devices)
{
	String[] jids = new String[devices.length];
	for (RosterEntry re : xmpp.getRoster().getEntries())
	{
		for (int i = 0; i < devices.length; i++)
		{
			if (re.getName().equals(devices[i]))
			{
				jids[i] = re.getUser();
			}
		}
	}
	return jids;
}
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:23,代码来源:MessagingManager.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:ice-coffee,项目名称:EIM,代码行数:21,代码来源:RosterExchange.java

示例3: 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

示例4: entriesAdded

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
public void entriesAdded(Collection<String> addresses) {
    for (String addr : addresses) {
        RosterEntry entry = getSession().conn.getRoster().getEntry(addr);
        getSession().getBuddyManager().storeBuddy(new XMPPBuddy(getSession().getBuddyManager(), entry.getUser(), entry.getName(), entry.getGroups(), entry));

        // Facebook does not support presence probes in their XMPP implementation. See http://developers.facebook.com/docs/chat#features
        if (!TransportType.facebook.equals(getSession().getTransport().getType())) {
            //ProbePacket probe = new ProbePacket(getSession().getJID()+"/"+getSession().xmppResource, entry.getUser());
            ProbePacket probe = new ProbePacket(null, entry.getUser());
            Log.debug("XMPP: Sending the following probe packet: "+probe.toXML());
            try {
                getSession().conn.sendPacket(probe);
            }
            catch (IllegalStateException e) {
                Log.debug("XMPP: Not connected while trying to send probe.");
            }
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:20,代码来源:XMPPListener.java

示例5: 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

示例6: getContactFromRosterEntry

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
    * Get a contact from a RosterEntry.
    * @param entry a roster entry containing information for the contact.
    * @return a contact for this entry.
    */
   private Contact getContactFromRosterEntry(RosterEntry entry) {
String user = entry.getUser();
Contact c = new Contact(user);
Presence p = mAdaptee.getPresence(user);

if (p.getStatus() == null || "".equals(p.getStatus()))
    p.setStatus(mDefaultStatusMessages.get(Status.getStatusFromPresence(p)));
c.setStatus(p);
try {
    c.setGroups(entry.getGroups());
} catch (NullPointerException e) {
    Log.d(TAG, "Group list not ready", e);
}
Iterator<Presence> iPres = mAdaptee.getPresences(user);
while (iPres.hasNext()) {
    p = iPres.next();
    if (!p.getType().equals(Presence.Type.unavailable))
	c.addRes(StringUtils.parseResource(p.getFrom()));
}
c.setName(entry.getName());
c.setAvatarId(mAvatarIdmap.get(user));
return c;
   }
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:29,代码来源:RosterAdapter.java

示例7: addAuditor

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
public boolean addAuditor(String id) {
	RosterEntry entry = getEntry(id);
	if (entry == null) {
		error("can not add auditor %s", id);
		return false;
	}
	String jabberID = entry.getUser();
	auditors.add(jabberID);
	broadcast(String.format("added buddy %s", entry.getName()));
	return true;
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:12,代码来源:XMPP.java

示例8: getJabberID

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
public String getJabberID(String id) {
	RosterEntry entry = getEntry(id);
	String jabberID;
	if (entry == null) {
		// error("could not get entry for id - using %s", id);
		jabberID = id;
	} else {
		jabberID = entry.getUser();
	}
	return jabberID;
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:12,代码来源:XMPP.java

示例9: removeAuditor

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
public boolean removeAuditor(String id) {
	RosterEntry entry = getEntry(id);
	if (entry == null) {
		error("can not remove auditor %s", id);
		return false;
	}
	String jabberID = entry.getUser();
	auditors.remove(jabberID);
	return true;
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:11,代码来源:XMPP.java

示例10: getNickname

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
 * 
 * ����jid����û��dz�
 * 
 * @param Jid
 * @param connection
 * @return
 */
public static User getNickname(String Jid, XMPPConnection connection) {
	Roster roster = connection.getRoster();
	for (RosterEntry entry : roster.getEntries()) {
		String params = entry.getUser();
		if (params.split("/")[0].equals(Jid)) {
			return transEntryToUser(entry, roster);
		}
	}
	return null;

}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:20,代码来源:ContacterManager.java

示例11: getName

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
 * 获取联系人名称
 * 
 * @param rosterEntry
 * @return
 */
private String getName(RosterEntry rosterEntry) {
	String name = rosterEntry.getName();
	if (name != null && name.length() > 0) {
		return name;
	}
	name = StringUtils.parseName(rosterEntry.getUser());
	if (name.length() > 0) {
		return name;
	}
	return rosterEntry.getUser();
}
 
开发者ID:victoryckl,项目名称:XmppTest,代码行数:18,代码来源:SmackImpl.java

示例12: fetchRosterEntries

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**	fetchRosterEntries
 * 
 */
private void fetchRosterEntries() {
	Collection<RosterEntry> rosterEntries = roster.getEntries();
	for (RosterEntry entry : rosterEntries) {
		Presence presence = roster.getPresence(entry.getUser());
		Contact contact;
		contact = new Contact(entry.getUser(), presence.isAvailable());
		eventbus.contactEvent(contact);
	}
}
 
开发者ID:mjohenneken,项目名称:SimpleAndroidChat,代码行数:13,代码来源:ConnectionAdapter.java

示例13: nicknameToJID

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
/**
 * Converts a nickname to a JID by looking it up in the roster.
 *
 * @param nickname the nickname to convert
 * @return the JID of the nickname in the roster, or the nickname if it wasn't found
 */
private String nicknameToJID(String nickname) {
	for (RosterEntry r : connection.getRoster().getEntries()) {
		if (r.getName().equals(nickname))
			return r.getUser();
	}

	return nickname;
}
 
开发者ID:kcbanner,项目名称:chief,代码行数:15,代码来源:Bot.java

示例14: getRosterEntries

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
private ArrayList<PRosterEntry> getRosterEntries()
{
	Log.d(TAG, "getRosterEntries");
	if (connection != null && connection.isConnected() == true)
	{
		Roster roster = connection.getRoster();
		Collection<RosterEntry> entries = roster.getEntries();

		ArrayList<PRosterEntry> data = new ArrayList<PRosterEntry>();

		for (RosterEntry rosterEntry : entries)
		{
			PRosterEntry re = new PRosterEntry();
			Presence p = roster.getPresence(rosterEntry.getUser());

			re.name = rosterEntry.getName();
			re.user = rosterEntry.getUser();
			re.presence = p.getType().name();

			data.add(re);
		}
		Log.d(TAG, "getRosterEntries " + data.size());
		return data;
	}
	else
	{
		return new ArrayList<PRosterEntry>();
	}
}
 
开发者ID:jonathangerbaud,项目名称:KlyphMessenger,代码行数:30,代码来源:MessengerService.java

示例15: getName

import org.jivesoftware.smack.RosterEntry; //导入方法依赖的package包/类
private String getName(RosterEntry rosterEntry) {
	String name = rosterEntry.getName();
	if (name != null && name.length() > 0) {
		return name;
	}
	name = StringUtils.parseName(rosterEntry.getUser());
	if (name.length() > 0) {
		return name;
	}
	return rosterEntry.getUser();
}
 
开发者ID:ufo22940268,项目名称:maven-yaxim,代码行数:12,代码来源:SmackableImp.java


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