• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java LocalUser类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中pl.mn.communicator.LocalUser的典型用法代码示例。如果您正苦于以下问题:Java LocalUser类的具体用法?Java LocalUser怎么用?Java LocalUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

LocalUser类属于pl.mn.communicator包,在下文中一共展示了LocalUser类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: removeContact

点赞 3

import pl.mn.communicator.LocalUser; //导入依赖的package包/类
/**
 * @see net.sf.kraken.session.TransportSession#removeContact(net.sf.kraken.roster.TransportBuddy)
 */
@Override
public void removeContact(GaduGaduBuddy contact) {
    String ggContact = getTransport().convertJIDToID(contact.getJID());
    pseudoRoster.removeItem(ggContact);
    for (GaduGaduBuddy buddy : getBuddyManager().getBuddies()) {
        if (buddy.getJID().equals(contact.getJID())) {
            LocalUser byeUser = buddy.toLocalUser();
            try {
                iSession.getPresenceService().removeMonitoredUser(new User(byeUser.getUin()));
            }
            catch (GGException e) {
                Log.debug("GaduGadu: Error while removing user from being monitored during delete:", e);
            }
            break;
        }
    }
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:21,
代码来源:GaduGaduSession.java

示例2: addContact

点赞 2

import pl.mn.communicator.LocalUser; //导入依赖的package包/类
/**
 * @see net.sf.kraken.session.TransportSession#addContact(org.xmpp.packet.JID, String, java.util.ArrayList)
 */
@Override
public void addContact(JID jid, String nickname, ArrayList<String> groups) {
    String contact = getTransport().convertJIDToID(jid);
    if (nickname == null || nickname.length() < 1) {
        nickname = jid.toBareJID();
    }
    LocalUser newUser = new LocalUser();
    newUser.setUin(Integer.parseInt(contact));
    newUser.setDisplayName(nickname);
    if (groups.size() > 0) {
        newUser.setGroup(groups.get(0));
    }
    PseudoRosterItem rosterItem;
    if (pseudoRoster.hasItem(contact)) {
        rosterItem = pseudoRoster.getItem(contact);
        rosterItem.setNickname(nickname);
        rosterItem.setGroups(groups);
    }
    else {
        rosterItem = pseudoRoster.createItem(contact, nickname, groups);
    }
    getBuddyManager().storeBuddy(new GaduGaduBuddy(getBuddyManager(), newUser, rosterItem));
    try {
        iSession.getPresenceService().addMonitoredUser(new User(newUser.getUin()));
    }
    catch (GGException e) {
        Log.debug("GaduGadu: Error while setting up user to be monitored during add:", e);
    }
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:33,
代码来源:GaduGaduSession.java

示例3: GaduGaduBuddy

点赞 2

import pl.mn.communicator.LocalUser; //导入依赖的package包/类
public GaduGaduBuddy(TransportBuddyManager<GaduGaduBuddy> manager, LocalUser localUser, PseudoRosterItem item) {
    super(manager, Integer.toString(localUser.getUin()), localUser.getDisplayName(), null);
    if (localUser.getGroup() != null) {
        this.groups = Arrays.asList(localUser.getGroup());
    }
    gaduFirstName = localUser.getFirstName();
    gaduLastName = localUser.getLastName();
    gaduNickName = localUser.getNickName();
    gaduTelephone = localUser.getTelephone();
    gaduEmailAddress = localUser.getEmailAddress();
    pseudoRosterItem = item;
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:13,
代码来源:GaduGaduBuddy.java

示例4: toLocalUser

点赞 2

import pl.mn.communicator.LocalUser; //导入依赖的package包/类
public LocalUser toLocalUser() {
    LocalUser localUser = new LocalUser();
    localUser.setUin(Integer.parseInt(this.getName()));
    localUser.setDisplayName(this.getNickname() != null ? this.getNickname() : this.getName());
    Collection<String> groups = this.getGroups();
    if (groups.size() > 0) {
        localUser.setGroup((String)groups.toArray()[0]);
    }
    localUser.setEmailAddress(this.getGaduEmailAddress());
    localUser.setFirstName(this.getGaduFirstName() != null ? this.getGaduFirstName() : this.getName());
    localUser.setLastName(this.getGaduLastName());
    localUser.setNickName(this.getNickname());
    localUser.setTelephone(this.getGaduTelephone());
    return localUser;
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:16,
代码来源:GaduGaduBuddy.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)