本文整理汇总了Java中org.jxmpp.jid.Jid.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Jid.toString方法的具体用法?Java Jid.toString怎么用?Java Jid.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jxmpp.jid.Jid
的用法示例。
在下文中一共展示了Jid.toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendBlogPostComment
import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
public BlogPostComment sendBlogPostComment(String content, BlogPost blogPost)
throws SmackException.NotConnectedException, InterruptedException,
XMPPException.XMPPErrorException, SmackException.NoResponseException {
Jid jid = XMPPSession.getInstance().getUser().asEntityBareJid();
String userName = XMPPUtils.fromJIDToUserName(jid.toString());
Jid pubSubServiceJid = XMPPSession.getInstance().getPubSubService();
// create stanza
PublishCommentExtension publishCommentExtension = new PublishCommentExtension(blogPost.getId(), userName, jid, content, new Date());
PubSub publishCommentPubSub = PubSub.createPubsubPacket(pubSubServiceJid, IQ.Type.set, publishCommentExtension, null);
// send stanza
XMPPSession.getInstance().sendStanza(publishCommentPubSub);
return new BlogPostComment(publishCommentExtension.getId(),
blogPost.getId(),
content,
userName,
jid.toString(),
publishCommentExtension.getPublished());
}
示例2: joined
import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
@Override
public void joined(EntityFullJid entityFullJid) {
XmppAddress xa = new XmppAddress(entityFullJid.toString());
ChatGroup chatGroup = mChatGroupManager.getChatGroup(xa);
MultiUserChat muc = mChatGroupManager.getMultiUserChat(entityFullJid.asBareJid().toString());
Occupant occupant = muc.getOccupant(entityFullJid);
Jid jidSource = (occupant != null) ? occupant.getJid() : null;
if (jidSource != null)
xa = new XmppAddress(jidSource.toString());
else
xa = new XmppAddress(entityFullJid.toString());
Contact mucContact = new Contact(xa, xa.getUser(), Imps.Contacts.TYPE_NORMAL);
chatGroup.notifyMemberJoined(entityFullJid.toString(),mucContact);
if (occupant != null) {
chatGroup.notifyMemberRoleUpdate(mucContact, occupant.getRole().name(), occupant.getAffiliation().toString());
}
}
示例3: entriesDeleted
import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
@Override
public void entriesDeleted(Collection<Jid> addresses) {
ContactList cl;
try {
cl = mContactListManager.getDefaultContactList();
for (Jid address : addresses) {
Contact contact = new Contact(new XmppAddress(address.toString()),address.toString(), Imps.Contacts.TYPE_NORMAL);
mContactListManager.notifyContactListUpdated(cl, ContactListListener.LIST_CONTACT_REMOVED, contact);
}
} catch (ImException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例4: handleSubscribeRequest
import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
private void handleSubscribeRequest (Jid jid) throws ImException, RemoteException {
ContactList cList = getContactListManager().getDefaultContactList();
XmppAddress xAddr = new XmppAddress(jid.toString());
Contact contact = new Contact(xAddr, xAddr.getUser(), Imps.Contacts.TYPE_NORMAL);
mContactListManager.doAddContactToListAsync(contact, cList, false);
mContactListManager.getSubscriptionRequestListener().onSubScriptionRequest(contact, mProviderId, mAccountId);
ChatSession session = findOrCreateSession(jid.toString(), false);
org.jivesoftware.smack.packet.Message msg = new org.jivesoftware.smack.packet.Message();
msg.setStanzaId((Math.random()*10000f)+"subscribe");
msg.setTo(mUserJid);
msg.setFrom(jid);
String message = mContext.getString(R.string.subscription_notify_text, contact.getName());
msg.setBody(message);
handleMessage(msg, false, false);
}
示例5: compareTo
import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
@Override
public final int compareTo(Jid other) {
String otherString = other.toString();
String myString = toString();
return myString.compareTo(otherString);
}