/** * Returns true if the specified XMPP address is an entry in the roster. * * @param user the XMPP address of the user (eg "jsmith@example.com"). The * address could be in any valid format (e.g. "domain/resource", * "user@domain" or "user@domain/resource"). * @return true if the XMPP address is an entry in the roster. */ public boolean contains(String user) { return getEntry(user) != null; }
/** * Returns true if the specified XMPP address is an entry in the roster. * * @param user the XMPP address of the user (eg "jsmith@example.com"). The * address could be in any valid format (e.g. "domain/resource", * "user@domain" or "user@domain/resource"). * @return true if the XMPP address is an entry in the roster. */ public boolean contains(String user) { return getEntry(user) != null; }
/** * Returns true if the specified XMPP address is an entry in the roster. * * @param user the XMPP address of the user (eg "jsmith@example.com"). The address could be * in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource"). * @return true if the XMPP address is an entry in the roster. */ public boolean contains(String user) { return getEntry(user) != null; }
/** * Returns true if the specified XMPP address is an entry in the roster. * * @param user the XMPP address of the user (eg "jsmith@example.com"). The * address could be in any valid format (e.g. "domain/resource", * "user@domain" or "user@domain/resource"). * @return true if the XMPP address is an entry in the roster. */ public boolean contains(String user) { return getEntry(user) != null; }
/** * 检查节点是否在线 */ private boolean checkOnline() { mRoster = XmppConnectionManager.getXmppconnectionManager().getRoster(); RosterEntry entry = mRoster.getEntry(childJid); String type = mRoster.getPresence(entry.getUser()) + ""; if (type.equals("available (online)")) { return true; } else { return false; } }
RosterEntry entry = mRoster.getEntry(nodeName.substring(0, nodeName.lastIndexOf("/"))); String type = mRoster.getPresence(entry.getUser()) + ""; holder.userName.setText(name);
/** * Gets a friend based on his XMPPAddress. * * @param xmppAddress * For example sum12345678@pvp.net * @return The corresponding Friend or null if user is not found or he is * not a friend of you. */ public Friend getFriendById(String xmppAddress) { final RosterEntry entry = connection.getRoster().getEntry( StringUtils.parseBareAddress(xmppAddress)); if (entry != null) { return new Friend(this, connection, entry); } return null; }
RosterEntry entry = mRoster.getEntry(from.substring(0, from.lastIndexOf("/"))); Log.e("tt", "entry = " + entry); final String type = mRoster.getPresence(entry.getUser()) + "";
@Override public SampleResult perform(JMeterXMPPSampler sampler, SampleResult res) throws Exception { Action action = Action.valueOf(sampler.getPropertyAsString(ACTION, Action.get_roster.toString())); Roster roster = sampler.getXMPPConnection().getRoster(); String entry = sampler.getPropertyAsString(ENTRY); res.setSamplerData(action.toString() + ": " + entry); if (action == Action.get_roster) { res.setResponseData(rosterToString(roster).getBytes()); } else if (action == Action.add_item) { roster.createEntry(entry, entry, new String[0]); } else if (action == Action.delete_item) { RosterEntry rosterEntry = roster.getEntry(entry); if (rosterEntry != null) { roster.removeEntry(rosterEntry); } } return res; }
throw new XMPPException(resultIQ.getError()); RosterEntry gatewayEntry = roster.getEntry(entityJID); roster.removeEntry(gatewayEntry);